Errors still aren't quite right

This commit is contained in:
Connor Johnstone
2023-03-10 17:57:18 -07:00
parent fc96e2e9be
commit 2ec474a77a
4 changed files with 52 additions and 34 deletions

View File

@@ -35,6 +35,7 @@ where
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;
if err <= 1.0.into() {
println!("{:?}", f64::from(h));
// Accept the stepsize
self.factor_old = err.max(1.0e-4.into());
if h_new.abs() > self.h_max {
@@ -42,6 +43,7 @@ where
h_new = self.h_max.copysign(h_new);
}
(true, h_new)
// (true, h_new)
} else {
// Reject the stepsize and propose a smaller one
h_new = h / (self.factor_c1.min(factor_11 / self.safety_factor));