Control State Equations

Use the State Equations tool to create and set control state equation data.

Create Control State Equations

A control state equation is an entity that can be used to model any generic dynamic system in an abstract manner.

  1. From the Model Browser, select the system to which the control state equation is to be added.
  2. Right-click on a system in the Model Browser and select Add > Control Entity > ControlStateEquation from the context menu.
    OR
    Right-click on a control state equations folder in the Model Browser and select Add ControlStateEquation from the context menu.
    OR
    From the Model ribbon, click the arrow next to the Controls tool set name, then select State Equations icon.
    The Add ControlStateEquation dialog is displayed.
  3. Specify a label for the control state equation.
    The label can be changed at any time.
  4. Specify a variable name for the control state equation.
    By default, variables names of entities in MotionView follow a certain convention. For example, all control state equation entities have a variable name starting with “cse_”. 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 control state equation entity has been added to the model, the panel for the equation will automatically be displayed in the panel area.

Edit Control State Equations

A user subroutine is used to describe the behavior of the dynamic system. The dynamic system is characterized by a vector of inputs u, a vector of dynamic states x, and a vector of outputs y. The state vector x is defined through a set of differential equations. The output vector y is defined by a set of algebraic equations.

Define the Properties of Control State Equations

From the Properties tab, you can provide inputs needed for the control state equation.

  1. If the Control State Equation panel is not currently displayed, select the desired control state equation by clicking on it in the Model Browser or in the modeling window.
    The Control State Equation panel is automatically displayed.
  2. Double-click the SolverArray collector under Input Array and select an array for the control state equation from the Model Tree.
    The solver array should be of the type U.
  3. Specify the number of outputs being returned by the control state equation by entering a value in the No of Outputs text box.
  4. Select Static Hold if the state of the control state equation is not permitted to change during static and quasi-static analysis of the solver. Otherwise, deselect the option.
  5. Define an initial conditions array for the states.
    1. Select the Use Initial Conditions Array check box.
    2. Double-click the SolverArray collector and select a solver array of type IC which contains the initial conditions for the states from the Model Tree.
      The number of entities in the IC array should be equal to the number of states.
    3. Specify the number of states in the control state equation by entering a value in the No of States text box.
    Note: Linear control state equations are not currently supported by MotionView.

Define the User-Functions of Control State Equations

The User-Function tab is used to provide user subroutine related information for the control state equation.

  1. Click the User-Function tab.
  2. 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.
  3. Click the XXFunction box and specify the function name in the subroutine that is used to compute the partial derivatives of the states.
    The default function name is GSEXX.
  4. Click the XUFunction box and specify the function name in the subroutine that is used to compute the partial derivatives of the states with respect to the inputs.
    The default function name is GSEXU.
  5. Click the YXFunction box and specify the function name in the subroutine that is used to compute the partial derivatives of output with respect to the states.
    The default function name is GSEXYX.
  6. Click the YUFunction box and specify the function name in the subroutine that is used to compute the partial derivatives of output with respect to the inputs.
    The default function name is GSEYU.