Closed elswit closed 3 years ago
The issue is that the name value pairs are case sensitive. You need to switch to RelTol
and AbsTol
. I'll see if we can ignore case and give warnings for unused parameters. Most of this is deferred to odeset
though.
The issue boils down to how odeset
handles struct arguments vs name value pairs. A simple fix would involve using the function namedargs2cell
, but this requires MATLAB 2019b. I guess that's not too new of a version.
Ok. It was strange that one integrator worked fine with the lowercase string and the other didn't. I don't think relying on 2019> version is unreasonable.
None of the integrators were passed the tolerances since the capitalization was wrong. ode45
just happen to have a very small global error using default tolerances.
Yeah, silently ignoring options is wrong. We need to warnings everywhere when an option is ignored.
A simple test on Dahlquist:.
4.162909795304426e-04
if we switch to ode45
sol = model.solve('Reltol',1e-10, 'Abstol', 1e-10, 'Method', @ode45);
sol.y(end)-exp(-1)
1.209031486038015e-09