2
3
4
5
6
7
8
9
10
11
12
13
14
15
17
18
19
20
21
22
23#ifndef FORWARD_EULER_HPP
24#define FORWARD_EULER_HPP
33 template <
typename T,
unsigned int N>
36 ForwardEulerIntegrator(
Rates<T, N>& rate_calculator);
43 void step(T start_time, T end_time,
const std::array<T, N> &start_state, std::array<T, N> &out_state);
48 std::array<T, N> _rates;
51 template <
typename T,
unsigned int N>
55 for(
unsigned int i = 0; i < N; i++) {
60 template <
typename T,
unsigned int N>
62 const std::array<T, N> &start_state,
63 std::array<T, N> &out_state) {
65 Integrator<T, N>::_rate_calculator.calculateRates(start_time, start_state, _rates);
69 for(
unsigned int i = 0; i < N; i++) {
70 out_state[i] = start_state[i] +
_step_size*_rates[i];
Definition ForwardEulerIntegrator.hpp:34
void step(T start_time, T end_time, const std::array< T, N > &start_state, std::array< T, N > &out_state)
Function to step the integrator forward from time start to time end.
Definition ForwardEulerIntegrator.hpp:61
T _step_size
Step size for integrator.
Definition ForwardEulerIntegrator.hpp:46
This class is a base implementation of the integrator. It defines the basic functions and components ...
Definition Integrator.hpp:37