aerosandbox.performance.operating_point ======================================= .. py:module:: aerosandbox.performance.operating_point Attributes ---------- .. autoapisummary:: aerosandbox.performance.operating_point.op_point Classes ------- .. autoapisummary:: aerosandbox.performance.operating_point.OperatingPoint Module Contents --------------- .. py:class:: OperatingPoint(atmosphere = Atmosphere(altitude=0), velocity = 1.0, alpha = 0.0, beta = 0.0, p = 0.0, q = 0.0, r = 0.0) Bases: :py:obj:`aerosandbox.common.AeroSandboxObject` Helper class that provides a standard way to create an ABC using inheritance. .. py:attribute:: atmosphere .. py:attribute:: velocity :value: 1.0 .. py:attribute:: alpha :value: 0.0 .. py:attribute:: beta :value: 0.0 .. py:attribute:: p :value: 0.0 .. py:attribute:: q :value: 0.0 .. py:attribute:: r :value: 0.0 .. py:property:: state :type: Dict[str, Union[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. .. py:method:: get_new_instance_with_state(new_state = None) Creates a new instance of the OperatingPoint class from the given state. :param new_state: 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. .. py:method:: _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: a) manually, or b) by using OperatingPoint.get_new_instance_with_state() Hence, this function is meant for PRIVATE use only - be careful how you use this! .. py:method:: unpack_state(dict_like_state = None) 'Unpacks' a Dict-like state into an array-like that represents the state of the OperatingPoint. :param dict_like_state: Takes in a dict-like representation of the state. Returns: The array representation of the state that you gave. .. py:method:: pack_state(array_like_state = None) 'Packs' an array into a Dict that represents the state of the OperatingPoint. :param array_like_state: Takes in an iterable that must have the same number of entries as the state vector of the OperatingPoint. Returns: The Dict representation of the state that you gave. .. py:method:: __repr__() .. py:method:: __getitem__(index) Indexes one item from each attribute of an OperatingPoint instance. Returns a new OperatingPoint instance. :param index: 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. .. py:method:: __len__() .. py:method:: __array__(dtype='O') Allows NumPy array creation without infinite recursion in __len__ and __getitem__. .. py:method:: dynamic_pressure() Dynamic pressure of the working fluid :returns: Dynamic pressure of the working fluid. [Pa] :rtype: float .. py:method:: 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] .. py:method:: 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] .. py:method:: 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] .. py:method:: mach() Returns the Mach number associated with the current flight condition. .. py:method:: indicated_airspeed() Returns the indicated airspeed associated with the current flight condition, in meters per second. .. py:method:: equivalent_airspeed() Returns the equivalent airspeed associated with the current flight condition, in meters per second. .. py:method:: 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. .. py:method:: 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). :param x_from: x-component of the vector, in `from_axes` frame. :param y_from: y-component of the vector, in `from_axes` frame. :param z_from: z-component of the vector, in `from_axes` frame. :param from_axes: The axes to convert from. :param to_axes: The axes to convert to. Returns: The x-, y-, and z-components of the vector, in `to_axes` frame. Given as a tuple. .. py:method:: compute_rotation_matrix_wind_to_geometry() Computes the 3x3 rotation matrix that transforms from wind axes to geometry axes. Returns: a 3x3 rotation matrix. .. py:method:: compute_freestream_direction_geometry_axes() .. py:method:: compute_freestream_velocity_geometry_axes() .. py:method:: compute_rotation_velocity_geometry_axes(points) .. py:data:: op_point