State Equations in Inspire Motion

Define a generic dynamic system characterized by single or multiple inputs, dynamic states, and outputs.

State Equations is an abstract modeling element that defines a generic linear or non-linear dynamic system. A user subroutine is used to describe the behavior of the dynamic system. The dynamic system is characterized by an array of inputs u, an array of dynamic states x, and an array of outputs y. The states are defined through a set of differential equations: xd(t)=F(x(t), u(t)). The output array y is defined by a set of algebraic equations: y(t)=G(x(t),u(t)). Both F() and G() are required to be defined in user-defined subroutines.

Create a State Equation in Inspire Motion

Learn how to create an abstract system using state equations that interact with your simulation through a user subroutine in the form of an external shared library (DLL/SO) or a script written in an interpreted language (Python/MATLAB/Compose).

First, ensure you have your code implementation ready (DLL/SO file or script).
  1. Create a solver variable. For more information, see Solver Variables.
  2. Create a solver array. If you plan to use initial conditions, select IC as the type. For more information, see Solver Arrays.
  3. For information on how to add or edit an entity like a state equation, see Entity Creation.

State Equation Properties in Inspire Motion

Descriptions of state equation properties in the Property Editor.

Property Description
General
Name Name of the entity
Variable Name The variable name, a unique identifier string of the entity
ID A unique identifying integer
Properties
Input array Select an input array for the state equation.
Use initial conditions Select this option to specify an initial condition for the states.
IC array Define an initial conditions array for the states. Its length must match the number of states.
Number of outputs Specify the number of outputs being returned by the state equation. This must be greater than 0.
Number of states Specify the number of states in the control state equation. This must be greater than 0.
Static hold Turn on this option if the states of the state equation is not permitted to change during static and quasi-static analysis of the solver. Otherwise, turn off the option.
Signal Specify the properties of the equation using user subroutines. Do the following:
  1. Provide an expression with the User expr function with parameters being passed to the user subroutine.
  2. Activate the Use local file and function name check box if a specific local file is to be used. If this option is not specified, the application will search for a subroutine following its user subroutine loading rules.
    1. Specify a Local file where the subroutine code can be accessed by the solver.
      Note: 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).
    2. Select a Function type from the dropdown menu
      • DLL/SO
      • Python
      • Matlab
      • Compose
    3. Specify the Function name in the subroutine that defines the entity, or accept the default name provided by the application.
User-Function

The following four functions, GSEXX, GSEXU, GSEYX, GSEYU, provide the matrices of partial derivatives. They are required when an implicit integrator is used. Activate each check box if specific function name is to be used, otherwise the application will search for the default function name.

XXFunction Turn on XXFunction 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.

XUFunction Turn on XUFunction 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.

YXFunction Turn on YXFunction 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 GSEYX.

YUFunction Turn on YUFunction 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.