Model Module#

Model Class#

The Model class serves as a container for all the entities that comprise a MotionSolve model. Interacting with the model is possible through the numerous methods that are listed below.

Model.control

Defines a control command for one or more simulations.

Model.generate_abcd

Generate a state space representation of the model in the form of state matrices A, B, C, and D in the desired format.

Model.generate_eigensolution

Perform eigen-analysis of the model, generate eigenvalues and mode shapes.

Model.simulate_frequencyResponse

Performs a frequency response analysis of the model

Model.generateOutput

Creates plt and animation h3d files.

Model.reset

Reset the model.

Model.runAllSimulationEvents

Run all the valid SimulationEvent objects sequentially.

Model.save_model

Saves a snapshot of the model.

Model.simulate

Sends the model to the solver and runs the simulation.

Model.verify

Sends the model to solver and performs a verification analysis.

Model Entities#

The entities listed below are used to create your model. These elements co-exist under the Model class and interact with each other in well-defined ways in order to represent a realistic multibody system.

Accgrav

Defines the acceleration due to gravity along the global X, Y, and Z directions.

Arc

Generates an arc graphic defined by a center marker, a radius or reference marker, and an angle.

Array

Specifies a list of instances of type Variable (used by other MotionSolve modeling elements) or numerical constants.

Beam

Defines a straight, massless beam of uniform cross-section acting between two Markers, i and j that belong to two different bodies.

Box

Creates a rectangular 3D graphic.

Bushing

Defines a massless bushing between two Markers, i and j that belong to two different bodies.

Cforce

Creates a force element which establishes linear force-displacement (stiffness) and/or force-velocity (damping) relationships between markers connected by higher-pair constraints.

Circle

Creates a circle graphic defined by a center marker and a radius.

CoSim

Performs a one-/two-way coupled Leader/Follower simulation by instantiating separate MotionSolve processes.

Contact

Defines a 3-D contact force between geometries on two rigid or flexible bodies.

Coupler

Defines an algebraic relationship between the degrees of freedom of two or three joints.

Curve

Defines a parametric curve in 3D space.

CurveGraphic

Creates a curve graphic that represents a Curve.

Cvcv

Defines a (Curve to Curve) higher pair constraint.

Cvsf

Defines a (Curve to Surface) higher pair constraint.

Cylinder

Creates a 3D graphic with straight parallel sides and a circular cross-section along the z-axis of the cm Marker.

Debug

Outputs data that helps you debug your simulation.

DeformableCurve

Specifies a deformable curve that is made to pass through the origins of a specified set of markers, using CUBIC spline interpolation.

DeformableCurveGraphic

Creates a curve graphic that represents a DeformableCurve.

DeformableSurface

Specifies a deformable surface that is made to pass through the origins of a specified set of markers, using CUBIC spline interpolation.

DeformableSurfaceGraphic

Creates a surface graphic that represents a DeformableSurface.

Diff

Creates a user-defined state variable and defines a first-order differential equation that describes it.

Dv

Defines a special type of solver state variable.

Ellipsoid

Creates a 3D graphic where its cross-sectional planes consist of ellipses or circles, with the center aligned to the cm Marker.

Equilibrium

Specifies error tolerances and other parameters for static and quasi-static equilibrium analyses.

External

Creates a graphic object defined using an external file.

Field

Applies a translational and rotational action-reaction force between two markers.

FlexBody

Defines a flexible body object in MotionSolve.

Fmu

Creates a Functional Mock-up Interface used for Model Exchange and Co-Simulation.

ForceGraphic

Creates an arrow representing a force acting on the specified entity.

Friction

Applies frictional forces in a joint.

Frustum

Creates a 3D graphic of a portion of a cone.

Gcon

Specifies a user defined general constraint.

Gear

Defines a gear constraint between two bodies.

Gforce

Defines a general force and torque acting between two markers.

Grid

Defines a set of nodal coordinates in 3D space.

Gse

Defines a generic dynamic system.

H3dOutput

Defines the parameters for the animation output file.

Integrator

Specifies parameters that control the dynamic analysis integrator.

Joint

Creates an idealized connector between two bodies.

Jprim

Removes degrees of freedom between two bodies by specifying conditions in which the relative translational or rotational motion can occur.

LineMesh

Creates a graphic that connects a number of vertices with straight lines.

Linear

Specifies the solver parameters that control the linear analysis.

Lse

Defines a linear dynamic system.

Marker

Defines an orthonormal, right-handed coordinate system and reference frame in MotionSolve.

Mate

Specifies general mating constraints between geometric primitives based on

Matrix

Defines a general, real-valued, M x N matrix for use in MotionSolve.

Mforce

Defines a distributed force on a FlexBody in MotionSolve.

Motion

Specifies a system degree of freedom as an explicit function of time.

MQTT_pub

Represents a publisher client for MQTT communication.

MQTT_sub

Represents a subscriber client for MQTT communication.

Nforce

Creates a multi-point force element which establishes linear force-displacement (stiffness) and/or force-velocity (damping) relationships between many markers.

NuCMS

Creates a set of flexible body properties with the goal to more accurately capture the mode shapes based on Predictive Component Mode Synthesis theory.

Outline

Creates line segments between the various cm Markers.

Output

Specifies if the plt, abf, mrf files are to be generated during the solver run.

Part

Defines a rigid body object in MotionSolve.

Pforce

Defines a penalty force whose purpose is to maintain a soft constraint in the system.

Pinput

Defines the inputs (type Variable) to a mechanical system or plant.

