ModelingToolkit Standard Library: Mechanical Components
Index
ModelingToolkitStandardLibrary.Mechanical.Rotational.AngleSensor
ModelingToolkitStandardLibrary.Mechanical.Rotational.Damper
ModelingToolkitStandardLibrary.Mechanical.Rotational.Fixed
ModelingToolkitStandardLibrary.Mechanical.Rotational.Flange
ModelingToolkitStandardLibrary.Mechanical.Rotational.IdealGear
ModelingToolkitStandardLibrary.Mechanical.Rotational.Inertia
ModelingToolkitStandardLibrary.Mechanical.Rotational.PartialCompliant
ModelingToolkitStandardLibrary.Mechanical.Rotational.PartialCompliantWithRelativeStates
ModelingToolkitStandardLibrary.Mechanical.Rotational.RelSpeedSensor
ModelingToolkitStandardLibrary.Mechanical.Rotational.RotationalFriction
ModelingToolkitStandardLibrary.Mechanical.Rotational.SpeedSensor
ModelingToolkitStandardLibrary.Mechanical.Rotational.Spring
ModelingToolkitStandardLibrary.Mechanical.Rotational.SpringDamper
ModelingToolkitStandardLibrary.Mechanical.Rotational.Support
ModelingToolkitStandardLibrary.Mechanical.Rotational.Torque
ModelingToolkitStandardLibrary.Mechanical.Rotational.TorqueSensor
ModelingToolkitStandardLibrary.Mechanical.Translational.AccelerationSensor
ModelingToolkitStandardLibrary.Mechanical.Translational.Damper
ModelingToolkitStandardLibrary.Mechanical.Translational.Fixed
ModelingToolkitStandardLibrary.Mechanical.Translational.Force
ModelingToolkitStandardLibrary.Mechanical.Translational.ForceSensor
ModelingToolkitStandardLibrary.Mechanical.Translational.MechanicalPort
ModelingToolkitStandardLibrary.Mechanical.Translational.PositionSensor
ModelingToolkitStandardLibrary.Mechanical.Rotational.PartialElementaryOneFlangeAndSupport2
ModelingToolkitStandardLibrary.Mechanical.Rotational.PartialElementaryTwoFlangesAndSupport2
ModelingToolkitStandardLibrary.Mechanical.Rotational.Position
ModelingToolkitStandardLibrary.Mechanical.Rotational.Speed
ModelingToolkitStandardLibrary.Mechanical.Translational.Acceleration
ModelingToolkitStandardLibrary.Mechanical.Translational.Mass
ModelingToolkitStandardLibrary.Mechanical.Translational.Position
ModelingToolkitStandardLibrary.Mechanical.Translational.Spring
ModelingToolkitStandardLibrary.Mechanical.Translational.Velocity
Rotational Components
Rotational Utils
ModelingToolkitStandardLibrary.Mechanical.Rotational.Flange
— ConstantSupport(;name)
1-dim. rotational flange of a shaft.
States:
phi(t)
: [rad
] Absolute rotation angle of flangetau(t)
: [N.m
] Cut torque in the flange
ModelingToolkitStandardLibrary.Mechanical.Rotational.Support
— ConstantSupport(;name)
Support/housing of a 1-dim. rotational shaft
States:
phi(t)
: [rad
] Absolute rotation angle of the support/housingtau(t)
: [N.m
] Cut torque in the support/housing
ModelingToolkitStandardLibrary.Mechanical.Rotational.PartialCompliantWithRelativeStates
— ConstantPartialCompliantWithRelativeStates(; name, phi_rel = 0.0, tau = 0.0)
Partial model for the compliant connection of two rotational 1-dim. shaft flanges where the relative angle and speed are used as preferred states
States:
phi_rel(t)
: [rad
] Relative rotation angle (= flangeb.phi - flangea.phi). It accepts an initial value, which defaults to 0.0.w_rel(t)
: [rad/s
] Relative angular velocity (= D(phi_rel)). It accepts an initial value, which defaults to 0.0.a_rel(t)
: [rad/s²
] Relative angular acceleration (= D(w_rel)). It accepts an initial value, which defaults to 0.0.tau(t)
: [N.m
] Torque between flanges (= flange_b.tau). It accepts an initial value, which defaults to 0.0.
Connectors:
ModelingToolkitStandardLibrary.Mechanical.Rotational.PartialElementaryOneFlangeAndSupport2
— FunctionPartialElementaryOneFlangeAndSupport2(; name, use_support = false)
Partial model for a component with one rotational 1-dim. shaft flange and a support used for textual modeling, i.e., for elementary models
States:
phi_support(t)
: [rad
] Absolute angle of support flange"
Connectors:
flange
Flange
Parameters:
use_support
: If support flange enabled, otherwise implicitly grounded
ModelingToolkitStandardLibrary.Mechanical.Rotational.PartialElementaryTwoFlangesAndSupport2
— FunctionPartialElementaryTwoFlangesAndSupport2(;name, use_support=false)
Partial model for a component with two rotational 1-dim. shaft flanges and a support used for textual modeling, i.e., for elementary models
States:
phi_support(t)
: [rad
] Absolute angle of support flange
Connectors:
Parameters:
use_support
: If support flange enabled, otherwise implicitly grounded
ModelingToolkitStandardLibrary.Mechanical.Rotational.PartialCompliant
— ConstantPartialCompliant(; name, phi_rel = 0.0, tau = 0.0)
Partial model for the compliant connection of two rotational 1-dim. shaft flanges.
States:
phi_rel(t)
: [rad
] Relative rotation angle (flange_b.phi - flange_a.phi
). It accepts an initial value, which defaults to 0.0.tau(t)
: [N.m
] Torque between flanges (flange_b.tau
). It accepts an initial value, which defaults to 0.0.
Connectors:
Rotational Core Components
ModelingToolkitStandardLibrary.Mechanical.Rotational.Fixed
— ConstantFixed(;name, phi0 = 0.0)
Flange fixed in housing at a given angle.
Connectors:
flange
Flange
Parameters:
phi0
: [rad
] Fixed offset angle of housing
ModelingToolkitStandardLibrary.Mechanical.Rotational.Inertia
— ConstantInertia(;name, J, phi = 0.0, w = 0.0, a = 0.0)
1D-rotational component with inertia.
States:
phi
: [rad
] Absolute rotation angle of componentw
: [rad/s
] Absolute angular velocity of component (= D(phi))a
: [rad/s²
] Absolute angular acceleration of component (= D(w))
Connectors:
Parameters:
J
: [kg·m²
] Moment of inertia
ModelingToolkitStandardLibrary.Mechanical.Rotational.Spring
— ConstantSpring(; name, c, phi_rel0 = 0.0)
Linear 1D rotational spring
States:
phi_rel(t)
: [rad
] Relative rotation angle (flange_b.phi - flange_a.phi
)tau(t)
: [N.m
] Torque between flanges (flange_b.tau
)
Connectors:
Parameters:
c
: [N.m/rad
] Spring constantphi_rel0
: [rad
] Unstretched spring angle. Defaults to 0.0.
ModelingToolkitStandardLibrary.Mechanical.Rotational.Damper
— ConstantDamper(; name, d)
Linear 1D rotational damper
States:
phi_rel(t)
: [rad
] Relative rotation angle (= flangeb.phi - flangea.phi)w_rel(t)
: [rad/s
] Relative angular velocity (= D(phi_rel))a_rel(t)
: [rad/s²
] Relative angular acceleration (= D(w_rel))tau(t)
: [N.m
] Torque between flanges (= flange_b.tau)
Connectors:
Parameters:
d
: [N.m.s/rad
] Damping constant
ModelingToolkitStandardLibrary.Mechanical.Rotational.SpringDamper
— ConstantSpringDamper(; name, d)
Linear 1D rotational spring and damper
States:
phi_rel(t)
: [rad
] Relative rotation angle (= flangeb.phi - flangea.phi)w_rel(t)
: [rad/s
] Relative angular velocity (= D(phi_rel))a_rel(t)
: [rad/s²
] Relative angular acceleration (= D(w_rel))tau(t)
: [N.m
] Torque between flanges (= flange_b.tau)
Connectors:
Parameters:
d
: [N.m.s/rad
] Damping constantc
: [N.m/rad
] Spring constantphi_rel0
: [rad
] Unstretched spring angle. Defaults to 0.0
ModelingToolkitStandardLibrary.Mechanical.Rotational.IdealGear
— ConstantIdealGear(; name, ratio, use_support = false)
Ideal gear without inertia.
This element characterizes any type of gear box which is fixed in the ground and which has one driving shaft and one driven shaft.
States:
phi_a(t)
: [rad
] Relative angle between shaft a and the supportphi_b(t)
: [rad
] Relative angle between shaft b and the support
Connectors:
Parameters:
ratio
: Transmission ratio (flangea.phi/flangeb.phi)use_support
: If support flange enabled, otherwise implicitly grounded. By default it isfalse
ModelingToolkitStandardLibrary.Mechanical.Rotational.RotationalFriction
— ConstantRotationalFriction(; name, f, tau_c, w_brk, tau_brk)
Models rotational friction with Stribeck effect, Coulomb friction and viscous friction between the two flanges. The friction torque is a function of the relative angular velocity between flange_a
and flange_b
.
Friction model: "Armstrong, B. and C.C. de Wit, Friction Modeling and Compensation, The Control Handbook, CRC Press, 1995."
States:
phi_rel(t)
: [rad
] Relative rotation angle(= flange_b.phi - flange_a.phi)
w_rel(t)
: [rad/s
] Relative angular velocity(= D(phi_rel))
a_rel(t)
: [rad/s²
] Relative angular acceleration(= D(w_rel))
tau(t)
: [N.m
] Torque between flanges(= flange_b.tau)
Connectors:
Parameters:
f
: [N⋅m/(rad/s)
] Viscous friction coefficienttau_c
: [N⋅m
] Coulomb friction torquew_brk
: [rad/s
] Breakaway friction velocitytau_brk
: [N⋅m
] Breakaway friction torque
Rotational Sources
ModelingToolkitStandardLibrary.Mechanical.Rotational.Torque
— ConstantTorque(; name, use_support = false)
Input signal acting as external torque on a flange
States:
phi_support(t)
: [rad
] Absolute angle of support flange
Connectors:
Parameters:
use_support
ModelingToolkitStandardLibrary.Mechanical.Rotational.Speed
— FunctionSpeed(; name, use_support = false, exact = false, f_crit = 50)
Forced movement of a flange according to a reference angular velocity signal
States:
phi_support(t)
: [rad
] Absolute angle of support flange"
Connectors:
flange
Flangew_ref
RealInput Reference angular velocity of flange with respect to support as input signal needs to be continuously differential
Parameters:
use_support
: If support flange enabled, otherwise implicitly groundedexact
: true/false exact treatment/filtering the input signaltau_filt
: [rad/s
] if exact=false, Time constant of low-pass filter to filter input signal
ModelingToolkitStandardLibrary.Mechanical.Rotational.Position
— FunctionPosition(; name, exact = false, f_crit = 50, use_support = false)
Forced movement of a flange according to a reference angle signal.
The input signal phi_ref
defines the reference angle in [rad]. Flange is forced to move according to this reference motion relative to flange support. According to parameter exact
(default = false
), this is done in the following way:
exact=true
: The reference angle is treated exactly. This is only possible if the input signal is defined by an analytical function that can be differentiated at least twice in order to compute the acceleration.exact=false
: The reference angle is filtered and the second derivative of the filtered curve is used to compute the reference acceleration of the flange. This second derivative is not computed by numerical differentiation but by an appropriate realization of the filter. For filtering, a second-order Bessel filter is used. The critical frequency (also called cut-off frequency) of the filter is defined via parameterf_crit
in [Hz]. This value should be selected in such a way that it is higher than the essential low frequencies in the signal.
Connectors
flange::Flange
: Flange to be movedphi_ref::RealInput
: Reference angle of flange with respect to support
Variables
phi(t)
: Rotation angle of flange with respect to supportw(t)
: Ifexact=false
, Angular velocity of flange with respect to supporta(t)
: Ifexact=false
, Angular acceleration of flange with respect to support
Parameters
exact
: (structural) true/false exact treatment/filtering the input signalf_crit
: [Hz] ifexact=false
, Critical frequency of filter to filter input signal
Rotational Sensors
ModelingToolkitStandardLibrary.Mechanical.Rotational.AngleSensor
— ConstantAngleSensor(; name)
Ideal sensor to measure the absolute flange angle
Connectors:
flange
: Flange Flange of shaft from which sensor information shall be measuredphi
: RealOutput Absolute angle of flange
ModelingToolkitStandardLibrary.Mechanical.Rotational.SpeedSensor
— ConstantSpeedSensor(; name)
Ideal sensor to measure the absolute flange angular velocity
Connectors:
flange
: Flange Flange of shaft from which sensor information shall be measuredw
: RealOutput Absolute angular velocity of flange
ModelingToolkitStandardLibrary.Mechanical.Rotational.TorqueSensor
— ConstantTorqueSensor(;name)
Ideal sensor to measure the torque between two flanges (= flange_a.tau
)
Connectors:
flange_a
: Flange Left flange of shaftflange_b
: Flange Left flange of shafttau
: RealOutput Torque in flange flangea and flangeb (tau = flange_a.tau = -flange_b.tau
)
ModelingToolkitStandardLibrary.Mechanical.Rotational.RelSpeedSensor
— ConstantRelSpeedSensor(; name)
Ideal sensor to measure the relative angular velocity
Connectors:
flange_a
: Flange Flange of shaft from which sensor information shall be measuredflange_b
: Flange Flange of shaft from which sensor information shall be measuredw
: RealOutput Absolute angular velocity of flange
Translational Components
Translational Utils
ModelingToolkitStandardLibrary.Mechanical.Translational.MechanicalPort
— ConstantMechanicalPort(;name)
1-dim. rotational flange of a shaft.
States:
v
: [m/s] velocity of the nodef
: [N] force entering the node
Translational Core Components
ModelingToolkitStandardLibrary.Mechanical.Translational.Mass
— FunctionMass(; name, m, g = 0)
Sliding mass with inertia
Parameters:
m
: [kg] mass of sliding bodyg = 0
: [m/s^2] [m/s²] gravity field acting on the mass, positive value acts in the positive direction
States:
v
: [m/s] absolute linear velocity of sliding masss
: [m] absolute position of sliding mass (optional with parameter s)
Connectors:
flange
: 1-dim. translational flange
ModelingToolkitStandardLibrary.Mechanical.Translational.Spring
— FunctionSpring(; name, k, delta_s = 0.0, va=0.0, v_b_0=0.0)
Linear 1D translational spring
Parameters:
k
: [N/m] Spring constantdelta_s
: initial spring stretchva
: [m/s] Initial value of absolute linear velocity at flange_a (default 0 m/s)v_b_0
: [m/s] Initial value of absolute linear velocity at flange_b (default 0 m/s)
Connectors:
flange_a
: 1-dim. translational flange on one side of springflange_b
: 1-dim. translational flange on opposite side of spring
ModelingToolkitStandardLibrary.Mechanical.Translational.Damper
— ConstantDamper(; name, d, flange_a.v = 0.0, flange_b.v = 0.0)
Linear 1D translational damper
Parameters:
d
: [N.s/m] Damping constant
Connectors:
flange_a
: 1-dim. translational flange on one side of damper. Initial value of statev
is set to 0.0 m/s.flange_b
: 1-dim. translational flange on opposite side of damper. Initial value of statev
is set to 0.0 m/s.
ModelingToolkitStandardLibrary.Mechanical.Translational.Fixed
— ConstantFixed(; name)
Fixes a flange position (velocity = 0)
Connectors:
flange
: 1-dim. translational flange
Translational Sources
ModelingToolkitStandardLibrary.Mechanical.Translational.Force
— ConstantForce(; name)
Linear 1D force input source
Connectors:
flange
: 1-dim. translational flangef
: real input
ModelingToolkitStandardLibrary.Mechanical.Translational.Position
— FunctionPosition(solves_force = true; name)
Linear 1D position input source. Set solves_force=false
to force input force to 0 (i.e. only the position is given, the respective force needed is already provided elsewhere in the model).
Connectors:
flange
: 1-dim. translational flanges
: real input
ModelingToolkitStandardLibrary.Mechanical.Translational.Velocity
— FunctionVelocity(solves_force = true; name)
Linear 1D position input source. Set solves_force=false
to force input force to 0 (i.e. only the velocity is given, the respective force needed is already provided elsewhere in the model).
Connectors:
flange
: 1-dim. translational flangev
: real input
ModelingToolkitStandardLibrary.Mechanical.Translational.Acceleration
— FunctionAcceleration(solves_force = true; name)
Linear 1D position input source. Set solves_force=false
to force input force to 0 (i.e. only the acceleration is given, the respective force needed is already provided elsewhere in the model).
Connectors:
flange
: 1-dim. translational flangea
: real input
Translational Sensors
ModelingToolkitStandardLibrary.Mechanical.Translational.ForceSensor
— ConstantForceSensor(; name)
Linear 1D force sensor, measures the force between two flanges.
Connectors:
flange
: 1-dim. translational flangeoutput
: real output
ModelingToolkitStandardLibrary.Mechanical.Translational.PositionSensor
— ConstantPositionSensor(; s = 0, name)
Linear 1D position sensor.
States:
s
: [m] absolute position (with initial value of 0.0)
Connectors:
flange
: 1-dim. translational flangeoutput
: real output
ModelingToolkitStandardLibrary.Mechanical.Translational.AccelerationSensor
— ConstantAccelerationSensor(; name)
Linear 1D acceleration sensor.
States:
a
: [m/s^2] measured acceleration
Connectors:
flange
: 1-dim. translational flangeoutput
: real output