HyperWorks Solvers

Reference: Solver Variable

Reference: Solver Variable

Previous topic Next topic Expand/collapse all hidden text  

Reference: Solver Variable

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  
hmtoggle_plus1greyXML Format

Command Element

Description

Modifies a variable element.

Format

<Reference_Variable

      id                  = "integer"

  {   type                = "EXPRESSION"

      expr                = "motionsolve_expression"

    | USERSUB

      usrsub_dll_name     = "valid_path_name"

      usrsub_param_string = "USER( [[par_1][, ...][, par_n]] )" } >

</Reference_Variable>

Attributes

id

Element identification number (integer>0).  This number is unique among all Reference_Variable elements.

type

Select from EXPRESSION and USERSUB. Specifies how the variable expression is defined.

The EXPRESSION option specifies that the value of the Reference_Variable is a MotionSolve expression that can be evaluated at run-time.  The USERSUB option indicates that the value of the event is specified in a user defined subroutine, VARSUB. The parameters "usrsub_param_string" and
"usrsub_dll_name" are used to provide more information about the user defined subroutine.

expr

Specifies a MotionSolve expression that defines the Reference_Variable. Use this parameter only when type = EXPRESSION. Any valid run-time MotionSolve expression can be provided as input.

usrsub_dll_name

Specifies the path and name of the DLL or shared library containing the user subroutine.  MotionSolve uses this information to load the user subroutine VARSUB in the DLL at run time.  Use this keyword only when type = USERSUB is selected.

usrsub_param_string

The list of parameters that are passed from the data file to the user defined VARSUB. Use this keyword only when type = USERSUB is selected.

Comments

1.Reference_Variable can be referenced using the function VARVAL(id).
2.The Reference_Variable element can also be used to define the following elements: Control_PlantInput, Control_PlantOutput and Reference_Array.

Example

<Reference_Variable

    id                  = "30700800"

    type                = "EXPRESSION"

    expr                = "sqrt(VX(30301011)**2+VY(30301011)**2)">

</Reference_Variable>

<Reference_Variable

    id                  = "30100100"

    type                = "USERSUB"

    usrsub_param_string = "USER(30102031,30101020,0.01,1)"

    usrsub_dll_name     = "NULL">

</Reference_Variable>

hmtoggle_plus1greyPython Format

Command Element

Description

Modifies a VARIABLE element.

Declaration

def VARIABLE(ID, FUNCTION="", ROUTINE="", INTERPRETER="", SCRIPT="", DESIGN=""):

Attributes

id

Element identification number (integer>0).  This number is unique among all the VARIABLE elements. It uniquely identifies the modeling element.

FUNCTION

Modifies the MotionSolve expression that defines the VARIABLE. Any valid run-time MotionSolve expression can be provided as input.

Or

The list of parameters that are passed from the data file to the user defined subroutine, VARSUB.  This attribute is common to all types of user subroutines and scripts.

ROUTINE

Modifies the alternative name for the user subroutine VARSUB.

INTERPRETER

Modifies the interpreted language that the user script is written in.  Valid choices are MATLAB or PYTHON.

SCRIPT

Modifies the path and name of the user written script that contains the routine.

DESIGN

Modifies the variable, response variable, or the default (none of the above).

Comments

See Reference_Variable

Example

This example demonstrates how to modify an EXPRESSION based VARIABLE.

VARIABLE(30700800, FUNCTION="sqrt(VX(30301011)**2+VY(30301011)**2)")

The second example shows how to modify a USER SUBROUTINE based VARIABLE.

VARIABLE(30100100, FUNCTION="USER(30102031,30101020,0.01,1)", ROUTINE="NULL")

See Also:

Control_PlantInput

Control_PlantOutput

Reference_Array

Command Statements

Model Statements

Functions

Notation and Syntax