Horizontal Wind Model — Robotics/Wind
Robotics/Wind/Horizontal_Wind_Model · 1 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.
Horizontal Wind Model
Robotics / Wind
A steady horizontal wind of a given speed, blowing from a given direction, handed back in body axes. It is the constant-wind block of the Aerospace Blockset – not a climatology: the speed and direction are the block's own parameters, and nothing depends on altitude, date or position.
- ψ = Wdeg·(π/180) – the direction the wind blows FROM, in radians clockwise from north.
- v = V·[−cos ψ; −sin ψ; 0] – the wind in the inertial north-east-down frame.
- w = DCM·v – the same wind rotated into body axes.
Ports
- DCM – the direction cosine matrix from inertial (north-east-down) to body axes, [3,3].
- Output – w, the wind in body axes, [3,1], in the unit the wind speed parameter is given in.
Parameters
- Units – which unit the wind speed (and therefore the output) is in: Metric (MKS) for m/s (the default), English (Velocity in ft/s) or English (Velocity in kts). It changes no arithmetic: the block converts only the angle.
- Wind Speed At Altitude – V, a scalar. Defaults to 15.
- Wind Direction At Altitude (deg) – Wdeg, a scalar, the direction the wind blows FROM, in degrees clockwise from north. Defaults to 0.
- 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. The inertial wind v is folded to two constants at export time, so every core computes two products and one sum per output element.
The three HDL targets are genuine Q16.16: a constant times a DCM element needs no real arithmetic, so the cores are synthesizable. The two constants are quantized to Q16.16 (one step is about 1.5×10−5), and so is the answer.
Simulink bridge
Import and export, mapped to Aerospace Blockset's
aerolibwind2/Horizontal Wind Model: Units →
units 1:1 and therefore lossless, Wind Speed At Altitude
→ Vwind and Wind Direction At Altitude (deg) →
Wdeg. The two source popups, Vw_source and
W_source, are pinned to Internal: setting either to
External adds a port to the Simulink block, and this block's ports do
not follow a parameter, so importing a Simulink block set to External reports
the difference rather than accepting it. "Sampling Time (s)" does not cross: the Simulink
block defines no SampleTime parameter, measured on R2026a.
Notes
- Stateless and algebraic: the output depends only on this sample's DCM.
- The sign is the aeronautical one. ψ is where the wind comes FROM, so a 15 m/s northerly (ψ = 0) is −15 m/s along north.
- Bit-exact with Simulink, measured: the angle is converted as Wdeg·(π/180), which is not the same double as Wdeg·π/180.
- The DCM is used as given; nothing checks that it is orthonormal.
Code facts#
| Fact | Value |
|---|---|
| registered type | Robotics/Wind/Horizontal_Wind_Model |
| family | Robotics/Wind |
| solver environment class | ICoreBlock_0_Robotics_1_Wind_2_Horizontal_Wind_Model |
| source | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Wind/Horizontal_Wind_Model/ICoreBlock_0_Robotics_1_Wind_2_Horizontal_Wind_Model.cpp |
| header | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Wind/Horizontal_Wind_Model/ICoreBlock_0_Robotics_1_Wind_2_Horizontal_Wind_Model.h |
| default size on canvas | 120 × 60 px |
| ports at insert | 1 in, 1 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 | DCM |
| 2 | out | ICoreDouble | — |
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)%~%English (Velo… | units |
Wind Speed At Altitude | 15 | Vwind |
Wind Direction At Altitude (deg) | 0 | Wdeg |
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 | aerolibwind2/Horizontal Wind Model |
| port-count rule | PortsParam::None |
SampleTime parameter | no — the counterpart defines none; the rate stays on the ICore side |
| always set | Vw_source = Internal, W_source = Internal |
| ICore config | Simulink parameter | Value translation |
|---|---|---|
Units | units | Metric (MKS) → Metric (MKS), English (Velocity in ft/s) → English (Velocity in ft/s), English (Velocity in kts) → English (Velocity in kts) |
Wind Speed At Altitude | Vwind | passes through |
Wind Direction At Altitude (deg) | Wdeg | passes through |
Caveat (shown to the user): aerolibwind2/Horizontal Wind Model has NO SampleTime parameter (verified against the R2026a block dialog), so "Sampling Time (s)" does not cross. Vw_source and W_source are pinned to Internal because External moves that block's port list
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).
Horizontal Wind Model — a steady wind from a fixed direction, rotated into body axes psi = Wdeg * (pi/180) v = V * [-cos psi; -sin psi; 0] (the inertial, north-east-down wind) w = DCM * v
⚠ MEASURED AGAINST R2026a before any of it was written: aerolibwind2/Horizontal Wind Model is a SinCos on the direction (through a deg -> rad Unit Conversion), a Mux [cos; sin; 0], a Gain of -1, an element-wise Product with the speed and a matrix Product with the DCM. The chain above reproduces it BIT-FOR-BIT (max |error| 0, not one element different) over 400 random (DCM, V, psi) samples with psi in [-720, 720] deg, in all three unit systems. Two spellings of the conversion that look equivalent are NOT: Wdeg*pi/180 and Wdeg/180*pi each miss by an ULP on over half the samples. And the unit system changes nothing: it names V's unit, the output is in the same one, and the block converts only the ANGLE.
The dialog's two "source" popups (Vw_source, W_source) are pinned to Internal: External moves the Simulink block's port list, and an ICore block's ports do not follow a config.
v is a constant, folded at export time, so every core is two products and one sum per row -- which keeps the three HDL targets GENUINE Q16.16.
Sample results#
No stimulus produced a sampled output in this rig — Invalid input size at Horizontal Wind Model block: ICore Blocks/Home/Horizontal Wind Model. 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 c90ce53c01 · produced by docsSample --out <folder> --blocks Horizontal_Wind_Model --steps 60
Sample data: docs/generated/samples/Robotics__Wind__Horizontal_Wind_Model.json