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
Specifies the type of analysis to perform. Valid options are:
  • DYNAMICS - perform a dynamic simulation
  • STATICS - perform a static or quasi-static simulation
  • KINEMATICS - perform a kinematic simulation
  • TRANSIENT - perform either a DYNAMIC or KINEMATIC simulation based on the number of degrees of freedom in the system.
  • ASSEMBLY - perform an assembly analysis.
Note: Any other value for analysis results in an error.
name
Character array
A brief description of the analysis. This string is associated with the requested analysis when certain output files are generated.
tbegin
double precision
This specifies the start time of the simulation. When multiple analysis are being performed in CONSUB, tbegin is required to be set to the simulation time when ANALYS is invoked.
tend
Double precision
This specifies the end time of the simulation.
tend > tbegin, otherwise MotionSolve will issue an error.
init
Integer
This attribute is ignored by MotionSolve; it is present in the function signature for compatibility reasons only.

Output

istat
Integer
A flag that return the status of the call to ANALYS. istat can have the following values:
0
Success
-1
Failure: analysis was provided an invalid value.
-9
Failure: tbegin is not the same as the current simulation time.
-10
Failure: tbegin > tend

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

  1. 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.
  2. 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.
  3. 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.
  4. MotionSolve does not automatically generate output when ANALYS is called. You have to request for output by calling DATOUT before ANALYS is called.