Skip to content

Commit

Permalink
changed Scholz47 to Scholz4_7 as recommended in #2126 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwittens committed Feb 2, 2024
1 parent d07cf46 commit acee4d4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/OrdinaryDiffEq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ export MagnusMidpoint, LinearExponential, MagnusLeapfrog, LieEuler, CayleyEuler,
export Rosenbrock23, Rosenbrock32, RosShamp4, Veldd4, Velds4, GRK4T, GRK4A,
Ros4LStab, ROS3P, Rodas3, Rodas23W, Rodas3P, Rodas4, Rodas42, Rodas4P, Rodas4P2, Rodas5, Rodas5P,
RosenbrockW6S4OS, ROS34PW1a, ROS34PW1b, ROS34PW2, ROS34PW3, ROS34PRw, ROS3PRL, ROS3PRL2,
ROS2PR, ROS2S, ROS3PR, Scholz47
ROS2PR, ROS2S, ROS3PR, Scholz4_7

export LawsonEuler, NorsettEuler, ETD1, ETDRK2, ETDRK3, ETDRK4, HochOst4, Exp4, EPIRK4s3A,
EPIRK4s3B,
Expand Down
2 changes: 1 addition & 1 deletion src/alg_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ alg_order(alg::PFRK87) = 8
alg_order(alg::ROS2PR) = 2
alg_order(alg::ROS2S) = 2
alg_order(alg::ROS3PR) = 3
alg_order(alg::Scholz47) = 3
alg_order(alg::Scholz4_7) = 3
alg_order(alg::Rosenbrock23) = 2
alg_order(alg::Rodas23W) = 3
alg_order(alg::Rosenbrock32) = 3
Expand Down
4 changes: 2 additions & 2 deletions src/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2895,7 +2895,7 @@ Scientific Computing, 18 (1), pp. 1-22.
- E. Hairer, G. Wanner, Solving ordinary differential equations II, stiff and
differential-algebraic problems. Computational mathematics (2nd revised ed.), Springer (1996)
#### ROS2PR, ROS2S, ROS3PR, Scholz47
#### ROS2PR, ROS2S, ROS3PR, Scholz4_7
-Rang, Joachim (2014): The Prothero and Robinson example:
Convergence studies for Runge-Kutta and Rosenbrock-Wanner methods.
https://doi.org/10.24355/dbbs.084-201408121139-0
Expand Down Expand Up @@ -2957,7 +2957,7 @@ for Alg in [
:ROS2PR,
:ROS2S,
:ROS3PR,
:Scholz47,
:Scholz4_7,
:ROS3P,
:Rodas3,
:ROS34PW1a,
Expand Down
14 changes: 7 additions & 7 deletions src/generic_rosenbrock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -963,15 +963,15 @@ More Information at https://doi.org/10.24355/dbbs.084-201408121139-0
""" ROS3PR

"""
Scholz47Tableau()
Scholz4_7Tableau()
3nd order stiffly accurate Rosenbrock-Wanner method with 3 internal stages with B_PR consistent of order 3, which is strongly A-stable with Rinf~=-0.73
Convergence with order 4 for the stiff case, but has a poor accuracy.
Rang, Joachim (2014): The Prothero and Robinson example:
Convergence studies for Runge-Kutta and Rosenbrock-Wanner methods. https://doi.org/10.24355/dbbs.084-201408121139-0
"""
function Scholz47Tableau() # 3rd order
function Scholz4_7Tableau() # 3rd order
gamma=7.88675134594813e-01
Alpha=[0 0 0;
2.36602540378444e+00 0 0;
Expand All @@ -989,13 +989,13 @@ end
3nd order stiffly accurate Rosenbrock-Wanner method with 3 internal stages with B_PR consistent of order 3, which is strongly A-stable with Rinf~=-0.73
Convergence with order 4 for the stiff case, but has a poor accuracy.
More Information at https://doi.org/10.24355/dbbs.084-201408121139-0
""" Scholz47
""" Scholz4_7


"""
@ROS23(part)
Generate code for the 3 step ROS methods: ROS2PR, ROS2S, ROS3PR, Scholz47
Generate code for the 3 step ROS methods: ROS2PR, ROS2S, ROS3PR, Scholz4_7
`part` should be one of `:tableau`, `:cache`, `:init`, `:performstep`.
`@ROS23(:tableau)` should be placed in `tableaus/rosenbrock_tableaus.jl`.
`@ROS23(:cache)` should be placed in `caches/rosenbrock_caches.jl`.
Expand All @@ -1009,23 +1009,23 @@ macro ROS23(part)
ROS2PRtabname=:ROS2PRTableau
ROS2Stabname=:ROS2STableau
ROS3PRtabname=:ROS3PRTableau
Scholz47tabname=:Scholz47Tableau
Scholz4_7tabname=:Scholz4_7Tableau
n_normalstep=length(tabmask.b)-1
if part.value==:tableau
tabstructexpr=gen_tableau_struct(tabmask,:Ros23Tableau)
tabexprs=Array{Expr,1}([tabstructexpr])
push!(tabexprs,gen_tableau(ROS2PRTableau(),tabstructexpr,ROS2PRtabname))
push!(tabexprs,gen_tableau(ROS2STableau(),tabstructexpr,ROS2Stabname))
push!(tabexprs,gen_tableau(ROS3PRTableau(),tabstructexpr,ROS3PRtabname))
push!(tabexprs,gen_tableau(Scholz47Tableau(),tabstructexpr,Scholz47tabname))
push!(tabexprs,gen_tableau(Scholz4_7Tableau(),tabstructexpr,Scholz4_7tabname))
return esc(quote $(tabexprs...) end)
elseif part.value==:cache
constcacheexpr,cacheexpr=gen_cache_struct(tabmask,cachename,constcachename)
cacheexprs=Array{Expr,1}([constcacheexpr,cacheexpr])
push!(cacheexprs,gen_algcache(cacheexpr,constcachename,:ROS2PR,ROS2PRtabname))
push!(cacheexprs,gen_algcache(cacheexpr,constcachename,:ROS2S,ROS2Stabname))
push!(cacheexprs,gen_algcache(cacheexpr,constcachename,:ROS3PR,ROS3PRtabname))
push!(cacheexprs,gen_algcache(cacheexpr,constcachename,:Scholz47,Scholz47tabname))
push!(cacheexprs,gen_algcache(cacheexpr,constcachename,:Scholz4_7,Scholz4_7tabname))
return esc(quote $(cacheexprs...) end)
elseif part.value==:init
return esc(gen_initialize(cachename,constcachename))
Expand Down
10 changes: 5 additions & 5 deletions test/algconvergence/ode_rosenbrock_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,21 @@ import LinearSolve
sol = solve(prob, ROS3PR())
@test length(sol) < 20 #length(sol) = 4 => Too Small??

### Scholz47
### Scholz4_7
prob = prob_ode_linear

sim = test_convergence(dts, prob, Scholz47())
sim = test_convergence(dts, prob, Scholz4_7())
@test sim.𝒪est[:final]3 atol=testTol

sol = solve(prob, Scholz47())
sol = solve(prob, Scholz4_7())
@test length(sol) < 30

prob = prob_ode_2Dlinear

sim = test_convergence(dts, prob, Scholz47())
sim = test_convergence(dts, prob, Scholz4_7())
@test sim.𝒪est[:final]3 atol=testTol

sol = solve(prob, Scholz47())
sol = solve(prob, Scholz4_7())
@test length(sol) < 30

println("4th order Rosenbrocks")
Expand Down
2 changes: 1 addition & 1 deletion test/interface/mass_matrix_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ dependent_M2 = MatrixOperator(ones(3, 3), update_func = update_func2,
@test _norm_dsol(ROS2PR(), prob, prob2)0 atol=1e-11
@test _norm_dsol(ROS2S(), prob, prob2)0 atol=1e-11
@test _norm_dsol(ROS3PR(), prob, prob2)0 atol=1e-11
@test _norm_dsol(Scholz47(), prob, prob2)0 atol=1e-11
@test _norm_dsol(Scholz4_7(), prob, prob2)0 atol=1e-11
@test _norm_dsol(RosShamp4(), prob, prob2)0 atol=1e-10
@test _norm_dsol(Veldd4(), prob, prob2)0 atol=1e-10
@test _norm_dsol(Velds4(), prob, prob2)0 atol=1e-10
Expand Down

0 comments on commit acee4d4

Please sign in to comment.