Generated reference › COESA Atmosphere — Robotics/Atmosphere
kind: generated#block#robotics-atmosphere

COESA Atmosphere — Robotics/Atmosphere

h T

Robotics/Atmosphere/COESA_Atmosphere · 1 input / 4 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.

COESA Atmosphere

Robotics / Atmosphere

The 1976 COESA-extended U.S. Standard Atmosphere: a geopotential altitude in, and the atmosphere's temperature, speed of sound, static pressure and density out. Inside the layer the altitude falls in, with base altitude h₀, base temperature T₀, base pressure p₀ and lapse rate L, and with GMR = g₀M/R* and Rs = R*/M:

  • on a layer with a lapse rate, T = T₀ + L(h − h₀) and p = p₀(T₀/T)GMR/L
  • on an isothermal layer, T = T₀ and p = p₀·e−GMR(h−h₀)/T₀
  • then ρ = p / (RsT) and a = √(γTRs)

Seven layers span sea level to 84852 m, and both ends are extrapolated rather than clamped.

Ports

  • h – the geopotential altitude, in metres. Any size [m,n]; the block works entry by entry.
  • T – the temperature, in kelvin. Same size as the input.
  • a – the speed of sound, in m/s. Same size as the input.
  • P – the static pressure, in pascals. Same size as the input.
  • rho – the density, in kg/m³. Same size as the input.

Parameters

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

The atmosphere itself has no parameters, and that is the point: the 1976 standard fixes every breakpoint, lapse rate and constant, which is what makes it a shared reference rather than a setting. A lapse-rate atmosphere whose constants you choose is ISA Atmosphere.

Code export

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

The seven layers are unrolled into the emitted arithmetic at export time rather than shipped as a table: which layer an altitude falls in is a comparison chain, and each branch then carries only its own constants – and only one of the two pressure formulas, because whether a layer has a lapse rate is known when the code is written. The constants are printed at 17 significant digits, so all ten backends and this block's own simulation compute with the same doubles.

The three hardware targets are simulation-only: a power with a fractional exponent, an exponential and a square root have no Q16.16 form, so values convert at the port boundary and the arithmetic runs in floating point. And a fixed-point port cannot carry a sea-level pressure at all – Q16.16 saturates past about 32767, while standard sea level is 101325 – so a hardware export of this block is for the thin part of the atmosphere, above roughly 9 km, where all four outputs fit.

Simulink bridge

Import and export, mapped to Aerospace Blockset's aerolibatmos2/COESA Atmosphere Model. The block has no configuration to carry, so no parameter pairs cross.

Four Simulink parameters are always implied. units is always Metric (MKS), this block being metric throughout; action is always None, that parameter only choosing whether Simulink warns when an altitude leaves the table; and spec is always 1976 COESA-extended U.S. Standard Atmosphere with model at Profile. The last pair is not cosmetic: that one Simulink block also serves the Non-Standard Day 210C and Non-Standard Day 310 library entries, which are the same block at a different spec – so naming the standard is what says which atmosphere crossed. The Simulink block defines no SampleTime parameter, measured, so the rate stays on the ICore side.

Notes

  • Algebraic and stateless: the outputs depend on this sample alone.
  • Not linear, so the block carries no state space and model reduction correctly reports it as unmergeable.
  • The altitude is GEOPOTENTIAL, not geometric. Nothing converts between the two, and at 84852 m they differ by about 1.1 km.
  • Its sea-level density is 1.2249991558877125, not 1.225. Density here is the perfect-gas relation against Rs = 287.05307204706463, where an ISA dialog takes 287.0531 and a sea-level density of exactly 1.225 as given. The two atmospheres genuinely differ in the sixth digit.
  • Nothing clamps at either end – below sea level and above 84852 m the outer layers are extrapolated, which is what the reference implementation does.
  • A non-positive temperature answers zero on all four outputs, which the reference does not do. Extrapolating the top layer past about 178 km drives the temperature through zero, and VHDL's real ** asserts on a negative base rather than answering, so the guard has to exist and all ten targets carry the same one.
  • Verified against R2026a over fifteen altitudes from −6000 m to 100000 m – both extrapolated ends, every layer and every breakpoint – where all sixty answers agree to the last bit.

Code facts#

FactValue
registered typeRobotics/Atmosphere/COESA_Atmosphere
familyRobotics/Atmosphere
solver environment classICoreBlock_0_Robotics_1_Atmosphere_2_COESA_Atmosphere
sourcesrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Atmosphere/COESA_Atmosphere/ICoreBlock_0_Robotics_1_Atmosphere_2_COESA_Atmosphere.cpp
headersrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Atmosphere/COESA_Atmosphere/ICoreBlock_0_Robotics_1_Atmosphere_2_COESA_Atmosphere.h
default size on canvas160 × 110 px
ports at insert1 in, 4 out
code generators implementedPython, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Ports#

#DirectionSignal typeDescription label
1inICoreDoubleh
2outICoreDoubleT
3outICoreDoublea
4outICoreDoubleP
5outICoreDoublerho

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 pathaerolibatmos2/COESA Atmosphere Model
port-count rulePortsParam::None
SampleTime parameterno — the counterpart defines none; the rate stays on the ICore side
always setunits = Metric (MKS), spec = 1976 COESA-extended U.S. Standard Atmosphere, model = Profile, action = None

Caveat (shown to the user): the altitude is GEOPOTENTIAL and in metres, and the four outputs are kelvin, m/s, pascals and kg/m^3. 'spec' and 'model' are always written, and that is not cosmetic: the same Simulink block also serves the Non-Standard Day 210C and Non-Standard Day 310 library entries at a different 'spec', so naming the standard is what says which atmosphere crossed. 'units' is always Metric (MKS) and 'action' always None, that parameter only choosing whether Simulink warns when an altitude leaves the table. The Simulink block has no SampleTime, so the rate stays on the ICore side

Catalog contract: src/ICoreBlocks/ICoreCoder/ICoreCommandSystem/SimulinkBridge/ICoreSimulinkBlockCatalog.h

Description vs code#

The lists agree. check_block_descriptions.py finds no disagreement between the description's Ports, Parameters, Code export and Simulink bridge lists and the code's.

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).

COESA Atmosphere -- the 1976 COESA-extended U.S. Standard Atmosphere, altitude in T = T0 + L * (h - h0) layer with a lapse rate p = p0 * (T0 / T)^(GMR/L) T = T0 isothermal layer p = p0 * exp(-GMR * (h - h0) / T0) rho = p / (Rs * T) a = sqrt(gamma * T * Rs)

The seven layers live in ICoreCoesa1976Support, shared with Pressure Altitude, which reads the same table the other way. Every constant the export targets carry is printed from that table at 17 significant digits, so the ten of them and this block's own simulation share one set of numbers rather than ten transcriptions.

⚠ THE ARRANGEMENT WAS MEASURED, NOT DERIVED. Driven against R2026a's own block over fifteen altitudes from -6000 m to 100000 m -- both extrapolated ends, every layer, and every breakpoint -- all sixty answers agree TO THE LAST BIT.

⚠ THE LAYER TEST IS >=, NOT >, AND THE TOP BREAKPOINT IS NOT A LAYER. An altitude at or above 84852 m extrapolates the layer BELOW it, which is what the reference does and why the table has seven rows and eight breakpoints.

⚠ ITS SEA-LEVEL DENSITY IS 1.2249991558877125 AND NOT 1.225 -- see the header.

⚠ A NON-POSITIVE TEMPERATURE ANSWERS ZERO ON ALL FOUR OUTPUTS, which the reference does not do. The guard is forced rather than chosen: extrapolating the top layer past about 178 km drives the temperature through zero, and VHDL's real "**" ASSERTS on a negative base rather than answering, aborting a simulation instead of producing a bad number.

ALGEBRAIC and STATELESS, and nonlinear in its input, so no state space.

Sample results#

COESA Atmosphere — Repeating Sequence Stair: [-2 -1 -0.5 0 0.5 1 2 3], one entry per sampleCOESA Atmosphere — Repeating Sequence Stair: [-2 -1 -0.5 0 0.5 1 2 3], one entry per sample05e41e5012345t (s)in ICoreDouble-Out-0out ICoreDouble-Out-0out ICoreDouble-Out-1out ICoreDouble-Out-2
tin ICoreDouble-Out-0out ICoreDouble-Out-0out ICoreDouble-Out-1out ICoreDouble-Out-2
0-2288.2340.31.013e5
0.40.5288.1340.31.013e5
0.8-2288.2340.31.013e5
1.20.5288.1340.31.013e5
1.6-2288.2340.31.013e5
20.5288.1340.31.013e5
2.4-2288.2340.31.013e5
2.80.5288.1340.31.013e5
3.2-2288.2340.31.013e5
3.60.5288.1340.31.013e5
4-2288.2340.31.013e5
4.40.5288.1340.31.013e5
4.8-2288.2340.31.013e5
5.20.5288.1340.31.013e5

Every 4th of 60 samples, from the table stimulus.

The same rig also ran:

StimulusWhat it isOutput range
impulseImpulse: one sample of 1 at k = 5, 0 elsewhere (Repeating Sequence Stair)288.1 … 288.1
rampRamp: slope 1 from t = 0288.1 … 288.1
sineSine Wave: amplitude 1, 2 rad/s, no phase, no bias288.1 … 288.2
stepStep: 0 -> 1 at t = 1 s288.1 … 288.1

Plotted: table — Repeating Sequence Stair: [-2 -1 -0.5 0 0.5 1 2 3], one entry per sample

Category static · sample time 0.1 · 60 steps · commit 7df85021459493e38f84f64127a6774c411e769c · produced by docsSample --out <folder> --blocks COESA_Atmosphere ISA_Atmosphere Pressure_Altitude --steps 60 · data docs/generated/samples/Robotics__Atmosphere__COESA_Atmosphere.json · the SVG is generated from those numbers by tools/docs/plot_svg.py, so it is a run and not a drawing (R-D10).