22#ifndef INTEGRATOR_RK4_HPP
23#define INTEGRATOR_RK4_HPP
42 int16
step(floating_point start_time, floating_point end_time,
const std::array<floating_point, N> &start_state, std::array<floating_point, N> &out_state)
override;
53 void configureForStep(floating_point start_time, floating_point end_time,
const std::array<floating_point, N> &start_state);
57 int16
calculateK1(std::array<floating_point, N> &state_for_k2);
62 int16
calculateK2(
const std::array<floating_point, N> &state_in_k2, std::array<floating_point, N> &state_for_k3);
67 int16
calculateK3(
const std::array<floating_point, N> &state_in_k2, std::array<floating_point, N> &state_for_k4);
71 int16
calculateK4(
const std::array<floating_point, N> &state_in_k4);
87 std::array<floating_point, N>
_k1;
88 std::array<floating_point, N>
_k2;
89 std::array<floating_point, N>
_k3;
90 std::array<floating_point, N>
_k4;
108 for(uint32 i = 0; i < N; i++) {
119 const std::array<floating_point, N> &start_state) {
126 for(uint32 i = 0; i < N; i++) {
137 for(uint32 i = 0; i < N; i++) {
145 std::array<floating_point, N> &state_for_k3) {
150 for(uint32 i = 0; i < N; i++) {
158 std::array<floating_point, N> &state_for_k4) {
163 for(uint32 i = 0; i < N; i++) {
178 for(uint32 i = 0; i < N; i++) {
185 const std::array<floating_point, N> &start_state,
186 std::array<floating_point, N> &out_state) {
Integrator(Rates< N > &rate_calculator)
Constructor for the integrator.
Definition Integrator.hpp:60
Rates< N > & _rate_calculator
Reference to dynamics object that calculates rates.
Definition Integrator.hpp:56
std::array< floating_point, N > _start_state
Definition RK4Integrator.hpp:84
std::array< floating_point, N > _k3
Definition RK4Integrator.hpp:89
floating_point _step_average
Definition RK4Integrator.hpp:79
floating_point _full_step_size
Step size for integrator.
Definition RK4Integrator.hpp:77
floating_point _end_time
Definition RK4Integrator.hpp:83
int16 _error
Error code.
Definition RK4Integrator.hpp:93
std::array< floating_point, N > _k2
Definition RK4Integrator.hpp:88
floating_point _start_time
Initial state tracking.
Definition RK4Integrator.hpp:82
void getValueEndStep(std::array< floating_point, N > &end_state)
Calculation of final integrated step at the end of state.
Definition RK4Integrator.hpp:177
int16 calculateK1(std::array< floating_point, N > &state_for_k2)
Function to calculate k1.
Definition RK4Integrator.hpp:132
int16 calculateK2(const std::array< floating_point, N > &state_in_k2, std::array< floating_point, N > &state_for_k3)
Function to calculate k2.
Definition RK4Integrator.hpp:144
int16 calculateK4(const std::array< floating_point, N > &state_in_k4)
Function to calculate k4.
Definition RK4Integrator.hpp:170
std::array< floating_point, N > _k1
RK4 step rate values k1, k2, k3, k4 and var to calc average rate.
Definition RK4Integrator.hpp:87
floating_point _half_step_size
Definition RK4Integrator.hpp:78
int16 calculateK3(const std::array< floating_point, N > &state_in_k2, std::array< floating_point, N > &state_for_k4)
Function to calculate k3.
Definition RK4Integrator.hpp:157
RK4Integrator(Rates< N > &rate_calculator)
Definition RK4Integrator.hpp:98
int16 step(floating_point start_time, floating_point end_time, const std::array< floating_point, N > &start_state, std::array< floating_point, N > &out_state) override
Definition RK4Integrator.hpp:184
void configureForStep(floating_point start_time, floating_point end_time, const std::array< floating_point, N > &start_state)
Function to configure a full integration step.
Definition RK4Integrator.hpp:118
int16 _saved_warning
Definition RK4Integrator.hpp:94
std::array< floating_point, N > _k4
Definition RK4Integrator.hpp:90
#define NO_ERROR
Error code in the case where matrix math executed successfully.
Definition clockwerkerrors.h:34
Definition DeadReckon.cpp:20