Wind Shear Model — Robotics/Wind
Robotics/Wind/Wind_Shear_Model · 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.
Wind Shear Model
Robotics / Wind
The mean wind of a low-altitude boundary layer, after MIL-F-8785C: its speed grows with the logarithm of the altitude, it blows from a fixed direction, and the block hands it back in body axes.
- hf = max(h·k, 3) – the altitude in feet, held at 3 ft or above (k = 1/0.3048 for a metric altitude, 1 otherwise).
- s = −W20·ln(hf/z0) / ln(20/z0) – the shear law, equal to −W20 at 20 ft (6 m); z0 is 0.15 ft for Category C flight and 2.0 ft otherwise.
- w = DCM·[s·cos ψ; s·sin ψ; 0] – the inertial wind rotated into body axes.
Ports
- h – the altitude, a scalar [1,1]: metres in the Metric unit system, feet in both English ones.
- DCM – the direction cosine matrix from inertial (north-east-down) to body axes, [3,3].
- Output – w, the mean wind in body axes, [3,1], in the unit the wind speed parameter is given in.
Parameters
- Units – which unit system h and the wind speed are in:
- Metric (MKS) – h in metres, wind in m/s (the default).
- English (Velocity in ft/s) – h in feet, wind in ft/s.
- English (Velocity in kts) – h in feet, wind in knots. The arithmetic is identical to ft/s: only the altitude is ever converted.
- Flight Phase – sets the surface roughness z0:
- Category C - Terminal Flight Phase – z0 = 0.15 ft (the default).
- Other – z0 = 2.0 ft.
- Wind Speed At 6 m Altitude – W20, a scalar, the wind speed at the 20 ft reference height. Defaults to 15.
- Wind Direction At 6 m Altitude (deg) – ψ, 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 direction vector scaled by −W20 and ln(20/z0) are folded to constants at export time, so every core computes one clamp, one logarithm and six products per sample.
The three HDL targets are simulation-only: a logarithm of a signal
has no Q16.16 form, so values convert at the port boundary and the arithmetic runs
in real. The cores simulate correctly and are not offered as
synthesizable.
Simulink bridge
Import and export, mapped to Aerospace Blockset's
aerolibwind2/Wind Shear Model: Units →
units and Flight Phase → phase, both 1:1 and
therefore lossless, Wind Speed At 6 m Altitude → W_20
and Wind Direction At 6 m Altitude (deg) → Wdeg –
the block's whole dialog. "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 altitude and 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 at 20 ft.
- The 3 ft floor is in feet whatever the units: a metric altitude is converted before it is held, so anything below 0.9144 m reads as 3 ft.
- The DCM is used as given; nothing checks that it is orthonormal.
Code facts#
| Fact | Value |
|---|---|
| registered type | Robotics/Wind/Wind_Shear_Model |
| family | Robotics/Wind |
| solver environment class | ICoreBlock_0_Robotics_1_Wind_2_Wind_Shear_Model |
| source | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Wind/Wind_Shear_Model/ICoreBlock_0_Robotics_1_Wind_2_Wind_Shear_Model.cpp |
| header | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Wind/Wind_Shear_Model/ICoreBlock_0_Robotics_1_Wind_2_Wind_Shear_Model.h |
| default size on canvas | 120 × 80 px |
| ports at insert | 2 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 | h |
| 2 | in | ICoreDouble | DCM |
| 3 | 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 |
Flight Phase | Category C - Terminal Flight Phase%~%Other~~Category C - … | phase |
Wind Speed At 6 m Altitude | 15 | W_20 |
Wind Direction At 6 m 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/Wind Shear Model |
| port-count rule | PortsParam::None |
SampleTime parameter | no — the counterpart defines none; the rate stays on the ICore side |
| 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) |
Flight Phase | phase | Category C - Terminal Flight Phase → Category C - Terminal Flight Phase, Other → Other |
Wind Speed At 6 m Altitude | W_20 | passes through |
Wind Direction At 6 m Altitude (deg) | Wdeg | passes through |
Caveat (shown to the user): aerolibwind2/Wind Shear Model has NO SampleTime parameter (verified against the R2026a block dialog), so "Sampling Time (s)" does not cross
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).
Wind Shear Model — MIL-F-8785C logarithmic mean wind, rotated into body axes hf = max(h * kh, 3) (feet; kh = 1/0.3048 in Metric, else 1) r = ln(hf / z0) / ln(20 / z0) (z0 = 0.15 ft Category C, else 2.0 ft) w = DCM * (r * [-W20 cos psi; -W20 sin psi; 0])
⚠ MEASURED AGAINST R2026a, three unit systems x two flight phases, before any of it was written: the chain above reproduces aerolibwind2/Wind Shear Model to 1.8e-15, and an altitude of 0.2 m reproduces the 3-foot floor exactly. The masked subsystem is exactly this wiring -- Cast To Double, Length Conversion (to ft), a Saturation [3, inf), Gain 1/z0, ln, divided by ln(20/z0), times Gain(-W20) on the Mux [cos psi, sin psi, 0], then Product(DCM, v).
The two constant halves of that -- the direction vector scaled by -W20, and ln(20/z0) -- are folded at export time, so the emitted arithmetic is one clamp, one ln and six products.
HDL is SIMULATION-ONLY real arithmetic: a logarithm of a signal has no Q16.16 form.
Sample results#
No stimulus produced a sampled output in this rig — Invalid input size at Wind Shear Model block: ICore Blocks/Home/Wind Shear 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 fc85ac64df179e0aadfcbe797a2731524d14cbb9 · produced by docsSample --out <folder> --blocks Linear_Second_Order_Actuator Nonlinear_Second_Order_Actuator Wind_Shear_Model Discrete_Wind_Gust_Model Julian_Date_Conversion --steps 60
Sample data: docs/generated/samples/Robotics__Wind__Wind_Shear_Model.json