Components.RelativeStates
Definition of relative state variables.
Usually, the absolute angle and the absolute angular velocity of Inertia models are used as state variables. In some circumstances, relative quantities are better suited, e.g., because it may be easier to supply initial values. In such cases, model RelativeStates allows the definition of state variables in the following way:
Connect an instance of this model between two spline connectors.
The relative rotation angle and the relative angular velocity between the two connectors are used as state variables.
This component transmits zero torque on both splines. Its only purpose is to introduce phi_rel and w_rel as preferred state variables via high statePriority.
This component extends from RotationalComponents.Interfaces.PartialTwoSplines
Usage
RotationalComponents.Components.RelativeStates()
Connectors
spline_a- This connector represents a rotational spline with angle and torque as the potential and flow variables, respectively. (Spline)spline_b- This connector represents a rotational spline with angle and torque as the potential and flow variables, respectively. (Spline)
Variables
| Name | Description | Units |
|---|---|---|
phi_rel | Relative rotation angle used as state variable | rad |
w_rel | Relative angular velocity used as state variable | rad/s |
a_rel | Relative angular acceleration | rad/s2 |
Behavior
using RotationalComponents #hide
using ModelingToolkit #hide
@named sys = RotationalComponents.Components.RelativeStates() #hide
full_equations(sys) #hide<< @example-block not executed in draft mode >>Source
"""
Definition of relative state variables.
Usually, the absolute angle and the absolute angular velocity of
`Inertia` models are used as state variables. In some circumstances,
relative quantities are better suited, e.g., because it may be easier
to supply initial values. In such cases, model `RelativeStates` allows
the definition of state variables in the following way:
- Connect an instance of this model between two spline connectors.
- The **relative rotation angle** and the **relative angular velocity**
between the two connectors are used as **state variables**.
This component transmits zero torque on both splines. Its only purpose is
to introduce `phi_rel` and `w_rel` as preferred state variables via high
`statePriority`.
"""
component RelativeStates
extends RotationalComponents.Interfaces.PartialTwoSplines
"Relative rotation angle used as state variable"
variable phi_rel::Angle(statePriority = 50)
"Relative angular velocity used as state variable"
variable w_rel::AngularVelocity(statePriority = 50)
"Relative angular acceleration"
variable a_rel::AngularAcceleration
relations
phi_rel = spline_b.phi - spline_a.phi
w_rel = der(phi_rel)
a_rel = der(w_rel)
spline_a.tau = 0
spline_b.tau = 0
metadata {
"Dyad": {"icons": {"default": "dyad://RotationalComponents/RelativeStates.svg"}}
}
endFlattened Source
"""
Definition of relative state variables.
Usually, the absolute angle and the absolute angular velocity of
`Inertia` models are used as state variables. In some circumstances,
relative quantities are better suited, e.g., because it may be easier
to supply initial values. In such cases, model `RelativeStates` allows
the definition of state variables in the following way:
- Connect an instance of this model between two spline connectors.
- The **relative rotation angle** and the **relative angular velocity**
between the two connectors are used as **state variables**.
This component transmits zero torque on both splines. Its only purpose is
to introduce `phi_rel` and `w_rel` as preferred state variables via high
`statePriority`.
"""
component RelativeStates
"First spline"
spline_a = Spline() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
"Second spline"
spline_b = Spline() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
"Relative rotation angle used as state variable"
variable phi_rel::Angle(statePriority = 50)
"Relative angular velocity used as state variable"
variable w_rel::AngularVelocity(statePriority = 50)
"Relative angular acceleration"
variable a_rel::AngularAcceleration
relations
phi_rel = spline_b.phi - spline_a.phi
w_rel = der(phi_rel)
a_rel = der(w_rel)
spline_a.tau = 0
spline_b.tau = 0
metadata {
"Dyad": {"icons": {"default": "dyad://RotationalComponents/RelativeStates.svg"}}
}
endTest Cases
No test cases defined.
Related
Examples
Experiments
Analyses