Skip to content
Snippets Groups Projects
Commit de456c9a authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Use a different coordinate system for assertions

parent 1845a5b4
No related branches found
No related tags found
No related merge requests found
...@@ -49,8 +49,15 @@ double state_update_dieterich_bisection(double h, double uol, ...@@ -49,8 +49,15 @@ double state_update_dieterich_bisection(double h, double uol,
double state_update_dieterich(double h, double uol, // unorm / L double state_update_dieterich(double h, double uol, // unorm / L
double old_state) { double old_state) {
double const ret1 = state_update_dieterich_bisection(h, uol, old_state); double const ret = state_update_dieterich_bisection(h, uol, old_state);
assert(std::abs(ret1 - old_state + uol - h * std::exp(-ret1)) < 1e-12); /* We have
return ret1; ret - old_state + uol = h*exp(-ret)
or
log((ret - old_state + uol)/h) = -ret
*/
assert(std::abs(std::log((ret - old_state + uol) / h) + ret) < 1e-13);
return ret;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment