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

NRLMSISE 00 Atmosphere — Robotics/Atmosphere

Robotics/Atmosphere/NRLMSISE_00_Atmosphere · 7 input / 2 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.

NRLMSISE-00 Atmosphere

Robotics / Atmosphere

The US Naval Research Laboratory's NRLMSISE-00 empirical model of the neutral atmosphere, from the ground to the lower exosphere: the temperature and the number densities of helium, atomic oxygen, nitrogen, oxygen, argon, hydrogen and atomic nitrogen, plus the total mass density, at a position and a time, driven by the solar flux F10.7 and the geomagnetic index Ap.

The thermosphere (above 72.5 km) is a Bates temperature profile joined to a cubic spline below 120 km, with each species' density a diffusive profile blended into a fully mixed one at the turbopause; below 72.5 km the temperature is two more splines through nodes that are themselves spherical harmonic expansions. The arithmetic is the reference implementation's, line for line.

Ports

  • LLA – [3,1]: the geodetic latitude and longitude in degrees and the altitude in metres. A latitude past ±90° is folded back over the pole, which also turns the longitude by 180°, and a longitude past ±180° is wrapped once.
  • year – [1,1]. Read by nothing: the reference uses the year only to warn about a day of year past the end of it.
  • doy – [1,1]: the day of year, 1 to 366, truncated toward zero to a whole day.
  • sec – [1,1]: seconds of the UT day. The local apparent solar time is sec/3600 + lon/15 hours.
  • F107a – [1,1]: the 81-day average of F10.7, centred on the day of year (150 is a moderate Sun).
  • F107 – [1,1]: the daily F10.7 of the previous day.
  • aph – [7,1]: the magnetic indices – the daily Ap, then the 3-hour ap now, 3, 6 and 9 hours before, and the averages of the eight 3-hour values 12–33 and 36–57 hours before. Only the daily Ap is read unless flag 9 is −1.
  • T – [2,1]: the exospheric temperature and the temperature at the altitude, in kelvin.
  • rho – [9,1]: the number densities of He, O, N2, O2, Ar per cubic metre, the total mass density in kg/m³, then H, N and the anomalous oxygen per cubic metre.

Parameters

  • Flags – the model's 23 switches, a row of 23 numbers (default all 1). Each turns one term of the model on (1), off (0) or keeps only its cross terms (2); flag 9 at −1 selects the 3-hour ap history in place of the daily Ap. In order: F10.7 effect on the mean, time independent, symmetrical annual, symmetrical semiannual, asymmetrical annual, asymmetrical semiannual, diurnal, semidiurnal, daily Ap, all UT/longitude effects, longitudinal, UT and mixed UT/longitude, mixed Ap/UT/longitude, terdiurnal, departures from diffusive equilibrium, all TINF variations, all TLB variations, all TN1 variations, all S variations, all TN2 variations, all NLB variations, all TN3 variations, and turbopause scale height variations. Each entry is truncated toward zero, as the reference does.
  • Include Anomalous Oxygen – off (default) or on: whether the anomalous oxygen joins the total mass density. Its own density is output either way.
  • 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. Each carries the whole model as straight-line code with the model's coefficients written in at 17 significant digits, so every target computes the same doubles as the block's own simulation. The switches are baked in at export time.

The three hardware targets are simulation-only: exponentials, powers and cubic splines have no Q16.16 form, so values convert at the port boundary and the arithmetic runs in floating point. A Q16.16 port cannot hold a number density (they run from about 106 to 1026 per cubic metre) nor an altitude above about 32.7 km, so a hardware export answers the temperatures and little else.

Simulink bridge

Import and export, mapped to Aerospace Blockset's aerolibatmos2/NRLMSISE-00 Atmosphere Model. Two configuration values cross: Flags → flags, and Include Anomalous Oxygen → oxygen_in, one for one.

