Creating and Modifying General State Equations |
The following procedure teaches you how to represent a subsystem that has well defined inputs (u), internal states (x), and a set of well defined outputs (y).
Learn more about:
Also see:
To create or modify a general state equation:
From the Build menu, point to System Elements, point to General State Equation, and then select either New or Modify.
The Modify or Create General State Equation dialog box appears. Both dialog boxes contain the same options.
If you selected New, change the name of the general state equation element, if desired, and assign a unique ID to it. Learn about ADAMS/Solver IDs.
Set up the GSE by filling in the following text boxes:
In the U Array (Inputs) text box, specify the array element that defines the input variables for the GSE. The U array is optional. When not specified, there are no system inputs. The number of inputs to the GSE is inferred from the number of variables in the U array.
In the Y Array (Outputs) text box, specify the array element that defines the output variables for the GSE.
In the User Function Parameters text box, specify the parameters that are to be passed to the user-written subroutines that define the constitutive equations of a GSE, viz., Equations 1, 2, and 3.
Three user subroutines are associated with a GSE:
GSE_DERIV is called to evaluate fc() in Equations 1.
GSE_UPDATE is called to evaluate fd() in Equations 2.
GSE_OUTPUT is called to evaluate g() in Equations 3.
See the Subroutines help in the ADAMS/Solver online help.
If you specified a user function, in the Interface Function Names, enter function names to use other than the standard names GSE_DERIV, GSE_UPDATE, and GSE_OUTPUT.
Set States to the type of system to define:
None (No options appear; defines a feed-forward system)
The dialog box changes depending on the type of system. See the next tables for the values to enter depending on the systems you are creating. For a sampled system, you enter both continous and discrete values.
Add or change any comments about the GSE that you want to enter to help you manage and identify it. Learn about comments.
Options for Defining Continuous and Sampled Systems
|
For the option: |
Do the following: |
|---|---|
|
X Array (Continous) |
Enter the array element that defines the continuous states for the GSE. The array element must be of the X type, and it cannot be used in any other linear state equation, general state equation, or transfer function. |
|
IC Array (Continous) |
Enter the array element that specifies the initial conditions for the continuous states in the system. When you do not specify an IC array for a GSE, all the continuous states are initialized to zero. |
|
Static Hold |
Indicate whether or not the continuous GSE states are permitted to change during static and quasi-static simulations. |
Options for Discrete and Sampled Systems
|
For the option: |
Do the following: |
|---|---|
|
X Array (Discrete) |
Enter the array element that is used to access the discrete states for the GSE. It must be of the X type, and it cannot be used in any other linear state equation, general state equation, or transfer function. |
|
IC Array (Discrete) |
Enter the array element that specifies the initial conditions for the discrete states in the system. The array is optional. The array element must be of the IC type. When you do not specify an IC array for a GSE, all the discrete states are initialized to zero. |
|
First Sample Time |
Specify the simulation time at which the sampling of the discrete states is to start. All discrete states before the first sample time are defined to be at the initial condition specified. The default is zero. |
|
Sample Function/Sample User Parameters |
Specify the sampling period associated with the discrete states of a GSE. This tells ADAMS/Solver to control its step size so that the discrete states of the GSE are updated at: last_sample_time + sample_period In cases where an expression for the sampling period is difficult to write, you can specify it in a user-written subroutine GSE_SAMP. ADAMS/Solver will call this function at each sample time to find out the next sample period. Select the More button |