-
-
Notifications
You must be signed in to change notification settings - Fork 49
Add keywords minstep, maxstep and initstep to ode23s and oderkf #59
Conversation
…function hinit for estimation of initial step.
Anyone? |
d0 = norm(x0, Inf)/tau | ||
f0 = F(t0, x0) | ||
d1 = norm(f0, Inf)/tau | ||
if d0 < 1e-5 || d1 < 1e-5 |
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.
The indentation in this if
statement and the next makes it more difficult to understand the control flow here, IMO.
Sorry. I took a look at the code and commented on a few nitpicks, but I haven't tried to run anything (I don't work with related stuff anymore, so I can do very little except look at the test results). The CI build seems fine, as far as ODE.jl code is related - Coveralls doesn't seem to be working on 0.4, which means the build script fails there, but all the tests pass on both 0.3 and 0.4. No idea why Github didn't get a notification that the build was finished, but it's probably not your fault :) |
And as far as the intent of the PR is concerned, I'm all for it :) |
Regarding the initial step choice, I also think you should replace the arbitrary constants (1e-5, 1e-15 etc.) with By the way, if we want to have generic solvers, shouldn't we replace the numbers in Butcher tables with rationals? |
@pwl regarding rationals: yes, we should. I might do a quick PR if you don't want to :) |
I think the constants in |
Ah. Well, that does make it a little less obvious what to do, but I still think there's merit in trying. For most cases, it's quite obvious if the constant could chosen due to its relation to This might be better handled under #60 though, so I don't think it's necessary to change that before this PR can be merged. (Please do fix the indentation, though :) ) |
Just a quick comment -- does anyone solve ODEs with rationals? (I guess not...) |
@acroy Are you using some IDE to do the indentation for you? There seems to be whitespace changes in a whole bunch of irrelevant places now, and the indentation is still off in many places (e.g. in |
@tlycken I am using Atom as an editor. I thought that I might have (accidentally) converted the tabs to spaces at some point. Strange. |
Now it should be better. I also changed |
Yeah, this LGTM. |
Should we use the opportunity to replace |
Perhaps pick a better name, if possible? |
You mean |
I think it sounds too serious, but is difficult for a newcomer to decipher, if it was a public api. :-) Internal API, of course, is ok. |
I'd say it's time, but merge them separately to make it easier to revert one but not the other, should we need to. |
…Adjusted comments.
Alright, let's do it like that. |
Add keywords minstep, maxstep and initstep to ode23s and oderkf.
As the title says this PR adds the keywords
minstep
,maxstep
andinitstep
toode23s
andoderkf
as suggested in the API docs. The initial step estimator is actually due to @berceanu (I hope you are Ok with me taking it from #43; otherwise just let me know). The other commits are just minor cosmetic changes.