13 assert(time_steps.size() >= p);
16 Vector<double> times(p + 1);
17 for (
unsigned int i = 0; i < p + 1; ++i)
20 for (
unsigned int j = 0; j < i; ++j)
21 times[i] -= time_steps[j];
25 Vector<double> alpha(p + 1);
28 for (
unsigned int j = 1; j < p + 1; ++j)
31 for (
unsigned int i = 1; i < j; ++i)
32 factor *= times[0] - times[i];
34 Vector<double> term(p + 1);
35 term.equ(factor,
delta(p, 0, j, times));
66 const Vector<double> ×)
70 Vector<double> arr(order + 1);
77 Vector<double> delta_1 =
delta(order, n, j - 1, times);
78 Vector<double> delta_2 =
delta(order, n + 1, j - 1, times);
79 Vector<double> delta_sol(order + 1);
80 for (
unsigned int i_del = 0; i_del < order + 1; ++i_del)
82 (delta_1[i_del] - delta_2[i_del]) / (times[n] - times[n + j]);
Vector< double > delta(const unsigned int order, const unsigned int n, const unsigned int j, const Vector< double > ×)
Recursive function for calculating the order divided differences ( ) that is used for calculating ba...
Vector< double > calculate_bdf_coefficients(const Parameters::SimulationControl::TimeSteppingMethod method, const std::vector< double > &time_steps)
Calculate the coefficients required for backward differentiation formula (BDF) integration of order .