*SetLocalUserFunction() - GSE

Specifies the local subroutine function, type and function name for a general state equation that has continuous states.

Syntax

*SetLocalUserFunction(varname, local_dll[,local_func_type], 
                                         [local_funcname], [local_xx_dll], 
                                         [local_xx_type], [local_xx_funcname], 
                                         [local_xu_dll], [local_xu_type], 
                                         [local_xu_funcname],[local_yx_dll], 
                                         [local_yx_type],[local_yx_funcname], 
                                         [local_yu_dll], [local_yu_type], 
                                         [local_yu_funcname])

Arguments

varname
The variable name of the state equation.
Data type: variable
local_dll
The file name of the local function that is to be used by a state equation for states and outputs.
Data type: string
local_func_type
A keyword that suggests the type of subroutine file. Valid values are: DLL|PYTHON|MATLAB. See Comments below.
Data type: keyword
local_xx_type local_xu_type local_yx_type local_yu_type
Reserved for future use. Enter a blank token.
Data type: keyword
local_xx_dll
Optional alternate file name for states' partial derivative with respect to the states (GSEXX).
Data type: string
local_xu_dll
Optional alternate file name for states' partial derivative with respect to the states (GSEXU).
Data type: string
local_yx_dll
Optional alternate file name for states' partial derivative with respect to the states (GSEYX).
Data type: string
local_yu_dll
Optional alternate file name for states' partial derivative with respect to the states (GSEYU).
Data type: string
local_funcname
The alternate function name to be referred by the state equation for states and outputs within the local function file ( local_dll ). The default value is GSESUB.
Data type: string
local_xx_funcname
The string that refers to a subroutine function for the partial derivative (GSEXX) in the specified file .
Data type: string
local_xu_funcname
The string that refers to a subroutine function for the partial derivative (GSEXU) in the specified file .
Data type: string
local_yx_funcname
The string that refers to a subroutine function for the partial derivative (GSEYX) in the specified file .
Data type: string
local_yu_funcname
The string that refers to a subroutine function for the partial derivative (GSEYU) in the specified file.
Data type: string

Example

*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 )
 *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)` 
 *SetLocalUserFunction( gse_0, "mygsesubdll", PYTHON, "mygsesubfunc", 
"dll_xx", , myxxfunc, "dll_xu", , myxufunc, 
"dll_yx", , myyxfunc, "dll_yu", , myyufunc)

Context

*BeginMdl()

*DefineAnalysis()

*DefineSystem()

*DefineAssembly()

*BeginContext()

Comments

This statement can be used to specify the function file name, function type and the function name that is referred by the user-defined entity.

This statement can be considered as the superset of the *SetLocalUserDLL and *SetLocalUserFuncname statements.

Using this function automatically sets use_local_dll to "true". If use_local_dll has to be set to "false", use *SetLocalUserDLLFlag subsequent to using this statement. Any previous *SetLocalUserDLLFlag statements to control the state of local_dll flag will be overridden.

PYTHON and MATLAB for local_func_type are applicable for MotionSolve only.

Use DLL if the solution is being solved in Linux with an .so function type. It is recommended to avoid specifying a .dll or .so extension in the *SetLocalUserFunction statement so that the solver deck is portable between various platforms.

MotionView does not verify the availability of the file specified in local_dll at the mentioned location.

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 file name if local_func_type is set to DLL so that the solver deck is portable between various platforms.