:py:mod:`multirotor.physics` ============================ .. py:module:: multirotor.physics Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: multirotor.physics.thrustEqn multirotor.physics.thrust multirotor.physics.torque multirotor.physics._apply_forces_torques Attributes ~~~~~~~~~~ .. autoapisummary:: multirotor.physics.apply_forces_torques .. py:function:: thrustEqn(vi, *prop_params) .. py:function:: thrust(prop_speed, airstream_velocity, R, A, rho, a, b, c, eta, theta0, theta1) -> float .. py:function:: torque(position_vector: numpy.ndarray, force: numpy.ndarray, moment_of_inertia: float, prop_angular_acceleration: float, drag_coefficient: float, prop_angular_velocity: float, clockwise: int) -> numpy.ndarray Calculates the torque acting on the three body axes (roll, pitch, yaw), due to a single propeller. Parameters ---------- position_vector : np.ndarray Position vector of force, relative to center of mass. If multiple vectors, should be in shape 3 x n_vectors. force : np.ndarray Force vector acting at that position (nominally thrust). If multiple vectors, should be in shape 3 x n_vectors. moment_of_inertia : float Moment of inertia of the body. prop_angular_acceleration : float Angular acceleration experienced by propeller. drag_coefficient : float The drag coefficient of propeller. prop_angular_velocity : float Propeller speed (rad/s) clockwise : int Whether propeller is spinning clockwise or counter clockwise. Returns ------- np.ndarray The torque due to the propeller acting on the center of mass. .. py:function:: _apply_forces_torques(forces: numpy.ndarray, torques: numpy.ndarray, x: numpy.ndarray, g: float, mass: float, inertia_matrix: numpy.matrix, inertia_matrix_inverse: numpy.matrix) -> numpy.ndarray Given forces and torqes, return the rate of change of state. Parameters ---------- forces : np.ndarray Forces acting in the body frame. torques : np.ndarray Torques acting in the body frame. x : np.ndarray State of the vehicle. g : float Gravitational acceleration. mass : float Mass of the vehicle. inertia_matrix : np.matrix Inertial matrix. inertia_matrix_inverse : np.matrix Inverse of inertial matrix. Returns ------- np.ndarray The rate of change of state d(state)/dt .. py:data:: apply_forces_torques