Spaceshot Flight Software
The Illinois Space Society's Homemade Rocket Firmware
rk4 Class Reference

Public Member Functions

array< float, 2 > accel (array< float, 2 > u, float rho)
 A function that calculates the acceleration of the rocket at a given altitude and velocity given by the rk4 simulation. More...
 
array< float, 2 > rk4_step (array< float, 2 > state, float dt, float rho)
 A function that propagates the rk4 apogee simulation by one time step. More...
 
array< float, 2 > sim_apogee (array< float, 2 > state, float dt)
 A function that returns the simulated apogee of the rocket from state estimates. More...
 
float cd (float alt, float vel)
 A function that returns the Coefficient of drag at a given altitude and velocity (based on mach number) More...
 

Public Attributes

array< double, 151 > poly
 

Member Function Documentation

◆ accel()

array< float, 2 > rk4::accel ( array< float, 2 >  u,
float  rho 
)

A function that calculates the acceleration of the rocket at a given altitude and velocity given by the rk4 simulation.

Parameters
uan array containing the altitude and vertical velocity from the rk4 apogee simulation
rhothe air density returned from the atmosphere class
Returns
array<float, 2> the velocity and acceleration (fixed frame) due to aerodynamic forces at the current step of the rk4

◆ cd()

float rk4::cd ( float  alt,
float  vel 
)

A function that returns the Coefficient of drag at a given altitude and velocity (based on mach number)

Parameters
altthe current altitude from the kalman filter
velthe current velocity from the kalman filter
Returns
float the Coefficient of drag at the present estimated state

◆ rk4_step()

array< float, 2 > rk4::rk4_step ( array< float, 2 >  state,
float  dt,
float  rho 
)

A function that propagates the rk4 apogee simulation by one time step.

Parameters
statethe rk4 altitude and velocity
dtthe time step size
rhothe density of the air at a given rk4 step altitude
Returns
array<float, 2> the next rk4 state

◆ sim_apogee()

array< float, 2 > rk4::sim_apogee ( array< float, 2 >  state,
float  dt 
)

A function that returns the simulated apogee of the rocket from state estimates.

Parameters
statealtitude and velocity from kalman filter
dtthe time step size
Returns
array<float, 2> the predicted apogee and velocity at that altitude (should be close to zero)

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