Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnoStrouwen committed Aug 21, 2024
1 parent 6050417 commit 41801dd
Show file tree
Hide file tree
Showing 30 changed files with 490 additions and 423 deletions.
56 changes: 28 additions & 28 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@ makedocs(sitename = "OrdinaryDiffEq.jl",
clean = true,
doctest = false,
modules = [OrdinaryDiffEq,
OrdinaryDiffEq.OrdinaryDiffEqAdamsBashforthMoulton,
OrdinaryDiffEq.OrdinaryDiffEqBDF,
OrdinaryDiffEq.OrdinaryDiffEqDefault,
OrdinaryDiffEq.OrdinaryDiffEqExplicitRK,
OrdinaryDiffEq.OrdinaryDiffEqExponentialRK,
OrdinaryDiffEq.OrdinaryDiffEqExtrapolation,
OrdinaryDiffEq.OrdinaryDiffEqFeagin,
OrdinaryDiffEq.OrdinaryDiffEqFIRK,
OrdinaryDiffEq.OrdinaryDiffEqHighOrderRK,
OrdinaryDiffEq.OrdinaryDiffEqIMEXMultistep,
OrdinaryDiffEq.OrdinaryDiffEqLinear,
OrdinaryDiffEq.OrdinaryDiffEqLowOrderRK,
OrdinaryDiffEq.OrdinaryDiffEqLowStorageRK,
OrdinaryDiffEq.OrdinaryDiffEqNordsieck,
OrdinaryDiffEq.OrdinaryDiffEqPDIRK,
OrdinaryDiffEq.OrdinaryDiffEqPRK,
OrdinaryDiffEq.OrdinaryDiffEqQPRK,
OrdinaryDiffEq.OrdinaryDiffEqRKN,
OrdinaryDiffEq.OrdinaryDiffEqRosenbrock,
OrdinaryDiffEq.OrdinaryDiffEqSDIRK,
OrdinaryDiffEq.OrdinaryDiffEqSSPRK,
OrdinaryDiffEq.OrdinaryDiffEqStabilizedIRK,
OrdinaryDiffEq.OrdinaryDiffEqStabilizedRK,
OrdinaryDiffEq.OrdinaryDiffEqSymplecticRK,
OrdinaryDiffEq.OrdinaryDiffEqTsit5,
OrdinaryDiffEq.OrdinaryDiffEqVerner,
],
OrdinaryDiffEq.OrdinaryDiffEqAdamsBashforthMoulton,
OrdinaryDiffEq.OrdinaryDiffEqBDF,
OrdinaryDiffEq.OrdinaryDiffEqDefault,
OrdinaryDiffEq.OrdinaryDiffEqExplicitRK,
OrdinaryDiffEq.OrdinaryDiffEqExponentialRK,
OrdinaryDiffEq.OrdinaryDiffEqExtrapolation,
OrdinaryDiffEq.OrdinaryDiffEqFeagin,
OrdinaryDiffEq.OrdinaryDiffEqFIRK,
OrdinaryDiffEq.OrdinaryDiffEqHighOrderRK,
OrdinaryDiffEq.OrdinaryDiffEqIMEXMultistep,
OrdinaryDiffEq.OrdinaryDiffEqLinear,
OrdinaryDiffEq.OrdinaryDiffEqLowOrderRK,
OrdinaryDiffEq.OrdinaryDiffEqLowStorageRK,
OrdinaryDiffEq.OrdinaryDiffEqNordsieck,
OrdinaryDiffEq.OrdinaryDiffEqPDIRK,
OrdinaryDiffEq.OrdinaryDiffEqPRK,
OrdinaryDiffEq.OrdinaryDiffEqQPRK,
OrdinaryDiffEq.OrdinaryDiffEqRKN,
OrdinaryDiffEq.OrdinaryDiffEqRosenbrock,
OrdinaryDiffEq.OrdinaryDiffEqSDIRK,
OrdinaryDiffEq.OrdinaryDiffEqSSPRK,
OrdinaryDiffEq.OrdinaryDiffEqStabilizedIRK,
OrdinaryDiffEq.OrdinaryDiffEqStabilizedRK,
OrdinaryDiffEq.OrdinaryDiffEqSymplecticRK,
OrdinaryDiffEq.OrdinaryDiffEqTsit5,
OrdinaryDiffEq.OrdinaryDiffEqVerner
],
warnonly = [:docs_block, :missing_docs, :eval_block],
format = Documenter.HTML(analytics = "UA-90474609-3",
assets = ["assets/favicon.ico"],
Expand All @@ -56,7 +56,7 @@ makedocs(sitename = "OrdinaryDiffEq.jl",
"explicit/SymplecticRK.md",
"explicit/PRK.md",
"explicit/QPRK.md",
"explicit/Extrapolation.md",
"explicit/Extrapolation.md"
],
"Implicit Solvers" => [
"implicit/SDIRK.md",
Expand Down
2 changes: 1 addition & 1 deletion docs/src/explicit/Extrapolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ first_steps("OrdinaryDiffEqExtrapolation", "ExtrapolationMidpointDeuflhard")
AitkenNeville
ExtrapolationMidpointDeuflhard
ExtrapolationMidpointHairerWanner
```
```
1 change: 0 additions & 1 deletion docs/src/explicit/Nordsieck.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ The Nordsieck implementations here are considered experimental implementations o
and are generally considered inferior to the fixed-leading history-based BDF implementation of FBDF, and thus for all standard usage we recommend FBDF.
However, this algorithm is kept for experimental research and development purposes with the possibility of one day becoming a more discontinuity-aware BDF implementation.


```@eval
first_steps = evalfile("./common_first_steps.jl")
first_steps("OrdinaryDiffEqNordsieck", "AN5")
Expand Down
2 changes: 2 additions & 0 deletions docs/src/explicit/RKN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ To be able to access the solvers in `OrdinaryDiffEqRKN`, you must first install
using Pkg
Pkg.add("OrdinaryDiffEqRKN")
```

This will only install the solvers listed at the bottom of this page.
If you want to explore other solvers for your problem,
you will need to install some of the other libraries listed in the navigation bar on the left.

## Example usage

```julia
using OrdinaryDiffEqOrdinaryDiffEqRKN
function HH_acceleration!(dv, v, u, p, t)
Expand Down
5 changes: 4 additions & 1 deletion docs/src/explicit/SymplecticRK.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ Because of discretization error, when it is solving a Hamiltonian system it does
Instead, that trajectory itself is perturbed `O(Δtn)` for the order n from the true trajectory.
Then there's a linear drift due to numerical error of this trajectory over time
Normal integrators tend to have a quadratic (or more) drift, and do not have any good global guarantees about this phase space path (just local).
What means is that symplectic integrators tend to capture the long-time patterns better than normal integrators because of this lack of drift and this almost guarantee of periodicity.
What means is that symplectic integrators tend to capture the long-time patterns better than normal integrators because of this lack of drift and this almost guarantee of periodicity.

## Installation

To be able to access the solvers in `OrdinaryDiffEqSymplecticRK`, you must first install them use the Julia package manager:

```julia
using Pkg
Pkg.add("OrdinaryDiffEqSymplecticRK")
```

This will only install the solvers listed at the bottom of this page.
If you want to explore other solvers for your problem,
you will need to install some of the other libraries listed in the navigation bar on the left.

## Example usage

```julia
using OrdinaryDiffEqSymplecticRK
function HH_acceleration!(dv, v, u, p, t)
Expand Down
3 changes: 2 additions & 1 deletion docs/src/implicit/BDF.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ SBDF2
SBDF3
SBDF4
```

### IMEX SDIRK

```@docs
Expand All @@ -42,4 +43,4 @@ IMEXEulerARK
DImplicitEuler
DABDF2
DFBDF
```
```
4 changes: 2 additions & 2 deletions docs/src/implicit/Extrapolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Solvers based on within method parallelism.
These solvers perform well for medium sized systems of ordinary differential equations, of about 20 to 500 equations,
at low tolerances.
at low tolerances.

```@eval
first_steps = evalfile("./common_first_steps.jl")
Expand All @@ -16,4 +16,4 @@ ImplicitEulerExtrapolation
ImplicitDeuflhardExtrapolation
ImplicitHairerWannerExtrapolation
ImplicitEulerBarycentricExtrapolation
```
```
2 changes: 1 addition & 1 deletion docs/src/implicit/FIRK.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ first_steps("OrdinaryDiffEqFIRK", "RadauIIA5")
RadauIIA3
RadauIIA5
RadauIIA9
```
```
6 changes: 3 additions & 3 deletions docs/src/implicit/PDIRK.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ There are some advantages to this,
as no SDIRK method can be a higher order than 5,
while DIRK methods generally can have arbitrarily high order and lower error coefficients,
leading to lower errors at larger dt sizes.
With the right construction of the tableau,
With the right construction of the tableau,
these matrices can be factorized and the underlying steps can be computed in parallel,
which is why these are the parallel DIRK methods.

!!! warning "Experimental"

`OrdinaryDiffEqPDIRK` is experimental,
as there are no parallel DIRK tableaus that achieve good performance in the literature.


```@eval
first_steps = evalfile("./common_first_steps.jl")
first_steps("OrdinaryDiffEqPDIRK", "PDIRK44")
Expand All @@ -27,4 +27,4 @@ first_steps("OrdinaryDiffEqPDIRK", "PDIRK44")

```@docs
PDIRK44
```
```
2 changes: 1 addition & 1 deletion docs/src/implicit/Rosenbrock.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ Velds4
GRK4T
GRK4A
Ros4LStab
```
```
4 changes: 3 additions & 1 deletion docs/src/implicit/SDIRK.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ Hairer42
Kvaerno4
Kvaerno5
```

### IMEX SDIRK

```@docs
KenCarp4
KenCarp47
Expand All @@ -42,4 +44,4 @@ ESDIRK436L2SA2
ESDIRK437L2SA
ESDIRK547L2SA2
ESDIRK659L2SA
```
```
1 change: 0 additions & 1 deletion docs/src/implicit/StabalizedIRK.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ first_steps("OrdinaryDiffEqStabalizedIRK", "IRKC")
```@docs
IRKC
```

1 change: 0 additions & 1 deletion docs/src/implicit/StabalizedRK.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ SERK2
ESERK4
ESERK5
```

2 changes: 1 addition & 1 deletion docs/src/semilinear/ExponentialRK.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ EPIRK5s3
EXPRB53s3
EPIRK5P1
EPIRK5P2
```
```
2 changes: 1 addition & 1 deletion docs/src/semilinear/Linear.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ CayleyEuler

```@docs
CG3
```
```
52 changes: 29 additions & 23 deletions lib/OrdinaryDiffEqBDF/src/algorithms.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
function BDF_docstring(description::String,
name::String;
references::String = "",
extra_keyword_description::String = "",
extra_keyword_default::String = "")
name::String;
references::String = "",
extra_keyword_description::String = "",
extra_keyword_default::String = "")
keyword_default = """
chunk_size = Val{0}(),
autodiff = true,
Expand Down Expand Up @@ -30,8 +30,8 @@ function BDF_docstring(description::String,
)
end


@doc BDF_docstring("An adaptive order 2 L-stable fixed leading coefficient multistep BDF method.",
@doc BDF_docstring(
"An adaptive order 2 L-stable fixed leading coefficient multistep BDF method.",
"ABDF2",
references = """
E. Alberdi Celayaa, J. J. Anza Aguirrezabalab, P. Chatzipantelidisc. Implementation of
Expand Down Expand Up @@ -81,11 +81,11 @@ function ABDF2(; chunk_size = Val{0}(), autodiff = true, standardtag = Val{true}
smooth_est, extrapolant, controller, step_limiter!)
end


@doc BDF_docstring("Implicit-explicit (IMEX) method designed for SplitODEFunction equations,
which reduce the size of the implicit handling to a subset of the equations.
It's similar to the additive Runge-Kutta methods in splitting mode,
like `KenCarp4`, but instead using a multistep BDF approach",
@doc BDF_docstring(
"Implicit-explicit (IMEX) method designed for SplitODEFunction equations,
which reduce the size of the implicit handling to a subset of the equations.
It's similar to the additive Runge-Kutta methods in splitting mode,
like `KenCarp4`, but instead using a multistep BDF approach",
"SBDF",
references = """@article{ascher1995implicit,
title={Implicit-explicit methods for time-dependent partial differential equations},
Expand Down Expand Up @@ -205,8 +205,9 @@ See also `SBDF`.
"""
SBDF4(; kwargs...) = SBDF(4; kwargs...)

@doc BDF_docstring("An adaptive order 1 quasi-constant timestep L-stable numerical differentiation function (NDF) method.
Optional parameter kappa defaults to Shampine's accuracy-optimal -0.1850.",
@doc BDF_docstring(
"An adaptive order 1 quasi-constant timestep L-stable numerical differentiation function (NDF) method.
Optional parameter kappa defaults to Shampine's accuracy-optimal -0.1850.",
"QNDF1",
references = """@article{shampine1997matlab,
title={The matlab ode suite},
Expand Down Expand Up @@ -246,7 +247,7 @@ end
function QNDF1(; chunk_size = Val{0}(), autodiff = Val{true}(), standardtag = Val{true}(),
concrete_jac = nothing, diff_type = Val{:forward},
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(),
extrapolant = :linear, kappa = -37//200,
extrapolant = :linear, kappa = -37 // 200,
controller = :Standard, step_limiter! = trivial_limiter!)
QNDF1{
_unwrap_val(chunk_size), _unwrap_val(autodiff), typeof(linsolve), typeof(nlsolve),
Expand All @@ -260,7 +261,8 @@ function QNDF1(; chunk_size = Val{0}(), autodiff = Val{true}(), standardtag = Va
step_limiter!)
end

@doc BDF_docstring("An adaptive order 2 quasi-constant timestep L-stable numerical differentiation function (NDF) method.",
@doc BDF_docstring(
"An adaptive order 2 quasi-constant timestep L-stable numerical differentiation function (NDF) method.",
"QNDF2",
references = """@article{shampine1997matlab,
title={The matlab ode suite},
Expand Down Expand Up @@ -314,8 +316,9 @@ function QNDF2(; chunk_size = Val{0}(), autodiff = Val{true}(), standardtag = Va
step_limiter!)
end

@doc BDF_docstring("An adaptive order quasi-constant timestep NDF method.
Utilizes Shampine's accuracy-optimal kappa values as defaults (has a keyword argument for a tuple of kappa coefficients).",
@doc BDF_docstring(
"An adaptive order quasi-constant timestep NDF method.
Utilizes Shampine's accuracy-optimal kappa values as defaults (has a keyword argument for a tuple of kappa coefficients).",
"QNDF",
references = """@article{shampine1997matlab,
title={The matlab ode suite},
Expand Down Expand Up @@ -364,7 +367,8 @@ function QNDF(; max_order::Val{MO} = Val{5}(), chunk_size = Val{0}(),
diff_type = Val{:forward},
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(), κ = nothing,
tol = nothing,
extrapolant = :linear, kappa = (-37//200, -1//9, -823//10000, -83//2000, 0//1),
extrapolant = :linear, kappa = (
-37 // 200, -1 // 9, -823 // 10000, -83 // 2000, 0 // 1),
controller = :Standard, step_limiter! = trivial_limiter!) where {MO}
QNDF{MO, _unwrap_val(chunk_size), _unwrap_val(autodiff), typeof(linsolve),
typeof(nlsolve), typeof(precs), diff_type, _unwrap_val(standardtag),
Expand Down Expand Up @@ -416,9 +420,10 @@ function MEBDF2(; chunk_size = Val{0}(), autodiff = true, standardtag = Val{true
extrapolant)
end

@doc BDF_docstring("An adaptive order quasi-constant timestep NDF method.
Fixed leading coefficient BDF.
Utilizes Shampine's accuracy-optimal kappa values as defaults (has a keyword argument for a tuple of kappa coefficients).",
@doc BDF_docstring(
"An adaptive order quasi-constant timestep NDF method.
Fixed leading coefficient BDF.
Utilizes Shampine's accuracy-optimal kappa values as defaults (has a keyword argument for a tuple of kappa coefficients).",
"FBDF",
references = """@article{shampine2002solving,
title={Solving 0= F (t, y (t), y′(t)) in Matlab},
Expand Down Expand Up @@ -550,8 +555,9 @@ See also `SBDF`, `IMEXEuler`.
"""
IMEXEulerARK(; kwargs...) = SBDF(1; ark = true, kwargs...)

@doc BDF_docstring("Implicit Euler for implicit DAE form.
It uses an apriori error estimator for adaptivity based on a finite differencing approximation from SPICE.",
@doc BDF_docstring(
"Implicit Euler for implicit DAE form.
It uses an apriori error estimator for adaptivity based on a finite differencing approximation from SPICE.",
"DImplicitEuler",
extra_keyword_description = """
- `nlsolve`: TBD
Expand Down
10 changes: 5 additions & 5 deletions lib/OrdinaryDiffEqCore/src/doc_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ function explicit_rk_docstring(description::String,
)
end
function differentiation_rk_docstring(description::String,
name::String,
solver_class::String;
references::String = "",
extra_keyword_description::String = "",
extra_keyword_default::String = "")
name::String,
solver_class::String;
references::String = "",
extra_keyword_description::String = "",
extra_keyword_default::String = "")
keyword_default = """
chunk_size = Val{0}(),
autodiff = true,
Expand Down
Loading

0 comments on commit 41801dd

Please sign in to comment.