-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Format all markdown files with JuliaFormatter.jl (#169)
* Format all markdown files with JuliaFormatter.jl * Update docs/src/getting_started.md * Update docs/src/dae.md * Update docs/src/getting_started.md * Update docs/src/getting_started.md * Update docs/src/getting_started.md
- Loading branch information
1 parent
8db3c25
commit 18fc101
Showing
8 changed files
with
170 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,46 @@ | ||
# Solving DAEs with Probabilistic Numerics | ||
|
||
ProbNumDiffEq.jl provides probabilistic numerical solvers for _differential algebraic equations_ (DAEs). | ||
Currently, we recommend using the semi-implicit `EK1` algorithm. | ||
|
||
!!! note | ||
|
||
For a more general tutorial on DAEs, solved with classic solvers, check out the | ||
[DifferentialEquations.jl DAE tutorial](https://diffeq.sciml.ai/stable/tutorials/dae_example/). | ||
|
||
|
||
#### Solving a Mass-Matrix DAE with the `EK1` | ||
|
||
```@example 2 | ||
using ProbNumDiffEq, Plots | ||
function rober(du,u,p,t) | ||
y₁,y₂,y₃ = u | ||
k₁,k₂,k₃ = p | ||
du[1] = -k₁*y₁ + k₃*y₂*y₃ | ||
du[2] = k₁*y₁ - k₃*y₂*y₃ - k₂*y₂^2 | ||
du[3] = y₁ + y₂ + y₃ - 1 | ||
nothing | ||
function rober(du, u, p, t) | ||
y₁, y₂, y₃ = u | ||
k₁, k₂, k₃ = p | ||
du[1] = -k₁ * y₁ + k₃ * y₂ * y₃ | ||
du[2] = k₁ * y₁ - k₃ * y₂ * y₃ - k₂ * y₂^2 | ||
du[3] = y₁ + y₂ + y₃ - 1 | ||
nothing | ||
end | ||
M = [1. 0 0 | ||
0 1. 0 | ||
0 0 0] | ||
f = ODEFunction(rober,mass_matrix=M) | ||
M = [1.0 0 0 | ||
0 1.0 0 | ||
0 0 0] | ||
f = ODEFunction(rober, mass_matrix=M) | ||
prob_mm = ODEProblem(f, [1.0, 0.0, 0.0], (0.0, 1e5), (0.04, 3e7, 1e4)) | ||
using Logging; Logging.disable_logging(Logging.Warn) # hide | ||
using Logging; Logging.disable_logging(Logging.Warn); # hide | ||
sol = solve(prob_mm, EK1(), reltol=1e-8, abstol=1e-8) | ||
Logging.disable_logging(Logging.Debug) # hide | ||
plot(sol, xscale=:log10, tspan=(1e-6, 1e5), layout=(3,1), legend=false, ylabel=["u₁(t)" "u₂(t)" "u₃(t)"], xlabel=["" "" "t"], denseplot=false) | ||
plot( | ||
sol, | ||
xscale=:log10, | ||
tspan=(1e-6, 1e5), | ||
layout=(3, 1), | ||
legend=false, | ||
ylabel=["u₁(t)" "u₂(t)" "u₃(t)"], | ||
xlabel=["" "" "t"], | ||
denseplot=false, | ||
) | ||
``` | ||
|
||
|
||
### References | ||
|
||
[1] N. Bosch, F. Tronarp, P. Hennig: **Pick-and-Mix Information Operators for Probabilistic ODE Solvers** (2022) ([link](https://arxiv.org/abs/2110.10770)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.