3 #include <fluxionum/ParametricIterativeEulerMethod.h>
24 template <
typename A,
typename B>
41 arma::Col<A>
const &
ta;
47 arma::Mat<B>
const &
ya;
72 arma::Col<B>
const &
y0,
73 arma::Col<A>
const &
ta,
74 arma::Mat<B>
const &
ya,
93 arma::Col<B>
eval(A
const &h)
override{
97 if((
i<
ta.n_elem-1) && (th >=
ta.at(
i+1))){
98 for(
size_t j =
ta.n_elem-1 ; j >
i ; --j){
100 tdiff = h-(
ta.at(j)-
t);
102 y =
ya.row(j).as_col();
Fixed parametric iterative Euler method.
Definition: FixedParametricIterativeEulerMethod.h:27
void setCurrentPieceIndex(size_t const i)
Set the index identifying the current piece.
Definition: FixedParametricIterativeEulerMethod.h:131
void restart() override
Definition: FixedParametricIterativeEulerMethod.h:115
FixedParametricIterativeEulerMethod(Function< A, arma::Col< B >> &dydt, A const &t0, arma::Col< B > const &y0, arma::Col< A > const &ta, arma::Mat< B > const &ya, size_t const i=0)
FixedParametricIterativeEulerMethod default constructor.
Definition: FixedParametricIterativeEulerMethod.h:69
arma::Col< A > const & ta
The frontiers such that . For the last frontier, the interval is .
Definition: FixedParametricIterativeEulerMethod.h:41
arma::Col< B > eval(A const &h) override
Compute the parametric iterative Euler method but considering given fixed frontiers.
Definition: FixedParametricIterativeEulerMethod.h:93
arma::Mat< B > const & ya
The value of at each of the frontiers such that .
Definition: FixedParametricIterativeEulerMethod.h:47
size_t i
The index of the current piece.
Definition: FixedParametricIterativeEulerMethod.h:55
size_t getCurrentPieceIndex() const
Obtain the index identifying the current piece.
Definition: FixedParametricIterativeEulerMethod.h:126
Abstract class representing a function.
Definition: Function.h:27
Parametric iterative Euler method.
Definition: ParametricIterativeEulerMethod.h:27
virtual void restart()
Restart the ParametricIterativeEulerMethod so it is at its initial state again .
Definition: ParametricIterativeEulerMethod.h:112
arma::Col< B > y
The current value of .
Definition: ParametricIterativeEulerMethod.h:61
arma::Col< B > y0
The initial value of , .
Definition: ParametricIterativeEulerMethod.h:55
Function< A, arma::Col< B > > & dydt
Reference to the parametric derivative function.
Definition: ParametricIterativeEulerMethod.h:39
arma::Col< B > eval(A const &h) override
Iteratively compute the next value using Euler method.
Definition: ParametricIterativeEulerMethod.h:102
A t
The current value of .
Definition: ParametricIterativeEulerMethod.h:50
A t0
The initial value of , .
Definition: ParametricIterativeEulerMethod.h:44