*SetLocalUserDLL() - GSE
Specifies the local subroutine files for a general state equation that has continuous states.
Syntax
*SetLocalUserDLL(varname, local_dll
[,local_xx_dll]
[,local_xu_dll]
[,local_yx_dll]
[,local_yu_dll])
Arguments
- varname
- The variable name of the state equation.
- local_dll
- The string that refers to a subroutine file having function for states and output (GSESUB).
- local_xx_dll
- Optional alternate file name for states' partial derivative with respect to the states (GSEXX).
- local_xu_dll
- Optional alternate file name for states' partial derivative with respect to the inputs (GSEXU).
- local_yx_dll
- Optional alternate file name for output partial derivative with respect to the states (GSEYX).
- local_yu_dll
- Optional alternate file name for output partial derivative with respect to the inputs (GSEYU).
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})`
)
*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
Comments
This statement can be used to specify subroutine file names for a general state equation with continuous states only. This is applicable for both MotionSolve and ADAMS.
In the case of ADAMS, this statement writes out the now deprecated ROUTINE argument. Use the *LocalInterfaceDLL() statement to write out the INTERFACE argument.
If local subroutine files are not used, the solver would use the default subroutine file provided at the solver run command line. If local functions are not specified through the *SetLocalUserFuncName() statement for continuous states, the solver will search for functions GSESUB, GSEXX, GSEXU, GSEYX and GSEYU as default (MotionSolve and ADAMS)
Use the *SetLocalUserFunction() statement to specify the type of subroutine (dll, python, or matlab subroutine). This statement is in fact a superset function that can be used to specify the subroutine file, type, and the function instead of the *SetLocalUserDLL() and *SetLocalUserFuncName() statements.
While working with MotionSolve, if a file in the local installation has to be used, it is recommended to specify the file name without the path. This is especially useful when the solution is executed on a different machine.
It is recommended to avoid specifying a .dll or .so extension for the subroutine file so that the solver deck is portable between various platforms.