MotionSolve

This block performs co-simulation with Altair MotionSolve.

    MotionSolve

Library

Activate/CoSimulation

Description

The MotionSolve block implements co-simulation between Twin Activate and Altair MotionSolve. The MotionSolve model acts as a plant. The model must be prepared by adding Control_PlantInput and Control_PlantOutput. These statements reference variables that are either used as inputs to the model, such as forces or torques, or measure outputs, such as displacements or velocities.

MotionSolve and MotionView (.xml, .mdl and .py) input format are supported. If the inputfile is a MotionView (.mdl), a conversion to (.xml) will be performed. From within the block parameter dialog it is possible to invoke MotionView to view and edit the MotionView model.

On output, if the action is active in the MotionSolve (.xml) model, the results (.mrf) will be converted into an H3D file (.h3d).

Simulations with this block require that Altair MotionSolve solver is installed. The path to the solver and its licensing must be set within Twin Activate preferences panel, section CoSimulation.

Unlike in MotionSolveSignals block, input and output ports of this block are vectors. The name of each vector in the MotionSolve model are displayed as port labels.

Parameters

MotionSolve_0

NameLabelDescriptionData TypeValid Values

xml

Input file name

MotionSolve or MotionView model file name

String

mrf

MRF output filename

MotionSolve ouptut filename (.mrf)

String

usub

DLL User-sub filename

String

nin

Number of input ports

The number of input ports on this block must correspond to the number of Control_PlantInput statements in the model. This field is automatically filled if the Reload button is pressed.

Number

inports

Inputs

Structure

inports/label

Label

Cell of strings

inports/rowsize

Row size

The input ports can be vectorial, in this case the size of vector is given here. This field is automatically filled if the Reload button is pressed.

Cell of scalars

nout

Number of output ports

The number of output ports on this block must correspond to the number of Control_PlantOutput statements in the model. This field is automatically filled if the Reload button is pressed.

Number

outports

Outputs

Structure

outports/label

Label

Cell of strings

outports/rowsize

Row size

The output ports can be vectorial, in this case the size of vector is given here. This field is automatically filled if the Reload button is pressed.

Cell of scalars

depu

Direct feedthrough

Sets the direct feedthough of the block to true to ensure that when MotionSolve is called, the block inputs are up to date. If an algebraic loop occurs, deselect this option.

Number

0
1

externalActivation

External activation

Specifies if the block receives an external activation or inherits its activation through its regular input ports. If selected, an additional activation port is added to the block. By default, external activation is not selected. If External activation is selected, the communication with the MotionSolve simulation engine occurs only at event instants such as a fixed-rate event defined by an external clock.

Number

0
1

MotionSolve_1

NameLabelDescriptionData TypeValid Values

log_file_name

Log file name (*.log)

Twin Activate messages as well as messages communicated from MotionSolve to Twin Activate are logged into this file.

String

MotionSolve_2

NameLabelDescriptionData TypeValid Values

msip

MotionSolve server IP address

Used for TCP communication. Not used in the current release.

String

msport

MotionSolve server port number

Used for TCP communication. Not used in the current release.

Scalar

nthread

Number of MotionSolve threads

Specifies the number of threads of MotionSolve. If set to zero or negative value, MotionSolve default thread number will be used.

Number

nEnvVar

Number of environment variables

Number of environment variables that are passed to MotionSolve.

Number

EnvVars

Environment Variables

Structure

EnvVars/varname

Name

Name of the environment variable that is passed to MotionSolve.

Cell of strings

EnvVars/varvalue

Value

Value of the environment variable that is passed to MotionSolve.

Cell of strings

Ports

NameTypeDescriptionIO TypeNumber

Port 1

explicit

output

nout

Port 2

explicit

input

nin

Port 3

activation

input

externalActivation

Advanced Properties

NameValueDescription

always active

no

direct-feedthrough

Depends on block parameters

zero-crossing

no

mode

no

continuous-time state

yes

discrete-time state

no

See Also