Learning Rust, have a small toy compartmental model that runs fine, have copied various other peoples work. It uses a crate called ode_solvers which iteratively solves a system of differential equations, over time so the dependent variable is time. This is the code at the beginning of the ode_solver section:
impl ode_solvers::System<f64, State> for TwoPool {
fn system(&self, _: Time, y: &State, dy: &mut State) {
further down I have this code and it works, printing out the values of state variables as the model runs, just diagnostics at early stages. What I can not extract, and thus print out, is the value of time at each stage because I don't know what the independent variable (time) is actually called.
// print the outputs of the model at each integration iteration
println!("PoolSizes t{:.3}, A={:.3}, B={:.3}, Tot={:.3}", Time,y[0], y[1], y[2]);
This code works, prints the value of state variables A, B and Tot at each iteration but fails with the variable "Time". Any suggestions about where/how to find out what the correct name of Time is in this case to extract it? Thx. J>