Finished dopri5, interpolation, and callbacks

This commit is contained in:
Connor Johnstone
2023-03-14 16:55:06 -06:00
parent 75b88f7152
commit 43ec9eb0ac
9 changed files with 228 additions and 73 deletions

View File

@@ -21,8 +21,6 @@ impl<const D:usize> Controller<D> for PIController {
let factor_11 = err.powf(self.alpha);
let factor = self.factor_c2.max(self.factor_c1.min(factor_11 * self.factor_old.powf(-self.beta) / self.safety_factor));
let mut h_new = h / factor;
// let mut h_new = 0.9 * h * err.powf(-1.0 / 5.0);
println!("err: {}\th_new: {}", err, h_new);
if err <= 1.0 {
// Accept the stepsize
self.factor_old = err.max(1.0e-4);