Python external functions: ExternallyCalculatedImposedMotion

This class is a Python equivalent of the C external function type TExternallyCalculatedImposedMotionStructValue. OrcaFlex itself creates this type in the Python namespace and passes an instance of this class as an attribute of the ExternalFunctionInfo parameter to the Python external function methods if the external function is being used to calculate vessel primary motion or constraint imposed motion. The Python external function can modify the values of the instance attributes to return motion data to OrcaFlex.

Construction

Instances of this class are created by OrcaFlex.

Attributes and methods

See the documentation for the C external function type TExternallyCalculatedImposedMotionStructValue for a description of each field.

Position, Velocity, AngularVelocity, Acceleration, AngularAcceleration

These vector attributes are Python lists with 3 numeric elements.

Orientation

This attribute is a 3 by 3 matrix whose rows are unit vectors in the axes directions of the child-frame, expressed as components with respect to the parent-frame. It is in the form of a Python list with 3 items, one for each row in the matrix, each of which is itself a Python list containing the 3 components of the unit vector for that row. Expressed in Python this is:

info.StructValue.Orientation = [

[xX, xY, xZ], # parent X,Y,Z components of child x-axis direction

[yX, yY, yZ], # parent X,Y,Z components of child y-axis direction

[zX, zY, zZ], # parent X,Y,Z components of child z-axis direction

]

The rows of Orientation must therefore all be unit vectors and must be orthogonal to each other.

See also

TExternallyCalculatedImposedMotionStructValue, ExternalFunctionInfo.