Butchers Tableau
The Butcher tableau is a way of representing the coefficients of a Runge-Kutta method (see the wikipedia page). Diffsol uses the Tableau
struct to represent the tableau, and this is used to create any of the SDIRK or ERK solvers. Diffsol has a few inbuilt tableaus that you can use, otherwise you can create your own by constructing an instance of Tableau
To create an SDIRK or ERK solver using a pre-defined tableau, you can use methods on the OdeSolverProblem
struct like so:
use crate::{problem_implicit, LS, M};
use diffsol::Tableau;
pub fn create_solvers_tableau() {
let problem = problem_implicit();
// Create a SDIRK solver with a pre-defined tableau
let tableau = Tableau::<M>::tr_bdf2(problem.context().clone());
let state = problem.rk_state(&tableau).unwrap();
let _solver = problem.sdirk_solver::<LS, _>(state, tableau);
// Create an ERK solver with a pre-defined tableau
let tableau = Tableau::<M>::tsit45(problem.context().clone());
let state = problem.rk_state(&tableau).unwrap();
let _solver = problem.explicit_rk_solver(state, tableau);
}