Plane

Creates a plane graphic expressed in respect to the rm Marker.

PointGraphic

Creates a graphic point located at the origin of the reference Marker.

PointMass

Defines an entity that has mass but no inertia properties.

Poutput

Defines a list of outputs (type Variable) to a mechanical system or plant.

ProximitySensor

Defines a sensor between two bodies which monitors their minimum separation.

Pstate

Creates a container for Solver Variables that are used in generating a linear representation of a model about an operating point.

Ptcv

Defines a (Point to Curve) higher pair constraint.

Ptdcv

Defines a (Point to Deformable Curve) higher pair constraint.

Ptdcvf

Creates a contact force between a Marker

Ptdsf

Defines a (Point to Deformable Surface) higher pair constraint.

Ptdsff

Creates a soft constraint (force) that attempts to maintain a Marker on a DeformableSurface.

Ptsf

Defines a (Point to Surface) higher pair constraint.

Request

Defines an output request entity in MotionSolve.

Rv

Defines a special type of solver state variable.

Sensor

Defines an event sensor in the model.

Sforce

Defines a force or torque acting between two Markers.

Sfsf

Defines a (Surface to Surface) higher pair constraint.

SimulationEvent

Defines an event in MotionSolve and adds it to a list.

Sphere

Creates a 3D graphic whose plane sections are circles and cm Marker at its center.

Spline

Defines spline with two or three independent variables.

SpringDamper

Defines a spring damper acting between two Markers.

SpringDamperGraphic

Creates a spring damper geometry.

String

Defines a user defined text string in MotionSolve.

Surface

Defines a parametric surface element in 3D space.

SurfaceGraphic

Creates a surface graphic that represents a Surface.

Tfsiso

Defines a transfer function as a ratio of two polynomials in the Laplace domain.

Transient

Specifies parameters that control the time-domain-based nonlinear dynamic analysis.

Triamesh

Creates a graphic object defined using 'Nodes' and 'Faces'.

Units

Defines the units for the model.

Upost

Defines a user-written Post-Subroutine.

UserGraphic

Creates a user-defined (Grasub) geometry.

UserMsg

Defines a user-written Message-Subroutine.

Variable

Defines a variable in terms of a scalar algebraic equation in MotionSolve.

Vforce

Defines a vector force that consists of three orthogonal components.

Vtorque

Defines a vector torque that consists of three orthogonal components.

Yforce

Creates a Force State Equation.

Result Objects#

msolve has special classes and methods to extract and store the results of a simulation. These objects provide a practical and convenient platform for post-processing.

The following process map explains the different ways you can obtain the results of a simulation.

../_images/results_process.png

Comments

  1. Run a SimulationEvent or use the Model.simulate method with the returnResults set to True. This instructs msolve to store the results to a SimulationResults object.

  2. Use the SimulationResults.asDataFrame method to get the results as a dictionary of Pandas dataframes, or,

  3. Use the SimulationResults.getObject method, specifying the entity whose results are to be extracted. This entity can be a Body, a Request, or a Rv. A ResultObject is created, which can be one of BodyResult, FlexBodyResult, PointMassResult, RequestResult, or RvResult, depending on the entity.

  4. Use one of the methods ResultObject.getStep, ResultObject.getDataFrame, ResultObject.getComponent to extract the numerical data of the entity.

Note

There is a wide range of libraries available in python for data post-processing, that can be used in conjunction with msolve.


SimulationResults

Container object that encloses all the results from a single simulation.

SimulationResultsHistory

A container class that can be used to store, serialize and de-serialize SimulationResults for cross plotting.

ResultObject

Base class for all the result objects of a simulation.

BodyResult

Contains all the results associated with a single Part of the model.

FlexBodyResult

Contains results associated with a single FlexBody of the model.

PointMassResult

Contains all the results associated with a single PointMass of the model.

RequestResult

Contains all the results associated with a single Request of the model.

RvResult

Contains all the results associated with a single Rv of the model.

Base Classes#

Base classes are used in class derivation. They group model entities according to their functionality and they cannot be used standalone.

AnalysisParameters

Base class for analysis settings objects.

Body

Base class for Body objects.

Command

Base class for command objects.

Constraint

Base class for constraint objects.

Force

Base class for force objects.

Generic

Base class for generic modeling elements.

Graphics

Base class for graphic objects.

ReferenceData

Base class for reference data objects.

SolverOutput

Base class for output objects.

Class Aliases#

Class aliases are alternative names for specific model entities.

Dcurve

alias of msolve.Model.DeformableCurve

DeformCurve

alias of msolve.Model.DeformableCurveGraphic

DeformSurface

alias of msolve.Model.DeformableSurfaceGraphic

Dsurface

alias of msolve.Model.DeformableSurface

Flex_Body

alias of msolve.Model.FlexBody

GraCurve

alias of msolve.Model.CurveGraphic

GraForce

alias of msolve.Model.ForceGraphic

GraPoint

alias of msolve.Model.PointGraphic

GraSurface

alias of msolve.Model.SurfaceGraphic

ParamCurve

alias of msolve.Model.CurveGraphic

ParamCurveGraphic

alias of msolve.Model.CurveGraphic

ParamSurface

alias of msolve.Model.SurfaceGraphic

ParamSurfaceGraphic

alias of msolve.Model.SurfaceGraphic

PlantState

alias of msolve.Model.Pstate

Point_Mass

alias of msolve.Model.PointMass

Spdp

alias of msolve.Model.SpringDamperGraphic