Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sequences for ImplicitEulerExtrapolation #1199

Merged
merged 7 commits into from Jul 4, 2020

Conversation

utkarsh530
Copy link
Member

@utkarsh530 utkarsh530 commented Jul 3, 2020

Hi,

I added a choice of sequences in ImplicitEulerExtrapolation similar to seulex. The default sequence is set to Bulirsch. There we some minor improvements in the method. Comparing with seulex:

function test!(du, u, p, t)
     du[1] = -10 * u[1]
     du[2] = -0.01 * u[2]
 end
 u0 = [1.01;1.01]
 tspan = (0.0, 1.0)
 prob = ODEProblem(test!, u0, tspan)
julia> sol = solve(prob,seulex())
retcode: Success
Interpolation: 1st order linear
t: 12-element Array{Float64,1}:
 0.0
 1.0e-6
 7.957010852370433e-6
 5.6357010852370424e-5
 ⋮
 0.171697546989057
 0.362553477748044
 0.8757951760869469
 1.0
u: 12-element Array{Array{Float64,1},1}:
 [1.01, 1.01]
 [1.0099899000505004, 1.0099999898999994]
 [1.009919637387684, 1.0099999196341929]
 [1.0094309545603295, 1.0099994307943505]
 ⋮
 [0.18151135597475912, 1.0082673426661455]
 [0.02691950277797022, 1.006344839833677]
 [0.00015776855888100059, 1.001193090258896]
 [4.575739308257184e-5, 0.9999503320867008]
julia> sol = solve(prob,ImplicitEulerExtrapolation(),dt=1e-6)
┌ Warning: Threading in `ImplicitEulerExtrapolation` is currently disabled. Thus `threading` has been changed from `true` to `false`.
└ @ OrdinaryDiffEq C:\Users\Utkarsh\.julia\dev\OrdinaryDiffEq\src\algorithms.jl:65
retcode: Success
Interpolation: 3rd order Hermite
t: 14-element Array{Float64,1}:
 0.0
 1.0e-6
 1.1e-5
 0.00011099999999999999
 ⋮
 0.33900999182564423
 0.5605959154883677
 0.8354148791156211
 1.0
u: 14-element Array{Array{Float64,1},1}:
 [1.01, 1.01]
 [1.0099899000505, 1.0099999899]
 [1.0098889061104441, 1.009999888900006]
 [1.0088795221484086, 1.0099988789006225]
 ⋮
 [0.03404236668264801, 1.006581796382659]
 [0.0037126518729961797, 1.00435382215883]
 [0.00023777180592478287, 1.0015974566391057]
 [4.585389370221542e-5, 0.999950332087402]

I will make changes on adaptive step-sizing (which seems to be different from Hairer II for seulex) after this. It would help me compare benchmarks across different sequences.
@ChrisRackauckas please review.

@ChrisRackauckas
Copy link
Member

Looks correct to me, but it should get convergence tests for the different sequence choices. See how the other convergence tests set the minimum and maximum order.

@ChrisRackauckas ChrisRackauckas merged commit 2df4ff2 into SciML:master Jul 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants