stdatm.atmosphere_partials module

Implementation of International Standard Atmosphere with partial derivatives of state parameters with respect to altitude.

class stdatm.atmosphere_partials.AtmosphereWithPartials(altitude: Union[float, Sequence[float]], delta_t: float = 0.0, altitude_in_feet: bool = True)[source]

Bases: stdatm.atmosphere.Atmosphere

Implementation of International Standard Atmosphere for troposphere and stratosphere with derivatives of state parameters with respect to altitude.

Atmosphere properties and partials are provided in the same “shape” as provided altitude:

  • if altitude is given as a float, returned values will be floats

  • if altitude is given as a sequence (list, 1D numpy array, …), returned values will be 1D numpy arrays

  • if altitude is given as nD numpy array, returned values will be nD numpy arrays

The AtmosphereWithPartials class inherits from the Atmosphere class and thus retains its usages. It however adds the computation of the partial derivatives of all state properties with respect to the altitude.

Usage:

>>> from stdatm import AtmosphereWithPartials
>>> pressure = AtmosphereWithPartials(30000).pressure # pressure at 30,000 feet, dISA = 0 K
>>> # pressure at 30,000 feet, dISA = 0 K
>>> partials_pressure_altitude = AtmosphereWithPartials(30000).partial_pressure_altitude

>>> # init for alt. 0, 10,000 and 30,000 feet
>>> atm = AtmosphereWithPartials([0.0,10000.0,30000.0])
>>> # derivative of pressures with respect to altitude for all defined altitudes
>>> atm.partial_pressure_altitude
array([-3.66160356, -2.70401861, -1.36992549])
>>> # derivative of dynamic viscosities with respect to altitude for all defined altitudes
>>> atm.partial_dynamic_viscosity_altitude
array([-9.55961630e-11, -9.88873356e-11, -1.06349854e-10])
Parameters
  • altitude – altitude (units decided by altitude_in_feet)

  • delta_t – temperature increment (°C) applied to whole temperature profile

  • altitude_in_feet – if True, altitude should be provided in feet. Otherwise, it should be provided in meters.

property partial_temperature_altitude: Union[float, numpy.ndarray]

Partial derivative of the temperature in K with respect to the altitude in the unit provided.

property partial_pressure_altitude: Union[float, numpy.ndarray]

Partial derivative of the pressure in Pa with respect to the altitude in the unit provided.

property partial_density_altitude: Union[float, numpy.ndarray]

Partial derivative of the density in kg/m**3 with respect to the altitude in the unit provided.

property partial_speed_of_sound_altitude: Union[float, numpy.ndarray]

Partial derivative of the speed of sound in m/s with respect to the altitude in the unit provided.

property partial_dynamic_viscosity_altitude: Union[float, numpy.ndarray]

Partial derivative of the dynamic viscosity in kg/m/s with respect to the altitude in the unit provided.

property partial_kinematic_viscosity_altitude: Union[float, numpy.ndarray]

Partial derivative of the kinematic viscosity in m**2/s with respect to the altitude in the unit provided.