*SetGeneralStateEquation()

Specifies the type of states available and user defined subroutine expression for the general state equation.

Syntax

*SetGeneralStateEquation(varname, USER 
                                      , 'usr_sub' 
                                      [, system_type] )

Arguments

varname
The variable name of the general state equation.
Data type: varname
USER
Keyword that indicates the next argument is a user defined expression that calls the subroutine.
Data type: keyword
usr_sub
The user defined expression that calls the subroutine.
Data type: string
system_type
The type of states in the general state equation.
Valid values are: CONTINUOUS|DISCRETE|SAMPLED.
Note: The default state is CONTINUOUS.
Data type: keyword

Example

 *SolverVariable( sv_1, "Input 1" )
 *SetSolverVariable( sv_1, EXPR, `VX(1, 2, 3)`, OFF )
 *SolverVariable( sv_2, "Input 2" )
 *SetSolverVariable( sv_2, EXPR, `STEP(TIME, 0, 1, 5, 200)`, OFF )
 *SolverVariable( sv_3, "Input 3" )
 *SetSolverVariable( sv_3, LIN, 1+1, OFF )
 *SolverArray( u_array, "Input Array", U, sv_1, sv_2, sv_3 )
 *SolverArray( ic_array, "IC Array", IC )
 *SetSolverArray( ic_array, VALUE, 4, 0.0, 
3.4, 
b_0.mass, 
b_0.Izz ) 
 *GeneralStateEquation( gse_0, "My Controller", 3, 
u_array, ic_array )
 *SetGeneralStateEquation(gse_0, USER, `USER(500, 
{frc_cont.i.idstring}, 
{frc_cont.j.idstring})`
, CONTINUOUS
)
 *SetContinuousStates( gse_0, 4, STATIC_HOLD )
 *SetLocalUserDLL( gse_0, "mygsesubdll", "dll_xx", 
"dll_xu", 
"dll_yx", 
"dll_yu" )
 *ActionReactionForce(frc_cont, "Control Force", LOA, 
b_0, 
B_Ground, 
p_cont, 
P_Global_Origin )
 *SetForce( frc_cont, EXPR, ARYVAL({gse_0.y_array.idstring}, 2)` )

Context

*BeginMdl()

*DefineAssembly()

*DefineSystem()

*DefineAnalysis()

*BeginContext()

Comments

This statement is used to specify the function that calls the user subroutine and the type of state equation.

The following is the interpretation of the different values for system_type:
  • CONTINUOUS
    The equation has continuous states only. The general state equation will be exported to MotionSolve and ADAMS. Any statements related to discrete states will be ignored.
  • DISCRETE
    The equation has discrete states only. Not applicable for MotionSolve.
  • SAMPLED
    The equation has both continuous and discrete states. Not applicable for MotionSolve.