HyperWorks Solvers

Model/Control

Model/Control

Previous topic Next topic No expanding text in this topic  

Model/Control

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

CONTROL

Usage

control (function, routine=None, script=None):

 

Description

Argument

Description

function

String defining a valid MotionSolve user expression

The string contains the list of parameters that are passed to the user defined subroutine.

This argument is mandatory.

routine

The user subroutine is defined in a DLL or shared library

String

Specifies an alternative name for the user subroutine. The name consists of two pieces of information, separated by “”. The first is the pathname to the shared library containing the Consub. The second is the name of the Consub function in the shared library.

An example is: routine=”/staff/Altair/engine.dllmyConsub

”/staff/Altair/ engine.dll is the dll
“myConsub” is the function within this DLL that performs the calculations

The user subroutine is defined in a Python function

Pointer to a callable function in Python

An example is: routine=myConsub

myConsub is a Python function or method that can be called from wherever the model resides.

 

The attribute routine is optional.  When not specified, routine defaults to “CONSUB”.

Script

String

The string points to a file that contains the consub function defined in routine.

Example

# Create a model

m = CreateStewartPlatform (output=”Stewart-Platform”)

 

# Invoke a CONSUB, mySimulationDriver to run the simulation

m.control (function=”USER(1,2,3)”, routine= mySimulationDriver)