You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The purpose is to finalize the implementation of the Python classes responsible for tracking the state of the boat. This encompasses kinematic information regarding the boat's position, velocity, and acceleration in both global and relative reference frames. For more detailed information on the reference frames utilized, please refer to this confluence page.
Description
You will accomplish the following tasks within boat_simulator/nodes/physics_engine/model.py.
Modify the BoatState constructor to include:
timestep: A scalar value representing the time interval used for calculations, expressed in seconds ($s$).
mass: The total mass of the boat, expressed in kilograms ($kg$).
inertia: The boat's inertia, expressed in kilograms-meters squared ($kg\cdot m^2$).
air_density: A scalar representing the density of air, expressed in kilograms per cubic meter $\left(\dfrac{kg}{m^3}\right)$.
water_density: A scalar representing the density of water, expressed in kilograms per cubic meter $\left(\dfrac{kg}{m^3}\right)$.
Add 2 instances of MediumForceComputation as attributes:
For sail forces, using air density provided in constructor.
For rudder forces, using water density provided in constructor.
(You can find the necessary lift/drag coefficients and areas in boat_simulator/common/constants.py.)
Implement compute_net_force_and_torque to calculate the total force and torque:
Calculate apparent wind and water velocities by subtracting the boat's velocity from the respective true velocities.
Use the compute method from MediumForceComputation to obtain forces on the sail and rudder.
Calculate hull drag force as the product of boat velocity and hull drag factor (hull drag factor can be found in boat_simulator/common/constants.py).
Determine total torque by summing the moments produced by the sail and rudder forces, accounting for the respective distances from the pivot point and the angles.
Torque from the Sail Force: $\tau_{sail} = F_{sail} \times d_{sail} \times \sin(\alpha_{sail})$
Torque from the Rudder Force: $\tau_{rudder} = F_{rudder} \times d_{rudder} \times \sin(\alpha_{rudder})$
Total Torque: $\tau_{total} = \tau_{sail} + \tau_{rudder}$
Where: $F_{sail}$ and $F_{rudder}$: Magnitude of the lift and drag force on the sail and rudder respectively. $d_{sail}$ and $d_{rudder}$: Distance from the sail/rudder's centre of effort to the pivot point. $\alpha_{sail}$ and $\alpha_{rudder}$: Angle of attack of the sail and rudder respectively.
Tests
Add your unit tests to tests/unit/nodes/physics_engine/test_model.py. Utilize the pytest API for testing, which is already installed.
Purpose
The purpose is to finalize the implementation of the Python classes responsible for tracking the state of the boat. This encompasses kinematic information regarding the boat's position, velocity, and acceleration in both global and relative reference frames. For more detailed information on the reference frames utilized, please refer to this confluence page.
Description
You will accomplish the following tasks within
boat_simulator/nodes/physics_engine/model.py
.Modify the
BoatState
constructor to include:timestep
: A scalar value representing the time interval used for calculations, expressed in seconds (mass
: The total mass of the boat, expressed in kilograms (inertia
: The boat's inertia, expressed in kilograms-meters squared (air_density
: A scalar representing the density of air, expressed in kilograms per cubic meterwater_density
: A scalar representing the density of water, expressed in kilograms per cubic meterAdd 2 instances of
MediumForceComputation
as attributes:(You can find the necessary lift/drag coefficients and areas in
boat_simulator/common/constants.py
.)Implement
compute_net_force_and_torque
to calculate the total force and torque:Calculate apparent wind and water velocities by subtracting the boat's velocity from the respective true velocities.
Use the
compute
method fromMediumForceComputation
to obtain forces on the sail and rudder.Calculate hull drag force as the product of boat velocity and hull drag factor (hull drag factor can be found in
boat_simulator/common/constants.py
).Determine total torque by summing the moments produced by the sail and rudder forces, accounting for the respective distances from the pivot point and the angles.
Torque from the Sail Force:$\tau_{sail} = F_{sail} \times d_{sail} \times \sin(\alpha_{sail})$ $\tau_{rudder} = F_{rudder} \times d_{rudder} \times \sin(\alpha_{rudder})$ $\tau_{total} = \tau_{sail} + \tau_{rudder}$
Torque from the Rudder Force:
Total Torque:
Where:
$F_{sail}$ and $F_{rudder}$ : Magnitude of the lift and drag force on the sail and rudder respectively.
$d_{sail}$ and $d_{rudder}$ : Distance from the sail/rudder's centre of effort to the pivot point.
$\alpha_{sail}$ and $\alpha_{rudder}$ : Angle of attack of the sail and rudder respectively.
Tests
Add your unit tests to
tests/unit/nodes/physics_engine/test_model.py
. Utilize the pytest API for testing, which is already installed.Resources
The text was updated successfully, but these errors were encountered: