$npx -y skills add matlab/matlab-agentic-toolkit --skill matlab-compute-aerospace-environmentCompute aerospace environment properties including atmosphere (ISA, COESA, NRLMSISE-00, non-standard, CIRA), gravity (spherical harmonic, WGS84, zonal, centrifugal), horizontal wind (HWM), magnetic field (WMM, IGRF), geoid height, geocentric radius, space weather data, planetary
| 1 | # Compute Aerospace Environment |
| 2 | |
| 3 | Calculate environment properties for aerospace vehicle analysis: atmosphere, gravity, wind, magnetic field, geoid, space weather, planetary ephemeris, and Earth orientation using Aerospace Toolbox functions. |
| 4 | |
| 5 | ## When to Use |
| 6 | |
| 7 | - Computing atmospheric properties (temperature, pressure, density, speed of sound) |
| 8 | - Calculating gravity vectors or acceleration for any planet |
| 9 | - Modeling horizontal wind at altitude |
| 10 | - Getting magnetic field components for navigation or compass correction |
| 11 | - Computing geoid height or geocentric radius |
| 12 | - Reading space weather data for NRLMSISE-00 inputs |
| 13 | - Computing planet or Moon positions (ephemeris) |
| 14 | - Getting Earth orientation parameters (polar motion, nutation, UT1-UTC, CIP) |
| 15 | - Any prompt mentioning: atmosphere model, ISA, COESA, NRLMSISE, pressure, temperature, density, speed of sound, gravity model, WGS84, wind model, HWM, magnetic model, WMM, IGRF, geoid, space weather, solar flux, F10.7, Ap index, planet ephemeris, Moon position, Earth nutation, polar motion, UT1, IERS |
| 16 | |
| 17 | ## When NOT to Use |
| 18 | |
| 19 | - Coordinate frame conversions or rotations — use `matlab-convert-aerospace-coordinates` |
| 20 | - Orbital mechanics or trajectory propagation (use ephemeris for positions, not orbit propagation) |
| 21 | - Aerodynamic coefficient calculations |
| 22 | - Simulink environment model blocks — use Aerospace Blockset |
| 23 | |
| 24 | ## Workflow |
| 25 | |
| 26 | 1. **Identify the quantity needed** — use the decision table below |
| 27 | 2. **Call the function** — follow the patterns in this skill for correct syntax |
| 28 | 3. **Verify results** — check units and magnitude are physically reasonable |
| 29 | |
| 30 | ## Decision Table |
| 31 | |
| 32 | | Need | Function | Key Input | |
| 33 | |------|----------|-----------| |
| 34 | | Standard atmosphere (quick) | `atmosisa` | altitude (m) | |
| 35 | | 1976 COESA atmosphere | `atmoscoesa` | altitude (m) | |
| 36 | | NRLMSISE-00 (detailed upper atmosphere) | `atmosnrlmsise00` | alt, lat, lon, year, day, UTsec | |
| 37 | | Non-standard atmosphere (MIL-STD) | `atmosnonstd` | alt + positional string args | |
| 38 | | CIRA 1986 reference atmosphere | `atmoscira` | lat, ctype, coord, month | |
| 39 | | Lapse rate atmosphere (custom) | `atmoslapse` | altitude (m) + 9 physical params | |
| 40 | | Pressure altitude | `atmospalt` | pressure (Pa) | |
| 41 | | Horizontal wind (HWM07/14) | `atmoshwm` | lat, lon, alt + name-value | |
| 42 | | Spherical harmonic gravity (any planet) | `gravitysphericalharmonic` | PCPF [x,y,z] (m) | |
| 43 | | WGS84 gravity (Earth, geodetic) | `gravitywgs84` | h, lat (+ lon, method, flags) | |
| 44 | | Zonal harmonic gravity (any planet) | `gravityzonal` | PCPF [x,y,z] (m) | |
| 45 | | Centrifugal acceleration | `gravitycentrifugal` | PCPF [x,y,z] (m) | |
| 46 | | WMM magnetic field | `wrldmagm` | height(m), lat, lon, decimalYear | |
| 47 | | IGRF magnetic field | `igrfmagm` | height(m), lat, lon, decimalYear, generation | |
| 48 | | Geoid height (undulation) | `geoidheight` | lat, lon | |
| 49 | | Geocentric radius | `geocradius` | geocentric lat (deg) | |
| 50 | | Read space weather CSV | `aeroReadSpaceWeatherData` | CSV file path | |
| 51 | | Extract solar flux / Ap indices | `fluxSolarAndGeomagnetic` | datetime or [year,day,UTCsec], MAT file | |
| 52 | | Planet/Moon position and velocity | `planetEphemeris` | Julian date, center, target | |
| 53 | | Earth nutation angles | `earthNutation` | Julian date | |
| 54 | | Moon libration angles | `moonLibration` | Julian date | |
| 55 | | Earth polar motion | `polarMotion` | UTC (Julian date) | |
| 56 | | Celestial Intermediate Pole adjustment | `deltaCIP` | UTC (Julian date) | |
| 57 | | Difference between UT1 and UTC | `deltaUT1` | UTC (Julian date) | |
| 58 | | Read IERS Earth orientation data | `aeroReadIERSData` | folder path | |
| 59 | |
| 60 | ## Patterns |
| 61 | |
| 62 | ### Standard and COESA Atmosphere |
| 63 | |
| 64 | ```matlab |
| 65 | % International Standard Atmosphere |
| 66 | [T, a, P, rho] = atmosisa(1000); |
| 67 | |
| 68 | % 1976 COESA (valid 0-1000 km) |
| 69 | [T, a, P, rho] = atmoscoesa(1000); |
| 70 | ``` |
| 71 | |
| 72 | ### Pressure Altitude (atmospalt) |
| 73 | |
| 74 | Converts pressure (Pa) to altitude (m) using the International Standard Atmosphere. |
| 75 | |
| 76 | ```matlab |
| 77 | % Pressure altitude at standard sea-level pressure |
| 78 | alt = atmospalt(101325); % returns 0 m |
| 79 | |
| 80 | % Pressure altitude at multiple pressures |
| 81 | alt = atmospalt([101325, 79501, 54048, 26500]); |
| 82 | |
| 83 | % Typical use: convert measured pressure to altitude |
| 84 | measuredPressure_Pa = 75000; |
| 85 | pressureAltitude_m = atmospalt(measuredPressure_Pa); |
| 86 | ``` |
| 87 | |
| 88 | Input: pressure in |