Model Entities#
- class Debug(**kwds)#
Outputs data that helps you debug your simulation.
Name
Type
Required
Default
Modifiable
Designable
Bool
False
\(\checkmark\)
Bool
False
\(\checkmark\)
Str
Str
Bool
False
\(\checkmark\)
Bool
False
\(\checkmark\)
See also
For more details, see also DebugOutput.
- anim#
A flag that causes animation frames to be generated.
Type=Bool, Default=False, Modifiable
- eprint#
A flag controlling the generation of debugging information.
Type=Bool, Default=False, Modifiable
- label#
A string describing the object.
Type=Str
- name#
Defines a nametag for the object.
Type=Str
- screen_output#
True if the debug output is to be printed to the screen.
Type=Bool, Default=False, Modifiable
- verbose#
The level of verbosity of the output.
Type=Bool, Default=False, Modifiable
- class Dv(**kwds)#
- Defines a special type of solver state variable.
It is used in the evaluation and computation of design sensitivity as a design parameter. Its value is modified during the simulation in case of Design Sensitivity Analysis.
Name
Type
Required
Default
Modifiable
Designable
Double
\(\checkmark\)
0.0
Double [2]
[-1000000000000.0, 1000000000000.0]
Int
Auto
Str
Str
Bool
True
Bool
True
Double [0]
0.0
Example
Create a Dv variable.#from msolve import * model = Model(output="dv") Units(length="MILLIMETER") Accgrav(kgrav=-9810) ground = Part(ground=True) global_ref = Marker(body=ground) body=Part(mass=1, ip=[1e3,1e3,1e3], cm=Marker(qp=[0,0,100], zv=[0,0,1])) radius = Dv(b=100, blimit=[80,135]) length = Dv(b=1e3, blimit=[850, 1100]) cyl = Cylinder(cm=body.cm, radius=radius, length=length, end_caps="CLOSED") H3dOutput(save=True)
See also
For more details, see also Design Variables and Limits.
- b#
Initial value of the design variable.
Type=Double, Required, Default=0.0
- blimit#
Lower and Upper bound numerical values for the Design Variable.
Type=Double [2], Default=[-1000000000000.0, 1000000000000.0]
- id#
The id of the object.
Type=Int
- label#
A string describing the object.
Type=Str
- name#
Defines a nametag for the object.
Type=Str
- scaleBySen#
True if scale the design variable by sensitivity.
Type=Bool, Default=True
- sensitivity#
When set to False, MotionSolve ignores this Dv in dsa analysis.
Type=Bool, Default=True
- values#
List of values of the design variable used in Plackett-Burman and fractional factorial DOE.
Type=Double [0], Default=0.0
- class Equilibrium(**kwds)#
Specifies error tolerances and other parameters for static and quasi-static equilibrium analyses.
Name
Type
Required
Default
Modifiable
Designable
Double
\(\checkmark\)
Double
\(\checkmark\)
Double
\(\checkmark\)
Str
Int
\(\checkmark\)
Enum
FIM_D
\(\checkmark\)
Str
Bool
False
\(\checkmark\)
Double
\(\checkmark\)
Enum
\(\checkmark\)
See also
For more details, see also Parameters: Static Solver.
- error#
Upper limit for the change in the residual of the system equations at the static equilibrium point (for force imbalance method), or upper limit for the change in system states at the static equilibrium point for Maximum Kinetic Energy Attrition Method.
Type=Double, Modifiable
- imbalance#
Maximum force imbalance allowed.
Type=Double, Modifiable
- kinetic_energy_error#
Maximum allowed residual kinetic energy at static equilibrium.
Type=Double, Modifiable
- label#
A string describing the object.
Type=Str
- maxit#
Number of iterations allowed before static simulation terminates.
Type=Int, Modifiable
- method#
Specifies the static solver method used.
Type=Enum, Default=FIM_D, Modifiable
Permitted values are:
FIM_D
FIM_S
MKEAM
- name#
Defines a nametag for the object.
Type=Str
- skip_mkeam#
True if you want to skip MKEAM analysis following FIM failure.
Type=Bool, Default=False, Modifiable
- stability#
Fraction of mass matrix added to Jacobian.
Type=Double, Modifiable
- type#
The type of simulation.
Type=Enum, Modifiable
Permitted values are:
DYNAMIC
STATIC
- class FlexBody(**kwds)#
- Defines a flexible body object in MotionSolve.
This entity has mass and inertia properties just like a rigid body. In addition, it has modal flexibility properties that allow it to deform under loads. The FlexBody operates in 3-D space where it can simultaneously undergo large overall motion as well as deformation.
Name
Type
Required
Default
Modifiable
Designable
Reference -
NuCMSColor
Function
Str
Function
FileName
Reference -
ArrayInt
Auto
Str
Str
Int
0
FileName
Str
Bool
True
Location
0.0, 0.0, 0.0
\(\checkmark\)
Angles
\(\checkmark\)
Bool
False
\(\checkmark\)
Routine
Script
Reference -
MarkerDouble
\(\checkmark\)
\(\checkmark\)
Double
\(\checkmark\)
\(\checkmark\)
Double
\(\checkmark\)
\(\checkmark\)
Reference -
MarkerDouble
\(\checkmark\)
\(\checkmark\)
Double
\(\checkmark\)
\(\checkmark\)
Double
\(\checkmark\)
\(\checkmark\)
Location
\(\checkmark\)
Location
\(\checkmark\)
Location
\(\checkmark\)
Location
\(\checkmark\)
Example
For this example, a mtx file is required. The file is located in the mbd_modeling\flexbodies folder in the MotionSolve tutorials Model Files. You may copy the file to your working directory.
Create a FlexBody.#from msolve import * model = Model(output='flexbody') ground = Part(ground=True) global_ref = Marker(part=ground) Units(system='MKS') Accgrav(kgrav=-9.81) flex = FlexBody(mtx_file="sla_flex_left.mtx", qg=[1,1,1], zv=[0,0,1])
See also
For more details, see also Body: Flexible.
User Subroutine
The following user subroutine template expects the function signature and return value(s) as shown. Note that this is a placeholder implementation for reference purposes only.
def DMPSUB(id, time, par, npar, freq, nmode, h): cratios = nmode*[0.0] # compute a custom modal damping ratio for a flexible body return cratios def MASS_READ(id, itype, par, npar): # update the FlexBody mass properties itype = 1 mass = [10,1,1,1,0,0,0] # mass, Ixx, Iyy, Izz, Ixy, Ixz, Iyz return py_put_mass(id, itype, mass)
For more information, see MotionSolve Subroutines.
- cms_data#
NuCMS object that contains the CMS representation for the FlexBody.
Type=Reference (NuCMS)
- color#
The color of the graphic for this flexible body.
Type=Color
- cratio#
State-dependent expression of damping coefficient for each mode. For user defined damping can be defined as ‘USER(<list of parameters passed to subroutine>)’.
Type=Function
- full_label#
When defined on a rigid body it indicates that aero-dynamic loads calculated during a MotionSolve-Acusolve co-simulation will be applied. It is essential for this string to correspond to the Rigid Body label defined within the Motion Ribbon of HyperWorks CFD, under External Surface.
Type=Str
- function#
Parameters passed to user defined subroutine.
Type=Function
- h3d_file#
H3D file containing nodes in finite element mesh.
Type=FileName
- ic_array#
Array holding the initial conditions of the flex body modes
Type=Reference (Array)
- id#
The id of the object.
Type=Int
- label#
A string describing the object.
Type=Str
- lset_file#
Output filename for contact bdf file generated during simulation.
Type=Str
- max_num_cnt_loadset#
Maximum number of exported contact loadsets.
Type=Int, Default=0
- mtx_file#
MTX file containing CMS representation for FlexBody.
Type=FileName
- name#
Defines a nametag for the object.
Type=Str
- orthogonal_loadset#
Boolean indicating if computed loadsets will be orthogonalized.
Type=Bool, Default=True
- qg#
Type=Location, Default=0.0, 0.0, 0.0
- reuler#
3-1-3 Euler angles of local part reference marker.
Type=Angles, Designable
- rigidified#
Convert the flexible body to a rigid body if True.
Type=Bool, Default=False, Modifiable
- routine#
The value can be a callable Python function, a Matlab/OML script, or a string that includes the name of a DLL/SO file and the corresponding function name, separated by ‘::’.
Type=Routine
- script#
Path and name of the script that contains the routine.
Type=Script
- vm#
Marker used to define initial translational velocity. When not specified, it defaults to the global coordinate system.
Type=Reference (Marker)
- vx#
Initial translational velocity along x-axis.
Type=Double, Modifiable, Designable
- vy#
Initial translational velocity along y-axis.
Type=Double, Modifiable, Designable
- vz#
Initial translational velocity along z-axis.
Type=Double, Modifiable, Designable
- wm#
Marker used to define initial angular velocity. When not specified, it defaults to the FlexBody cm coordinate system.
Type=Reference (Marker)
- wx#
Initial angular velocity along x-axis.
Type=Double, Modifiable, Designable
- wy#
Initial angular velocity along y-axis.
Type=Double, Modifiable, Designable
- wz#
Initial angular velocity along z-axis.
Type=Double, Modifiable, Designable
- xg#
Type=Location
- xv#
Type=Location
- zg#
Type=Location
- zv#
Type=Location
- class Grid(**kwds)#
- Defines a set of nodal coordinates in 3D space.
This entity is a fully parameterized entity used in conjunction with Absolute Nodal Coordinate Formulation elements.
Name
Type
Required
Default
Modifiable
Designable
Int
Auto
Str
Str
Double [3]
[0, 0, 0]
Double [3]
0.0
Double [3]
0.0
Double [3]
0.0
Double [3]
0.0
Double [3]
0.0
Double [3]
0.0
Double [3]
0.0
Double [3]
0.0
Double [3]
0.0
Double [3]
0.0
Double [3]
0.0
See also
For more details, see also Grid.
- id#
The id of the object.
Type=Int
- label#
A string describing the object.
Type=Str
- name#
Defines a nametag for the object.
Type=Str
- r#
Current x, y, z coordinates of the Grid.
Type=Double [3], Default=[0, 0, 0]
- r0#
The relaxed position x, y, z coordinates for the Grid.
Type=Double [3], Default=0.0
- rd#
The x, y, z velocities of the Grid.
Type=Double [3], Default=0.0
- rx#
The x gradient vectors for the Grid.
Type=Double [3], Default=0.0
- rx0#
The x relaxed position gradient vector.
Type=Double [3], Default=0.0
- rxd#
The time derivative of the x gradient vector.
Type=Double [3], Default=0.0
- ry#
The y gradient vectors for the Grid.
Type=Double [3], Default=0.0
- ry0#
The y relaxed position gradient vector.
Type=Double [3], Default=0.0
- ryd#
The time derivative of the y gradient vector.
Type=Double [3], Default=0.0
- rz#
The z gradient vectors for the Grid.
Type=Double [3], Default=0.0
- rz0#
The z relaxed position gradient vector.
Type=Double [3], Default=0.0
- rzd#
The time derivative of the z gradient vector.
Type=Double [3], Default=0.0
- class Gse(**kwds)#
- Defines a generic dynamic system.
The dynamic system is characterized by an array of inputs u, an array of dynamic states x, and an array of outputs y. See
Array. The state array x is defined by a set of differential equations. The output vector y is defined by a set of algebraic equations.
Name
Type
Required
Default
Modifiable
Designable
Bool
True
\(\checkmark\)
Alias
Function
\(\checkmark\)
\(\checkmark\)
Reference -
Array\(\checkmark\)
Int
Auto
Double
0.0
Alias
Str
Str
Str
Int
0
Int
0
Routine
Script
Bool
False
\(\checkmark\)
Reference -
Array\(\checkmark\)
Reference -
Array\(\checkmark\)
Reference -
Array\(\checkmark\)
See also
For more details, see also Control: State Equation.
User Subroutine
The following user subroutine template expects the function signature and return value(s) as shown. Note that this is a placeholder implementation for reference purposes only.
def GSESUB(id, time, par, npar, dflag, iflag, nstate, states, ninput, input, noutput): # calculate the state array derivatives `stated` and the `output` array values stated = nstate * [0.0] output = noutput * [0.0] return [stated, output] def GSEXU(id, time, par, npar, iflag, nstate, states, ninput, input, noutpt): # calculate the derivatives of the state array with respect to the input result = nstate*ninput*[0.0] return result def GSEXX(id, time, par, npar, iflag, nstate, states, ninput, input, noutpt): # compute the matrix of the partial derivatives of the state derivative array vector with respect to the state vector result = nstate*nstate*[0.0] return result def GSEYU(id, time, par, npar, iflag, nstate, states, ninput, input, noutpt): # compute the matrix of the partial derivatives of the output array vector with respect to the input vector result = noutpt*ninput*[0.0] return result def GSEYX(id, time, par, npar, iflag, nstate, states, ninput, input, noutpt): # compute the matrix of the partial derivatives of the output array vector with respect to the state vector result = noutpt*nstate*[0.0] return result
For more information, see MotionSolve Subroutines.
- active#
Defines the state of the object.
Type=Bool, Default=True, Modifiable
- fmu_comm_intvl#
Alias to interval.
Type=Alias
- function#
Parameters passed to user defined subroutine.
Type=Function, Required, Modifiable
- ic#
Array used to store the initial values of the states.
Type=Reference (Array), Modifiable
- id#
The id of the object.
Type=Int
- interval#
Time interval between successive communications with the FMU, defaults to h_max
Type=Double, Default=0.0
- ip_addr#
Alias to ip_address.
Type=Alias
- ip_address#
IP address for the server FMU connecting to MotionSolve.
Type=Str
- label#
A string describing the object.
Type=Str
- name#
Defines a nametag for the object.
Type=Str
- no#
Specifies the number of outputs in the Gse.
Type=Int, Default=0
- ns#
Specifies the number of states in the Gse.
Type=Int, Default=0
- routine#
The value can be a list of callable Python functions, a Matlab/OML script, or a string that includes the name of a DLL/SO file and the corresponding function name, separated by ‘::’.The order of the user subroutines is fixed and must be ‘gsesub’, ‘gsexx’, ‘gsexu’, ‘gseyx’, ‘gseyu’ and ‘gsexxd’. Only ‘gsesub’ is mandatory.
Type=Routine
- script#
Path and name of the script that contains the routine.
Type=Script
- static_hold#
Specifies if dynamic states are kept constant during static solution.
Type=Bool, Default=False, Modifiable
- u#
Array used to store the inputs, u.
Type=Reference (Array), Modifiable
- x#
Array used to store the states, x.
Type=Reference (Array), Modifiable
- y#
Array used to store the outputs, y.
Type=Reference (Array), Modifiable
- class H3dOutput(**kwds)#
Defines the parameters for the animation output file.
Name
Type
Required
Default
Modifiable
Designable
Bool
False
Alias
Double
9999999.0
Alias
Enum
AUTO
Bool
False
Enum
TENSOR
Alias
Alias
Int
1
Str
Bool
True
Bool
False
Str
Bool
False
Alias
Double
0.0
Alias
Enum
NONE
Alias
Enum
NONE
Enum
AUTO
See also
For more details, see also H3D Output.
- capture_max_pd#
Determines whether MotionSolve should monitor the maximumpenetration between colliding bodies across consecutive output steps.
Type=Bool, Default=False
- end#
Specifies the end time for writing the H3D.
Type=Alias
- end_time#
Type=Double, Default=9999999.0
- format#
Alias to format_type.
Type=Alias
- format_type#
Specifies the format for Flexible Body result.
Type=Enum, Default=AUTO
Permitted values are:
AUTO
MODAL
NODAL
NODALG
- frf_animation#
If True, a file ending in ‘_frf’ is generated. It contains all the results related to frequency response analysis and, when opened in HV, it shows the nodal deformations for each frequency.
Type=Bool, Default=False
- gpstress_format#
Specifies the format for grid point stress output. TENSOR enables grid point stress modeshapes if present in
FlexBodyH3D file.Type=Enum, Default=TENSOR
Permitted values are:
NONE
TENSOR
- grasave#
Alias to save.
Type=Alias
- inc#
Alias to increment.
Type=Alias
- increment#
Controls how often data is written to the H3D file as a multiple of the output step.
Type=Int, Default=1
- label#
A string describing the object.
Type=Str
- linear_anim#
Specifies whether linear analysis mode shapes are to be included in H3D file.
Type=Bool, Default=True
- linz_animation#
If True, a file ending in ‘_linz’ is generated. It contains the nodal deformations obtained in a linear analysis in a format that corresponds to the OptiStruct output.
Type=Bool, Default=False
- name#
Defines a nametag for the object.
Type=Str
- save#
Specifies if animation h3d file is to be generated.
Type=Bool, Default=False
- start#
Specifies the start time for writing the H3D.
Type=Alias
- start_time#
Type=Double, Default=0.0
- strain#
Alias to strain_format.
Type=Alias
- strain_format#
Specifies the format for Flexible Body strain result.
Type=Enum, Default=NONE
Permitted values are:
NONE
TENSOR
- stress#
Alias to stress_format.
Type=Alias
- stress_format#
Specifies the format for Flexible Body stress result.
Type=Enum, Default=NONE
Permitted values are:
NONE
TENSOR
- version#
Specifies the H3D format version to use for output. AUTO uses the latest version supported by the current solver.
Type=Enum, Default=AUTO
Permitted values are:
14
AUTO
- class Integrator(**kwds)#
Specifies parameters that control the dynamic analysis integrator.
Name
Type
Required
Default
Modifiable
Designable
Double
\(\checkmark\)
Int
\(\checkmark\)
Int
\(\checkmark\)
Int
0
Int
0
\(\checkmark\)
Double
1000
\(\checkmark\)
Bool
False
\(\checkmark\)
Double
\(\checkmark\)
Double
\(\checkmark\)
Double
\(\checkmark\)
Double
\(\checkmark\)
Bool
True
\(\checkmark\)
Int
\(\checkmark\)
Str
Int
\(\checkmark\)
Int
\(\checkmark\)
Str
Pattern
\(\checkmark\)
Double
0.01
\(\checkmark\)
Enum
DSTIFF
Double
\(\checkmark\)
See also
For more details, see also Parameters: Transient Solver.
- dae_constr_tol#
Tolerance that the corrector must satisfy at convergence.
Type=Double, Modifiable
- dae_eval_expiry#
Number of integration steps after which the evaluation pattern defined by dae_jacob_eval is ignored, and the default evaluation pattern is to be used.
Type=Int, Modifiable
- dae_index#
The index of the DAE formulation.
Type=Int, Modifiable
- dae_jacob_eval#
Frequency of evaluation of the Jacobian matrix during corrector iterations.
Info
This attribute is mutually exclusive with
pattern.Type=Int, Default=0
- dae_jacob_init#
Number of initial Jacobian matrix evaluations.
Type=Int, Default=0, Modifiable
- dae_vc_tol_factor#
A factor that multiplies
errorto yield the error tolerance.Type=Double, Default=1000, Modifiable
- dae_vel_ctrl#
True if the integrator is to include velocity states in its check.
Type=Bool, Default=False, Modifiable
- error#
Maximum absolute error allowed.
Type=Double, Modifiable
- hinit#
Maximum initial step size.
Type=Double, Modifiable
- hmax#
Maximum step size the integrator is allowed to take.
Type=Double, Modifiable
- hmin#
Minimum step size the integrator is allowed to take.
Type=Double, Modifiable
- interpolate#
Specifies whether the integrator uses interpolation for the results at the output steps.
Type=Bool, Default=True, Modifiable
- kmax#
Maximum order that the integrator is to take.
Type=Int, Modifiable
- label#
A string describing the object.
Type=Str
- maxit#
Maximum number of iterations the corrector is allowed to take to achieve convergence.
Type=Int, Modifiable
- minit#
Minimum number of iterations for the corrector.
Type=Int, Modifiable
- name#
Defines a nametag for the object.
Type=Str
- pattern#
Frequency of evaluation of the Jacobian matrix during corrector iterations.
Type=Pattern, Modifiable
- rel_abs_tol_ratio#
Specifies the ratio of relative error to absolute error used by the integrator.
Type=Double, Default=0.01, Modifiable
- type#
Defines the integrator to be used.
Type=Enum, Default=DSTIFF
Permitted values are:
ABAM
CSTIFF
DSTIFF
MSTIFF
VSTIFF
- class Linear(**kwds)#
Specifies the solver parameters that control the linear analysis.
Name
Type
Required
Default
Modifiable
Designable
Double
1.0
Double
-1
Bool
False
\(\checkmark\)
Bool
False
Str
Bool
False
\(\checkmark\)
Str
Bool
False
Bool
True
Reference -
Pinput\(\checkmark\)
Reference -
Poutput\(\checkmark\)
Reference -
PstateBool
False
\(\checkmark\)
Bool
False
Example
For an example, see
PointMass.- animation_scale#
Specifies a scale factor for magnifying the mode shapes during animation.
Type=Double, Default=1.0
- cutoff_frequency#
Specifies the upper bound of the eigenvalues of the system.
Type=Double, Default=-1
- eigensol#
If True, the eigenvalue and eigenvector data are written to an .eig file.
Type=Bool, Default=False, Modifiable
- kinetic#
Specifies whether modal kinetic energy distribution is to be written out to the solver log file and the linz.mrf output file.
Type=Bool, Default=False
- label#
A string describing the object.
Type=Str
- matlab#
If True, the A,B,C, D matrices are written out into a file compatible with MATLAB.
Type=Bool, Default=False, Modifiable
- name#
Defines a nametag for the object.
Type=Str
- nodamping#
If True, damping is disabled in linear solver.
Type=Bool, Default=False
- oml#
If True, the A, B, C, D matrices will be written out in an OML format file.
Type=Bool, Default=True
- pinput#
Specifies the plant input used for the B and D state matrices.
Type=Reference (Pinput), Modifiable
- poutput#
Specifies the plant output used for the C and D state matrices.
Type=Reference (Poutput), Modifiable
- pstate#
Specifies a
PlantStateto be used in the state space representation of the system. APlantStatedefines a list of variables used in generating a linear representation of the model about an operating point. The linear representation is used for both eigenvalue analysis and state matrix generation..Type=Reference (Pstate)
- simulink_mdl#
If True, the A, B, C, D matrices are written out in Simulink MDL format.
Type=Bool, Default=False, Modifiable
- statemat#
If True, the A, B, C, D matrices will be written out in a file.
Type=Bool, Default=False
- class Lse(**kwds)#
- Defines a linear dynamic system.
The form of the dynamic system is:
\[ \begin{align}\begin{aligned}\dot x = Ax + Bu\\y = Cx + Du\end{aligned}\end{align} \]The state variables x, the inputs, u, and the outputs, y, are specified with Arrays. Use
Matrixto define the coefficient matrices a, b, c and d.
Name
Type
Required
Default
Modifiable
Designable
Reference -
Matrix\(\checkmark\)
\(\checkmark\)
Bool
True
\(\checkmark\)
Reference -
Matrix\(\checkmark\)
Reference -
Matrix\(\checkmark\)
Reference -
Matrix\(\checkmark\)
Reference -
Array\(\checkmark\)
Int
Auto
Str
Str
Bool
False
\(\checkmark\)
Reference -
Array\(\checkmark\)
Reference -
Array\(\checkmark\)
\(\checkmark\)
Reference -
Array\(\checkmark\)
Example
Create a Linear State Equation (Lse).#from msolve import * model = Model(output="lse") Units(system="MKS") ground = Part(ground=True) global_ref = Marker(body=ground) a = Matrix(full="CORDER", rows=2, columns=2, values=[0,1,2,0.2]) b = Matrix(full="CORDER", rows=2, columns=1, values=[10,2]) c = Matrix(full="CORDER", rows=1, columns=2, values=[0,1]) d = Matrix(full="CORDER", rows=1, columns=2, values=[0.5,0.1]) ic = Array(type="IC", numbers=[1,1]) x = Array(type="X") y = Array(type="Y") u = Array(type="u",size=1) u.variables = Variable(function="-STEP(TIME, 0, 0, 0.1, 1)") lse = Lse(u=u, x=x, y=y, a=a, b=b, c=c, d=d, ic=ic)
See also
For more details, see also Control: State Equation.
- a#
State matrix for this Lse.
Type=Reference (Matrix), Required, Modifiable
- active#
Defines the state of the object.
Type=Bool, Default=True, Modifiable
- b#
Input matrix for this Lse.
Type=Reference (Matrix), Modifiable
- c#
Output matrix for this Lse.
Type=Reference (Matrix), Modifiable
- d#
Feed-thru matrix for this Lse.
Type=Reference (Matrix), Modifiable
- ic#
Array used to store the initial values of the states.
Type=Reference (Array), Modifiable
- id#
The id of the object.
Type=Int
- label#
A string describing the object.
Type=Str
- name#
Defines a nametag for the object.
Type=Str
- static_hold#
Specifies if dynamic states x are kept fixed during static/quasi-static solution.
Type=Bool, Default=False, Modifiable
- u#
Array used to store the inputs, u, of this Lse.
Type=Reference (Array), Modifiable
- x#
Array used to store the states, x, of this Lse.
Type=Reference (Array), Required, Modifiable
- y#
Array used to store the output, y, of this Lse.
Type=Reference (Array), Modifiable
- class Marker(**kwds)#
- Defines an orthonormal, right-handed coordinate system and reference frame in MotionSolve.
Name
Type
Required
Default
Modifiable
Designable
Reference -
BodyReference -
FlexBodyBool
False
Str
Function
Reference -
GridInt
Auto
Str
Str
Int
0
Alias
Reference -
PartReference -
PointMassLocation
\(\checkmark\)
0.0, 0.0, 0.0
\(\checkmark\)
\(\checkmark\)
Angles
\(\checkmark\)
\(\checkmark\)
Reference -
MarkerRoutine
Script
Bool
False
Alias
Location
\(\checkmark\)
\(\checkmark\)
Location
\(\checkmark\)
\(\checkmark\)
Location
\(\checkmark\)
\(\checkmark\)
Location
\(\checkmark\)
\(\checkmark\)
Example
Create Markers.#from msolve import * model = Model(output="marker") Units(system="MKS") ground = Part(ground=True) part = Part(mass=1, ip=[1]*3) m1 = Marker(part=ground, zp=[0,0,100]) m2 = part.cm = Marker(part=part, qp=Point(10,5,0), xv=[1,0,0], zv=[0,0,1], usexv=True) m3 = Marker(part=part, qp=m1.qp, floating=True, reuler=[0,90,0])
See also
For more details, see also Reference: Marker.
User Subroutine
The following user subroutine template expects the function signature and return value(s) as shown. Note that this is a placeholder implementation for reference purposes only.
def MARKER_READ(id, par, npar): # compute the marker position and use py_put_marker to update the marker position id = 1 pos = [1, 2, 3] angle_type = 1 # 0 - DC matrix # 1 - Euler Angles # 2 - YPR (Yaw, Pitch, Roll) # 3 - Euler Parameters angle = [0,0,0] errflg = py_put_marker(id, r, angle_type, angle) return errflg
For more information, see MotionSolve Subroutines.
- body#
Specifies the body to which Marker belongs.
Info
This attribute is mutually exclusive with
point_mass,flex_body,part.Type=Reference (Body)
- dc()#
Returns three vectors parallel to the x, y, z axes of a Marker in the global reference frame.
- flex_body#
Specifies the
FlexBodyto which Marker belongs.Info
This attribute is mutually exclusive with
point_mass,part,body.Type=Reference (FlexBody)
- floating#
Specifies whether the marker is floating.
Type=Bool, Default=False
- full_label#
Label used during MotionSolve - Acusolve co-simulation.
Type=Str
- function#
Parameters passed to user defined subroutine.
Type=Function
- grid#
Define the Marker location using a Grid object.
Type=Reference (Grid)
- id#
The id of the object.
Type=Int
- label#
A string describing the object.
Type=Str
- name#
Defines a nametag for the object.
Type=Str
- node#
Node on flexible body to which Marker is attached.
Type=Int, Default=0
- node_id#
Alias to node.
Type=Alias
- part#
Specifies the Part to which Marker belongs.
Info
This attribute is mutually exclusive with
point_mass,flex_body,body.Type=Reference (Part)
- point_mass#
Specifies the PointMass to which Marker belongs.
Type=Reference (PointMass)
- qp#
Specifies the coordinates of Marker with respect to body or
rm.Type=Location, Required, Default=0.0, 0.0, 0.0, Modifiable, Designable
- reuler#
Specifies body-fixed 3-1-3 Euler angles, in radians, of the Marker with respect to the
rmMarkerType=Angles, Modifiable, Designable
- rm#
Specifies the reference marker in which the location and orientation of the marker are described. When not specified, the position of the Marker is assumed to be with respect to the parent body.
Type=Reference (Marker)
- routine#
The value can be a callable Python function, a Matlab/OML script, or a string that includes the name of a DLL/SO file and the corresponding function name, separated by ‘::’.
Type=Routine
- script#
Path and name of the script that contains the routine.
Type=Script
- usexp#
Use x-point-z-point method of orientation if True.
Type=Bool, Default=False
- usexv#
Alias to usexp.
Type=Alias
- xaxis()#
Returns a vector parallel to the x-axis of a Marker in the global reference frame.
- xp#
Specifies the coordinates of a point on the x-axis of the Marker expressed in the
rmMarker coordinate system.Type=Location, Modifiable, Designable
- xv#
Vector parallel to the x-axis direction of the Marker in the
rmMarker coordinate system.Type=Location, Modifiable, Designable
- yaxis()#
Returns a vector parallel to the y-axis of a Marker in the global reference frame.
- zaxis()#
Returns a vector parallel to the z-axis of a Marker in the global reference frame.
- class NuCMS(**kwds)#
Creates a set of flexible body properties with the goal to more accurately capture the mode shapes based on Predictive Component Mode Synthesis theory.
Name
Type
Required
Default
Modifiable
Designable
Double
0.1
Double
Bool
False
FileName
\(\checkmark\)
Bool
False
Int
Auto
Int
1
Double
100000.0
Str
Str
Double
0.001
Str
Int
0
Int
Str
Bool
True
Str
Double
0.001
Double
1e-06
Double
1
Int [0]
0
See also
For more details, see also Reference: Flexible Body Data.
- alimit#
Rotational mode shape limit.
Type=Double, Default=0.1
- cutoff_frequency#
Additional cut-off frequency.
Type=Double
- ext_only#
If set to True, internal CGPA are ignored.
Type=Bool, Default=False
- fem_file#
Input FEM deck.
Type=FileName, Required
- fem_only#
If set to True CMS will only generate the fem file.
Type=Bool, Default=False
- id#
The id of the object.
Type=Int
- increments#
Number of increments.
Type=Int, Default=1
- ka#
Stiffness of contact elements used in joints.
Type=Double, Default=100000.0
- label#
A string describing the object.
Type=Str
- lset_file#
Loadset bdf file generated during precursory flex analysis.
Type=Str
- mu#
Friction coefficient of contact elements in joints.
Type=Double, Default=0.001
- name#
Defines a nametag for the object.
Type=Str
- ncov#
Number of convoluted modes.
Type=Int, Default=0
- nmode#
Additional requested normal modes.
Type=Int
- output#
Output file name.
Type=Str
- overwrite#
If set to True a new CMS calculation will be performed every time.
Type=Bool, Default=True
- preload_file#
Type=Str
- ptol#
Pivot tolerance.
Type=Double, Default=0.001
- rtol#
Tolerance for orthogonalization procedure.
Type=Double, Default=1e-06
- tlimit#
Translational mode shape limit.
Type=Double, Default=1
- zset#
Subset of ASET1 nodes eliminated by the NuCMS process.
Type=Int [0], Default=0
- class Output(**kwds)#
- Specifies if the plt, abf, mrf files are to be generated during the solver run.
Attributes can be used to control the output files preferences.
Name
Type
Required
Default
Modifiable
Designable
Enum
ALL
Enum
DEFAULT
Bool
False
Double
1e-07
Bool
False
Bool
True
Double
1e-07
Alias
Double
1e-07
Bool
False
Str
Bool
True
Str
Enum
ALL
Enum
COMMENT
Alias
Bool
False
Bool
False
Alias
Enum
ALL
EnumStr [0]
Bool
False
Double
1e-07
Bool
False
Example
For an example, see
Contact.See also
For more details, see also Output: Results.
- abf_unique_time#
Controls which result is written to the abf file when there are more than one result data at a single time step.
Type=Enum, Default=ALL
Permitted values are:
ALL
FIRST
LAST
- abf_yrequest_label#
Controls the name of each request in the abf file. ‘LABEL’ instructs MS to use the request label as the title. ‘COMMENT’ uses the request comment string as the title.
Type=Enum, Default=DEFAULT
Permitted values are:
COMMENT
DEFAULT
LABEL
- abfsave#
Specifies if abf file is to be created.
Type=Bool, Default=False
- azero#
Output accelerations less than the specified value are set to be equal to zero.
Type=Double, Default=1e-07
- capture_max_pd#
MotionSolve monitors and reports the maximum penetration for colliding bodies in between two output steps.
Type=Bool, Default=False
- contact_gra_output#
Used to enable or disable contact force vector animation in the h3d file.
Type=Bool, Default=True
- dzero#
Output displacements less than the specified value are set to be equal to zero.
Type=Double, Default=1e-07
- flex_vel_acc_output#
Type=Alias
- fzero#
Output forces less than the specified value are set to be equal to zero.
Type=Double, Default=1e-07
- include_flex_vel_acc#
Type=Bool, Default=False
- label#
A string describing the object.
Type=Str
- mrfsave#
Specifies if mrf file is to be created.
Type=Bool, Default=True
- name#
Defines a nametag for the object.
Type=Str
- plt_unique_time#
Controls which result is written to the plt file when there are more than one result data at a single time step.
Type=Enum, Default=ALL
Permitted values are:
ALL
FIRST
LAST
- plt_yrequest_label#
Controls the name of each request in the plt file. ‘LABEL’ instructs MS to use the request label as the title. ‘COMMENT’ uses the request comment string as the title.
Type=Enum, Default=COMMENT
Permitted values are:
COMMENT
LABEL
- pltsave#
Alias to save.
Type=Alias
- req_angle_radians#
If True output request will return angular quantities in rad.
Type=Bool, Default=False
- req_comment_only#
Specifies whether a Request id prefix is to be added to requests in mrf and abf files.
Type=Bool, Default=False
- reqsave#
Alias to save.
Type=Alias
- results_mode#
Result filtering mode for
SimulationResults. ALL keeps all result classes; INCLUDE keeps only classes listed in results_types; EXCLUDE drops classes listed in results_types.Type=Enum, Default=ALL
Permitted values are:
ALL
EXCLUDE
INCLUDE
- results_types#
Result class names used by results_mode. Multi-select. Accepts a list or a space/comma-separated string. If empty, all result classes are kept.
Type=EnumStr [0]
Permitted values are:
BODYRESULT
FLEXBODYRESULT
FRFBODYRESULT
FRFFREQUENCYRESULT
FRFREQUESTRESULT
POINTMASSRESULT
REQUESTRESULT
RVRESULT
- save#
Specifies if plt file is to be created.
Type=Bool, Default=False
- vzero#
Output velocities less than the specified value are set to be equal to zero.
Type=Double, Default=1e-07
- ypr#
Specifies whether YPR angles are requested.
Type=Bool, Default=False
- class Part(**kwds)#
- Defines a rigid body object in MotionSolve.
This entity has mass, inertia properties and initial position, orientation and velocity.
Name
Type
Required
Default
Modifiable
Designable
Reference -
MarkerStr
Function
Bool
False
Int
Auto
Reference -
MarkerIps
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
\(\checkmark\)
\(\checkmark\)
Str
Double
0.0
\(\checkmark\)
\(\checkmark\)
Str
Enum
Location
0.0, 0.0, 0.0
\(\checkmark\)
Angles
\(\checkmark\)
Routine
Script
Bool
False
Reference -
MarkerDouble
\(\checkmark\)
\(\checkmark\)
Double
\(\checkmark\)
\(\checkmark\)
Double
\(\checkmark\)
\(\checkmark\)
Bool
False
\(\checkmark\)
Reference -
MarkerDouble
\(\checkmark\)
\(\checkmark\)
Double
\(\checkmark\)
\(\checkmark\)
Double
\(\checkmark\)
\(\checkmark\)
Location
\(\checkmark\)
Location
\(\checkmark\)
Location
\(\checkmark\)
Location
\(\checkmark\)
Method Name
Method Description
createWetBodyPlant(self)Called automatically if the body is wet to create ACUSOLVE entities.
Method Details
- createWetBodyPlant()
Called automatically if the body is wet to create ACUSOLVE entities.
Creates all the implicit required entities for wet body ACUSOLVE co-simulation.
This includes solver variables, plant input, and Gforce acting on the wet body CM expressed in Global Reference Frame
- Returns:
plantInput
Example
Create a Part.#from msolve import * model = Model(output="part") Units(length="MILLIMETER") ground = Part(ground=True) global_ref = Marker(part=ground) part = Part (mass=1, ip=[1e3,1e3,1e3], cm=Marker(qp=[10,0,0]), planar="XY")
See also
For more details, see also Body: Rigid.
User Subroutine
The following user subroutine template expects the function signature and return value(s) as shown. Note that this is a placeholder implementation for reference purposes only.
def MASS_READ(id, itype, par, npar): itype = 0 mass = [10,1,1,1,0,0,0] # mass, Ixx, Iyy, Izz, Ixy, Ixz, Iyz return py_put_mass(id, itype, mass)
For more information, see MotionSolve Subroutines.
- cm#
Marker locating at center-of-mass.
Type=Reference (Marker)
- createWetBodyPlant()#
Called automatically if the body is wet to create ACUSOLVE entities.
Creates all the implicit required entities for wet body ACUSOLVE co-simulation.
This includes solver variables, plant input, and Gforce acting on the wet body CM expressed in Global Reference Frame
- Returns:
plantInput
- full_label#
When defined on a rigid body it indicates that aero-dynamic loads calculated during a MotionSolve-Acusolve co-simulation will be applied. It is essential for this string to correspond to the Rigid Body label defined within the Motion Ribbon of HyperWorks CFD, under External Surface.
Type=Str
- function#
Parameters passed to user defined subroutine.
Type=Function
- ground#
Specifies if the part is ground or not.
Type=Bool, Default=False
- id#
The id of the object.
Type=Int
- im#
Marker where the inertia matrix is computed. When not specified, it defaults to the
cmmarker.Type=Reference (Marker)
- ip#
Mass moments of inertia matrix.
Type=Ips, Default=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], Modifiable, Designable
- label#
A string describing the object.
Type=Str
- mass#
Mass of the part.
Type=Double, Default=0.0, Modifiable, Designable
- name#
Defines a nametag for the object.
Type=Str
- planar#
Specifies the plane that the part is constrained to.
Type=Enum
Permitted values are:
XY
XZ
YX
YZ
ZX
ZY
- qg#
Type=Location, Default=0.0, 0.0, 0.0
- reuler#
3-1-3 Euler angles of local part reference Marker.
Type=Angles, Designable
- routine#
The value can be a callable Python function, a Matlab/OML script, or a string that includes the name of a DLL/SO file and the corresponding function name, separated by ‘::’.
Type=Routine
- script#
Path and name of the script that contains the routine.
Type=Script
- virtual#
Specifies if the part is virtual.
Type=Bool, Default=False
- vm#
Marker used to define initial translational velocity. When not specified, it defaults to the global coordinate system.
Type=Reference (Marker)
- vx#
Initial translational velocity along x-axis.
Type=Double, Modifiable, Designable
- vy#
Initial translational velocity along y-axis.
Type=Double, Modifiable, Designable
- vz#
Initial translational velocity along z-axis.
Type=Double, Modifiable, Designable
- wet#
Determine whether fluid loads from the corresponding AcuSolve model will be applied.
Type=Bool, Default=False, Modifiable
- wm#
Marker used to define initial angular velocity. When not specified, it defaults to the
cmmarker.Type=Reference (Marker)
- wx#
Initial angular velocity about x-axis.
Type=Double, Modifiable, Designable
- wy#
Initial angular velocity about y-axis.
Type=Double, Modifiable, Designable
- wz#
Initial angular velocity about z-axis.
Type=Double, Modifiable, Designable
- xg#
Type=Location
- xv#
Type=Location
- zg#
Type=Location
- zv#
Type=Location
- class PointMass(**kwds)#
- Defines an entity that has mass but no inertia properties.
Three translational coordinates characterize the position of the PointMass. By default, the orientation of the PointMass is set to be the same as the global coordinate system. It never changes during simulation. Markers on PointMass may have location and orientation coordinates. The orientation of these Markers does not change during the simulation.
Name
Type
Required
Default
Modifiable
Designable
Reference -
MarkerStr
Function
Int
Auto
Str
Double
0.0
\(\checkmark\)
\(\checkmark\)
Str
Location
0.0, 0.0, 0.0
\(\checkmark\)
Routine
Script
Bool
False
Double
\(\checkmark\)
\(\checkmark\)
Double
\(\checkmark\)
\(\checkmark\)
Double
\(\checkmark\)
\(\checkmark\)
Location
\(\checkmark\)
Location
\(\checkmark\)
Location
\(\checkmark\)
Location
\(\checkmark\)
Example
Create a PointMass body.#from msolve import * model = Model(output="pointmass") Units(system="MKS") ground = Part(ground=True) global_ref = Marker(body=ground) pmass = PointMass(mass=1, cm=Marker(qp=[5,0,0])) sd1 = SpringDamper(type = "TRANSLATION", i = Marker(body=pmass, qp=[5,0,0], zp=[6,0,0]), j = Marker(body=ground, qp=[0,0,0], zp=[1,0,0]), length = 5, k = 100, c = 1 ) sd2 = SpringDamper(type = "TRANSLATION", i = sd1.i, j = Marker(body=ground, qp=[10,0,0], zp=[11,0,0]), length = 5, k = 50 ) Linear(eigensol=True, nodamping=True) model.simulate(type="LINEAR")
See also
For more details, see also Point Mass.
User Subroutine
The following user subroutine template expects the function signature and return value(s) as shown. Note that this is a placeholder implementation for reference purposes only.
def MASS_READ(id, itype, par, npar): itype = 2 mass = [10,1,1,1,0,0,0] # mass, Ixx, Iyy, Izz, Ixy, Ixz, Iyz return py_put_mass(id, itype, mass)
For more information, see MotionSolve Subroutines.
- cm#
Marker locating the center-of-mass.
Type=Reference (Marker)
- full_label#
When defined on a rigid body it indicates that aero-dynamic loads calculated during a MotionSolve-Acusolve co-simulation will be applied. It is essential for this string to correspond to the Rigid Body label defined within the Motion Ribbon of HyperWorks CFD, under External Surface.
Type=Str
- function#
Parameters passed to user defined subroutine.
Type=Function
- id#
The id of the object.
Type=Int
- label#
A string describing the object.
Type=Str
- mass#
Mass of the PointMass.
Type=Double, Default=0.0, Modifiable, Designable
- name#
Defines a nametag for the object.
Type=Str
- qg#
Type=Location, Default=0.0, 0.0, 0.0
- routine#
The value can be a callable Python function, a Matlab/OML script, or a string that includes the name of a DLL/SO file and the corresponding function name, separated by ‘::’.
Type=Routine
- script#
Path and name of the script that contains the routine.
Type=Script
- virtual#
Specifies if the point mass is virtual.
Type=Bool, Default=False
- vx#
Initial translational velocity along x-axis.
Type=Double, Modifiable, Designable
- vy#
Initial translational velocity along y-axis.
Type=Double, Modifiable, Designable
- vz#
Initial translational velocity along z-axis.
Type=Double, Modifiable, Designable
- xg#
Type=Location
- xv#
Type=Location
- zg#
Type=Location
- zv#
Type=Location
- class ProximitySensor(**kwds)#
- Defines a sensor between two bodies which monitors their minimum separation.
The results of ProximitySensor can be accessed using the PROXIMITY function for use in defining expressions or for plotting. A line representing the closest distance between geometries is created in the animation h3d file.
Name
Type
Required
Default
Modifiable
Designable
Bool
True
Int
Auto
Reference -
FlexBodyReference -
Graphics[0]Reference -
FlexBodyReference -
Graphics[0]Str
Str
Example
For an example, see
Contact.See also
For more details, see also Sensor: Proximity.
- active#
Defines the state of this object.
Type=Bool, Default=True
- id#
The id of the object.
Type=Int
- iflex#
Flexible body used as first body in proximity sensor.
Info
This attribute is mutually exclusive with
igeom.Type=Reference (FlexBody)
- igeom#
Graphics on the first body for proximity sensor.
Info
This attribute is mutually exclusive with
iflex.Type=Reference (Graphics) [0]
- jflex#
Flexible body used as second body in proximity sensor.
Info
This attribute is mutually exclusive with
jgeom.Type=Reference (FlexBody)
- jgeom#
Graphics on the second body for proximity sensor.
Info
This attribute is mutually exclusive with
jflex.Type=Reference (Graphics) [0]
- label#
A string describing the object.
Type=Str
- name#
Defines a nametag for the object.
Type=Str
- class Request(**kwds)#
- Defines an output request entity in MotionSolve.
Requests are written to MotionSolve output files so that they may be used for plotting and signal processing by HyperGraph, HyperGraph 3D, or python.
Requests can be defined using:
runtime expressions,
built-in functions (MOTION, FORCE, FIELD etc.. ) or,
user written functions.
Name
Type
Required
Default
Modifiable
Designable
Alias
Alias
Alias
Alias
Alias
Alias
Alias
Alias
Str [8]
Str [0]
Str
Str [0]
Function
\(\checkmark\)
Function
\(\checkmark\)
Function
\(\checkmark\)
Function
\(\checkmark\)
Function
\(\checkmark\)
Function
\(\checkmark\)
Function
\(\checkmark\)
Function
\(\checkmark\)
Function
Reference -
Marker\(\checkmark\)
Int
Auto
Bool
False
\(\checkmark\)
Reference -
Marker\(\checkmark\)
Str
Str
Str
Reference -
Marker\(\checkmark\)
Routine
Script
Enum
EXPRESSION
Example
For an example, see
RequestResult.See also
For more details, see also Post: Output Request.
User Subroutine
The following user subroutine template expects the function signature and return value(s) as shown. Note that this is a placeholder implementation for reference purposes only.
def REQSUB(id, time, par, npar, iflag): # calculate the 8 values of a user-defined request result = 8*[0.0] return result
For more information, see MotionSolve Subroutines.
- F1#
Type=Alias
- F2#
Type=Alias
- F3#
Type=Alias
- F4#
Type=Alias
- F5#
Type=Alias
- F6#
Type=Alias
- F7#
Type=Alias
- F8#
Type=Alias
- clabels#
List of strings defining component labels.
Type=Str [8]
- cnames#
List of strings defining component names.
Type=Str [0]
- comment#
String defining a comment associated with request.
Type=Str
- cunits#
List of strings defining component units.
Type=Str [0]
- f1#
String defining the request expression for f1.
Info
This attribute can only be used when type = EXPRESSION.
Type=Function, Modifiable
- f2#
String defining the request expression for f2.
Info
This attribute can only be used when type = EXPRESSION.
Type=Function, Modifiable
- f3#
String defining the request expression for f3.
Info
This attribute can only be used when type = EXPRESSION.
Type=Function, Modifiable
- f4#
String defining the request expression for f4.
Info
This attribute can only be used when type = EXPRESSION.
Type=Function, Modifiable
- f5#
String defining the request expression for f5.
Info
This attribute can only be used when type = EXPRESSION.
Type=Function, Modifiable
- f6#
String defining the request expression for f6.
Info
This attribute can only be used when type = EXPRESSION.
Type=Function, Modifiable
- f7#
String defining the request expression for f7.
Info
This attribute can only be used when type = EXPRESSION.
Type=Function, Modifiable
- f8#
String defining the request expression for f8.
Info
This attribute can only be used when type = EXPRESSION.
Type=Function, Modifiable
- function#
Parameters passed to user defined subroutine.
Info
This attribute can only be used when type = USER.
Type=Function
- i#
Reference to existing i marker.
Info
This attribute can only be used when type = DISPLACEMENT, VELOCITY, ACCELERATION, FORCE.
Type=Reference (Marker), Modifiable
- id#
The id of the object.
Type=Int
- impose_angle_limit#
When True it bound the angle computed between +-180 deg.
Type=Bool, Default=False, Modifiable
- j#
Reference to existing j marker. When not specified, it defaults to the global coordinate system.
Info
This attribute can only be used when type = DISPLACEMENT, VELOCITY, ACCELERATION, FORCE.
Type=Reference (Marker), Modifiable
- label#
A string describing the object.
Type=Str
- name#
Defines a nametag for the object.
Type=Str
- results_name#
Type=Str
- rm#
Reference to existing rm marker. When not specified, it defaults to the global coordinate system.
Info
This attribute can only be used when type = DISPLACEMENT, VELOCITY, ACCELERATION, FORCE.
Type=Reference (Marker), Modifiable
- routine#
The value can be a callable Python function, a Matlab/OML script, or a string that includes the name of a DLL/SO file and the corresponding function name, separated by ‘::’.
Type=Routine
- script#
Path and name of the script that contains the routine.
Type=Script
- type#
Defines the type of request.
Type=Enum, Default=EXPRESSION
Permitted values are:
ACCELERATION
DISPLACEMENT
EXPRESSION
FORCE
USER
VELOCITY
- class Rv(**kwds)#
- Defines a special type of solver state variable.
It is used in the evaluation and computation of design sensitivity as a response variable.
The
Responsemodule is a library of classes currently available for creating commonly used responses.
Name
Type
Required
Default
Modifiable
Designable
Function
Double
0.0
Int
Auto
Str
Str
Routine
Script
Bool
True
Method Name
Method Description
responseValue(self)Returns the value of the response.
Method Details
- responseValue()
Returns the value of the response.
- Returns:
The value of the response.
- Return type:
float
Note
RVAL1 of a
Response Variableis the value of response variable or the rate of change/Derivative of RVAL
Example
Create a Response variable (Rv).#from msolve import * model = Model(output='rv') ground = Part(ground=True) global_ref = Marker(part=ground) Units(system='mmks') Accgrav(kgrav=-9810) part = Part(mass=10, ip=[1e3]*3) part.cm = Marker() rv = Rv(function=f'5*VZ({part.cm.id},{global_ref.id})')
See also
For more details, see also Response Variables.
- function#
MotionSolve expression that defines the variable used as response for DSA.
Type=Function
- ic#
Specifies the initial condition of the Rv object.
Type=Double, Default=0.0
- id#
The id of the object.
Type=Int
- label#
A string describing the object.
Type=Str
- name#
Defines a nametag for the object.
Type=Str
- responseValue()#
Returns the value of the response.
- Returns:
The value of the response.
- Return type:
float
Note
RVAL1 of a
Response Variableis the value of response variable or the rate of change/Derivative of RVAL
- routine#
The value can be a callable Python function, a Matlab/OML script, or a string that includes the name of a DLL/SO file and the corresponding function name, separated by ‘::’.
Type=Routine
- script#
Path and name of the script that contains the routine.
Type=Script
- sensitivity#
When set to False, MotionSolve ignores this Rv in dsa analysis.
Type=Bool, Default=True
- class Scope(**kwds)#
- Defines a Scope Plot.
It will be displayed while the simulation is running and updated at every output step.
- Parameters:
x (Str, Function) – The independent variable for the Scope plot, in case the plot is 2D, and an independent variable for a 3D scope. ‘TIME’ will be used in case x is unspecified.
y (Str, Function) – The dependent variable(s) for a 2D plot, or an independent variable for a 3D plot. Can be a list of functions or result.component strings. Multiple curves can be plotted on the same plot.
z (Str, Function) – An independent variable for the Scope plot, which can be a function or a result.component string. When specified, the plot becomes 3D and only a single curve can be plotted.
plot_kwds (dict) – An optional dictionary that defines plot attributes such as linewidth, marker style etc..
- Class Attributes:
- default_dpi (int):
The default resolution (DPI) for saving figures. This applies to all Scope instances unless explicitly changed.
Default: 100 for medium-quality plots.
Can be adjusted globally using Scope.default_dpi = <value>.
Note
A Scope object is defined by an independent variable x and either the dependent variable(s) y, or the independent variables y and z.
The independent variable x is used for the horizontal axis of the plot. If x is omitted, it will default to the current simulation output time step. The dependent variable y is a list of functions or results that will be plotted against x. The independent variable z is a function or result to be plotted against x and a single y, producing a 3d plot.
Any function or combination of functions from Functions Module can be used, e.g. STEP(), DX(), AZ(), etc., except multiple-output functions, e.g. DISP(), FORCE(), etc. The x, y and z parameters can also take other formats, including strings that identify the result_name.component_name, such as “req2.F4”.
The publish_to_notebook attribute allows for seamless integration of Scope plots into Jupyter Notebooks, enabling dynamic report generation.
Note
plot_kwds can be a dictionary of values for the figure, or a dictionary of lists corresponding to each plotted line. In case of multiple dependent variables plotted, use the ‘autoscaled’ key to define which additional variables are scaled and displayed on a separate y-axis, appended to the right of the plot area.
Examples
from msolve import * # Set a higher DPI globally for all Scope instances Scope.default_dpi = 300 model = createDemoPendulum() part = model.getPart(2) # get the pendulum body with id = 2 plot_keywords = { 'color': 'blue', # Defines line color 'linewidth': 2.0, # Defines line width 'linestyle': '-', # Defines line style (solid line) 'marker': 'o', # Defines marker style (circle) 'markersize': 6, # Defines marker size 'markerfacecolor': 'blue', # Defines marker face color 'markeredgecolor': 'black', # Defines marker edge color 'markeredgewidth': 1.0, # Defines marker edge width 'alpha': 1.0, # Defines opacity (1.0 is fully opaque) 'autoscaled': False # Defines which dependent variables get twin axes } scope1 = Scope(x='TIME', y='part_displ.Z', plot_kwds = plot_keywords ) scope2 = Scope(y=f'ACCZ({part.cm.id})') # Plot multiple curves plot_keywords = { 'color': ['blue', 'red', 'green', 'teal'], 'autoscaled': [True, False, True], } scope3 = Scope(y=[f'DX({part.cm.id})', f'VX({part.cm.id})', f'ACCX({part.cm.id})', f'AX({part.cm.id})'], save=False, plot_kwds=plot_keywords) # run the simulation model.simulate(type="TRANSIENT", duration=3, steps=300)
Warning
The independent variable
xdoesn’t have to be monotonically increasing.- fig#
Matplotlib top level Artist, which holds all plot elements.
- Type:
matplotlib.figure.Figure
Name
Type
Required
Default
Modifiable
Designable
Bool
True
Int
Auto
Str
Str
Bool
False
Bool
False
Function
Function [0]
\(\checkmark\)
Function
Example
Create a number of Scopes.#from msolve import * model = Model(output='scope_demo') ground = Part(ground=True) global_ref = Marker(part=ground) Units(system='mmks') Accgrav(kgrav=-9810) part = Part(mass=50, ip=[1e3]*3) part.cm = Marker() bushing = Bushing(k=[1e2,1e2,1e2], kt = [1e3,1e3,1e3], c = [2,2,1], ct = [10,10,3], i = part.cm, j = global_ref, ) req = Request(type="EXPRESSION", f2=f"BUSH({bushing.id}, 0, 1, 0)", name="bushing_fm") # add a scope for the bushing force magnitude as a function # of the part displacement in the z direction with respect to ground plot1 = Scope(y="bushing_fm.F2", x=f"DZ({bushing.i.id})") # add a scope for the part cm translational displacements with respect to ground plot2 = Scope(y=[f"AX({part.cm.id})", f"AY({part.cm.id})", f"AZ({part.cm.id})"]) model.simulate(type="TRANSIENT", end=3, steps=300, store=True) plot(y="bushing_fm.F2", x='TIME') # to allow the plots to be displayed in an interactive session input("Press any key to close...")
- active#
Defines the state of this object.
Type=Bool, Default=True
- id#
The id of the object.
Type=Int
- label#
A string describing the object.
Type=Str
- name#
Defines a nametag for the object.
Type=Str
- publish_to_notebook#
If True, auto-generates a Jupyter Notebook report and includes this Scope in it.
Info
This attribute is mutually exclusive with
save.Type=Bool, Default=False
- save#
Flag to save the png file to the current working directory
Info
This attribute is mutually exclusive with
publish_to_notebook.Type=Bool, Default=False
- x#
A valid MotionSolve expression or function that defines the independent variable.
Type=Function
- y#
One or more dependent variables to plot. Accepts a single MotionSolve expression/result string (e.g., ‘req1.F2’) or a list of such entries to draw multiple Y channels on the same 2D axes. When plotting in 2D, you can optionally auto-scale additional Y channels onto right-side twin axes via plot_kwds[‘autoscaled’]. If a Z variable is provided for 3D plotting, only the first Y channel is used to form a single 3D curve (X, Y, Z).
Type=Function [0], Required
- z#
Optional z variable; when provided, Scope plots a 3D (x,y,z) curve.
Type=Function
- class Sensor(**kwds)#
- Defines an event sensor in the model.
Once an event of interest occurs, you can take action to respond to the event. For example, you can modify the simulation settings when a user-defined event occurs during the MBD solver run.
Name
Type
Required
Default
Modifiable
Designable
Bool
True
\(\checkmark\)
Double
0.0
Double
0.001
Alias
Function
Routine
Script
Alias
Bool
False
Double
0.0
Int
Auto
Str
Str
Enum
EQ
Bool
False
Bool
False
Bool
False
Alias
Alias
Function
Routine
Script
Double
0.0
Double
0.0
Bool
False
Double
0.0
See also
For more details, see also Sensor: Event, Sensor: Evaluate.
User Subroutine
The following user subroutine template expects the function signature and return value(s) as shown. Note that this is a placeholder implementation for reference purposes only.
def SENSUB(id, time, par, npar, iflag): # calculate the value of Sensor entity value = 0.0 return value def SEVSUB(id, time, par, npar, iflag): # calculate the value of Sensor evaluation value = 0.0 return value
For more information, see MotionSolve Subroutines.
- active#
Defines the state of the object.
Type=Bool, Default=True, Modifiable
- dt#
Print interval after the event has occurred.
Type=Double, Default=0.0
- error#
The error tolerance for detecting an event.
Type=Double, Default=0.001
- evaluate#
Alias to evaluate_function.
Type=Alias
- evaluate_function#
Expression that defines the sensor event.
Type=Function
- evaluate_routine#
The value can be a callable Python function, a Matlab/OML script, or a string that includes the name of a DLL/SO file and the corresponding function name, separated by ‘::’.
Type=Routine
- evaluate_script#
Path and name of the script that contains the routine for the sensor event.
Type=Script
- function#
Alias to sensor_function.
Type=Alias
- halt#
If True the simulation will stop after the event has occurred.
Type=Bool, Default=False
- hmax#
Maximum step size after the event has occurred.
Type=Double, Default=0.0
- id#
The id of the object.
Type=Int
- label#
A string describing the object.
Type=Str
- name#
Defines a nametag for the object.
Type=Str
- operator#
The comparison operator (<=>).
Type=Enum, Default=EQ
Permitted values are:
EQ
GE
LE
- print_#
If True the simulation will print output after the event has occurred.
Type=Bool, Default=False
- restart#
If True the simulation will restart after the event has occurred.
Type=Bool, Default=False
- return_#
If True the simulation will return and execute the next command after the event has occurred.
Type=Bool, Default=False
- routine#
Alias to sensor_routine.
Type=Alias
- script#
Alias to sensor_script.
Type=Alias
- sensor_function#
Expression that defines the sensor function.
Type=Function
- sensor_routine#
The value can be a callable Python function, a Matlab/OML script, or a string that includes the name of a DLL/SO file and the corresponding function name, separated by ‘::’.
Type=Routine
- sensor_script#
Path and name of the script that contains the routine for sensor.
Type=Script
- stepsize#
Maximum step size allowed after the event has occurred.
Type=Double, Default=0.0
- value#
The sensor event threshold.
Type=Double, Default=0.0
- verbose#
Boolean attribute that controls the verbosity of the sensor event.
Type=Bool, Default=False
- zero_crossing#
Tolerance for the zero crossing search.
Type=Double, Default=0.0
- class SimulationEvent(**kwds)#
- Defines an event in MotionSolve and adds it to a list.
Each event can be executed using the run() method. It’s also possible to execute all the events in the event queue by calling runSimulationEvents() method on the model class. SimulationEvent can be defined using:
keywords
compiled consub or callable python function
script
Examples:
Keywords:
event = SimulationEvent(type="TRANSIENT", start=1, end=2, steps=10)
Consub (can be callable python function or compiled MotionSolve consub):
def control(*args, **kwargs): pass event = SimulationEvent( function = "USER(5000,0,-9.81,0, 0.01)", routine = control )
Script:
event = SimulationEvent( script_file = "/home/user/events.py", function = "simulationScript", args = [10, 20, 30], # use list for homogeneous types #args = (1, "string"), # use tuple for mixed types kwargs = {'kwarg_1': 100, # use dict for any keyword, value pair 'kwarg_2': 200 } )
Info
A
Model.controlconsub is defined by both function and routine. If no function string is defined, the callable routine will be executed and the model will be passed as the first argument to it.Name
Type
Required
Default
Modifiable
Designable
Bool
True
\(\checkmark\)
Bool
False
Bool
False
Property
Double
0.0
Enum
NONE
Double
0.0
Double
Double
0.0
Reference -
FrequencyInputFunction
Double
0.0
Enum
Property
Str
Str
Int
0
Enum
ON
Int
0
Bool
False
Routine
Script
FileName
Double
0.0
Int
0
Bool
False
Enum
TRANSIENT
Bool
True
- active#
Defines the state of the object.
Type=Bool, Default=True, Modifiable
- active_contact_iteration#
Specifies whether the contact residual is being updated during the corrector step of the implicit solver.
Type=Bool, Default=False
- acusolve_cosim#
Specifies if this simulation is a ACUSOLVE MS co-simulation.
Type=Bool, Default=False
- args#
Arguments passed as non keywords to the script function.
Type=Property
- constraint_tol#
The tolerance on all algebraic constraint equations that the corrector must satisfy at convergence.
Type=Double, Default=0.0
- dsa#
The type of design sensitivity analysis.
Type=Enum, Default=NONE
Permitted values are:
ADJOINT
AUTO
DIRECT
FD
FD_SERIAL
NONE
- dtout#
The print interval.
Type=Double, Default=0.0
- duration#
The duration of the analysis.
Type=Double
- end#
The end time of the analysis.
Type=Double, Default=0.0
- frequency_input#
Type=Reference (FrequencyInput)
- function#
The name of the callable function or the string passed to the consub.
Type=Function
- implicit_diff_tol#
Modifies the accuracy to which implicit differential equations are to be satisfied.
Type=Double, Default=0.0
- increment_type#
Type=Enum
Permitted values are:
LINEAR
LOG
- kwargs#
Keyword Arguments passed to the script function.
Type=Property
- label#
A string describing the object.
Type=Str
- name#
Defines a nametag for the object.
Type=Str
- numThread#
Specifies the number of threads for Open MP multi-threaded contact simulation.
Type=Int, Default=0
- output#
Specifies protocol of standard output.
Type=Enum, Default=ON
Permitted values are:
FILEONLY
OFF
ON
- print_increment#
The frequency of output in terms of the integrator steps that have been taken.
Type=Int, Default=0
- returnResults#
Specifies if run data will be returned to the caller.
Type=Bool, Default=False
- routine#
The value can be a callable Python function, a Matlab/OML script, or a string that includes the name of a DLL/SO file and the corresponding function name, separated by ‘::’.
Type=Routine
- script#
The fully specified path and name of the script executed in run method.
Type=Script
- script_file#
The fully specified path and name of the file containing the simulation script.
Type=FileName
- start#
The start time of the analysis.
Type=Double, Default=0.0
- steps#
The number of output steps to take between start and end.
Type=Int, Default=0
- store#
If True, it stores the simulation results in a
SimulationResultsHistoryon the model.Type=Bool, Default=False
- type#
The type of simulation.
Type=Enum, Default=TRANSIENT
Permitted values are:
ASSEMBLY
DYNAMICS
FREQUENCYRESPONSE
KINEMATICS
LINEAR
STATICS
TRANSIENT
VERIFY
- validate_flag#
Type=Bool, Default=True
- class Transient(**kwds)#
Specifies parameters that control the time-domain-based nonlinear dynamic analysis.
Name
Type
Required
Default
Modifiable
Designable
Double
\(\checkmark\)
Double
\(\checkmark\)
Double
\(\checkmark\)
Double
\(\checkmark\)
Int
\(\checkmark\)
Str
Int
\(\checkmark\)
Str
Enum
DSTIFF
See also
For more details, see also Parameters: Transient Solver.
- error#
Maximum absolute error allowed.
Type=Double, Modifiable
- hinit#
The maximum initial step size.
Type=Double, Modifiable
- hmax#
Maximum step size the integrator is allowed to take.
Type=Double, Modifiable
- hmin#
Minimum step size the integrator is allowed to take.
Type=Double, Modifiable
- kmax#
Maximum order that the integrator is to take.
Type=Int, Modifiable
- label#
A string describing the object.
Type=Str
- maxit#
Maximum number of iterations for the corrector.
Type=Int, Modifiable
- name#
Defines a nametag for the object.
Type=Str
- type#
Define the integrator to be used.
Type=Enum, Default=DSTIFF
Permitted values are:
ABAM
CSTIFF
DSTIFF
MSTIFF
VSTIFF
- class Units(**kwds)#
- Defines the units for the model.
You can specify four types of units: Mass, Length, Time, and Force. Alternatively, you can use a predefined set of units with the system property.
Name
Type
Required
Default
Modifiable
Designable
Enum
NEWTON
Str
Enum
METER
Enum
KILOGRAM
Str
Enum
Enum
SECOND
Example
Specify the model units.#from msolve import * model = Model(output="units") # specify units explicitly Units(force="KNEWTON", length="MILLIMETER", mass="KILOGRAM", time="SECOND") # specify units using a pre-defined system Units(system='MMKS')
See also
For more details, see also Parameters: Units.
- force#
Defines the units for force.
Type=Enum, Default=NEWTON
Permitted values are:
CENTINEWTON
DYNE
KILOGRAM_FORCE
KNEWTON
KPOUND_FORCE
MEGANEWTON
MICRONEWTON
MILLINEWTON
NANONEWTON
NEWTON
OUNCE_FORCE
POUNDAL
POUND_FORCE
- label#
A string describing the object.
Type=Str
- length#
Defines the units for length.
Type=Enum, Default=METER
Permitted values are:
ANGSTROM
CENTIMETER
FOOT
INCH
KILOMETER
METER
MICROINCH
MICROMETER
MILE
MILLIINCH
MILLIMETER
MILS
NANOMETER
YARD
- mass#
Defines the units for mass.
Type=Enum, Default=KILOGRAM
Permitted values are:
GRAM
KILOGRAM
KILOTONNE
KPOUND_MASS
MEGAGRAM
MEGATONNE
MICROGRAM
MILLIGRAM
NANOGRAM
OUNCE_MASS
POUND_MASS
SLINCH
SLUG
TONNE
US_TON
- name#
Defines a nametag for the object.
Type=Str
- system#
Specifies a predefined set of units.
Type=Enum
Permitted values are:
CGS
FPS
IPS
MKS
MMKS
NONE
- time#
Defines the units for time.
Type=Enum, Default=SECOND
Permitted values are:
DAY
HOUR
MICROSECOND
MILLISECOND
MINUTE
NANOSECOND
SECOND
- class Upost(**kwds)#
- Defines a user-written Post-Subroutine.
It is called at every output step. It can be used to extract MotionSolve results, process the results programmatically for real-time animation or plotting or to write results to an external file.
Warning
This class is reserved for internal use only. Equivalent functionality can be
achieved by using the
Upostsclass.
Name
Type
Required
Default
Modifiable
Designable
Function
\(\checkmark\)
Str
Str
Routine
Script
See also
For more details, see also Post: User Output Request.
- function#
Parameters passed to user defined subroutine.
Type=Function, Required
- label#
A string describing the object.
Type=Str
- name#
Defines a nametag for the object.
Type=Str
- routine#
An alternative name for the user subroutine.
Type=Routine
- script#
Path and name of the script that contains the routine.
Type=Script
- class Uposts(**kwds)#
- Defines a user-written Post-Subroutine.
It can be used to extract MotionSolve results, process the results programmatically for real-time animation or plotting or to write results to an external file.
Name
Type
Required
Default
Modifiable
Designable
Bool
True
Function
\(\checkmark\)
Int
Auto
Str
Str
Routine
Script
User Subroutine
The following user subroutine template expects the function signature and return value(s) as shown. Note that this is a placeholder implementation for reference purposes only.
def POST_SUBS(id, time, par, npar, iflag, endflag): # Uposts can be used to interact with MotionSolve results. # For example post states can be obtained and serialized to file. errflg = 0 return errflg
For more information, see MotionSolve Subroutines.
- at_output#
True for evaluation only at output steps.
Type=Bool, Default=True
- function#
Parameters passed to user defined subroutine.
Type=Function, Required
- id#
The id of the object.
Type=Int
- label#
A string describing the object.
Type=Str
- name#
Defines a nametag for the object.
Type=Str
- routine#
An alternative name for the user subroutine.
Type=Routine
- script#
Path and name of the script that contains the routine.
Type=Script
- class UserMsg(**kwds)#
Defines a user-written Message-Subroutine.
Name
Type
Required
Default
Modifiable
Designable
Bool
True
\(\checkmark\)
Function
Str
Str
Routine
Script
See also
For more details, see also Messaging.
User Subroutine
The following user subroutine template expects the function signature and return value(s) as shown. Note that this is a placeholder implementation for reference purposes only.
def MSGSUB (self, msgid, time, par, npar, msgtype, iflag, endflag, message, outname): return
For more information, see MotionSolve Subroutines.
- active#
Defines the state of the object.
Type=Bool, Default=True, Modifiable
- function#
Parameters passed to user defined subroutine.
Type=Function
- label#
A string describing the object.
Type=Str
- name#
Defines a nametag for the object.
Type=Str
- routine#
The value can be a callable Python function, a Matlab/OML script, or a string that includes the name of a DLL/SO file and the corresponding function name, separated by ‘::’.
Type=Routine
- script#
Path and name of the script that contains the routine.
Type=Script
- class Yforce(**kwds)#
- Creates a Force State Equation.
This element combines
GseandGforcemodeling elements.
Name
Type
Required
Default
Modifiable
Designable
Reference -
MatrixBool
True
\(\checkmark\)
Reference -
MatrixReference -
MatrixReference -
MatrixFunction
Reference -
Marker\(\checkmark\)
Reference -
ArrayInt
Auto
Reference -
Marker\(\checkmark\)
Str
Str
Int
0
Reference -
MarkerRoutine
Script
Bool
False
Enum
Reference -
ArrayReference -
Array\(\checkmark\)
See also
For more details, see also Force: State Equation.
User Subroutine
The following user subroutine template expects the function signature and return value(s) as shown. Note that this is a placeholder implementation for reference purposes only.
def YFOSUB(id, time, par, npar, dflag, iflag, nstate, states, ninput, input, noutput): # compute derivatives of the states variables and force outputs stated = nstate * [0.0] output = noutput * [0.0] return [stated, output] def YFOXU(id, time, par, npar, iflag, nstate, states, ninput, input, noutput): result = nstate*ninput*[0.0] return result def YFOXX(id, time, par, npar, iflag, nstate, states, ninput, input, noutput): result = nstate*nstate*[0.0] return result def YFOYU(id, time, par, npar, iflag, nstate, states, ninput, input, noutput): result = noutput*ninput*[0.0] return result def YFOYX(id, time, par, npar, iflag, nstate, states, ninput, input, noutput): result = noutput*nstate*[0.0] return result
For more information, see MotionSolve Subroutines.
- a#
State
Matrixfor a linear Yforce.Info
This attribute can only be used when type = LINEAR.
Type=Reference (Matrix)
- active#
Defines the state of the object.
Type=Bool, Default=True, Modifiable
- b#
Input
Matrixfor a linear Yforce.Info
This attribute can only be used when type = LINEAR.
Type=Reference (Matrix)
- c#
Output
Matrixfor a linear Yforce.Info
This attribute can only be used when type = LINEAR.
Type=Reference (Matrix)
- d#
Feed-thru
Matrixfor a linear Yforce.Info
This attribute can only be used when type = LINEAR.
Type=Reference (Matrix)
- function#
Parameters passed to user defined subroutine.
Info
This attribute can only be used when type = USERSUB.
Type=Function
- id#
The id of the object.
Type=Int
- label#
A string describing the object.
Type=Str
- name#
Defines a nametag for the object.
Type=Str
- ns#
The number of states in the dynamic system.
Info
This attribute can only be used when type = USERSUB.
Type=Int, Default=0
- rm#
Reference marker used for defining the components of the force vector.
Type=Reference (Marker)
- routine#
The value can be a callable Python function, a Matlab/OML script, or a string that includes the name of a DLL/SO file and the corresponding function name, separated by ‘::’.
Type=Routine
- script#
Path and name of the script that contains the routine.
Type=Script
- static_hold#
Specifies if dynamic states x are kept fixed during static/quasi-static solution.
Type=Bool, Default=False
- type#
Type of the dynamic system.
Type=Enum
Permitted values are:
LINEAR
USERSUB