MODIFY
Utility/Data Access SubroutineMODIFY is a utility subroutine that can execute an ADAMS/Solver command from a CONSUB. This function is provided to maintain compatibility between user subroutines already written for ADAMS and MotionSolve.
Definition
If you are writing CONSUBs for MotionSolve, it may be easier to use MODSET instead. MODSET is more general. Any attribute in the XML file may be changed.
Format
- Fortran Calling Syntax
- CALL MODIFY (command, status)
- C/C++ Calling Syntax
- c_modify (char* command, int* status);
- Python Calling Syntax
- status = py_modify(command)
- MATLAB Calling Syntax
- status = m_modify(command)
Attributes
- command
- Character array
Output
- status
- 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
- MODIFY may only be called from a CONSUB.
- When coupled with other functions that allow you to perform analyses and write output, this is an extremely powerful capability to create higher-level analysis functions.
- After a call to MODIFY to change the model topology, the succeeding call to ANALYS must set its initialization flag to 1. This causes the equations to be reformulated and the effect of the model modification is taken into account.
- In cases where only some model parameters are being changed with MODIFY, it is acceptable to not reformulate the equations in the succeeding call to ANALYS.