@@ -6,6 +6,21 @@ abstract type AbstractMIRK <: BoundaryValueDiffEqAlgorithm end
6
6
Shooting(ode_alg; nlsolve = NewtonRaphson())
7
7
8
8
Single shooting method, reduces BVP to an initial value problem and solves the IVP.
9
+
10
+ ## Arguments
11
+
12
+ - `ode_alg`: ODE algorithm to use for solving the IVP. Any `OrdinaryDiffEq.jl` or solvers
13
+ that work with `SciMLBase.__solve(::ODEProblem, alg, args...; kwargs...)` can be used!
14
+
15
+ ## Keyword Arguments
16
+
17
+ - `nlsolve`: Internal Nonlinear solver. Any `NonlinearSolve.jl` solver or solvers that
18
+ work with `SciMLBase.__solve(::NonlinearProblem, alg, args...; kwargs...)` can be used!
19
+
20
+ !!! note
21
+ For type-stability, you need to specify the chunksize for autodiff. This can be done
22
+ via `NewtonRaphson(; autodiff = AutoForwardDiff(; chunksize = <chunksize>))`.
23
+ Alternatively, you can use other ADTypes!
9
24
"""
10
25
struct Shooting{O, N} <: BoundaryValueDiffEqAlgorithm
11
26
ode_alg:: O
@@ -16,10 +31,46 @@ Shooting(ode_alg; nlsolve = NewtonRaphson()) = Shooting(ode_alg, nlsolve)
16
31
17
32
"""
18
33
MultipleShooting(nshoots::Int, ode_alg; nlsolve = NewtonRaphson(),
19
- grid_coarsening = true)
34
+ grid_coarsening = true, jac_alg = BVPJacobianAlgorithm() )
20
35
21
36
Multiple Shooting method, reduces BVP to an initial value problem and solves the IVP.
22
37
Significantly more stable than Single Shooting.
38
+
39
+ ## Arguments
40
+
41
+ - `nshoots`: Number of shooting points.
42
+ - `ode_alg`: ODE algorithm to use for solving the IVP. Any `OrdinaryDiffEq.jl` or solvers
43
+ that work with `SciMLBase.__solve(::ODEProblem, alg, args...; kwargs...)` can be used!
44
+
45
+ ## Keyword Arguments
46
+
47
+ - `nlsolve`: Internal Nonlinear solver. Any `NonlinearSolve.jl` solver or solvers that
48
+ work with `SciMLBase.__solve(::NonlinearProblem, alg, args...; kwargs...)` can be used!
49
+ Note that any autodiff argument for the solver will be ignored and a custom jacobian
50
+ algorithm will be used.
51
+ - `jac_alg`: Jacobian Algorithm used for the nonlinear solver. Defaults to
52
+ `BVPJacobianAlgorithm()`, which automatically decides the best algorithm to use based
53
+ on the input types and problem type.
54
+ - For `TwoPointBVProblem`, only `diffmode` is used (defaults to
55
+ `AutoSparseForwardDiff` if possible else `AutoSparseFiniteDiff`).
56
+ - For `BVProblem`, `bc_diffmode` and `nonbc_diffmode` are used. For `nonbc_diffmode`
57
+ defaults to `AutoSparseForwardDiff` if possible else `AutoSparseFiniteDiff`. For
58
+ `bc_diffmode`, defaults to `AutoForwardDiff` if possible else `AutoFiniteDiff`.
59
+ - `grid_coarsening`: Coarsening the multiple-shooting grid to generate a stable IVP
60
+ solution. Possible Choices:
61
+ - `true`: Halve the grid size, till we reach a grid size of 1.
62
+ - `false`: Do not coarsen the grid. Solve a Multiple Shooting Problem and finally
63
+ solve a Single Shooting Problem.
64
+ - `AbstractVector{<:Int}` or `Ntuple{N, <:Integer}`: Use the provided grid coarsening.
65
+ For example, if `nshoots = 10` and `grid_coarsening = [5, 2]`, then the grid will be
66
+ coarsened to `[5, 2]`. Note that `1` should not be present in the grid coarsening.
67
+ - `Function`: Takes the current number of shooting points and returns the next number
68
+ of shooting points. For example, if `nshoots = 10` and
69
+ `grid_coarsening = n -> n ÷ 2`, then the grid will be coarsened to `[5, 2]`.
70
+
71
+ !!! note
72
+ For type-stability, the chunksizes for ForwardDiff ADTypes in `BVPJacobianAlgorithm`
73
+ must be provided.
23
74
"""
24
75
@concrete struct MultipleShooting{J <: BVPJacobianAlgorithm }
25
76
ode_alg
@@ -62,6 +113,25 @@ for order in (2, 3, 4, 5, 6)
62
113
63
114
$($ order) th order Monotonic Implicit Runge Kutta method, with Newton Raphson nonlinear solver as default.
64
115
116
+ ## Keyword Arguments
117
+
118
+ - `nlsolve`: Internal Nonlinear solver. Any `NonlinearSolve.jl` solver or
119
+ solvers that work with
120
+ `SciMLBase.__solve(::NonlinearProblem, alg, args...; kwargs...)` can be used!
121
+ - `jac_alg`: Jacobian Algorithm used for the nonlinear solver. Defaults to
122
+ `BVPJacobianAlgorithm()`, which automatically decides the best algorithm to
123
+ use based on the input types and problem type.
124
+ - For `TwoPointBVProblem`, only `diffmode` is used (defaults to
125
+ `AutoSparseForwardDiff` if possible else `AutoSparseFiniteDiff`).
126
+ - For `BVProblem`, `bc_diffmode` and `nonbc_diffmode` are used. For
127
+ `nonbc_diffmode` defaults to `AutoSparseForwardDiff` if possible else
128
+ `AutoSparseFiniteDiff`. For `bc_diffmode`, defaults to `AutoForwardDiff` if
129
+ possible else `AutoFiniteDiff`.
130
+
131
+ !!! note
132
+ For type-stability, the chunksizes for ForwardDiff ADTypes in
133
+ `BVPJacobianAlgorithm` must be provided.
134
+
65
135
## References
66
136
67
137
@article{Enright1996RungeKuttaSW,
0 commit comments