Adams Basic Package > Adams View > View Command Language > part > Part create equation general_state_equation

Part create equation general_state_equation

Allows you to create an existing general_state_equation.
The equation command allows you to create and manage equation elements in your model. These elements include differential_equations, transfer_functions, linear_state_equations, and general_state_equations. EQUATIONS help you model controls system elements or any other phenomena that can be represented by differential equations. Adams View makes it easier for you to identify these equations by allowing you to assign them names and drawing them as icons on the screen. During preprocessing, the icons for the EQUATIONs you create are displayed at or near the origin of your model by Adams View. All EQUATIONs are "owned" by a particular model and then you reference these EQUATIONs in the definition of other model objects.
A GENERAL_STATE_EQUATION is used along with associated ARRAYs and user-subroutines to define a system of explicit differential and (optionally) algebraic equations in state-space form. The state derivatives and outputs for a GENERAL_STATE_EQUATION may be user defined functions of the states, inputs, and time. The GENERAL_STATE_EQUATION is designed to model a nonlinear, time-varying system. It is especially useful in importing nonlinear system models developed elsewhere, into Adams. The set of coupled differential and algebraic equations which can be expressed in matrix notation as:
{(dX/dt)/Y} = {f({X},{U},t)}
The GENERAL_STATE_EQUATION definition is restricted to explicit functions of the states and inputs. However, because the VARIABLEs included in the u_input_array can be completely general, the user can write GENERAL_STATE_EQUATION equations that implicitly depend on any available Adams variable. The GENERAL_STATE_EQUATION follows standard control systems terminology, where X is the state array, Y is the output array, U is the input array, and IC is the initial condition array, X(t=0). In Adams View, each of these vectors is defined using an particular ARRAY. All ARRAY sizes must be consistent with the GENERAL_STATE_EQUATION definition. ARRAYs with zero-size and zero-valued partial derivative matrices should not be defined; Adams will correctly formulate the system equations based on those ARRAY statements and derivatives which do exist. The current values for the state derivative and output vectors of this GENERAL_STATE_EQUATION are computed in the user-supplied GSESUB subroutine (see the Adams Users Manual section on the "GSESUB"), much as the user would do for any other user-written subroutine. Additionally, the user must provide GSEXX, GSEXU, GSEYX and GSEYU subroutines (see the proper sections in the Adams Users Manual for a description of these routines) to compute the necessary internal partial derivatives in accordance with the values of df_dx_method, df_du_method, dg_dx_method, and the dg_du_method flags.

Format:

 
part create equation general_state_equation
general_state_equation_name =
an existing gse 
adams_id =  
integer 
comments =  
string
state_equation_count =  
integer 
discrete_state_equation_count = 
integer 
output_equation_count =  
integer 
x_state_array_name =  
an existing array 
u_input_array_name = 
an existing array 
y_output_array_name = 
an existing array 
ic_array_name = 
an existing array 
df_dx_method = 
gse_xxflag 
df_du_method =
gse_flag 
dg_dx_method = 
gse_flag 
dg_du_method = 
gse_flag 
static_hold = 
on_off 
user_function = 
real 

Example:

 
part create equation general_state_equation
general_state_equation_name =
.model_1.gse_1 &
adams_id =
1 &
x_state_array_name =
.model_1.array_18 &
u_input_array_name =
.model_1.array_16 &
y_output_array_name =
.model_1.array_17 &
ic_array_name =
.model_1.array_19 &
static_hold =
on &
user_function =
1.0 &
state_equation_count =
1 &
output_equation_count =
1 &
interface_routines =
"force" &
comments =
"none"
 
Parameter
Value Type
Description
general_state_equation_name
An Existing Gse
Specifies the general state equation to create
adams_id
Integer
Specifies a integer used to identify this element in Adams data file
comments
String
Specifies the comments about the object being created or modified
state_equation_count
Integer
Specifies the number of state equations to be used to define the system
discrete_state_equation_count
Integer
Specifies the number of discrete state equations to be used to define the system
output_equation_count
Integer
Specifies the number of output equations to be used to define the system
x_state_array_name
An Existing Array
Specifies the array to represent the state array
u_input_array_name
An Existing Array
Specifies an array to be used as input or control of linear system
y_output_array_name
An Existing Array
Specifies an array name to be used as output array
ic_array_name
An Existing Array
Specifies the array name for stating the initial conditions of linear system
discrete_state_array_name
An Existing Array
Specifies the array to represent the discrete state array
discrete_ic_array_name
An Existing Array
Specifies the array name for stating the initial conditions of linear system
df_dx_method
Gse_xxflag
Specifies how to compute the matrix of partial derivatives of the state equations with respect to the states
df_du_method
Gse_flag
Specifies whether or not and how to compute the matrix of partial derivatives of the state equations with respect to the inputs
dg_dx_method
Gse_flag
Specifies whether or not and how to compute the matrix of partial derivatives of the output equations with respect to the states
dg_du_method
An Existing Matrix
Specifies whether or not and how to compute the matrix of partial derivatives of the output equations with respect to the inputs
discrete
True_only
Specifies discrete GSE
sample_period
Real
Specify sampling time
static_hold
On/off
Indicates that the equations states are not changed during static and quasi-static analysis
user_function
Real
Specifies the constants to be passed to GSESUB
Implicit
On/off
Indicates that the function expression or subroutine defines the implicit form of the equation (on).
Routine
String
Specifies an alternative library and name for the user subroutine GSESUB.
Sample_offset
Real
Specifies the simulation time at which the sampling of the discrete states is to start. All discrete states before SAMPLE_OFFSET are defined to be at the initial condition specified. SAMPLE_OFFSET defaults to zero when not specified.
Statics_only
On/Off
When included (or set to On) will only activate GSE for statics. During dynamics the GSE will be inactive if set, and this should speed up the Solver solution during dynamics since less number of states are being solved.
interface_routines
Function
Specifies an alternative library and subroutine names for the user subroutines GSE_DERIV, GSE_UPDATE, GSE_OUTPUT, GSE_SAMP respectively.