Solver Variables

Use the Variables tool to create solver variables that can be used to create an algebraic expression of state variables, as well as other solver variables. This can then be referenced in function expressions throughout the solver input file.

Create Solver Variables

  1. From the Model Browser, select the system to which the solver variable is to be added.
  2. Right-click on a system in the Model Browser and select Add > Control Entity > Solver Variable from the context menu.
    OR
    Right-click on a solver differential equation folder in the Model Browser and select Add Solver Variable from the context menu.
    OR
    From the Model ribbon, click the Variables icon.
    The Add Solver Variable dialog is displayed.
  3. Specify a label for the solver variable.
    The label can be changed at any time.
  4. Specify a variable name for the solver variable.
    By default, variables names of entities in MotionView follow a certain convention. For example, all solver variable entities have a variable name starting with “sv_”. This is the recommended convention to follow when building models in MotionView since it has many advantages in model editing and model manipulation.
  5. Click OK to close the window or Apply to continue creating entities.
    Once a solver variable entity has been added to the model, the panel for the variable will automatically be displayed in the panel area.

Edit Solver Variables

  1. If the Solver Variables panel is not currently displayed, select the desired solver variable by clicking on it in the Model Browser or in the modeling window.
    The Solver Variables panel is automatically displayed.
  2. Click the Initial Conditions check box and enter a value in the text box.
  3. Select Static Hold if the state of the solver differential equation is not permitted to change during static and quasi-static analysis of the solver. Otherwise, deselect the option.
  4. Click the Implicit check box to specify whether the differential equation is of type implicit or explicit.
  5. If the Implicit check box is activated, select an AutoBalance type from the drop-down menu.
    If you select Penalty, enter values in the Penalty and Penalty1 text boxes.
  6. Select an option from the Type drop-down menu.
  7. Define the properties associated with your choice.
    If Linear is chosen, enter a value in the text box.
    If Curve is chosen:
    1. Select AKIMA, CUBIC, LINEAR, or QUINTIC as the interpolation method.
    2. Enter a value under Independent variable.
      The independent variable should be specified in Templex syntax.
    3. Resolve the curve by double-clicking the Curve collector and selecting a curve from the Select a Curve dialog.
      Note: To use a curve, you first need to define a curve (using the Curves panel) which represents the behavior of the solver variable.
    If Spline3D is chosen:
    1. Select AKIMA, CUBIC, LINEAR , or QUINTIC under as the method of interpolation.
    2. Specify an expression for Independent variable X and Independent variable Z.
    3. Resolve the 3D spline by double-clicking on the Spline3D collector and selecting a Spline3D entity from the Select a Spline3D dialog.
      Note: To use a Spline3D entity, you first need to define a spline using the Spline3D panel.
    If Expression is chosen, enter an expression.

Use User-Defined Properties for a Solver Variable

If desired, define the solver variable using the User-Defined tab, which will allow you to specify the properties of the variable using user subroutines.

  1. From the Properties tab, click the User-defined properties check box.
  2. Click the newly added User-Defined tab.
  3. Define the user subroutine.
    1. Provide an expression with the USER solver function with parameters being passed to the user subroutine.
    2. Alternatively, activate the Use local file and function name check box to specify a local file where the subroutine code can be accessed by the solver.
      If this option is not specified, MotionSolve will search for a subroutine following its user subroutine loading rules.
    3. Select a function type from the drop-down menu.
    4. Select the local file for the subroutine.
      The type of file to be specified will depend on the selected function type. For example, if DLL/SO is selected, you can specify a file with a .dll extension (for Windows) or an .so extension (for Linux).
    5. Specify the function name in the subroutine that defines the entity, or accept the default name provided by MotionView.