import%20marimo%0A%0A__generated_with%20%3D%20%220.14.10%22%0Aapp%20%3D%20marimo.App(width%3D%22medium%22)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%20International%20Standard%20Atmosphere%0A%0A%20%20%20%20The%20ISA%20model%20is%20a%20static%20atmosphere%20model%20based%20on%20average%20conditions%20at%20mid%20latitudes%20and%20assuming%20dry%20air.%0A%0A%20%20%20%20The%20atmosphere%20is%20split%20into%20a%20number%20of%20layers%20with%20an%20assumed%20linear%20distribution%20of%20absolute%20tempertaure%20%24T%24%0A%20%20%20%20against%20geopotential%20altitude%20%24h%24.%0A%0A%20%20%20%20Specifying%20a%20geometric%20altitude%20%24z%24%20the%20following%20atmospheric%20properties%20can%20be%20computed%20and%20returned%3A%0A%0A%20%20%20%20%7CAtmospsheric%20Property%7C%0A%20%20%20%20%7C---------------------%7C%0A%20%20%20%20%7CTempertaure%20%24T%24%20%20%20%20%20%20%7C%0A%20%20%20%20%7CPressure%20%24p%24%20%20%20%20%20%20%20%20%20%7C%0A%20%20%20%20%7CDensity%20%24%5Crho%24%20%20%20%20%20%20%20%7C%0A%20%20%20%20%7CSpeed%20of%20sound%20%24c%24%20%20%20%7C%0A%0A%20%20%20%20The%20atmospheric%20properties%20are%20calculated%20using%20a%20set%20of%206%20constants%2C%206%20equations%20and%20the%20layer%20data.%0A%0A%20%20%20%20%23%23%20Non-Standard%20Days%0A%0A%20%20%20%20%3E%20Non-standard%20(hot%20or%20cold)%20days%20are%20modeled%20by%20adding%20a%20specified%20temperature%20delta%20to%20the%20standard%20temperature%20at%20altitude%2C%20but%20pressure%20is%20taken%20as%20the%20standard%20day%20value.%20Density%20and%20viscosity%20are%20recalculated%20at%20the%20resultant%20temperature%20and%20pressure%20using%20the%20ideal%20gas%20equation%20of%20state.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20Constants%0A%0A%20%20%20%20%7CConstant%7CSymbol%7CValue%7CUnits%7C%0A%20%20%20%20%7C--------%7C------%7C-----%7C-----%7C%0A%20%20%20%20%7CGravitational%20acceleration%7C%24g%24%7C%249.80665%24%7C%24m%20%5Ccdot%20s%5E%7B-2%7D%24%7C%0A%20%20%20%20%7CSpecific%20gas%20constant%7C%24R_%7Bspecific%7D%24%7C%24287.0528%24%7C%24J%20%5Ccdot%20kg%5E%7B-1%7D%20%5Ccdot%20K%5E%7B-1%7D%24%7C%0A%20%20%20%20%7CAir%20specific%20heat%20ratio%7C%24%5Cgamma%24%7C%241.4%24%7C%7C%0A%20%20%20%20%7CEarth%20radius%7C%24r_0%24%7C%246356766%24%7Cm%7C%0A%20%20%20%20%7CStandard%20sea-level%20pressure%7C%24p_0%24%7C%24101325%24%7C%24Pa%24%7C%0A%20%20%20%20%7CStandard%20sea-level%20speed%20of%20sound%7C%24a_0%24%7C%24340.294%24%7C%24m%20%5Ccdot%20s%5E%7B-1%7D%24%7C%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20Layers%0A%0A%20%20%20%20%7CLayer%7CLayer%20Name%7CBase%20geopotential%20altitude%20(%24h%20(m)%24)%7CLapse%20rate%20(%24%5E%7B%5Ccirc%7DC%2Fkm%24)%7CBase%20temp%20(%24%5E%7B%5Ccirc%7DC%24)%7CBase%20pressure%20(%24Pa%24)%7C%0A%20%20%20%20%7C-----%7C----------%7C------------------------------------%7C-------------------%7C---------------%7C--------------------%7C%0A%20%20%20%20%7C0%20%20%20%20%7CTroposphere%7C0%7C6.5%7C15.0%7C101%2C325%7C%0A%20%20%20%20%7C1%20%20%20%20%7CTropopause%7C11%2C000%7C0.0%7C-56.5%7C22%2C632%7C%0A%20%20%20%20%7C2%20%20%20%20%7CStratosphere%7C20%2C000%7C-1.0%7C-56.5%7C5%2C474.9%7C%0A%20%20%20%20%7C3%20%20%20%20%7CStratosphere%7C32%2C000%7C-2.8%7C-44.5%7C868.02%7C%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20Equations%0A%0A%20%20%20%20%23%23%23%20Geometric%20and%20Geopotential%20Altitudes%0A%0A%20%20%20%20The%20geopotential%20altitude%20is%20based%20on%20a%20model%20that%20adjusts%20the%20altitude%20to%20include%20the%20variation%20of%20gravity%20with%20height%2C%20%0A%20%20%20%20while%20geometric%20altitude%20is%20the%20standard%20direct%20vertical%20distance%20above%20mean%20sea%20level%20(MSL).%20%20%0A%0A%20%20%20%20%24%24z%20%3D%20%5Cfrac%7Br_0%20h%7D%7Br_0%20-%20h%7D%20%5Ctag%7B1%7D%24%24%0A%0A%20%20%20%20Where%20%24z%24%20is%20the%20geometric%20altitude%20and%20%24h%24%20is%20the%20geopotential%20altitude.%0A%0A%20%20%20%20%23%23%23%20Temperature%0A%0A%20%20%20%20%24T_0%24%20is%20the%20temperature%20at%20start%20of%20the%20layer%2C%20%24a%24%20is%20the%20lapse%20rate%20for%20the%20layer%2C%20%24p_0%24%20is%20the%20atmospheric%0A%20%20%20%20pressure%20at%20the%20start%20of%20the%20layer%20and%20%24dh%24%20is%20the%20altitude%20above%20the%20start%20of%20the%20layer.%0A%0A%20%20%20%20%24%24T%20%3D%20T_0%20%2B%20a%20%5Ccdot%20dh%20%5Ctag%7B2%7D%24%24%0A%0A%20%20%20%20%23%23%23%20Pressure%0A%0A%20%20%20%20When%20the%20lapse%20rate%20is%20not%200.%0A%0A%20%20%20%20%24%24p%20%3D%20p_0%20%5Cleft(%20%5Cfrac%7BT%7D%7BT_0%7D%20%5Cright)%5E%7B-g%2F%7BaR%7D%7D%20%5Ctag%7B3%7D%24%24%0A%0A%20%20%20%20When%20the%20lapse%20rate%20is%200.%0A%0A%20%20%20%20%24%24%5Clarge%20p%20%3D%20p_0%20e%5E%7B%7B-g%20dh%7D%2F%7BRT%7D%7D%20%5Ctag%7B4%7D%24%24%0A%0A%20%20%20%20%23%23%23%20Density%0A%0A%20%20%20%20%24%24%5Crho%20%3D%20%5Cfrac%7Bp%7D%7BRT%7D%20%5Ctag%7B5%7D%24%24%0A%0A%20%20%20%20%23%23%23%20Speed%20of%20Sound%0A%0A%20%20%20%20%24%24c%20%3D%20%5Csqrt%7B%5Cgamma%20R%20T%7D%20%5Ctag%7B6%7D%24%24%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%23%23%20Python%20Implementation%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20math%0A%20%20%20%20from%20collections%20import%20namedtuple%0A%0A%20%20%20%20class%20ISAtmosphere%3A%0A%20%20%20%20%20%20%20%20%23%20Constants%0A%20%20%20%20%20%20%20%20R%20%3D%20287.0528%20%20%20%20%23%20Specific%20gas%20constant%0A%20%20%20%20%20%20%20%20g0%20%3D%209.80665%20%20%20%20%23%20Gravitational%20acceleration%20%0A%20%20%20%20%20%20%20%20gamma%20%3D%201.4%20%20%20%20%20%23%20Air%20specific%20heat%20ratio%0A%20%20%20%20%20%20%20%20r0%20%3D%206356766%20%20%20%20%23%20Earth%20radius%0A%0A%20%20%20%20%20%20%20%20StdSL_pressure%20%3D%20101325%20%20%20%20%20%20%20%20%20%23%20Pa%0A%20%20%20%20%20%20%20%20StdSL_speed_of_sound%20%3D%20340.294%20%20%23%20m%2Fs%0A%0A%20%20%20%20%20%20%20%20%23%20Atmosphere%20bands%0A%20%20%20%20%20%20%20%20AtmosphereBand%20%3D%20namedtuple('AtmosphereBand'%2C%20%5B'start_alt'%2C%20'end_alt'%2C%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20'base_temperature'%2C%20'base_pressure'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20'lapse_rate'%5D)%0A%0A%20%20%20%20%20%20%20%20atmosphere_bands%20%3D%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20AtmosphereBand(0%2C%20%20%20%20%2011000%2C%20288.15%2C%20101325%2C%20%20%20%20-0.0065)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20AtmosphereBand(11000%2C%2020000%2C%20216.65%2C%2022632%2C%20%20%20%20%200.0)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20AtmosphereBand(20000%2C%2032000%2C%20216.65%2C%205474.9%2C%20%20%20%200.001)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%0A%20%20%20%20%20%20%20%20def%20geopotential_altitude(self%2C%20geometric_altitude)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20(geometric_altitude%20*%20self.r0)%2F(self.r0%20%2B%20geometric_altitude)%0A%0A%20%20%20%20%20%20%20%20def%20geometric_altitude(self%2C%20geopotential_altitude)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20(self.r0%20*%20geopotential_altitude)%2F(self.r0%20-%20geopotential_altitude)%0A%0A%20%20%20%20%20%20%20%20def%20state(self%2C%20geometric_altitude%2C%20delta_temp%3D0)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20geopot_altitude%20%3D%20self.geopotential_altitude(geometric_altitude)%0A%20%20%20%20%20%20%20%20%20%20%20%20band_data%20%3D%20self.get_atmosphere_band(geopot_altitude)%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20dh%20%3D%20geopot_altitude%20-%20band_data.start_alt%0A%20%20%20%20%20%20%20%20%20%20%20%20lapse_rate%20%3D%20band_data.lapse_rate%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20temp%20%3D%200%0A%20%20%20%20%20%20%20%20%20%20%20%20pressure%20%3D%200%0A%20%20%20%20%20%20%20%20%20%20%20%20density%20%3D%200%0A%20%20%20%20%20%20%20%20%20%20%20%20speed_of_sound%20%3D%200%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20lapse_rate%20!%3D%200.0%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20temp%20%3D%20band_data.base_temperature%20%2B%20lapse_rate%20*%20dh%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pressure%20%3D%20band_data.base_pressure%20*%20math.pow(temp%2Fband_data.base_temperature%2C%20-self.g0%2F(lapse_rate%20*%20self.R))%0A%20%20%20%20%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20temp%20%3D%20band_data.base_temperature%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pressure%20%3D%20band_data.base_pressure%20*%20math.exp((-self.g0%20*%20dh)%2F(self.R%20*%20temp))%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20density%20%3D%20pressure%2F(self.R%20*%20(temp%20%2B%20delta_temp))%0A%20%20%20%20%20%20%20%20%20%20%20%20speed_of_sound%20%3D%20math.sqrt(self.gamma%20*%20self.R%20*%20(temp%20%2B%20delta_temp))%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20(pressure%2C%20density%2C%20temp%20%2B%20delta_temp%2C%20speed_of_sound)%0A%0A%20%20%20%20%20%20%20%20def%20get_atmosphere_band(self%2C%20geopot_altitude)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20band%20in%20self.atmosphere_bands%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20geopot_altitude%20%3E%3D%20band.start_alt%20and%20geopot_altitude%20%3C%3D%20band.end_alt%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20band%0A%20%20%20%20%20%20%20%20%20%20%20%20raise%20IndexError('Altitude%20out%20of%20range')%0A%0A%20%20%20%20return%20ISAtmosphere%2C%20math%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20Airspeed%20Utility%20Functions%0A%0A%20%20%20%20Utility%20functions%20to%20convert%20between%20calibrated%20airspeed%20(CAS)%2C%20true%20airspeed%20(TAS)%20and%20Mach%20(M)%20are%20provided.%20These%0A%20%20%20%20utlity%20functions%20make%20use%20of%20the%20ISA%20Python%20class%20for%20part%20of%20their%20calculations.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%23%23%23%20CAS%20to%20Mach%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(ISAtmosphere%2C%20math)%3A%0A%20%20%20%20def%20CAStoMach(cas%2C%20altitude)%3A%0A%20%20%20%20%20%20%20%20%22%22%22Convert%20Calibrated%20airspeed%20to%20Mach%20value.%0A%0A%20%20%20%20%20%20%20%20Assume%20m%2Fs%20for%20cas%20and%20m%20for%20altitude.%0A%0A%20%20%20%20%20%20%20%20Based%20on%20the%20formulas%20in%20the%20US%20Air%20Force%20Aircraft%20Performance%20Flight%0A%20%20%20%20%20%20%20%20Testing%20Manual%20(AFFTC-TIH-99-01)%2C%20in%20particular%20sections%204.6%20to%204.8.%0A%0A%20%20%20%20%20%20%20%20The%20subsonic%20and%20supersonic%20Mach%20number%20equations%20are%20used%20with%20the%20simple%0A%20%20%20%20%20%20%20%20substitutions%20of%20(Vc%2Fasl)%20for%20M%20and%20Psl%20for%20P.%20However%2C%20the%20condition%20for%0A%20%20%20%20%20%20%20%20which%20the%20equations%20are%20used%20is%20no%20longer%20subsonic%20(M%20%3C%201)%20or%20supersonic%0A%20%20%20%20%20%20%20%20(M%20%3E%201)%20but%20rather%20calibrated%20airspeed%20being%20less%20or%20greater%20than%20the%0A%20%20%20%20%20%20%20%20speed%20of%20sound%20(%20asl%20)%2C%20standard%20day%2C%20sea%20level%20(661.48%20knots).%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20%20%20%20%20ISA%20%3D%20ISAtmosphere()%0A%0A%20%20%20%20%20%20%20%20pressure%2C%20_%2C%20_%2C%20_%20%3D%20ISA.state(altitude)%0A%0A%20%20%20%20%20%20%20%20if%20cas%20%3C%20ISAtmosphere.StdSL_speed_of_sound%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20Bernoulli's%20compressible%20equation%20(4.11)%0A%20%20%20%20%20%20%20%20%20%20%20%20qc%20%3D%20ISAtmosphere.StdSL_pressure%20*%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20math.pow(1%20%2B%200.2%20*%20math.pow(cas%20%2F%20ISAtmosphere.StdSL_speed_of_sound%2C%202)%2C%203.5)%20-%201%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20Rayleigh's%20supersonic%20pitot%20equation%20(4.16)%0A%20%20%20%20%20%20%20%20%20%20%20%20qc%20%3D%20ISAtmosphere.StdSL_pressure%20*%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(166.9215801%20*%20math.pow(cas%20%2F%20ISAtmosphere.StdSL_speed_of_sound%2C%207))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%20math.pow(7%20*%20math.pow(cas%20%2F%20ISAtmosphere.StdSL_speed_of_sound%2C%202)%20-%201%2C%202.5)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-%201%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%0A%20%20%20%20%20%20%20%20%23%20Solving%20for%20M%20in%20equation%20(4.11)%2C%20also%20used%20as%20initial%20condition%20for%20supersonic%20case%0A%20%20%20%20%20%20%20%20mach%20%3D%20math.sqrt(5%20*%20(math.pow(qc%20%2F%20pressure%20%2B%201%2C%202%20%2F%207)%20-%201))%0A%0A%20%20%20%20%20%20%20%20if%20mach%20%3E%201%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20Iterate%20equation%20(4.22)%20since%20M%20appears%20on%20both%20sides%20of%20the%20equation%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20i%20in%20range(7)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mach%20%3D%200.88128485%20*%20math.sqrt((qc%20%2F%20pressure%20%2B%201)%20*%20math.pow(1%20-%201%20%2F%20(7%20*%20mach%20*%20mach)%2C%202.5))%0A%0A%20%20%20%20%20%20%20%20return%20mach%0A%20%20%20%20return%20(CAStoMach%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%23%23%23%20CAS%20to%20TAS%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(CAStoMach%2C%20ISAtmosphere)%3A%0A%20%20%20%20def%20CAStoTAS(cas%2C%20altitude)%3A%0A%20%20%20%20%20%20%20%20%22%22%22Assume%20m%2Fs%20for%20input%20and%20output%20velocities%20and%20m%20for%20altitude.%22%22%22%0A%0A%20%20%20%20%20%20%20%20mach%20%3D%20CAStoMach(cas%2C%20altitude)%0A%20%20%20%20%20%20%20%20ISA%20%3D%20ISAtmosphere()%0A%20%20%20%20%20%20%20%20_%2C%20_%2C%20_%2C%20speed_of_sound%20%3D%20ISA.state(altitude)%0A%20%20%20%20%20%20%20%20return%20mach%20*%20speed_of_sound%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%23%23%23%20TAS%20to%20CAS%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(ISAtmosphere%2C%20math)%3A%0A%20%20%20%20def%20TAStoCAS(tas%2C%20altitude)%3A%0A%20%20%20%20%20%20%20%20%22%22%22Assume%20m%2Fs%20for%20input%20and%20output%20velocities%20and%20m%20for%20altitude.%22%22%22%0A%0A%20%20%20%20%20%20%20%20ISA%20%3D%20ISAtmosphere()%0A%20%20%20%20%20%20%20%20pressure%2C%20_%2C%20_%2C%20speed_of_sound%20%3D%20ISA.state(altitude)%0A%0A%20%20%20%20%20%20%20%20mach%20%3D%20tas%20%2F%20speed_of_sound%0A%20%20%20%20%20%20%20%20qc%20%3D%20pressure%20*%20(%20math.pow(1%20%2B%200.2*mach**2%2C%207%2F2)%20-%201)%0A%20%20%20%20%20%20%20%20cas%20%3D%20ISA.StdSL_speed_of_sound%20*%20math.sqrt(%205%20*%20(%20math.pow(qc%2FISA.StdSL_pressure%20%2B%201%2C%202%2F7)%20-%201)%20)%20%0A%20%20%20%20%20%20%20%20return%20cas%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20Plotting%20the%20ISA%0A%0A%20%20%20%20The%20plots%20for%20temperature%2C%20pressure%2C%20density%20and%20speed%20of%20sound%20versus%20geometric%20altitude%20are%20produced%20by%20making%20%0A%20%20%20%20use%20of%20the%20ISA%20Python%20class.%20Included%20in%20the%20plots%20are%20outputs%20for%20the%20ISA%20standard%20day%20as%20well%20as%20two%20non-standard%20days.%20%0A%20%20%20%20One%20being%20%2B15C%20above%20standard%20day%20and%20one%20being%20-15C%20below%20standard%20day.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20rf%22%22%22%0A%20%20%20%20%23%23%23%20Temperature%0A%0A%20%20%20%20Effectively%20showing%20the%20linear%20lapse%20rates%20for%20the%20layers.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plotISA)%3A%0A%20%20%20%20plotISA('temps')%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%23%20Speed%20of%20Sound%0A%0A%20%20%20%20Since%20the%20speed%20of%20sound%20is%20proportional%20to%20the%20temperature%20the%20shape%20of%20the%20speed%20of%20sound%20curves%20mirrors%20the%20%0A%20%20%20%20temperature%20curves.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plotISA)%3A%0A%20%20%20%20plotISA('cs')%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%23%23%23%20Density%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plotISA)%3A%0A%20%20%20%20plotISA('densities')%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%23%20Pressure%0A%0A%20%20%20%20Given%20the%20definition%20of%20a%20non-standard%20day%20as%20expected%20the%20pressure%20versus%20altitude%20is%20identical%20for%20all%203%20cases.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plotISA)%3A%0A%20%20%20%20plotISA('pressures')%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%23%23%20Plotting%20Routine%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(ISAtmosphere%2C%20np%2C%20plt)%3A%0A%20%20%20%20def%20plotISA(property)%3A%0A%0A%20%20%20%20%20%20%20%20ISA%20%3D%20ISAtmosphere()%0A%0A%20%20%20%20%20%20%20%20alts%20%3D%20np.linspace(0%2C%2020000%2C%20200)%0A%0A%20%20%20%20%20%20%20%20msTokt%20%3D%201.944012%0A%0A%20%20%20%20%20%20%20%20titles_units%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20'pressures'%3A%20%7B%20'title'%3A%20'Pressure%20vs%20Altitude'%2C%20'xaxis'%3A%20'%24Pa%24'%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20'densities'%3A%20%7B%20'title'%3A%20'Density%20vs%20Altitude'%2C%20'xaxis'%3A%20'%24kg%20%5Ccdot%20m%5E%7B-3%7D%24'%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20'temps'%3A%20%7B%20'title'%3A%20'Temperature%20vs%20Altitude'%2C%20'xaxis'%3A%20'%24%5E%7B%5Ccirc%7DC%24'%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20'cs'%3A%20%7B%20'title'%3A%20'Speed%20of%20Sound%20vs%20Altitude'%2C%20'xaxis'%3A%20'%24kt%24'%7D%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20results%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20'Std'%3A%20%7B%20'toffset'%3A%200%2C%20'pressures'%3A%20%5B%5D%2C%20'densities'%3A%20%5B%5D%2C%20'temps'%3A%20%5B%5D%2C%20'cs'%3A%20%5B%5D%2C%20'color'%3A%20'black'%2C%20'label'%3A%20'Std'%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20'Hot'%3A%20%7B%20'toffset'%3A%2015%2C%20'pressures'%3A%20%5B%5D%2C%20'densities'%3A%20%5B%5D%2C%20'temps'%3A%20%5B%5D%2C%20'cs'%3A%20%5B%5D%2C%20'color'%3A%20'red'%2C%20'label'%3A%20'%2B15C'%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20'Cold'%3A%20%7B%20'toffset'%3A%20-15%2C%20'pressures'%3A%20%5B%5D%2C%20'densities'%3A%20%5B%5D%2C%20'temps'%3A%20%5B%5D%2C%20'cs'%3A%20%5B%5D%2C%20'color'%3A%20'blue'%2C%20'label'%3A%20'-15C'%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20for%20alt%20in%20alts%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20day%20in%20results.keys()%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20tempOffset%20%3D%20results%5Bday%5D%5B'toffset'%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pressure%2C%20density%2C%20temp%2C%20c%20%3D%20ISA.state(alt%2C%20tempOffset)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20results%5Bday%5D%5B'pressures'%5D.append(pressure)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20results%5Bday%5D%5B'densities'%5D.append(density)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20results%5Bday%5D%5B'temps'%5D.append(temp%20-%20272.15)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20results%5Bday%5D%5B'cs'%5D.append(c%20*%20msTokt)%0A%0A%20%20%20%20%20%20%20%20plt.figure()%0A%0A%20%20%20%20%20%20%20%20for%20day%20in%20results.keys()%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20plt.plot(results%5Bday%5D%5Bproperty%5D%2C%20alts%2C%20color%3Dresults%5Bday%5D%5B'color'%5D%2C%20label%3Dresults%5Bday%5D%5B'label'%5D)%0A%0A%20%20%20%20%20%20%20%20plt.title(titles_units%5Bproperty%5D%5B'title'%5D)%0A%20%20%20%20%20%20%20%20plt.xlabel(titles_units%5Bproperty%5D%5B'xaxis'%5D)%0A%20%20%20%20%20%20%20%20plt.ylabel('Geometric%20Altitude%20(m)')%0A%0A%20%20%20%20%20%20%20%20plt.legend()%0A%0A%20%20%20%20%20%20%20%20return%20plt.gca()%0A%20%20%20%20return%20(plotISA%2C)%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20marimo%20as%20mo%0A%20%20%20%20import%20numpy%20as%20np%0A%20%20%20%20import%20matplotlib.pyplot%20as%20plt%0A%20%20%20%20return%20mo%2C%20np%2C%20plt%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
86747a364e5954d1180bea5fae7372a090eb09969ab2521def35b25221fcdbca