Linear Drag

File: linear_drag.py
Author: Marcelo Jacinto (marcelo.jacinto@tecnico.ulisboa.pt)
Description: Computes the forces that should actuate on a rigidbody affected by linear drag
License: BSD-3-Clause. Copyright (c) 2023, Marcelo Jacinto. All rights reserved.

Classes:

LinearDrag

Class that implements linear drag computations afftecting a rigid body.

class pegasus.simulator.logic.dynamics.linear_drag.LinearDrag

Bases: Drag

Class that implements linear drag computations afftecting a rigid body. It inherits the Drag base class.

Methods:

__init__([drag_coefficients])

Receives as input the drag coefficients of the vehicle as a 3x1 vector of constants

update(state, dt)

Method that updates the drag force to be applied on the body frame of the vehicle.

Attributes:

drag

The drag force to be applied on the body frame of the vehicle

__init__(drag_coefficients=[0.0, 0.0, 0.0])

Receives as input the drag coefficients of the vehicle as a 3x1 vector of constants

Parameters:
  • drag_coefficients (list[float]) – The constant linear drag coefficients to used to compute the total drag forces

  • diag (affecting the rigid body. The linear drag is given by) –

  • body (are expressed in the body frame of the rigid) –

update(state, dt)

Method that updates the drag force to be applied on the body frame of the vehicle. The total drag force applied on the body reference frame (FLU convention) is given by diag(dx,dy,dz) * R’ * v where v is the velocity of the vehicle expressed in the inertial frame and R’ * v = velocity_body_frame

Parameters:

state (State) – The current state of the vehicle. dt (float): The time elapsed between the previous and current function calls (s).

Returns:

A list with len==3 containing the drag force to be applied on the rigid body according to a FLU body reference

Return type:

list

property drag

The drag force to be applied on the body frame of the vehicle

Returns:

A list with len==3 containing the drag force to be applied on the rigid body according to a FLU body reference frame, expressed in Newton (N) [dx, dy, dz]

Return type:

list