template<typename Scalar, int num_steps>
class mm::AdamsBashforth< Scalar, num_steps >
Class representing an AdamsBashforth method, an explicit linear multistep method.
- Template Parameters
-
Scalar | Type of scalars to use for calculations, e.g. double . |
num_steps | Number of previous steps the method uses. |
Usage example:
std::function<Eigen::VectorXd(double, const Eigen::VectorXd&)> func =
[](double, const Eigen::VectorXd& y) {
Eigen::VectorXd r(2);
r(0) = -y(1);
r(1) = y(0);
return r;
};
double dt = 0.1;
Eigen::VectorXd y0(2); y0 << 1.0, 0.0;
std::cout << solver << std::endl;
for (
auto step : solver) {
std::cout <<
step << std::endl;
std::cout << "This is the last step." << std::endl;
}
}
Definition at line 29 of file AdamsBashforth_fwd.hpp.
|
| AdamsBashforth (const Eigen::Matrix< scalar_t, steps, 1 > &b) |
| Construct an num_steps -step Adams Bashforth method with coefficients b , given as \(y_{n+s} = y_{n+s-1} + h \sum_{j=0}^{s-1} b_j f(t_j, y_j)\). More...
|
|
template<typename func_t > |
Integrator< func_t > | solve (const func_t &func, scalar_t t0, scalar_t t_max, scalar_t dt, const Eigen::VectorXd &y0) const |
| Returns a solver using this method. More...
|
|
template<typename initial_method_t , typename func_t > |
Integrator< func_t, initial_method_t > | solve (const initial_method_t &method, const func_t &func, scalar_t t0, scalar_t t_max, scalar_t dt, const Eigen::VectorXd &y0) const |
| Same as AdamsBashforth::solve, but offers the option of supplying your own initial method. More...
|
|