Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion lib/BVProblemLibrary/test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion lib/DAEProblemLibrary/test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion lib/DDEProblemLibrary/test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion lib/JumpProblemLibrary/test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ JumpProblemLibrary = {path = "../.."}
[compat]
Aqua = "0.8"
JumpProblemLibrary = "2"
SciMLTesting = "1.7"
SciMLTesting = "2.1"
Test = "1.10"
julia = "1.10"
18 changes: 18 additions & 0 deletions lib/NonlinearProblemLibrary/src/NonlinearProblemLibrary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/NonlinearProblemLibrary/test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
30 changes: 30 additions & 0 deletions lib/ODEProblemLibrary/src/filament_prob.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
14 changes: 14 additions & 0 deletions lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
126 changes: 126 additions & 0 deletions lib/ODEProblemLibrary/src/strange_attractors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/ODEProblemLibrary/test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ ODEProblemLibrary = {path = "../.."}
[compat]
Aqua = "0.8"
ODEProblemLibrary = "1"
SciMLTesting = "1.7"
SciMLTesting = "2.1"
Test = "1.10"
julia = "1.10"
28 changes: 28 additions & 0 deletions lib/SDEProblemLibrary/src/SDEProblemLibrary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/SDEProblemLibrary/test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ SDEProblemLibrary = {path = "../.."}
[compat]
Aqua = "0.8"
SDEProblemLibrary = "1"
SciMLTesting = "1.7"
SciMLTesting = "2.1"
Test = "1.10"
julia = "1.10"
2 changes: 1 addition & 1 deletion test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading
Loading