aerosandbox.performance
#
Submodules#
Package Contents#
Classes#
Helper class that provides a standard way to create an ABC using |
- class aerosandbox.performance.OperatingPoint(atmosphere=Atmosphere(altitude=0), velocity=1.0, alpha=0.0, beta=0.0, p=0.0, q=0.0, r=0.0)[source]#
Bases:
aerosandbox.common.AeroSandboxObject
Helper class that provides a standard way to create an ABC using inheritance.
- Parameters:
atmosphere (aerosandbox.Atmosphere) –
velocity (float) –
alpha (float) –
beta (float) –
p (float) –
q (float) –
r (float) –
- property state: Dict[str, float | aerosandbox.numpy.ndarray]#
Returns the state variables of this OperatingPoint instance as a Dict.
Keys are strings that give the name of the variables. Values are the variables themselves.
- Return type:
Dict[str, Union[float, aerosandbox.numpy.ndarray]]
- get_new_instance_with_state(new_state=None)[source]#
Creates a new instance of the OperatingPoint class from the given state.
- Parameters:
new_state (Union[Dict[str, Union[float, aerosandbox.numpy.ndarray]], List, Tuple, aerosandbox.numpy.ndarray]) – The new state to be used for the new instance. Ideally, this is represented as a Dict in identical format to the state of a OperatingPoint instance.
Returns: A new instance of this same OperatingPoint class.
- _set_state(new_state=None)[source]#
Force-overwrites all state variables with a new set (either partial or complete) of state variables.
Warning: this is not the intended public usage of OperatingPoint instances. If you want a new state yourself, you should instantiate a new one either:
manually, or
by using OperatingPoint.get_new_instance_with_state()
Hence, this function is meant for PRIVATE use only - be careful how you use this!
- Parameters:
new_state (Union[Dict[str, Union[float, aerosandbox.numpy.ndarray]], List, Tuple, aerosandbox.numpy.ndarray]) –
- unpack_state(dict_like_state=None)[source]#
‘Unpacks’ a Dict-like state into an array-like that represents the state of the OperatingPoint.
- Parameters:
dict_like_state (Dict[str, Union[float, aerosandbox.numpy.ndarray]]) – Takes in a dict-like representation of the state.
- Return type:
Tuple[Union[float, aerosandbox.numpy.ndarray]]
Returns: The array representation of the state that you gave.
- pack_state(array_like_state=None)[source]#
‘Packs’ an array into a Dict that represents the state of the OperatingPoint.
- Parameters:
array_like_state (Union[List, Tuple, aerosandbox.numpy.ndarray]) – Takes in an iterable that must have the same number of entries as the state vector of the OperatingPoint.
- Return type:
Dict[str, Union[float, aerosandbox.numpy.ndarray]]
Returns: The Dict representation of the state that you gave.
- __getitem__(index)[source]#
Indexes one item from each attribute of an OperatingPoint instance. Returns a new OperatingPoint instance.
- Parameters:
index (Union[int, slice]) – The index that is being called; e.g.,: >>> first_op_point = op_point[0]
Returns: A new OperatingPoint instance, where each attribute is subscripted at the given value, if possible.
- __array__(dtype='O')[source]#
Allows NumPy array creation without infinite recursion in __len__ and __getitem__.
- dynamic_pressure()[source]#
Dynamic pressure of the working fluid :returns: Dynamic pressure of the working fluid. [Pa] :rtype: float
- total_pressure()[source]#
Total (stagnation) pressure of the working fluid.
Assumes a calorically perfect gas (i.e. specific heats do not change across the isentropic deceleration).
Note that total pressure != static pressure + dynamic pressure, due to compressibility effects.
Returns: Total pressure of the working fluid. [Pa]
- total_temperature()[source]#
Total (stagnation) temperature of the working fluid.
Assumes a calorically perfect gas (i.e. specific heats do not change across the isentropic deceleration).
Returns: Total temperature of the working fluid [K]
- reynolds(reference_length)[source]#
Computes a Reynolds number with respect to a given reference length. :param reference_length: A reference length you choose [m] :return: Reynolds number [unitless]
- indicated_airspeed()[source]#
Returns the indicated airspeed associated with the current flight condition, in meters per second.
- equivalent_airspeed()[source]#
Returns the equivalent airspeed associated with the current flight condition, in meters per second.
- energy_altitude()[source]#
Returns the energy altitude associated with the current flight condition, in meters.
The energy altitude is the altitude at which a stationary aircraft would have the same total energy (kinetic + gravitational potential) as the aircraft at the current flight condition.
- convert_axes(x_from, y_from, z_from, from_axes, to_axes)[source]#
Converts a vector [x_from, y_from, z_from], as given in the from_axes frame, to an equivalent vector [x_to, y_to, z_to], as given in the to_axes frame.
- Both from_axes and to_axes should be a string, one of:
“geometry”
“body”
“wind”
“stability”
This whole function is vectorized, both over the vector and the OperatingPoint (e.g., a vector of OperatingPoint.alpha values)
Wind axes rotations are taken from Eq. 6.7 in Sect. 6.2.2 of Drela’s Flight Vehicle Aerodynamics textbook, with axes corrections to go from [D, Y, L] to true wind axes (and same for geometry to body axes).
- Parameters:
x_from (Union[float, aerosandbox.numpy.ndarray]) – x-component of the vector, in from_axes frame.
y_from (Union[float, aerosandbox.numpy.ndarray]) – y-component of the vector, in from_axes frame.
z_from (Union[float, aerosandbox.numpy.ndarray]) – z-component of the vector, in from_axes frame.
from_axes (str) – The axes to convert from.
to_axes (str) – The axes to convert to.
- Return type:
Tuple[float, float, float]
Returns: The x-, y-, and z-components of the vector, in to_axes frame. Given as a tuple.