Changed algorithms

This commit is contained in:
Connor Johnstone
2023-10-16 14:30:56 -06:00
parent 8450810ce1
commit 6f7e57990e

View File

@@ -1,5 +1,5 @@
use nalgebra::SVector;
use roots::{find_root_regula_falsi, SimpleConvergency};
use roots::{find_root_brent, SimpleConvergency};
use super::callback::Callback;
use super::controller::{Controller, PIController};
@@ -72,7 +72,7 @@ where
let test_y = self.integrator.step(&self.ode, test_t).0;
(callback.event)(self.ode.t + test_t, test_y, &self.ode.params)
};
let root = find_root_regula_falsi(0.0, step, &f, &mut convergency).unwrap();
let root = find_root_brent(0.0, step, &f, &mut convergency).unwrap();
step = root;
(new_y, _, dense_option) = self.integrator.step(&self.ode, step);
(callback.effect)(&mut self.ode);