Source code for aerosandbox.atmosphere._diff_atmo_functions
importaerosandbox.numpyasnpfromaerosandbox.modeling.interpolationimportInterpolatedModelfromaerosandbox.atmosphere._isa_atmo_functionsimport(pressure_isa,temperature_isa,)# Define the altitudes of knot pointsaltitude_knot_points=np.array([0,5e3,10e3,13e3,18e3,22e3,30e3,34e3,45e3,49e3,53e3,69e3,73e3,77e3,83e3,87e3,]+list(87e3+np.geomspace(5e3,2000e3,11))+list(0-np.geomspace(5e3,5000e3,11)))
[docs]defpressure_differentiable(altitude):""" Computes the pressure at a given altitude with a differentiable model. Args: altitude: Geopotential altitude [m] Returns: Pressure [Pa] """returnnp.exp(interpolated_log_pressure(altitude))
[docs]deftemperature_differentiable(altitude):""" Computes the temperature at a given altitude with a differentiable model. Args: altitude: Geopotential altitude [m] Returns: Temperature [K] """returninterpolated_temperature(altitude)