Five Simulink parameters are always implied: flux_ap_input is on, which is what gives the Simulink block this block's seven inputs; lst_input is off, the local solar time being computed from sec and lon as here; flags_input is Internal, the switches being a parameter; units is Metric (MKS), this block being metric throughout; and action is None, that parameter only choosing whether Simulink warns for an out-of-range input. 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.
  • Below 72.5 km the O, H, N and anomalous O densities are zero, as in the reference; the model is specified up to 1000 km and answers beyond it without complaint.
  • Metres become kilometres by a multiply by 0.001, the Simulink block's own unit conversion, measured.
  • One deliberate difference: at exactly 32.5 km the reference reuses spline nodes computed for an earlier sample. They are multiplied by zero there, so the answer does not move, unless no earlier sample ever computed them, in which case the reference answers NaN. This block computes them, and answers the finite value.
  • Verified bit for bit against the reference C over 6000 samples, and within 1.7×10−12 relative of R2026a's Simulink block.

Code facts#

FactValue
registered typeRobotics/Atmosphere/NRLMSISE_00_Atmosphere
familyRobotics/Atmosphere
solver environment classICoreBlock_0_Robotics_1_Atmosphere_2_NRLMSISE_00_Atmosphere
sourcesrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Atmosphere/NRLMSISE_00_Atmosphere/ICoreBlock_0_Robotics_1_Atmosphere_2_NRLMSISE_00_Atmosphere.cpp
headersrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Atmosphere/NRLMSISE_00_Atmosphere/ICoreBlock_0_Robotics_1_Atmosphere_2_NRLMSISE_00_Atmosphere.h
default size on canvas190 × 170 px
ports at insert7 in, 2 out
code generators implementedPython, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Ports#

#DirectionSignal typeDescription label
1inICoreDoubleLLA
2inICoreDoubleyear
3inICoreDoubledoy
4inICoreDoublesec
5inICoreDoubleF107a
6inICoreDoubleF107
7inICoreDoubleaph
8outICoreDoubleT
9outICoreDoublerho

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 variableDefaultSimulink parameter
Flags[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]flags
Include Anomalous Oxygenoff%~%on~~offoxygen_in

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/NRLMSISE-00\nAtmosphere Model
port-count rulePortsParam::None
SampleTime parameterno — the counterpart defines none; the rate stays on the ICore side
always setunits = Metric (MKS), lst_input = off, flux_ap_input = on, flags_input = Internal, action = None
ICore configSimulink parameterValue translation
Flagsflagspasses through
Include Anomalous Oxygenoxygen_inoff → off, on → on

Caveat (shown to the user): seven inputs -- [lat lon alt] in degrees, degrees and metres, then the year, the day of year, the UT seconds, F10.7a, F10.7 and the seven-element aph -- and two outputs: the two temperatures in kelvin and the nine densities. 'flux_ap_input' is always on (that is what gives the Simulink block its seven inputs), 'lst_input' always off (the local solar time is computed from sec and lon on both sides), 'flags_input' always Internal, 'units' always Metric (MKS) and 'action' always None (it only chooses whether Simulink warns). 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 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).

NRLMSISE-00 Atmosphere Model -- the NRL empirical atmosphere, transcribed T = [T_exo; T(h)] rho = [n_He; n_O; n_N2; n_O2; n_Ar; rho_mass; n_H; n_N; n_O*] as NRLMSISE-00 answers them for a position, a time, the solar flux and the magnetic indices.

The arithmetic is the reference C that MATLAB ships -- gtd7 in aeroatmnrlmsise00.c and the S-function saeroatmnrlmsise.c around it -- written once as a statement program in ICoreNrlmsise00Support: the live run executes that program and the ten exports render it, so none of the eleven places this model runs can drift from another.

⚠ MEASURED BIT FOR BIT against the reference C over 6000 samples (three switch sets, the anomalous oxygen on and off, 0 to 1100 km, every latitude and longitude fold), and within 1.7e-12 relative of R2026a's Simulink block -- the gap between two libms, which the reference C compiled here shows against the same block too.

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

Sample results#

No stimulus produced a sampled output in this rig — Invalid input size at: ICore Blocks/Home/NRLMSISE 00 Atmosphere. 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 94ee8065628133f3ee1bee3431474c39fc172a21 · produced by docsSample --out <folder> --blocks NRLMSISE_00_Atmosphere --steps 60

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