Generated reference › Mach Number — Robotics/Flight Parameters
kind: generated#block#robotics-flight-parameters

Mach Number — Robotics/Flight Parameters

M

Robotics/Flight_Parameters/Mach_Number · 2 input / 1 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.

Mach Number

Robotics / Flight Parameters

The airspeed as a multiple of the local speed of sound:

M = |V| / a, with |V| = √(u² + v² + w²)

It is the whole vector's magnitude that is compared, not one component, so a sideslipping or climbing aircraft is not slower than its longitudinal component suggests.

Ports

  • V – the velocity in body axes, a [3,1] column [u v w]’.
  • a – the local speed of sound, a [1,1] scalar, in the same units as V.
  • M – the Mach number, a [1,1] scalar. Dimensionless, and never negative – a magnitude over a speed.

Parameters

  • Sampling Time (s) – zero or less inherits the solver's rate; a positive value runs the block at that period.

There are no others: both quantities arrive on ports.

Code export

All ten targets: Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog and PLC Structured Text.

The three HDL targets are simulation-only, and for two reasons rather than one: there is no square root and no division in a Q16.16 datapath. The sum of squares is genuine fixed point; the root and the divide convert at the port boundary and evaluate in real. The cores simulate correctly and are not offered as synthesizable.

A zero speed of sound divides by zero, and the two worlds answer differently on purpose: the seven software targets produce IEEE ±Inf (NaN at 0/0) and agree exactly, while fixed point carries neither, so the HDL cores answer 0. That is the same divergence Math Function's reciprocal documents.

Simulink bridge

Import and export, mapped to Aerospace Blockset's aerolibasang/Mach Number. That block has no dialog parameters at all – measured in R2026a – so nothing is mapped and the add_block carrying nothing is itself the assertion. It defines no SampleTime either, so the rate stays on the ICore side.

Notes

  • Algebraic and stateless: the output depends on this sample alone.
  • Not linear – a root of a sum of squares, divided by another input – so the block carries no state space and model reduction correctly reports it as unmergeable.
  • Verified against R2026a: at V = [50 3 7]’ and a = 340.29 both this block and the Simulink one answer 0.14862815382646322.
  • Pair it with Dynamic Pressure, which takes the same velocity vector and a density.

Code facts#

FactValue
registered typeRobotics/Flight_Parameters/Mach_Number
familyRobotics/Flight_Parameters
solver environment classICoreBlock_0_Robotics_1_Flight_Parameters_2_Mach_Number
sourcesrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Flight_Parameters/Mach_Number/ICoreBlock_0_Robotics_1_Flight_Parameters_2_Mach_Number.cpp
headersrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Flight_Parameters/Mach_Number/ICoreBlock_0_Robotics_1_Flight_Parameters_2_Mach_Number.h
default size on canvas108 × 72 px
ports at insert2 in, 1 out
code generators implementedPython, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Ports#

#DirectionSignal typeDescription label
1inICoreDoubleV
2inICoreDoublea
3outICoreDoubleM

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#

No config variable beyond the Sampling Time (s) every block carries.

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.

supportSupport::Both
Simulink pathaerolibasang/Mach Number
port-count rulePortsParam::None
SampleTime parameterno — the counterpart defines none; the rate stays on the ICore side

Caveat (shown to the user): the Simulink block carries no dialog parameters and no SampleTime, so the whole mapping is the library path and the port list: V on the first port, the speed of sound on the second. The rate stays on the ICore side

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:

  • B0 every 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).

Mach Number -- M = |V| / a The airspeed as a multiple of the local speed of sound, from a body-axis velocity vector and a scalar speed of sound. One dot product, one root, one division; no state, no configuration.

MEASURED AGAINST R2026a rather than asserted: at V = [50 3 7]' and a = 340.29, Aerospace Blockset's aerolibasang/Mach Number answers 0.14862815382646322, and norm([50 3 7])/340.29 is that number to the last bit. The block carries NO dialog parameters at all and no SampleTime, so its whole bridge is the library path and the port list.

⚠ THE THREE HDL TARGETS ARE SIMULATION-ONLY, for two reasons rather than one: the root AND the division. The sum of squares is genuine Q16.16; only those two convert at the port boundary and evaluate in real, which is the choice Peak To RMS and Recursive IIR make for the same arithmetic.

⚠ A ZERO SPEED OF SOUND DIVIDES BY ZERO, and the two worlds answer differently on purpose. The seven software targets produce IEEE infinity (NaN at 0/0) and agree exactly; fixed point carries neither, so the HDL cores answer 0 -- the divergence Math Function's reciprocal already documents, and the description repeats it where a user reads it.

Sample results#

No stimulus produced a sampled output in this rig — Invalid input size at Mach Number block: ICore Blocks/Home/Mach Number. 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 7a92e77df807c552be6236159919fcefe95c17d3 · produced by docsSample --out <folder> --blocks Dynamic_Pressure Mach_Number Incidence_And_Airspeed Incidence_Sideslip_And_Airspeed --steps 60

Sample data: docs/generated/samples/Robotics__Flight_Parameters__Mach_Number.json