EOM 6DOF Simple Variable Mass Wind Quaternion — Robotics/Equations Of Motion
Robotics/Equations_Of_Motion/EOM_6DOF_Simple_Variable_Mass_Wind_Quaternion · 3 input / 11 output port(s) at insert · exports to Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text
Description#
The block's own DESCRIPTION_HTML, rendered verbatim — the same text the config dialog's info panel and the library navigator show. Fix a wrong sentence in the block's .cpp (R-D9), never here.
EOM 6DOF Simple Variable Mass Wind Quaternion
Robotics / Equations Of Motion
The six-degree-of-freedom equations of motion of a rigid body that burns fuel, with the translation carried in wind axes as the airspeed V, the angle of attack α and the sideslip angle β, and the attitude as a body quaternion q, so there is no gimbal lock. With the force Fw = [Fx; Fy; Fz] in wind axes, the moment M in body axes, the body rates ω = [p; q; r], the mass m a state driven by the mass flow rate and held between the empty and full masses, and the inertia tensor following it linearly between its empty and full values:
- V' = Fx/m
- α' = q − (p·cos α + r·sin α)·tan β + Fz/(m·V·cos β)
- β' = p·sin α − r·cos α + Fy/(m·V)
- I(m) = (1 − λ)·Ie + λ·If, λ = (m − me)/(mf − me), and dI/dt = (If − Ie)/(mf − me)·dm/dt – on the raw rate, even at a limit, as the Simulink block does it
- m' = dm/dt, except zero while the tank is empty and draining or full and filling
- ω' = I−T(M − dI/dt·ω − ω × (Iω)) – the transpose of the inverse, as the Simulink block divides a row vector by I; the two are the same for a symmetric tensor
- q' = ½Ω(ω)·q/|q| – the kinematics are evaluated on the normalized quaternion
- Xe' = DCMweT·[V; 0; 0], with DCMwe = DCMwb(α, β)·DCMbe(q)
Ports
- Fw – the applied force in wind axes, [3,1].
- M – the applied moment about the centre of gravity in body axes, [3,1].
- m_dot – the mass flow rate dm/dt (negative while burning), a scalar [1,1].
- Ve – the velocity in the flat-earth frame, DCMweT·Vw, [3,1].
- Xe – the position in the flat-earth frame, [3,1].
- Wind – the wind angles [μ; γ; χ] (bank, flight path and heading) in radians, read back from DCMwe: μ = atan2(D23, D33), γ = asin(−D13), χ = atan2(D12, D11), [3,1].
- DCMwe – the direction cosine matrix from the flat-earth frame to wind axes, [3,3].
- Vw – the velocity in wind axes, [V; 0; 0], [3,1].
- alpha_beta – [α; β] in radians, [2,1].
- alpha_beta_dot – [α'; β'] in rad/s, [2,1]. Reads Fw at the same instant.
- wb – the body rates [p; q; r] in rad/s, [3,1].
- dwb – the body angular accelerations ω' in rad/s2, [3,1]. Reads M at the same instant.
- Ab – the body-axes acceleration Vb × ω + DCMwbT·Fw/m, with Vb = DCMwbT·[V; 0; 0], [3,1]. Reads Fw at the same instant.
- Fuel – the fuel tank status: 1 full (m ≥ mf), −1 empty (m ≤ me), 0 otherwise, [1,1].
Parameters
- Units – Metric (MKS) (the default) or English (Velocity in ft/s). The two are the same arithmetic, so the choice only says which units the numbers are in.
- Initial Position [Xe Ye Ze] – three values. Defaults to [0 0 0].
- Initial Airspeed and Angles [V alpha beta] – the initial airspeed, angle of attack and sideslip (radians), three values. V must be nonzero, since it divides, and β inside (−π/2, π/2). Defaults to [100 0 0]: the Simulink dialog's own default, [0 0 0], divides by zero at the first step.
- Initial Wind Angles [mu gamma chi] – the initial bank, flight-path and heading angles in radians, three values; the initial body quaternion is the half-angle product of the Euler angles of DCMwbT·DCMwe. Defaults to [0 0 0].
- Initial Body Rates [p q r] – in rad/s, three values. Defaults to [0 0 0].
- Initial Mass – m0, from the empty to the full mass. Defaults to 1.
- Empty Mass – me, the lower limit, > 0. Defaults to 0.5.
- Full Mass – mf, the upper limit, greater than the empty mass. Defaults to 2.
- Empty Inertia – Ie, the invertible [3,3] tensor at the empty mass. Defaults to eye(3).
- Full Inertia – If, the invertible [3,3] tensor at the full mass. Defaults to 2*eye(3).
- Integration Substeps – M, how many fourth-order Runge-Kutta steps a sample is integrated with on the discrete solver and in exported code, a whole number of 1 or more. Defaults to 100. No Simulink counterpart.
- Sampling Time (s) – zero or less inherits the solver's rate; a positive value runs the block at that period.
Code export
All ten targets: Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog and PLC Structured Text (which has no atan2, so the wind-angle read-back rebuilds it from ATAN). A core holds the fourteen states, publishes the eleven outputs from them and the inputs of the same sample, and integrates one sample with the inputs held and M Runge-Kutta substeps – with M = 100, the same computation as Simulink's fixed-step ode4 at one hundredth of the sample time, the mass clamped to the tank at every stage and after every substep exactly as the Simulink block's limited integrator does it. The inertia is interpolated and inverted in closed form at every derivative evaluation.
The three HDL targets are simulation-only real arithmetic,
quantized at the port: a tangent and a square root of a state have no Q16.16 form. The cores
simulate correctly and are not offered as synthesizable.
Simulink bridge
Import and export, mapped to Aerospace Blockset's
aerolib6dof2/Simple Variable Mass 6DOF Wind (Quaternion): Units → units (the two
offered values 1:1), Initial Position [Xe Ye Ze] → xme_0, Initial
Airspeed and Angles [V alpha beta] → Vm_0, Initial Wind Angles [mu gamma
chi] → wind_0, Initial Body Rates [p q r] → pm_0,
Initial Mass → mass_0, Empty Mass → mass_e,
Full Mass → mass_f, Empty Inertia → inertia_e and
Full Inertia → inertia_f. Always emitted with mtype =
Simple Variable, rep = Quaternion
and vre_flag and abi_flag off: the mass type and the two flags each move
that block's port list, the representation selects a different block, and this block has one
port list. The knots unit system is not offered – it converts velocities inside the
integration – and an imported one is reported. The dialog's inertia is not read at
this mass type and is not offered. "Sampling Time (s)" does not cross: the
Simulink block is continuous and defines no SampleTime.
Notes
- Stateful, continuous and nonlinear: fourteen continuous states. Unlike the body-axes equations of motion, the block has direct feedthrough: alpha_beta_dot, dwb and Ab read the inputs of the same instant, so a loop from those outputs back to Fw or M is an algebraic loop.
- V divides and β = ±90° is singular (tan β and 1/cos β): a run that takes the airspeed through zero or the sideslip to ±90° is outside the model, as it is in the Simulink block.
- At a limit the mass stops, but the inertia rate does not: the Simulink block feeds the raw dm/dt to it, and so does this one. On the continuous solver the mass is held by the zero rate alone and can overshoot a limit by one solver step; the discrete solver and every exported core also clamp it, as Simulink does.
- No gimbal lock in the state. The wind-angle OUTPUT is a read-back, so μ and χ wrap at ±π and γ is clamped to the arcsine's domain at ±90°.
Code facts#
| Fact | Value |
|---|---|
| registered type | Robotics/Equations_Of_Motion/EOM_6DOF_Simple_Variable_Mass_Wind_Quaternion |
| family | Robotics/Equations_Of_Motion |
| solver environment class | ICoreBlock_0_Robotics_1_Equations_Of_Motion_2_EOM_6DOF_Simple_Variable_Mass_Wind_Quaternion |
| source | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Equations_Of_Motion/EOM_6DOF_Simple_Variable_Mass_Wind_Quaternion/ICoreBlock_0_Robotics_1_Equations_Of_Motion_2_EOM_6DOF_Simple_Variable_Mass_Wind_Quaternion.cpp |
| header | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Equations_Of_Motion/EOM_6DOF_Simple_Variable_Mass_Wind_Quaternion/ICoreBlock_0_Robotics_1_Equations_Of_Motion_2_EOM_6DOF_Simple_Variable_Mass_Wind_Quaternion.h |
| default size on canvas | 170 × 190 px |
| ports at insert | 3 in, 11 out |
| code generators implemented | Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text |
Ports#
| # | Direction | Signal type | Description label |
|---|---|---|---|
| 1 | in | ICoreDouble | Fw |
| 2 | in | ICoreDouble | M |
| 3 | in | ICoreDouble | m_dot |
| 4 | out | ICoreDouble | Ve |
| 5 | out | ICoreDouble | Xe |
| 6 | out | ICoreDouble | Wind |
| 7 | out | ICoreDouble | DCMwe |
| 8 | out | ICoreDouble | Vw |
| 9 | out | ICoreDouble | alpha_beta |
| 10 | out | ICoreDouble | alpha_beta_dot |
| 11 | out | ICoreDouble | wb |
| 12 | out | ICoreDouble | dwb |
| 13 | out | ICoreDouble | Ab |
| 14 | out | ICoreDouble | Fuel |
Ports the constructor creates. A block whose port list changes with its configuration adds or removes ports at load time; the count above is the one a freshly inserted block has.
Configuration variables#
| Config variable | Default | Simulink parameter |
|---|---|---|
Units | Metric (MKS)%~%English (Velocity in ft/s)~~Metric (MKS) | units |
Initial Position [Xe Ye Ze] | [0 0 0] | xme_0 |
Initial Airspeed and Angles [V alpha beta] | [100 0 0] | Vm_0 |
Initial Wind Angles [mu gamma chi] | [0 0 0] | wind_0 |
Initial Body Rates [p q r] | [0 0 0] | pm_0 |
Initial Mass | 1.0 | mass_0 |
Empty Mass | 0.5 | mass_e |
Full Mass | 2.0 | mass_f |
Empty Inertia | [1 0 0; 0 1 0; 0 0 1] | inertia_e |
Full Inertia | [2 0 0; 0 2 0; 0 0 2] | inertia_f |
Integration Substeps | 100 | not crossed |
Every block also carries Sampling Time (s) from ICoreBlockSolverEnvironment: zero or less inherits the solver's rate, a positive value runs the block at that period.
Simulink bridge#
| support | Support::Both |
| Simulink path | aerolib6dof2/Simple Variable Mass 6DOF Wind (Quaternion) |
| port-count rule | PortsParam::None |
SampleTime parameter | no — the counterpart defines none; the rate stays on the ICore side |
| deliberately not crossed | Integration Substeps |
| always set | mtype = Simple Variable, rep = Quaternion, vre_flag = off, abi_flag = off |
| ICore config | Simulink parameter | Value translation |
|---|---|---|
Units | units | Metric (MKS) → Metric (MKS), English (Velocity in ft/s) → English (Velocity in ft/s) |
Initial Position [Xe Ye Ze] | xme_0 | passes through |
Initial Airspeed and Angles [V alpha beta] | Vm_0 | passes through |
Initial Wind Angles [mu gamma chi] | wind_0 | passes through |
Initial Body Rates [p q r] | pm_0 | passes through |
Initial Mass | mass_0 | passes through |
Empty Mass | mass_e | passes through |
Full Mass | mass_f | passes through |
Empty Inertia | inertia_e | passes through |
Full Inertia | inertia_f | passes through |
Caveat (shown to the user): aerolib6dof2/Simple Variable Mass 6DOF Wind (Quaternion) is a continuous masked subsystem with NO SampleTime parameter (verified against the R2026a block dialog). mtype, vre_flag and abi_flag are pinned because each moves that block's port list (measured), and rep because Wind Angles is a different block; the kts unit system is not offered because it converts velocities inside the integration; the dialog's inertia is not read at this mass type; "Integration Substeps" is how this block integrates a sample and has no counterpart
Catalog contract: src/ICoreBlocks/ICoreCoder/ICoreCommandSystem/SimulinkBridge/ICoreSimulinkBlockCatalog.h
Description vs code#
The checker has a blind spot here — it could not resolve something (a grouped port bullet, a computed config name), which is reported and never counted as a pass. A reader has to settle it:
B0every stimulus in the sample errored — cross-checks skipped
The verdict above is
tools/docs/check_block_descriptions.py(P7.1), which compares LISTS. It cannot read a sentence: "stateless" on a block with a state, an initial-value semantic the recursion does not implement, a "not synthesizable" caveat the HDL banner contradicts. That is the agent audit (P7.3) on BLOCK_DESCRIPTION_AUDIT.md, and this tool's green is not a substitute for one.
File banner (developer view)#
The top comment of the block's .cpp — the maths, the realization and the export strategy, addressed to whoever changes it. It must not contradict the description above (P7.5).
Simple Variable Mass 6DOF Wind (Quaternion) -- wind-axes equations of motion, simple variable mass State [V alpha beta, p q r, q0 q1 q2 q3, xe ye ze, m], inputs Fw (WIND axes), M (body axes) and dm/dt. The equations, and the R2026a measurement that fixed each of them, are in ../ICoreEomWindQuatSupport.cpp -- this block is that arithmetic at the Simple Variable mass type.
What is particular to this block, measured on the masked subsystem: the mass is a LIMITED Simulink Integrator between the empty and full masses, and what reproduces it (2e-14 through both limits) is the mass CLAMPED at every Runge-Kutta stage -- in F/m, in the inertia's linear interpolation and in the rate gate -- and the state clamped after the step. The inertia RATE is (I_f - I_e)/(m_f - m_e) * dm/dt on the RAW input: the mask does not gate it at a limit, so a full tank still being filled keeps an Idot omega term (gating it is out by 2.9 in Ab). The dialog's
inertiais not read at this mass type. Units, pins and the ode4 equivalence are the body-axes 6DOF blocks'.
Sample results#
No stimulus produced a sampled output in this rig — Invalid input size at EOM 6DOF Simple Variable Mass Wind Quaternion block: ICore Blocks/Home/EOM 6DOF Simple Variable Mass Wind Quaternion. That is a fact about the single-block rig, not a verdict on the block: an offline batch fit, a block whose output only appears at onSolverFinish, or one that needs a driven environment cannot be exercised alone.
Category unsampled · sample time 0.1 · 60 steps · commit 845b82ae2e6ecfb4f8001612ef1259301958b745 · produced by docsSample --out <folder> --blocks EOM_6DOF_Wind_Quaternion EOM_6DOF_Simple_Variable_Mass_Wind_Quaternion EOM_6DOF_Custom_Variable_Mass_Wind_Quaternion --steps 60
Sample data: docs/generated/samples/Robotics__Equations_Of_Motion__EOM_6DOF_Simple_Variable_Mass_Wind_Quaternion.json