-
-
Notifications
You must be signed in to change notification settings - Fork 49
[WIP] adding output at specified points #43
Conversation
@@ -122,6 +122,25 @@ function ode23(F, y0, tspan; reltol = 1.e-5, abstol = 1.e-8) | |||
|
|||
end # ode23 | |||
|
|||
# helper functions | |||
maxeps(x::FloatingPoint, y::FloatingPoint) = max(eps(abs(x)), eps(abs(y))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you have abs
in eps(abs(...))
? According to the documentation eps(x)
is the difference between x
and the next larger number.
@tlycken the "prob" with |
@ivarne ty, fixed the signature |
any ideas on fixing the |
I think |
As we also have the derivatives, we could probably get a higher polynomial from 3 points. |
the polynomial interpolation that you refer to is normally referred to as dense output. i thought this was a separate issue of the api. in fact i just did a pr on api.md about it. the thing is, for 5th order rk, it can be done without further function evaluations, but not for higher orders. perhaps we neee a separate implementations depending on the method order? |
@ivarne: this is what dense output is actually about, doing interpolation @TLYKEN, @berceanu: I think the initial step is typically estimated by some On Wednesday, June 25, 2014, Ivar Nesje [email protected] wrote:
|
it looks like 3rd order hermite interpolation using the derivatives we already calculated should Just Work for any method order p |
Instead of interpolating for
and then only add the selected points to the output. Re. step sizes: my main concern in the case of
With this approach, the initial step with length |
@tlycken :
This is what I meant by "adjusts the time steps such that the given times are attained." :-) One might argue that the same effect can be achieved by calling
That would basically correspond to the lowest order method (the estimate should also depend on the tolerances). I guess |
@acroy: Great minds think alike! (But I guess they're only half great when it takes so long to successfully communicate that...)
Ah, that makes sense - I don't know exactly what I thought "using a lower order method to estimate step size" meant in practice, but it's probably the way to go then. It seems to me that creating good heuristics for the step sizes is complicated enough to warrant its own discussion; I say let's fork that issue out into its own, and focus on the rest of the changes here. We can always improve that part of the code later. @berceanu You mention problems with |
I propose to move the interpolation/dense output discussion to #40 and restrict this to approaches such as that suggested by @tlycken that make the solver pass exactly through the suggested set of time steps. |
I just implemented an algorithm based on explicit Euler stepping for initial step heuristics. |
@tlycken the
|
@berceanu Hm... that's not the behavior I'd expect from With your approach, quite surprising things could happen. For example, if I pass Instead, if |
I think it would be great to have |
This has been superseded, as far as I can tell, closing. (Please let me/us know if that was wrong.) |
I just added the
initstep
,minstep
andmaxstep
keywords specified in the API.Output at specified time-points is still wip, as for a
tspan
of[0.:10.:50.]
I currently get output at