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
11 changes: 1 addition & 10 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ NonlinearProblemLibrary = "b7050fa9-e91f-4b37-bcee-a89a063da141"
ODEProblemLibrary = "fdc4e326-1af4-4b90-96e7-779fcce2daa5"
SDEProblemLibrary = "c72e72a9-a271-4b2b-8966-303ed956772e"

[sources]
BVProblemLibrary = {path = "lib/BVProblemLibrary"}
DAEProblemLibrary = {path = "lib/DAEProblemLibrary"}
DDEProblemLibrary = {path = "lib/DDEProblemLibrary"}
JumpProblemLibrary = {path = "lib/JumpProblemLibrary"}
NonlinearProblemLibrary = {path = "lib/NonlinearProblemLibrary"}
ODEProblemLibrary = {path = "lib/ODEProblemLibrary"}
SDEProblemLibrary = {path = "lib/SDEProblemLibrary"}

[compat]
BVProblemLibrary = "0.1"
DAEProblemLibrary = "0.1"
Expand All @@ -30,7 +21,7 @@ NonlinearProblemLibrary = "0.1"
ODEProblemLibrary = "1"
Pkg = "1.10"
SafeTestsets = "0.1"
SciMLTesting = "2.1"
SciMLTesting = "2.4"
SDEProblemLibrary = "1"
Test = "1.10"
julia = "1.10"
Expand Down
2 changes: 0 additions & 2 deletions lib/BVProblemLibrary/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ version = "0.1.11"

[deps]
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"

[compat]
DiffEqBase = "6.158, 7"
Markdown = "1.10"
Pkg = "1.10"
SafeTestsets = "0.1"
SpecialFunctions = "2.3"
Expand Down
8 changes: 8 additions & 0 deletions lib/BVProblemLibrary/docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[deps]
BVProblemLibrary = "ded0fc24-dfea-4565-b1d9-79c027d14d84"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
BVProblemLibrary = "0.1"
Documenter = "1"
julia = "1.10"
5 changes: 5 additions & 0 deletions lib/BVProblemLibrary/docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using BVProblemLibrary, Documenter

makedocs(
; sitename = "BVProblemLibrary.jl", modules = [BVProblemLibrary], checkdocs = :exports
)
11 changes: 11 additions & 0 deletions lib/BVProblemLibrary/docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# BVProblemLibrary.jl

Premade boundary value problems for testing and benchmarking boundary value problem solvers.

## Public API

```@autodocs
Modules = [BVProblemLibrary]
Public = true
Private = false
```
103 changes: 51 additions & 52 deletions lib/BVProblemLibrary/src/BVProblemLibrary.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module BVProblemLibrary

using DiffEqBase: DiffEqBase, BVPFunction, BVProblem
using Markdown: Markdown
using SpecialFunctions: SpecialFunctions, erf

include("linear.jl")
Expand Down Expand Up @@ -37,37 +36,37 @@ flat_moon_function = BVPFunction(
flat_moon_f!, (flat_moon_bca!, flat_moon_bcb!),
bcresid_prototype = (zeros(4), zeros(3)), twopoint = Val(true)
)
@doc raw"""
"""
flat_moon

This test problem is about the optimal-time launching of a satellite into orbit from flat moon without atmospheric drag.

Given by

```math
\begin{align*}
\frac{dz_1}{dt} &= z_3 t_f, &
\frac{dz_2}{dt} &= z_4 t_f, \\
\frac{dz_3}{dt} &= A\cos(z_5) t_f, &
\frac{dz_4}{dt} &= (A\sin(z_5)-g) t_f, \\
\frac{dz_5}{dt} &= -z_6\cos(z_5) t_F, &
\frac{dz_6}{dt} &= z_6^2\sin(z_5) t_f, \\
\frac{dz_7}{dt} &= 0,
\end{align*}
\\begin{align*}
\\frac{dz_1}{dt} &= z_3 t_f, &
\\frac{dz_2}{dt} &= z_4 t_f, \\\\
\\frac{dz_3}{dt} &= A\\cos(z_5) t_f, &
\\frac{dz_4}{dt} &= (A\\sin(z_5)-g) t_f, \\\\
\\frac{dz_5}{dt} &= -z_6\\cos(z_5) t_F, &
\\frac{dz_6}{dt} &= z_6^2\\sin(z_5) t_f, \\\\
\\frac{dz_7}{dt} &= 0,
\\end{align*}
```

with boundary condition

```math
\begin{align*}
\\begin{align*}
z_1(0) &= 0, &
z_2(0) &= 0, \\
z_2(0) &= 0, \\\\
z_3(0) &= 0, &
z_4(0) &= 0, \\
z_4(0) &= 0, \\\\
z_5(1) &= h, &
z_6(1) &= V_c, \\
z_6(1) &= V_c, \\\\
z_7(1) &= 0.
\end{align*}
\\end{align*}
```

# Solution
Expand Down Expand Up @@ -112,37 +111,37 @@ flat_earth_function = BVPFunction(
bcresid_prototype = (zeros(4), zeros(3)), twopoint = Val(true)
)
flat_earth_tspan = (0, 700)
@doc raw"""
"""
flat_earth

Launch of a satellite into circular orbit from a flat Earth where we assume a uniform gravitational field ``g``.

Given by

```math
\begin{align*}
\frac{dz_1}{dt} &= z_3 \frac{V_c}{h}, \\[2pt]
\frac{dz_2}{dt} &= z_4 \frac{V_c}{h}, \\[2pt]
\frac{dz_3}{dt} &= acc \frac{1}{|V_c|\sqrt{1+z_6^2}}, \\[2pt]
\frac{dz_4}{dt} &= acc \frac{1}{|V_c|\sqrt{1+z_6^2}}-\frac{g}{V_c}, \\[2pt]
\frac{dz_5}{dt} &= 0, \\[2pt]
\frac{dz_6}{dt} &= -z_5 \frac{V_c}{h}, \\[2pt]
\frac{dz_7}{dt} &= 0,
\end{align*}
\\begin{align*}
\\frac{dz_1}{dt} &= z_3 \\frac{V_c}{h}, \\\\[2pt]
\\frac{dz_2}{dt} &= z_4 \\frac{V_c}{h}, \\\\[2pt]
\\frac{dz_3}{dt} &= acc \\frac{1}{|V_c|\\sqrt{1+z_6^2}}, \\\\[2pt]
\\frac{dz_4}{dt} &= acc \\frac{1}{|V_c|\\sqrt{1+z_6^2}}-\\frac{g}{V_c}, \\\\[2pt]
\\frac{dz_5}{dt} &= 0, \\\\[2pt]
\\frac{dz_6}{dt} &= -z_5 \\frac{V_c}{h}, \\\\[2pt]
\\frac{dz_7}{dt} &= 0,
\\end{align*}
```

with boundary conditions

```math
\begin{align*}
\\begin{align*}
z_1(0) &= 0, &
z_2(0) &= 0, \\
z_2(0) &= 0, \\\\
z_3(0) &= 0, &
z_4(0) &= 0, \\
z_4(0) &= 0, \\\\
z_5(1) &= h, &
z_6(1) &= V_c, \\
z_6(1) &= V_c, \\\\
z_7(1) &= 0.
\end{align*}
\\end{align*}
```

# Solution
Expand Down Expand Up @@ -226,37 +225,37 @@ flat_earth_drag_function = BVPFunction(
bcresid_prototype = (zeros(4), zeros(4)), twopoint = Val(true)
)
flat_earth_drag_tspan = (0, 100)
@doc raw"""
"""
flat_earth_drag

Launch into circular orbit from a flat Earth including atmospheric drag.

Given by

```math
\begin{align*}
\frac{dz_1}{dt} &= z_3 \frac{V_c}{h} \\
\frac{dz_2}{dt} &= z_4 \frac{V_c}{h} \\
\frac{dz_3}{dt} &= \frac{f}{V_c} \left(-\frac{z_6}{z_6^2+z_7^2} - V_c η\exp(-z_2 β) z_3\sqrt{z_3^3+z_4^2}\right)/m \\
\frac{dz_4}{dt} &= \frac{f}{V_c} \left(-\frac{z_7}{z_6^2+z_7^2} - V_c η\exp(-z_2 β) z_4\sqrt{z_3^3+z_4^2}\right)/m - g_{accel}/V_c \\
\frac{dz_5}{dt} &= -ηβ \exp(-z_2 β) (z_6z_3+z_7z_4)\sqrt{z_3^3+z_4^2}\frac{V_c}{m} \\
\frac{dz_6}{dt} &= η \exp(-z_2 β) \left(z_6(2z_3^2+z_4^2)+z_7z_3z_4\right) V_c/\sqrt{z_3^2+z_4^2}/m \\
\frac{dz_7}{dt} &= η \exp(-z_2 β) \left(z_7(z_3^2+2z_4^2)+z_6z_3z_4\right) V_c/\sqrt{z_3^2+z_4^2}/m \\
\end{align*}
\\begin{align*}
\\frac{dz_1}{dt} &= z_3 \\frac{V_c}{h} \\\\
\\frac{dz_2}{dt} &= z_4 \\frac{V_c}{h} \\\\
\\frac{dz_3}{dt} &= \\frac{f}{V_c} \\left(-\\frac{z_6}{z_6^2+z_7^2} - V_c η\\exp(-z_2 β) z_3\\sqrt{z_3^3+z_4^2}\\right)/m \\\\
\\frac{dz_4}{dt} &= \\frac{f}{V_c} \\left(-\\frac{z_7}{z_6^2+z_7^2} - V_c η\\exp(-z_2 β) z_4\\sqrt{z_3^3+z_4^2}\\right)/m - g_{accel}/V_c \\\\
\\frac{dz_5}{dt} &= -ηβ \\exp(-z_2 β) (z_6z_3+z_7z_4)\\sqrt{z_3^3+z_4^2}\\frac{V_c}{m} \\\\
\\frac{dz_6}{dt} &= η \\exp(-z_2 β) \\left(z_6(2z_3^2+z_4^2)+z_7z_3z_4\\right) V_c/\\sqrt{z_3^2+z_4^2}/m \\\\
\\frac{dz_7}{dt} &= η \\exp(-z_2 β) \\left(z_7(z_3^2+2z_4^2)+z_6z_3z_4\\right) V_c/\\sqrt{z_3^2+z_4^2}/m \\\\
\\end{align*}
```

with boundary conditions

```math
\begin{align*}
\\begin{align*}
z_1(0) &= 0, &
z_2(0) &= 0, \\
z_2(0) &= 0, \\\\
z_3(0) &= 0, &
z_4(0) &= 0, \\
z_4(0) &= 0, \\\\
z_5(1) &= h, &
z_6(1) &= V_c, \\
z_6(1) &= V_c, \\\\
z_7(1) &= 0.
\end{align*}
\\end{align*}
```

# Solution
Expand Down Expand Up @@ -293,19 +292,19 @@ function measles_bc!(res, u, p, t)
end
measles_function = BVPFunction(measles_f!, measles_bc!)
measles_tspan = (0, 1)
@doc raw"""
"""
measles

This is an epidemiology model, about the spread of diseases.

Given by

```math
\begin{align*}
\frac{dy_1}{dt} &= μ - β(t) y_1 y_3 \\
\frac{dy_2}{dt} &= β(t) y_1 y_3 - \frac{y_2}{λ} \\
\frac{dy_3}{dt} &= \frac{y_2}{λ} - \frac{y_3}{η}
\end{align*}
\\begin{align*}
\\frac{dy_1}{dt} &= μ - β(t) y_1 y_3 \\\\
\\frac{dy_2}{dt} &= β(t) y_1 y_3 - \\frac{y_2}{λ} \\\\
\\frac{dy_3}{dt} &= \\frac{y_2}{λ} - \\frac{y_3}{η}
\\end{align*}
```

with boundary condition
Expand Down
Loading
Loading