LIBRARY
Sources.Tests.ConstantSpeed
Test for ConstantSpeed source, matching MSL ModelicaTest.Rotational.AllComponents topology.
ConstantSpeed prescribes a fixed angular velocity w_fixed=11 rad/s on the inertia. The inertia's speed is constrained to w_fixed at all times.
Usage
RotationalComponents.Sources.Tests.ConstantSpeed()
Behavior
Source
dyad
"""
Test for ConstantSpeed source, matching MSL ModelicaTest.Rotational.AllComponents topology.
ConstantSpeed prescribes a fixed angular velocity w_fixed=11 rad/s on the inertia.
The inertia's speed is constrained to w_fixed at all times.
"""
test component ConstantSpeed
"Fixed ground for source support"
fixed = RotationalComponents.Components.Fixed()
"Constant speed source (w_fixed=11)"
constant_speed = RotationalComponents.Sources.ConstantSpeed(w_fixed = 11)
"Inertia (J=3)"
inertia = RotationalComponents.Components.Inertia(J = 3)
relations
initial inertia.phi = 0
connect(constant_speed.spline, inertia.spline_a)
connect(constant_speed.support, fixed.spline)
metadata {
"Dyad": {
"icons": {"default": "dyad://RotationalComponents/Example.svg"},
"tests": {
"case1": {
"stop": 1,
"atol": {"inertia.w": 0.001, "inertia.phi": 0.001},
"expect": {
"initial": {"inertia.phi": 0, "inertia.w": 11},
"final": {"inertia.w": 11, "inertia.phi": 11},
"signals": ["inertia.w", "inertia.phi"]
}
}
}
}
}
endFlattened Source
dyad
"""
Test for ConstantSpeed source, matching MSL ModelicaTest.Rotational.AllComponents topology.
ConstantSpeed prescribes a fixed angular velocity w_fixed=11 rad/s on the inertia.
The inertia's speed is constrained to w_fixed at all times.
"""
test component ConstantSpeed
"Fixed ground for source support"
fixed = RotationalComponents.Components.Fixed()
"Constant speed source (w_fixed=11)"
constant_speed = RotationalComponents.Sources.ConstantSpeed(w_fixed = 11)
"Inertia (J=3)"
inertia = RotationalComponents.Components.Inertia(J = 3)
relations
initial inertia.phi = 0
connect(constant_speed.spline, inertia.spline_a)
connect(constant_speed.support, fixed.spline)
metadata {
"Dyad": {
"icons": {"default": "dyad://RotationalComponents/Example.svg"},
"tests": {
"case1": {
"stop": 1,
"atol": {"inertia.w": 0.001, "inertia.phi": 0.001},
"expect": {
"initial": {"inertia.phi": 0, "inertia.w": 11},
"final": {"inertia.w": 11, "inertia.phi": 11},
"signals": ["inertia.w", "inertia.phi"]
}
}
}
}
}
endTest Cases
Test Case case1
julia
pltjulia
pltRelated
Examples
Experiments
Analyses
Tests