aerosandbox.dynamics
Submodules
- aerosandbox.dynamics.flight_dynamics
- aerosandbox.dynamics.point_mass
- aerosandbox.dynamics.rigid_body
- aerosandbox.dynamics.utilities
Classes
DynamicsPointMass1DHorizontal | Dynamics instance: |
DynamicsPointMass1DVertical | Dynamics instance: |
DynamicsPointMass2DCartesian | Dynamics instance: |
DynamicsPointMass2DSpeedGamma | Dynamics instance: |
DynamicsPointMass3DCartesian | Dynamics instance: |
DynamicsPointMass3DSpeedGammaTrack | Dynamics instance: |
DynamicsRigidBody2DBody | Dynamics instance: |
DynamicsRigidBody3DBodyEuler | Dynamics instance: |
Package Contents
class aerosandbox.dynamics.DynamicsPointMass1DHorizontal(mass_props=None, x_e=0, u_e=0)
: Bases: aerosandbox.dynamics.point_mass.point_3D.cartesian.DynamicsPointMass3DCartesian
Dynamics instance:
\* simulating a point mass
\* in 1D, oriented horizontally (i.e., the .add\_gravity() method will have no effect)
State variables:
: x\_e: x-position, in Earth axes. [meters]
u\_e: x-velocity, in Earth axes. [m/s]
Control variables:
: Fx\_e: Force along the Earth-x axis. [N]
Parameters:
: - **mass\_props** ([*aerosandbox.weights.mass\_properties.MassProperties*](/u/921f7ad402625b18#aerosandbox-weights-mass-properties-massproperties)) –
- **x\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **u\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
mass\_props
: For each state variable, self.state\_var = state\_var
For each indirect control variable, self.indirect\_control\_var = indirect\_control\_var
For each control variable, self.control\_var = 0
x\_e *= 0*
y\_e *= 0*
z\_e *= 0*
u\_e *= 0*
v\_e *= 0*
w\_e *= 0*
alpha *= 0*
beta *= 0*
bank *= 0*
Fx\_e *= 0*
Fy\_e *= 0*
Fz\_e *= 0*
*property* state*: Dict[str, float | aerosandbox.numpy.ndarray]*
: Returns the state variables of this Dynamics instance as a Dict.
Keys are strings that give the name of the variables.
Values are the variables themselves.
This method should look something like:
: ```default{ "x_e": self.x_e, "u_e": self.u_e, ... }
Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]]
*property* control\_variables*: Dict[str, float | aerosandbox.numpy.ndarray]*
: Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]]
state\_derivatives()
: A function that returns the derivatives with respect to time of the state specified in the state property.
Should return a Dict with the same keys as the state property.
Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]]
<a id="aerosandbox.dynamics.DynamicsPointMass1DVertical"></a> *class* aerosandbox.dynamics.DynamicsPointMass1DVertical(*mass\_props=None*, *z\_e=0*, *w\_e=0*)
: Bases: [`aerosandbox.dynamics.point_mass.point_3D.cartesian.DynamicsPointMass3DCartesian`](/u/b868c3a9353d3d04#aerosandbox-dynamics-point-mass-point-3d-cartesian-dynamicspointmass3dcartesian)
Dynamics instance:
\* simulating a point mass
\* in 1D, oriented vertically (i.e., the .add\_gravity() method will have an effect)
State variables:
: z\_e: z-position, in Earth axes. [meters]
w\_e: z-velocity, in Earth axes. [m/s]
Control variables:
: Fz\_e: Force along the Earth-x axis. [N]
Parameters:
: - **mass\_props** ([*aerosandbox.weights.mass\_properties.MassProperties*](/u/921f7ad402625b18#aerosandbox-weights-mass-properties-massproperties)) –
- **z\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **w\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
mass\_props
: For each state variable, self.state\_var = state\_var
For each indirect control variable, self.indirect\_control\_var = indirect\_control\_var
For each control variable, self.control\_var = 0
x\_e *= 0*
y\_e *= 0*
z\_e *= 0*
u\_e *= 0*
v\_e *= 0*
w\_e *= 0*
alpha *= 0*
beta *= 0*
bank *= 0*
Fx\_e *= 0*
Fy\_e *= 0*
Fz\_e *= 0*
*property* state*: Dict[str, float | aerosandbox.numpy.ndarray]*
: Returns the state variables of this Dynamics instance as a Dict.
Keys are strings that give the name of the variables.
Values are the variables themselves.
This method should look something like:
: ```default
>>> {
>>> "x_e": self.x_e,
>>> "u_e": self.u_e,
>>> ...
>>> } Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]]
*property* control\_variables*: Dict[str, float | aerosandbox.numpy.ndarray]*
: Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]]
state\_derivatives()
: A function that returns the derivatives with respect to time of the state specified in the state property.
Should return a Dict with the same keys as the state property.
Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]] class aerosandbox.dynamics.DynamicsPointMass2DCartesian(mass_props=None, x_e=0, z_e=0, u_e=0, w_e=0, alpha=0)
: Bases: aerosandbox.dynamics.point_mass.point_3D.cartesian.DynamicsPointMass3DCartesian
Dynamics instance:
\* simulating a point mass
\* in 2D
\* with velocity parameterized in Cartesian coordinates
State variables:
: x\_e: x-position, in Earth axes. [meters]
z\_e: z-position, in Earth axes. [meters]
u\_e: x-velocity, in Earth axes. [m/s]
w\_e: z-velocity, in Earth axes. [m/s]
Indirect control variables:
: alpha: Angle of attack. [degrees]
Control variables:
: Fx\_e: Force along the Earth-x axis. [N]
Fz\_e: Force along the Earth-z axis. [N]
Parameters:
: - **mass\_props** ([*aerosandbox.weights.mass\_properties.MassProperties*](/u/921f7ad402625b18#aerosandbox-weights-mass-properties-massproperties)) –
- **x\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **z\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **u\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **w\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **alpha** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
mass\_props
: For each state variable, self.state\_var = state\_var
For each indirect control variable, self.indirect\_control\_var = indirect\_control\_var
For each control variable, self.control\_var = 0
x\_e *= 0*
y\_e *= 0*
z\_e *= 0*
u\_e *= 0*
v\_e *= 0*
w\_e *= 0*
alpha *= 0*
beta *= 0*
bank *= 0*
Fx\_e *= 0*
Fy\_e *= 0*
Fz\_e *= 0*
*property* state*: Dict[str, float | aerosandbox.numpy.ndarray]*
: Returns the state variables of this Dynamics instance as a Dict.
Keys are strings that give the name of the variables.
Values are the variables themselves.
This method should look something like:
: ```default{ "x_e": self.x_e, "u_e": self.u_e, ... }
Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]]
*property* control\_variables*: Dict[str, float | aerosandbox.numpy.ndarray]*
: Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]]
state\_derivatives()
: A function that returns the derivatives with respect to time of the state specified in the state property.
Should return a Dict with the same keys as the state property.
Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]]
<a id="aerosandbox.dynamics.DynamicsPointMass2DSpeedGamma"></a> *class* aerosandbox.dynamics.DynamicsPointMass2DSpeedGamma(*mass\_props=None*, *x\_e=0*, *z\_e=0*, *speed=0*, *gamma=0*, *alpha=0*)
: Bases: [`aerosandbox.dynamics.point_mass.point_3D.speed_gamma_track.DynamicsPointMass3DSpeedGammaTrack`](/u/e8628e94265ea671#aerosandbox-dynamics-point-mass-point-3d-speed-gamma-track-dynamicspointmass3dspeedgammatrack)
Dynamics instance:
\* simulating a point mass
\* in 2D
\* with velocity parameterized in speed-gamma space.
State variables:
: x\_e: x-position, in Earth axes. [meters]
z\_e: z-position, in Earth axes. [meters]
speed: Speed; equivalent to u\_w, the x-velocity in wind axes. [m/s]
gamma: Flight path angle. [rad]
Indirect control variables:
: alpha: Angle of attack. [degrees]
Control variables:
: Fx\_w: Force along the wind-x axis. [N]
Fz\_w: Force along the wind-z axis. [N]
Parameters:
: - **mass\_props** ([*aerosandbox.weights.mass\_properties.MassProperties*](/u/921f7ad402625b18#aerosandbox-weights-mass-properties-massproperties)) –
- **x\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **z\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **speed** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **gamma** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **alpha** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
mass\_props
: For each state variable, self.state\_var = state\_var
For each indirect control variable, self.indirect\_control\_var = indirect\_control\_var
For each control variable, self.control\_var = 0
x\_e *= 0*
y\_e *= 0*
z\_e *= 0*
speed *= 0*
gamma *= 0*
track *= 0*
bank *= 0*
alpha *= 0*
beta *= 0*
Fx\_w *= 0*
Fy\_w *= 0*
Fz\_w *= 0*
*property* state*: Dict[str, float | aerosandbox.numpy.ndarray]*
: Returns the state variables of this Dynamics instance as a Dict.
Keys are strings that give the name of the variables.
Values are the variables themselves.
This method should look something like:
: ```default
>>> {
>>> "x_e": self.x_e,
>>> "u_e": self.u_e,
>>> ...
>>> } Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]]
*property* control\_variables*: Dict[str, float | aerosandbox.numpy.ndarray]*
: Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]]
state\_derivatives()
: A function that returns the derivatives with respect to time of the state specified in the state property.
Should return a Dict with the same keys as the state property.
Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]] class aerosandbox.dynamics.DynamicsPointMass3DCartesian(mass_props=None, x_e=0, y_e=0, z_e=0, u_e=0, v_e=0, w_e=0, alpha=0, beta=0, bank=0)
: Bases: aerosandbox.dynamics.point_mass.common_point_mass._DynamicsPointMassBaseClass
Dynamics instance:
\* simulating a point mass
\* in 3D
\* with velocity parameterized in Cartesian coordinates
State variables:
: x\_e: x-position, in Earth axes. [meters]
y\_e: y-position, in Earth axes. [meters]
z\_e: z-position, in Earth axes. [meters]
u\_e: x-velocity, in Earth axes. [m/s]
v\_e: v-velocity, in Earth axes. [m/s]
w\_e: z-velocity, in Earth axes. [m/s]
Indirect control variables:
: alpha: Angle of attack. [degrees]
beta: Sideslip angle. [degrees]
bank: Bank angle. [radians]
Control variables:
: Fx\_e: Force along the Earth-x axis. [N]
Fy\_e: Force along the Earth-y axis. [N]
Fz\_e: Force along the Earth-z axis. [N]
Parameters:
: - **mass\_props** ([*aerosandbox.weights.mass\_properties.MassProperties*](/u/921f7ad402625b18#aerosandbox-weights-mass-properties-massproperties)) –
- **x\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **y\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **z\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **u\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **v\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **w\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **alpha** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **beta** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **bank** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
mass\_props
: For each state variable, self.state\_var = state\_var
For each indirect control variable, self.indirect\_control\_var = indirect\_control\_var
For each control variable, self.control\_var = 0
x\_e *= 0*
y\_e *= 0*
z\_e *= 0*
u\_e *= 0*
v\_e *= 0*
w\_e *= 0*
alpha *= 0*
beta *= 0*
bank *= 0*
Fx\_e *= 0*
Fy\_e *= 0*
Fz\_e *= 0*
*property* state*: Dict[str, float | aerosandbox.numpy.ndarray]*
: Returns the state variables of this Dynamics instance as a Dict.
Keys are strings that give the name of the variables.
Values are the variables themselves.
This method should look something like:
: ```default{ "x_e": self.x_e, "u_e": self.u_e, ... }
Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]]
*property* control\_variables*: Dict[str, float | aerosandbox.numpy.ndarray]*
: Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]]
state\_derivatives()
: A function that returns the derivatives with respect to time of the state specified in the state property.
Should return a Dict with the same keys as the state property.
Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]]
*property* speed*: float*
: Return type:
: float
*property* gamma
: Returns the flight path angle, in radians.
Positive flight path angle indicates positive vertical speed.
*property* track
: Returns the track angle, in radians.
- Track of 0 == North == aligned with x\_e axis
- Track of np.pi / 2 == East == aligned with y\_e axis
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.
Identical to OperatingPoint.convert\_axes(), but adds in “earth” as a valid axis frame. For more documentation,
see the docstring of OperatingPoint.convert\_axes().
Both from\_axes and to\_axes should be a string, one of:
: - “geometry”
- “body”
- “wind”
- “stability”
- “earth”
Parameters:
: - **x\_from** (*float*) – x-component of the vector, in from\_axes frame.
- **y\_from** (*float*) – y-component of the vector, in from\_axes frame.
- **z\_from** (*float*) – z-component of the vector, in from\_axes frame.
- **from\_axes** (*str*) – The axes to convert from. See above for options.
- **to\_axes** (*str*) – The axes to convert to. See above for options.
Return type:
: Tuple[float, float, float]
Returns: The x-, y-, and z-components of the vector, in to\_axes frame. Given as a tuple.
add\_force(*Fx=0*, *Fy=0*, *Fz=0*, *axes='earth'*)
: Adds a force (in whichever axis system you choose) to this Dynamics instance.
Parameters:
: - **Fx** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) – Force in the x-direction in the axis system chosen. [N]
- **Fy** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) – Force in the y-direction in the axis system chosen. [N]
- **Fz** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) – Force in the z-direction in the axis system chosen. [N]
- **axes** – The axis system that the specified force is in. One of:
\* “geometry”
\* “body”
\* “wind”
\* “stability”
\* “earth”
Return type:
: None
Returns: None (in-place)
<a id="aerosandbox.dynamics.DynamicsPointMass3DSpeedGammaTrack"></a> *class* aerosandbox.dynamics.DynamicsPointMass3DSpeedGammaTrack(*mass\_props=None*, *x\_e=0*, *y\_e=0*, *z\_e=0*, *speed=0*, *gamma=0*, *track=0*, *alpha=0*, *beta=0*, *bank=0*)
: Bases: [`aerosandbox.dynamics.point_mass.common_point_mass._DynamicsPointMassBaseClass`](/u/39b047e923957490#aerosandbox-dynamics-point-mass-common-point-mass-dynamicspointmassbaseclass)
Dynamics instance:
\* simulating a point mass
\* in 3D
\* with velocity parameterized in speed-gamma-track space
State variables:
: x\_e: x-position, in Earth axes. [meters]
y\_e: y-position, in Earth axes. [meters]
z\_e: z-position, in Earth axes. [meters]
speed: Speed; equivalent to u\_w, the x-velocity in wind axes. [m/s]
gamma: Flight path angle. [radians]
track: Track angle. [radians]
> - Track of 0 == North == aligned with x\_e axis
> - Track of np.pi / 2 == East == aligned with y\_e axis
Indirect control variables:
: alpha: Angle of attack. [degrees]
beta: Sideslip angle. [degrees]
bank: Bank angle. [radians]
Control variables:
: Fx\_w: Force along the wind-x axis. [N]
Fy\_w: Force along the wind-y axis. [N]
Fz\_w: Force along the wind-z axis. [N]
Parameters:
: - **mass\_props** ([*aerosandbox.weights.mass\_properties.MassProperties*](/u/921f7ad402625b18#aerosandbox-weights-mass-properties-massproperties)) –
- **x\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **y\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **z\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **speed** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **gamma** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **track** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **alpha** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **beta** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **bank** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
mass\_props
: For each state variable, self.state\_var = state\_var
For each indirect control variable, self.indirect\_control\_var = indirect\_control\_var
For each control variable, self.control\_var = 0
x\_e *= 0*
y\_e *= 0*
z\_e *= 0*
speed *= 0*
gamma *= 0*
track *= 0*
alpha *= 0*
beta *= 0*
bank *= 0*
Fx\_w *= 0*
Fy\_w *= 0*
Fz\_w *= 0*
*property* state*: Dict[str, float | aerosandbox.numpy.ndarray]*
: Returns the state variables of this Dynamics instance as a Dict.
Keys are strings that give the name of the variables.
Values are the variables themselves.
This method should look something like:
: ```default
>>> {
>>> "x_e": self.x_e,
>>> "u_e": self.u_e,
>>> ...
>>> } Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]]
*property* control\_variables*: Dict[str, float | aerosandbox.numpy.ndarray]*
: Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]]
state\_derivatives()
: A function that returns the derivatives with respect to time of the state specified in the state property.
Should return a Dict with the same keys as the state property.
Return type:
: Dict[str, Union[float, aerosandbox.numpy.ndarray]]
*property* u\_e
*property* v\_e
*property* w\_e
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.
Identical to OperatingPoint.convert\_axes(), but adds in “earth” as a valid axis frame. For more documentation,
see the docstring of OperatingPoint.convert\_axes().
Both from\_axes and to\_axes should be a string, one of:
: - “geometry”
- “body”
- “wind”
- “stability”
- “earth”
Parameters:
: - **x\_from** (*float*) – x-component of the vector, in from\_axes frame.
- **y\_from** (*float*) – y-component of the vector, in from\_axes frame.
- **z\_from** (*float*) – z-component of the vector, in from\_axes frame.
- **from\_axes** (*str*) – The axes to convert from. See above for options.
- **to\_axes** (*str*) – The axes to convert to. See above for options.
Return type:
: Tuple[float, float, float]
Returns: The x-, y-, and z-components of the vector, in to\_axes frame. Given as a tuple.
add\_force(*Fx=0*, *Fy=0*, *Fz=0*, *axes='wind'*)
: Adds a force (in whichever axis system you choose) to this Dynamics instance.
Parameters:
: - **Fx** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) – Force in the x-direction in the axis system chosen. [N]
- **Fy** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) – Force in the y-direction in the axis system chosen. [N]
- **Fz** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) – Force in the z-direction in the axis system chosen. [N]
- **axes** – The axis system that the specified force is in. One of:
\* “geometry”
\* “body”
\* “wind”
\* “stability”
\* “earth”
Return type:
: None
Returns: None (in-place) class aerosandbox.dynamics.DynamicsRigidBody2DBody(mass_props=None, x_e=0, z_e=0, u_b=0, w_b=0, theta=0, q=0)
: Bases: aerosandbox.dynamics.rigid_body.rigid_3D.body_euler.DynamicsRigidBody3DBodyEuler
Dynamics instance:
\* simulating a rigid body
\* in 2D
\* with velocity parameterized in body axes
State variables:
: x\_e: x-position, in Earth axes. [meters]
z\_e: z-position, in Earth axes. [meters]
u\_b: x-velocity, in body axes. [m/s]
w\_b: z-velocity, in body axes. [m/s]
theta: pitch angle. [rad]
q: y-angular-velocity, in body axes. [rad/sec]
Control variables:
: Fx\_b: Force along the body-x axis. [N]
Fz\_b: Force along the body-z axis. [N]
My\_b: Moment about the body-y axis. [Nm]
Parameters:
: - **mass\_props** ([*aerosandbox.weights.mass\_properties.MassProperties*](/u/921f7ad402625b18#aerosandbox-weights-mass-properties-massproperties)) –
- **x\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **z\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **u\_b** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **w\_b** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **theta** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **q** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
mass\_props
: For each state variable, self.state\_var = state\_var
For each indirect control variable, self.indirect\_control\_var = indirect\_control\_var
For each control variable, self.control\_var = 0
x\_e *= 0*
y\_e *= 0*
z\_e *= 0*
u\_b *= 0*
v\_b *= 0*
w\_b *= 0*
phi *= 0*
theta *= 0*
psi *= 0*
p *= 0*
q *= 0*
r *= 0*
Fx\_b *= 0*
Fy\_b *= 0*
Fz\_b *= 0*
Mx\_b *= 0*
My\_b *= 0*
Mz\_b *= 0*
hx\_b *= 0*
hy\_b *= 0*
hz\_b *= 0*
*property* state
: Returns the state variables of this Dynamics instance as a Dict.
Keys are strings that give the name of the variables.
Values are the variables themselves.
This method should look something like:
: ```default{ "x_e": self.x_e, "u_e": self.u_e, ... }
*property* control\_variables
state\_derivatives()
: Computes the state derivatives (i.e. equations of motion) for a body in 3D space.
Based on Section 9.8.2 of Flight Vehicle Aerodynamics by Mark Drela.
Returns:
: {
: “xe” : d\_xe,
“ye” : d\_ye,
“ze” : d\_ze,
“u” : d\_u,
“v” : d\_v,
“w” : d\_w,
“phi” : d\_phi,
“theta”: d\_theta,
“psi” : d\_psi,
“p” : d\_p,
“q” : d\_q,
“r” : d\_r,
}
Return type:
: Time derivatives of each of the 12 state variables, given in a dictionary
<a id="aerosandbox.dynamics.DynamicsRigidBody3DBodyEuler"></a> *class* aerosandbox.dynamics.DynamicsRigidBody3DBodyEuler(*mass\_props=None*, *x\_e=0*, *y\_e=0*, *z\_e=0*, *u\_b=0*, *v\_b=0*, *w\_b=0*, *phi=0*, *theta=0*, *psi=0*, *p=0*, *q=0*, *r=0*)
: Bases: [`aerosandbox.dynamics.rigid_body.common_rigid_body._DynamicsRigidBodyBaseClass`](/u/b00fb929966beb88#aerosandbox-dynamics-rigid-body-common-rigid-body-dynamicsrigidbodybaseclass)
Dynamics instance:
\* simulating a rigid body
\* in 3D
\* with velocity parameterized in body axes
\* and angle parameterized in Euler angles
State variables:
: x\_e: x-position, in Earth axes. [meters]
y\_e: y-position, in Earth axes. [meters]
z\_e: z-position, in Earth axes. [meters]
u\_b: x-velocity, in body axes. [m/s]
v\_b: y-velocity, in body axes. [m/s]
w\_b: z-velocity, in body axes. [m/s]
phi: roll angle. Uses yaw-pitch-roll Euler angle convention. [rad]
theta: pitch angle. Uses yaw-pitch-roll Euler angle convention. [rad]
psi: yaw angle. Uses yaw-pitch-roll Euler angle convention. [rad]
p: x-angular-velocity, in body axes. [rad/sec]
q: y-angular-velocity, in body axes. [rad/sec]
r: z-angular-velocity, in body axes. [rad/sec]
Control variables:
: Fx\_b: Force along the body-x axis. [N]
Fy\_b: Force along the body-y axis. [N]
Fz\_b: Force along the body-z axis. [N]
Mx\_b: Moment about the body-x axis. [Nm]
My\_b: Moment about the body-y axis. [Nm]
Mz\_b: Moment about the body-z axis. [Nm]
hx\_b: Angular momentum (e.g., propellers) about the body-x axis. [kg\*m^2/sec]
hy\_b: Angular momentum (e.g., propellers) about the body-y axis. [kg\*m^2/sec]
hz\_b: Angular momentum (e.g., propellers) about the body-z axis. [kg\*m^2/sec]
Parameters:
: - **mass\_props** ([*aerosandbox.weights.mass\_properties.MassProperties*](/u/921f7ad402625b18#aerosandbox-weights-mass-properties-massproperties)) –
- **x\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **y\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **z\_e** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **u\_b** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **v\_b** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **w\_b** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **phi** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **theta** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **psi** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **p** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **q** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
- **r** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
mass\_props
: For each state variable, self.state\_var = state\_var
For each indirect control variable, self.indirect\_control\_var = indirect\_control\_var
For each control variable, self.control\_var = 0
x\_e *= 0*
y\_e *= 0*
z\_e *= 0*
u\_b *= 0*
v\_b *= 0*
w\_b *= 0*
phi *= 0*
theta *= 0*
psi *= 0*
p *= 0*
q *= 0*
r *= 0*
Fx\_b *= 0*
Fy\_b *= 0*
Fz\_b *= 0*
Mx\_b *= 0*
My\_b *= 0*
Mz\_b *= 0*
hx\_b *= 0*
hy\_b *= 0*
hz\_b *= 0*
*property* state
: Returns the state variables of this Dynamics instance as a Dict.
Keys are strings that give the name of the variables.
Values are the variables themselves.
This method should look something like:
: ```default
>>> {
>>> "x_e": self.x_e,
>>> "u_e": self.u_e,
>>> ...
>>> }*property* control\_variables
state\_derivatives()
: Computes the state derivatives (i.e. equations of motion) for a body in 3D space.
Based on Section 9.8.2 of Flight Vehicle Aerodynamics by Mark Drela.
Returns:
: {
: “xe” : d\_xe,
“ye” : d\_ye,
“ze” : d\_ze,
“u” : d\_u,
“v” : d\_v,
“w” : d\_w,
“phi” : d\_phi,
“theta”: d\_theta,
“psi” : d\_psi,
“p” : d\_p,
“q” : d\_q,
“r” : d\_r,
}
Return type:
: Time derivatives of each of the 12 state variables, given in a dictionary
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.
Identical to OperatingPoint.convert\_axes(), but adds in “earth” as a valid axis frame. For more documentation,
see the docstring of OperatingPoint.convert\_axes().
Both from\_axes and to\_axes should be a string, one of:
: - “geometry”
- “body”
- “wind”
- “stability”
- “earth”
Parameters:
: - **x\_from** – x-component of the vector, in from\_axes frame.
- **y\_from** – y-component of the vector, in from\_axes frame.
- **z\_from** – 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.
Returns: The x-, y-, and z-components of the vector, in to\_axes frame. Given as a tuple.
add\_force(*Fx=0*, *Fy=0*, *Fz=0*, *axes='body'*)
: Adds a force (in whichever axis system you choose) to this Dynamics instance.
Parameters:
: - **Fx** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) – Force in the x-direction in the axis system chosen. [N]
- **Fy** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) – Force in the y-direction in the axis system chosen. [N]
- **Fz** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) – Force in the z-direction in the axis system chosen. [N]
- **axes** – The axis system that the specified force is in. One of:
\* “geometry”
\* “body”
\* “wind”
\* “stability”
\* “earth”
Returns: None (in-place)
add\_moment(*Mx=0*, *My=0*, *Mz=0*, *axes='body'*)
: Adds a moment (in whichever axis system you choose) to this Dynamics instance.
Parameters:
: - **Mx** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) – Moment about the x-axis in the axis system chosen. Assumed these moments are applied about the center of mass. [Nm]
- **My** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) – Moment about the y-axis in the axis system chosen. Assumed these moments are applied about the center of mass. [Nm]
- **Mz** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) – Moment about the z-axis in the axis system chosen. Assumed these moments are applied about the center of mass. [Nm]
- **axes** – The axis system that the specified moment is in. One of:
\* “geometry”
\* “body”
\* “wind”
\* “stability”
\* “earth”
Returns: None (in-place)
*property* speed
: The speed of the object, expressed as a scalar.
*property* alpha
: The angle of attack, in degrees.
*property* beta
: The sideslip angle, in degrees.