aerosandbox.dynamics.rigid_body.rigid_2D¶
Submodules¶
Classes¶
Dynamics instance: |
Package Contents¶
- class aerosandbox.dynamics.rigid_body.rigid_2D.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.DynamicsRigidBody3DBodyEulerDynamics 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¶
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:
>>> { >>> "x_e": self.x_e, >>> "u_e": self.u_e, >>> ... >>> }
- property control_variables¶
- 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