HyperWorks Solvers

MODIFY

MODIFY

Previous topic Next topic No expanding text in this topic  

MODIFY

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

Subroutine Type

Utility/Data Access

Definition

MODIFY 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.

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.

Calling Syntax

Fortran

CALL MODIFY (command, status)

 

C/C++:

c_modify (char* command, int* status);

 

Python:

status = py_modify(command)

 

MATLAB

status = m_modify(command)

Input

command

character array

Any valid ADAMS/Solver command stored in a character array.

Output

status

integer

A flag that return the status of the call to MODIFY. ISTAT can have the following values:

0 = Success

Any other value indicates failure.

Comments

1.MODIFY may only be called from a CONSUB.
2.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.
3.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.
4.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.

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

See Also:

Analysis Control Subroutines