diff --git a/Project.toml b/Project.toml index cfefde6..f157be5 100644 --- a/Project.toml +++ b/Project.toml @@ -30,7 +30,7 @@ NonlinearProblemLibrary = "0.1" ODEProblemLibrary = "1" Pkg = "1.10" SafeTestsets = "0.1" -SciMLTesting = "1.7" +SciMLTesting = "2.1" SDEProblemLibrary = "1" Test = "1.10" julia = "1.10" diff --git a/lib/BVProblemLibrary/test/qa/Project.toml b/lib/BVProblemLibrary/test/qa/Project.toml index 7245dbb..8cb6a66 100644 --- a/lib/BVProblemLibrary/test/qa/Project.toml +++ b/lib/BVProblemLibrary/test/qa/Project.toml @@ -10,6 +10,6 @@ BVProblemLibrary = {path = "../.."} [compat] Aqua = "0.8" BVProblemLibrary = "0.1" -SciMLTesting = "1.7" +SciMLTesting = "2.1" Test = "1.10" julia = "1.10" diff --git a/lib/DAEProblemLibrary/test/qa/Project.toml b/lib/DAEProblemLibrary/test/qa/Project.toml index 1c0a85d..0e86db8 100644 --- a/lib/DAEProblemLibrary/test/qa/Project.toml +++ b/lib/DAEProblemLibrary/test/qa/Project.toml @@ -10,6 +10,6 @@ DAEProblemLibrary = {path = "../.."} [compat] Aqua = "0.8" DAEProblemLibrary = "0.1" -SciMLTesting = "1.7" +SciMLTesting = "2.1" Test = "1.10" julia = "1.10" diff --git a/lib/DDEProblemLibrary/test/qa/Project.toml b/lib/DDEProblemLibrary/test/qa/Project.toml index feb7f93..d3d76cc 100644 --- a/lib/DDEProblemLibrary/test/qa/Project.toml +++ b/lib/DDEProblemLibrary/test/qa/Project.toml @@ -10,6 +10,6 @@ DDEProblemLibrary = {path = "../.."} [compat] Aqua = "0.8" DDEProblemLibrary = "0.1" -SciMLTesting = "1.7" +SciMLTesting = "2.1" Test = "1.10" julia = "1.10" diff --git a/lib/JumpProblemLibrary/test/qa/Project.toml b/lib/JumpProblemLibrary/test/qa/Project.toml index eca6aca..1ddfe8f 100644 --- a/lib/JumpProblemLibrary/test/qa/Project.toml +++ b/lib/JumpProblemLibrary/test/qa/Project.toml @@ -10,6 +10,6 @@ JumpProblemLibrary = {path = "../.."} [compat] Aqua = "0.8" JumpProblemLibrary = "2" -SciMLTesting = "1.7" +SciMLTesting = "2.1" Test = "1.10" julia = "1.10" diff --git a/lib/NonlinearProblemLibrary/src/NonlinearProblemLibrary.jl b/lib/NonlinearProblemLibrary/src/NonlinearProblemLibrary.jl index 397aa7d..ea6f993 100644 --- a/lib/NonlinearProblemLibrary/src/NonlinearProblemLibrary.jl +++ b/lib/NonlinearProblemLibrary/src/NonlinearProblemLibrary.jl @@ -508,6 +508,24 @@ dicts = ( p18_dict, p19_dict, p20_dict, p21_dict, p22_dict, p23_dict, ) +""" + nlprob_23_testcases + +Dictionary of twenty-three named nonlinear benchmark problems. + +Each entry maps a problem title to a named tuple with fields `prob`, a +`NonlinearProblem`, and `true_sol`, which is either a reference solution or +`nothing` when no reference solution is provided. + +# Example + +```julia +using NonlinearProblemLibrary + +case = nlprob_23_testcases["Generalized Rosenbrock function"] +prob = case.prob +``` +""" const nlprob_23_testcases = Dict() for (problem, dict) in zip(problems, dicts) diff --git a/lib/NonlinearProblemLibrary/test/qa/Project.toml b/lib/NonlinearProblemLibrary/test/qa/Project.toml index 053f135..3fe47fa 100644 --- a/lib/NonlinearProblemLibrary/test/qa/Project.toml +++ b/lib/NonlinearProblemLibrary/test/qa/Project.toml @@ -12,6 +12,6 @@ NonlinearProblemLibrary = {path = "../.."} AllocCheck = "0.2" Aqua = "0.8" NonlinearProblemLibrary = "0.1" -SciMLTesting = "1.7" +SciMLTesting = "2.1" Test = "1" julia = "1.10" diff --git a/lib/ODEProblemLibrary/src/filament_prob.jl b/lib/ODEProblemLibrary/src/filament_prob.jl index 167b458..04bd2fd 100644 --- a/lib/ODEProblemLibrary/src/filament_prob.jl +++ b/lib/ODEProblemLibrary/src/filament_prob.jl @@ -172,6 +172,20 @@ function magnetic_force!(::FerromagneticContinuous, f::AbstractFilamentCache, t) return nothing end +""" + SolverDiffEq + +Solver marker for constructing the filament benchmark as a DiffEq +`ODEProblem`. + +# Example + +```julia +using ODEProblemLibrary + +prob = filament_prob(SolverDiffEq()) +``` +""" struct SolverDiffEq <: AbstractSolver end function (f::FilamentCache)(dr, r, p, t) @@ -245,6 +259,22 @@ function LDLt_inplace!( return L end +""" + filament_prob(::SolverDiffEq; N = 20, Cm = 32, ω = 200, time_end = 1.0) + +Construct the filament PDE discretization benchmark as an `ODEProblem`. + +`N` controls the number of filament segments, `Cm` and `ω` control the magnetic +forcing, and `time_end` sets the final time. + +# Example + +```julia +using ODEProblemLibrary + +prob = filament_prob(SolverDiffEq(); N = 10, time_end = 0.5) +``` +""" function filament_prob(::SolverDiffEq; N = 20, Cm = 32, ω = 200, time_end = 1.0) f = FilamentCache(N, Solver = SolverDiffEq, Cm = Cm, ω = ω) jac = (J, r, p, t) -> f(Val{:jac}, J, r, p, t) diff --git a/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl b/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl index 57699a9..0df7586 100644 --- a/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl +++ b/lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl @@ -337,6 +337,20 @@ mm_f = ODEFunction( mm_linear; analytic = (u0, p, t) -> exp(inv(MM_linear) * mm_A * t) * u0, mass_matrix = MM_linear ) +""" + prob_ode_mm_linear + +Linear ODE problem with a constant mass matrix. This is useful for testing ODE +solvers on mass-matrix systems with an analytic solution. + +# Example + +```julia +using ODEProblemLibrary + +prob = prob_ode_mm_linear +``` +""" prob_ode_mm_linear = ODEProblem(mm_f, rand(4), (0.0, 1.0)) ## Hires Problem diff --git a/lib/ODEProblemLibrary/src/strange_attractors.jl b/lib/ODEProblemLibrary/src/strange_attractors.jl index 1624591..a85cba2 100644 --- a/lib/ODEProblemLibrary/src/strange_attractors.jl +++ b/lib/ODEProblemLibrary/src/strange_attractors.jl @@ -12,6 +12,20 @@ function thomas_eqs(du, u, p, t) return du[3] = sin(x) - b * z end +""" + thomas + +`ODEFunction` for Thomas' cyclically symmetric attractor. + +# Example + +```julia +using ODEProblemLibrary + +f = thomas +prob = prob_ode_thomas +``` +""" thomas = ODEFunction(thomas_eqs) @doc doc""" Thomas' cyclically symmetric attractor equations @@ -42,6 +56,20 @@ function lorenz_eqs(du, u, p, t) return du[3] = x * y - β * z end +""" + lorenz + +`ODEFunction` for the Lorenz system. + +# Example + +```julia +using ODEProblemLibrary + +f = lorenz +prob = prob_ode_lorenz +``` +""" lorenz = ODEFunction(lorenz_eqs) @doc doc""" Lorenz equations @@ -72,6 +100,20 @@ function aizawa_eqs(du, u, p, t) return du[3] = c + a * z - z^3 / 3 - (x^2 + y^2) * (1 + e * z) + f * z * x^3 end +""" + aizawa + +`ODEFunction` for the Aizawa attractor. + +# Example + +```julia +using ODEProblemLibrary + +f = aizawa +prob = prob_ode_aizawa +``` +""" aizawa = ODEFunction(aizawa_eqs) @doc doc""" Aizawa equations @@ -100,6 +142,20 @@ function dadras_eqs(du, u, p, t) return du[3] = d * x * y - e * z end +""" + dadras + +`ODEFunction` for the Dadras attractor. + +# Example + +```julia +using ODEProblemLibrary + +f = dadras +prob = prob_ode_dadras +``` +""" dadras = ODEFunction(dadras_eqs) @doc doc""" Dadras equations @@ -128,6 +184,20 @@ function chen_eqs(du, u, p, t) return du[3] = x * y - b * z end +""" + chen + +`ODEFunction` for the Chen system. + +# Example + +```julia +using ODEProblemLibrary + +f = chen +prob = prob_ode_chen +``` +""" chen = ODEFunction(chen_eqs) @doc doc""" Chen equations @@ -156,6 +226,20 @@ function rossler_eqs(du, u, p, t) return du[3] = b + z * (x - c) end +""" + rossler + +`ODEFunction` for the Rossler attractor. + +# Example + +```julia +using ODEProblemLibrary + +f = rossler +prob = prob_ode_rossler +``` +""" rossler = ODEFunction(rossler_eqs) @doc doc""" Rössler equations @@ -185,6 +269,20 @@ function rabinovich_fabrikant_eqs(du, u, p, t) return du[3] = -2 * z * (a + x * y) end +""" + rabinovich_fabrikant + +`ODEFunction` for the Rabinovich-Fabrikant system. + +# Example + +```julia +using ODEProblemLibrary + +f = rabinovich_fabrikant +prob = prob_ode_rabinovich_fabrikant +``` +""" rabinovich_fabrikant = ODEFunction(rabinovich_fabrikant_eqs) @doc doc""" Rabinovich-Fabrikant equations @@ -213,6 +311,20 @@ function sprott_eqs(du, u, p, t) return du[3] = x - x^2 - y^2 end +""" + sprott + +`ODEFunction` for the Sprott attractor. + +# Example + +```julia +using ODEProblemLibrary + +f = sprott +prob = prob_ode_sprott +``` +""" sprott = ODEFunction(sprott_eqs) @doc doc""" Sprott equations @@ -241,6 +353,20 @@ function hindmarsh_rose_eqs(du, u, p, t) return du[3] = r * (s * (x - xr) - z) end +""" + hindmarsh_rose + +`ODEFunction` for the Hindmarsh-Rose neuron model. + +# Example + +```julia +using ODEProblemLibrary + +f = hindmarsh_rose +prob = prob_ode_hindmarsh_rose +``` +""" hindmarsh_rose = ODEFunction(hindmarsh_rose_eqs) @doc doc""" Hindmarsh-Rose equations diff --git a/lib/ODEProblemLibrary/test/qa/Project.toml b/lib/ODEProblemLibrary/test/qa/Project.toml index 5b386cd..20303fc 100644 --- a/lib/ODEProblemLibrary/test/qa/Project.toml +++ b/lib/ODEProblemLibrary/test/qa/Project.toml @@ -10,6 +10,6 @@ ODEProblemLibrary = {path = "../.."} [compat] Aqua = "0.8" ODEProblemLibrary = "1" -SciMLTesting = "1.7" +SciMLTesting = "2.1" Test = "1.10" julia = "1.10" diff --git a/lib/SDEProblemLibrary/src/SDEProblemLibrary.jl b/lib/SDEProblemLibrary/src/SDEProblemLibrary.jl index b463129..e859680 100644 --- a/lib/SDEProblemLibrary/src/SDEProblemLibrary.jl +++ b/lib/SDEProblemLibrary/src/SDEProblemLibrary.jl @@ -40,6 +40,20 @@ prob_sde_linear = SDEProblem( ) linear_analytic_strat(u0, p, t, W) = @.(u0 * exp(1.01t + 0.87W)) +""" + prob_sde_linear_stratonovich + +Scalar Stratonovich linear SDE with drift `1.01u`, diffusion `0.87u`, initial +condition `u0 = 1 / 2`, and time span `(0.0, 1.0)`. + +# Example + +```julia +using SDEProblemLibrary + +prob = prob_sde_linear_stratonovich +``` +""" prob_sde_linear_stratonovich = SDEProblem( SDEFunction( f_linear, σ_linear, @@ -67,6 +81,20 @@ prob_sde_2Dlinear = SDEProblem( ), ones(4, 2) / 2, (0.0, 1.0) ) +""" + prob_sde_2Dlinear_stratonovich + +Matrix-valued Stratonovich linear SDE with in-place drift and diffusion +definitions, initial condition `ones(4, 2) / 2`, and time span `(0.0, 1.0)`. + +# Example + +```julia +using SDEProblemLibrary + +prob = prob_sde_2Dlinear_stratonovich +``` +""" prob_sde_2Dlinear_stratonovich = SDEProblem( SDEFunction( f_linear_iip, σ_linear_iip, diff --git a/lib/SDEProblemLibrary/test/qa/Project.toml b/lib/SDEProblemLibrary/test/qa/Project.toml index c48efef..ac11cbd 100644 --- a/lib/SDEProblemLibrary/test/qa/Project.toml +++ b/lib/SDEProblemLibrary/test/qa/Project.toml @@ -10,6 +10,6 @@ SDEProblemLibrary = {path = "../.."} [compat] Aqua = "0.8" SDEProblemLibrary = "1" -SciMLTesting = "1.7" +SciMLTesting = "2.1" Test = "1.10" julia = "1.10" diff --git a/test/qa/Project.toml b/test/qa/Project.toml index 31a8d0e..99ff7d4 100644 --- a/test/qa/Project.toml +++ b/test/qa/Project.toml @@ -10,6 +10,6 @@ DiffEqProblemLibrary = {path = "../.."} [compat] DiffEqProblemLibrary = "5" SafeTestsets = "0.0.1, 0.1" -SciMLTesting = "1.7" +SciMLTesting = "2.1" Test = "1.10" julia = "1.10" diff --git a/test/qa/qa.jl b/test/qa/qa.jl index 454dc48..9d44248 100644 --- a/test/qa/qa.jl +++ b/test/qa/qa.jl @@ -3,4 +3,9 @@ using SciMLTesting, DiffEqProblemLibrary, Test # The root umbrella package re-exports each sublibrary; it owns no methods of its own, # so the reported method ambiguities all come from the imported dependency tree # (DiffEqBase / SciMLBase / Catalyst), matching the `ambiguities = false` each sublib uses. -run_qa(DiffEqProblemLibrary; explicit_imports = true, aqua_kwargs = (; ambiguities = false)) +run_qa( + DiffEqProblemLibrary; + explicit_imports = true, + aqua_kwargs = (; ambiguities = false), + api_docs_kwargs = (; rendered = true), +)