Components.RelativeStates
Definition of relative state variables.
This component defines relative position and relative velocity between two flanges as preferred state variables. It transmits zero force and is used purely for state selection purposes.
Connect an instance of this model between two flange connectors to use the relative position s_rel and relative velocity v_rel as state variables instead of the default absolute quantities.
The equations are:
This component extends from TranslationalComponents.Interfaces.PartialTwoFlanges
Usage
TranslationalComponents.Components.RelativeStates()
Connectors
flange_a- This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. (Flange)flange_b- This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. (Flange)
Variables
| Name | Description | Units |
|---|---|---|
s_rel | Relative position used as state variable | m |
v_rel | Relative velocity used as state variable | m/s |
a_rel | Relative acceleration | m/s2 |
Behavior
using TranslationalComponents #hide
using ModelingToolkit #hide
@named sys = TranslationalComponents.Components.RelativeStates() #hide
full_equations(sys) #hide<< @example-block not executed in draft mode >>Source
"""
Definition of relative state variables.
This component defines **relative position** and **relative velocity** between two
flanges as preferred state variables. It transmits zero force and is used purely
for state selection purposes.
Connect an instance of this model between two flange connectors to use
the relative position `s_rel` and relative velocity `v_rel` as state variables
instead of the default absolute quantities.
The equations are:
```math
s_{rel} = flange\_b.s - flange\_a.s
```
```math
v_{rel} = \\frac{d(s_{rel})}{dt}
```
```math
a_{rel} = \\frac{d(v_{rel})}{dt}
```
```math
flange\_a.f = 0
```
```math
flange\_b.f = 0
```
"""
component RelativeStates
extends TranslationalComponents.Interfaces.PartialTwoFlanges
"Relative position used as state variable"
variable s_rel::Distance(statePriority = 50)
"Relative velocity used as state variable"
variable v_rel::Velocity(statePriority = 50)
"Relative acceleration"
variable a_rel::Acceleration
relations
s_rel = flange_b.s - flange_a.s
v_rel = der(s_rel)
a_rel = der(v_rel)
flange_a.f = 0
flange_b.f = 0
metadata {
"Dyad": {"icons": {"default": "dyad://TranslationalComponents/RelativeStates.svg"}}
}
endFlattened Source
"""
Definition of relative state variables.
This component defines **relative position** and **relative velocity** between two
flanges as preferred state variables. It transmits zero force and is used purely
for state selection purposes.
Connect an instance of this model between two flange connectors to use
the relative position `s_rel` and relative velocity `v_rel` as state variables
instead of the default absolute quantities.
The equations are:
```math
s_{rel} = flange\_b.s - flange\_a.s
```
```math
v_{rel} = \\frac{d(s_{rel})}{dt}
```
```math
a_{rel} = \\frac{d(v_{rel})}{dt}
```
```math
flange\_a.f = 0
```
```math
flange\_b.f = 0
```
"""
component RelativeStates
"Left mechanical translational flange (connector)"
flange_a = Flange() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
"Right mechanical translational flange (connector)"
flange_b = Flange() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
"Relative position used as state variable"
variable s_rel::Distance(statePriority = 50)
"Relative velocity used as state variable"
variable v_rel::Velocity(statePriority = 50)
"Relative acceleration"
variable a_rel::Acceleration
relations
s_rel = flange_b.s - flange_a.s
v_rel = der(s_rel)
a_rel = der(v_rel)
flange_a.f = 0
flange_b.f = 0
metadata {
"Dyad": {"icons": {"default": "dyad://TranslationalComponents/RelativeStates.svg"}}
}
endTest Cases
No test cases defined.
Related
Examples
Experiments
Analyses
Tests