Post · 5 min read· pp. 923–927

aerosandbox.performance.operating_point

Attributes

Classes

OperatingPointHelper class that provides a standard way to create an ABC using

Module Contents

class aerosandbox.performance.operating_point.OperatingPoint(atmosphere=Atmosphere(altitude=0), velocity=1.0, alpha=0.0, beta=0.0, p=0.0, q=0.0, r=0.0) : Bases: aerosandbox.common.AeroSandboxObject

code
Helper class that provides a standard way to create an ABC using
inheritance.

Parameters:
:   - **atmosphere** ([*aerosandbox.Atmosphere*](/u/e98c1a890dad6c0c#aerosandbox-atmosphere)) –
    - **velocity** (*float*) –
    - **alpha** (*float*) –
    - **beta** (*float*) –
    - **p** (*float*) –
    - **q** (*float*) –
    - **r** (*float*) –

atmosphere

velocity *= 1.0*

alpha *= 0.0*

beta *= 0.0*

p *= 0.0*

q *= 0.0*

r *= 0.0*

*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*)
:   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*)
:   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:

    > 1. manually, or
    > 2. 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*)
:   ‘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*)
:   ‘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.

\_\_repr\_\_()
:   Return type:
    :   str

\_\_getitem\_\_(*index*)
:   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.

\_\_len\_\_()

\_\_array\_\_(*dtype='O'*)
:   Allows NumPy array creation without infinite recursion in \_\_len\_\_ and \_\_getitem\_\_.

dynamic\_pressure()
:   Dynamic pressure of the working fluid
    :returns: Dynamic pressure of the working fluid. [Pa]
    :rtype: float

total\_pressure()
:   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()
:   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*)
:   Computes a Reynolds number with respect to a given reference length.
    :param reference\_length: A reference length you choose [m]
    :return: Reynolds number [unitless]

mach()
:   Returns the Mach number associated with the current flight condition.

indicated\_airspeed()
:   Returns the indicated airspeed associated with the current flight condition, in meters per second.

equivalent\_airspeed()
:   Returns the equivalent airspeed associated with the current flight condition, in meters per second.

energy\_altitude()
:   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*)
:   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.

compute\_rotation\_matrix\_wind\_to\_geometry()
:   Computes the 3x3 rotation matrix that transforms from wind axes to geometry axes.

    Returns: a 3x3 rotation matrix.

    Return type:
    :   aerosandbox.numpy.ndarray

compute\_freestream\_direction\_geometry\_axes()

compute\_freestream\_velocity\_geometry\_axes()

compute\_rotation\_velocity\_geometry\_axes(*points*)

aerosandbox.performance.operating_point.op_point