From acee4d4cae9597880b0a72dc3e13678fa4810809 Mon Sep 17 00:00:00 2001 From: Collin Wittenstein Date: Fri, 2 Feb 2024 15:23:35 +0100 Subject: [PATCH] changed Scholz47 to Scholz4_7 as recommended in https://github.com/SciML/OrdinaryDiffEq.jl/pull/2126#discussion_r1476070177 --- src/OrdinaryDiffEq.jl | 2 +- src/alg_utils.jl | 2 +- src/algorithms.jl | 4 ++-- src/generic_rosenbrock.jl | 14 +++++++------- test/algconvergence/ode_rosenbrock_tests.jl | 10 +++++----- test/interface/mass_matrix_tests.jl | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index e8f8329394..53523a9484 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -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, diff --git a/src/alg_utils.jl b/src/alg_utils.jl index 6ff9efe377..f1f575c2ea 100644 --- a/src/alg_utils.jl +++ b/src/alg_utils.jl @@ -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 diff --git a/src/algorithms.jl b/src/algorithms.jl index bd1227e9f1..816a7a7d93 100644 --- a/src/algorithms.jl +++ b/src/algorithms.jl @@ -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 @@ -2957,7 +2957,7 @@ for Alg in [ :ROS2PR, :ROS2S, :ROS3PR, - :Scholz47, + :Scholz4_7, :ROS3P, :Rodas3, :ROS34PW1a, diff --git a/src/generic_rosenbrock.jl b/src/generic_rosenbrock.jl index 20d7320a45..67078c235d 100644 --- a/src/generic_rosenbrock.jl +++ b/src/generic_rosenbrock.jl @@ -963,7 +963,7 @@ 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. @@ -971,7 +971,7 @@ 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; @@ -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`. @@ -1009,7 +1009,7 @@ 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) @@ -1017,7 +1017,7 @@ macro ROS23(part) 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) @@ -1025,7 +1025,7 @@ macro ROS23(part) 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)) diff --git a/test/algconvergence/ode_rosenbrock_tests.jl b/test/algconvergence/ode_rosenbrock_tests.jl index 4b17d53a3d..8bf2db1759 100644 --- a/test/algconvergence/ode_rosenbrock_tests.jl +++ b/test/algconvergence/ode_rosenbrock_tests.jl @@ -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") diff --git a/test/interface/mass_matrix_tests.jl b/test/interface/mass_matrix_tests.jl index 47b48624dd..223a3a2dd3 100644 --- a/test/interface/mass_matrix_tests.jl +++ b/test/interface/mass_matrix_tests.jl @@ -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