aerosandbox.dynamics.rigid_body.rigid_2D.body

Attributes

dyn

Classes

DynamicsRigidBody2DBody

Dynamics instance:

Module Contents

class aerosandbox.dynamics.rigid_body.rigid_2D.body.DynamicsRigidBody2DBody(mass_props=None, x_e=0, z_e=0, u_b=0, w_b=0, theta=0, q=0)[source]

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) –

  • 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[source]

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[source]
y_e = 0[source]
z_e = 0[source]
u_b = 0[source]
v_b = 0[source]
w_b = 0[source]
phi = 0[source]
theta = 0[source]
psi = 0[source]
p = 0[source]
q = 0[source]
r = 0[source]
Fx_b = 0[source]
Fy_b = 0[source]
Fz_b = 0[source]
Mx_b = 0[source]
My_b = 0[source]
Mz_b = 0[source]
hx_b = 0[source]
hy_b = 0[source]
hz_b = 0[source]
property state[source]

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:
>>> {
>>>     "x_e": self.x_e,
>>>     "u_e": self.u_e,
>>>     ...
>>> }
property control_variables[source]
state_derivatives()[source]

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

aerosandbox.dynamics.rigid_body.rigid_2D.body.dyn[source]