Simulation > Mechanism Design and Mechanism Dynamics > Mechanism Dynamics > Custom Loads > About Functions and Their Argument Values
About Functions and Their Argument Values
A custom load function is called with a number of arguments that can be optionally added to your definition of the function. A detailed description of the arguments for each function follows.
CLUSEREvalCustomLoad
int CLUSEREvalCustomLoad (char* CustomLoadName, char* ForceName, double CurrentTime, double* value);
Input
CustomLoadName
Name of the custom load
ForceName
Name of the force motor or external force the custom load is used in.
CurrentTime
The current time of the analysis.
Value
The value of the custom load returned by the custom load application.
0 if successful. Any non zero value means that there is an error in the custom load and the analysis will not proceed.
CLevalMeasure
extern int CLevalMeasure (char*meaName, double* MeasureValue);
Input
MeaName
Name of the measure to be evaluated. The measure must exist in the model and must be a position or velocity measure.
Output:
MeasureValue
The value of the measure at the current time.
Return:
0 if successful. 1 if the measure does not exist or if the measure is not a position or velocity measure.
CLUSERDefineInit
int CLUSERDefineInit (char* CustomLoadName, char* ForceName);
Input
CustomLoadName
Name of the custom load.
ForceName
Name of the force motor or external force the custom load is used in.
Return:
0 if successful. Any non zero value means that there is an error in the custom load and the load will not be defined.
CLUSERRunInit
int CLUSERRunInit (char* CustomLoadName, char* ForceName);
Input:
CustomLoadName
Name of the custom load.
ForceName
Name of the force motor or external force the custom load is used in.
Return:
0 if successful. Any non zero value means that there is an error in the custom load and the load will not be defined.
CLUSERGetStateVariablesSize
int CLUSERGetStateVariablesSize (char* CustomLoadName, char* forceName, int* size);
Input:
CustomLoadName
Name of the custom load.
ForceName
Name of the force motor or external force the custom load is used in
Output:
Size
The size of the state variable vector.
Return:
0 if successful. Any non zero value means that state variables are not used for this custom load.
CLUSERInitStateVariables
int CLUSERInitStateVariables (char* CustomLoadName, char* forceName, double* StateVar);
Input:
CustomLoadName
Name of the custom load.
ForceName
Name of the force motor or external force the custom load is used in
Output:
StateVar
The vector of initial state variable values. The memory is allocated by Mechanism Design.
Return:
0 if successful. Any non zero value means that there is an error in the custom load and the analysis will not proceed.
CLUSERGetStateVariableDerivatives
int CLUSERGetStateVariableDerivatives (char* CustomLoadName, char* forceName, double CurrentTime, double* StateVar);
Input:
CustomLoadName
Name of the custom load.
ForceName
Name of the force motor or external force the custom load is used in
CurrentTime
The current time of the analysis.
Output:
StateVar
The vector of state variable values at this time. The memory is allocated by Mechanism Design.
Return:
0 if successful. Any non zero value means that there is an error in the custom load and the analysis will not proceed.
CLEvalStateVariables
int CLevalStateVariables (char* CustomLoadName, char*  forceName, int numElem, double* stateVarArray);
Input:
CustomLoadName
Name of the custom load.
ForceName
Name of the force motor or external force the custom load is used in
NumElem
The number of values in the state variable array.
Output:
StateVarArray
The vector of state variable values at this time. The memory is allocated by Mechanism Design.
Return:
0 if successful.