JSim 2026.06.01-p(1)
Loading...
Searching...
No Matches
frcsim::aerodynamics::SpinDecayModel Class Reference

#include <spin_decay_model.hpp>

Public Member Functions

 SpinDecayModel (const MagnusModel &magnus_model=MagnusModel())
 Constructs a spin decay model.
Vector3 step (const Vector3 &omegaLocal, const Vector3 &velocityWorld, const Quaternion &orientation, double dt) const noexcept
 Advances angular velocity forward in time.
void setLinearDecay (double k) noexcept
 Sets linear angular decay coefficient.
void setVelocityCoupling (double k) noexcept
 Sets velocity-coupled damping coefficient.
void setNonlinearDecay (double k) noexcept
 Sets nonlinear angular decay coefficient.
void setRadiusVector (const Vector3 &r) noexcept
 Sets radius (lever arm) used for Magnus torque calculation.

Constructor & Destructor Documentation

◆ SpinDecayModel()

frcsim::aerodynamics::SpinDecayModel::SpinDecayModel ( const MagnusModel & magnus_model = MagnusModel())
inlineexplicit

Constructs a spin decay model.

Parameters
magnus_modelExternal Magnus force model used for torque coupling
Note
Explicit to prevent unintended implicit conversions.

Member Function Documentation

◆ setLinearDecay()

void frcsim::aerodynamics::SpinDecayModel::setLinearDecay ( double k)
inlinenoexcept

Sets linear angular decay coefficient.

Parameters
kLinear damping coefficient

◆ setNonlinearDecay()

void frcsim::aerodynamics::SpinDecayModel::setNonlinearDecay ( double k)
inlinenoexcept

Sets nonlinear angular decay coefficient.

Parameters
kNonlinear damping coefficient (scales with angular magnitude)

◆ setRadiusVector()

void frcsim::aerodynamics::SpinDecayModel::setRadiusVector ( const Vector3 & r)
inlinenoexcept

Sets radius (lever arm) used for Magnus torque calculation.

Parameters
rRadius vector in body frame

◆ setVelocityCoupling()

void frcsim::aerodynamics::SpinDecayModel::setVelocityCoupling ( double k)
inlinenoexcept

Sets velocity-coupled damping coefficient.

Parameters
kCoupling coefficient with linear velocity magnitude

◆ step()

Vector3 frcsim::aerodynamics::SpinDecayModel::step ( const Vector3 & omegaLocal,
const Vector3 & velocityWorld,
const Quaternion & orientation,
double dt ) const
inlinenoexcept

Advances angular velocity forward in time.

Performs:

  • Frame transformation (body → world)
  • Damping calculations (linear, velocity-coupled, nonlinear)
  • Magnus torque computation via MagnusModel
  • Time integration in world frame
  • Transformation back to body frame
Parameters
omegaLocalAngular velocity in body frame
velocityWorldLinear velocity in world frame
orientationBody orientation as quaternion
dtTime step (seconds)
Returns
Updated angular velocity in body frame

Linear damping proportional to angular velocity

Velocity-coupled damping scales with linear speed

Nonlinear damping scales with angular magnitude

Magnus force computed from external model. This avoids duplicating aerodynamic logic.

Torque generated via lever arm cross force


The documentation for this class was generated from the following file: