c_get_linear_mat_states

The c_get_linear_mat_states () utility subroutine is exclusively used inside a CONSUB user-written subroutine. This will carry out the linear analysis and generate output for the state vector information, the numerical values of the state vector and the ABCD matrices if available. The c_get_linear_mat_states () subroutine has a C/C++ only implementation; there is no FORTRAN equivalent. The c_get_linear_mat_states () utility subroutine is supported only by Adams Solver C++.

Use

Called by

CONSUB

Prerequisite

None

Function Prototype

void c_get_linear_mat_states(struct sAdamsLinearDataIn *dataIn, struct sAdamsLinearDataOut *dataOut, int *type);

Calling Sequence

c_get_linear_mat_states(dataIn, dataOut, type);

Input Arguments

 
dataIn
Pointer to a data structure that holds the input parameters. The input parameters are seven integers
dataIn->PINPUT
dataIn->POUTPUT,
dataIn->PSTATE,
dataIn->RM,
dataIn->NODAMPIN,
dataIn->ORIGINAL,
dataIn->USEPBCS.
The first six integers share the same meaning with the arguments in LINEAR/STATEMAT command. Any none zero integers set to dataIn->NODAMPIN, dataIn->ORIGINAL and data->USEPBCS will turn these options ON. To turn these options OFF, one can simply set their values to be 0. The USEPBCS option is used to define the linearization coordinate system to be PBCS (ON) or BCS (OFF).
All the entries of this data structure must be initialized before calling this utility routine.
type
An integer pointer indicates the action taken by the utility routine.
*type = 1 initialize the dataOut data structure.
*type = 0 carry out the linear analysis and store the data in dataOut
*type = 5 clean up the memory

Output Argument

 
dataOut
Pointer to a data structure that holds the output information which are
dataOut->NS Integer, number of states
dataOut->NI Integer, number of inputs
dataOut->NO Integer, number of outputs
dataOut->ND Integer, number of differential states
dataOut->NK Integer, number of kinematic states
dataOut->A double pointer to an array with the size of NS*NS stored in column order
dataOut->B double pointer to an array with the size of NS*NI stored in column order
dataOut->C double pointer to an array with the size of NO*NS stored in column order
dataOut->D double pointer to an array with the size of NO*NI stored in column order
dataOut->STATESINFO double pointer to an array with the size of NS*3 stored in column order
dataOut->STATES double pointer to an array with the size of NS stored as
Where xi stands for a position state, vi stands for the corresponding time derivative, and zi stands for a differential state in the model.

Cautions

c_get_linear_mat_states utility routine must be initialized with *type = 1 before carrying out the linear analysis.

Note

Turning the USEPBCS option ON is equivalent to setting the environment variable MSC_LINEAR_PBCS_STATES to any value. However, the later environment variable setting will supersede the USEPBCS option.

Example:

In this example, we presented a code snippet where the linear utility routine is called from a CONSUB with the PINPUT = 2, POUTPUT = 3, PSTATE =1 and RM=6. The NODAMPIN and USEPBCS options are turned OFF and the ORIGINAL option is turned ON. The ABCD matrices, states vector info and the numerical values of the states are stored in the dataOut.
For examples of how to use the c_get_linear_mat_states() utility, see the following files:
For Windows, in the directory /install_dir/solver/samples, where install_dir is the directory in which you installed your Adams software.
For Linux, in the directory /install_dir/solver/samples, where install_dir is the directory in which you installed your Adams software.
linear_utility.acf
linear_utility.adm
linear_utility.c