ANALYS
Utility/Data Access SubroutineANALYS is a utility subroutine used to perform a specific type of analysis.
Definition
The analysis type is specified as an argument. ANALYS may only be called from
CONSUB.
Note: If called from any other
user-written subroutine, an error is returned.
Format
- Fortran Calling Syntax
- ALL ANALYS (ANALYSIS, NAME, TBEGIN, TEND, IFLAG, ISTAT)
- C/C++ Calling Syntax
- c_analys (char* analysis, char* name, double* tbegin, double* tend, int* iflag, int* istat);
- Python Calling Syntax
- istat = py_analys (analysis, name, tbegin, tend, iflag)
- MATLAB Calling Syntax
- istat = m_analys (analysis, name, tbegin, tend, iflag)
Arguments
- analysis
- Character array
- name
- Character array
- tbegin
- double precision
- tend
- Double precision
- init
- Integer
Output
- istat
- Integer
Example
def consub (par, npar):
#Purpose of the CONSUB
#This CONSUB performs 2 simulations:
# 1. gravity = 1g (surface of Earth)
# 2. gravity = 0.38g (surface of Mars)
# Behavior on Earth
istat = py_datout()
status = py_analys ("TRANSIENT", "Simulation on Earth", 0.0, 1.0, 1)
# Behavior on Mars
command = "ACCGRAV/IGRAV=0, JGRAV=0, KGRAV=-3.72742"
istat = py_modify (command)
istat = py_datout()
status = py_analys ("TRANSIENT", "Simulation on Mars", 1.0, 2.0, 1)
return status
Comments
- ANALYS provides you with the ability to invoke a simulation from a CONSUB. When coupled with other functions that allow you to modify the model and look at system responses, this is an extremely powerful capability to create higher level analysis functions.
- In order to perform an analysis, MotionSolve must first formulate the equations and generate matrices and other data required for the solution of the equations of motion. So the first call to ANALYS in a CONSUB must always have IFLAG=1.
- If you do want to reset the simulation time back to zero, you must do it through calls to MODIFY or MODSET. Then you can invoke ANALYS again with TBEGIN=0.
- MotionSolve does not automatically generate output when ANALYS is called. You have to request for output by calling DATOUT before ANALYS is called.