BoundaryValueDiffEqShooting
Single shooting method and multiple shooting method. To only use the Shooting methods form BoundaryVaueDiffEq.jl, you need to install them use the Julia package manager:
using Pkg
Pkg.add("BoundaryValueDiffEqShooting")
Shooting methods require OrdinaryDiffEq.jl loaded to use the ODE solvers
solve(prob::BVProblem, alg; kwargs...)
solve(prob::TwoPointBVProblem, alg; kwargs...)
Shooting methods should be use together with ODE solvers:
BoundaryValueDiffEqShooting.Shooting
BoundaryValueDiffEqShooting.MultipleShooting
Full List of Methods
Shooting
: Single shooting methods, reduces BVP to an initial value problem and solves the IVP.MultipleShooting
: Reduces BVP to an initial value problem and solves the IVP. Significantly more stable than Single Shooting.
Detailed Solvers Explanation
BoundaryValueDiffEqShooting.Shooting
— TypeShooting(ode_alg; kwargs...)
Shooting(ode_alg, nlsolve; kwargs...)
Shooting(; ode_alg = nothing, nlsolve = nothing, jac_alg = nothing)
Single shooting method, reduces BVP to an initial value problem and solves the IVP.
Arguments
ode_alg
: ODE algorithm to use for solving the IVP. Any solver which conforms to the SciMLODEProblem
interface can be used! (Defaults tonothing
which will use poly-algorithm ifDifferentialEquations.jl
is loaded else this must be supplied)nlsolve
: Internal Nonlinear solver. Any solver which conforms to the SciMLNonlinearProblem
interface can be used. Note that any autodiff argument for the solver will be ignored and a custom jacobian algorithm will be used.jac_alg
: Jacobian Algorithm used for the Nonlinear Solver. If this is not set, we check ifnlsolve.ad
exists and is not nothing. If it is, we use that to construct the jacobian. If not, we try to use the best algorithm based on the input types and problem type. IfBVPJacobianAlgorithm
is provided, onlydiffmode
is used (defaults toAutoForwardDiff
if possible elseAutoFiniteDiff
).
BoundaryValueDiffEqShooting.MultipleShooting
— TypeMultipleShooting(; nshoots::Int, ode_alg = nothing, nlsolve = nothing,
grid_coarsening = true, jac_alg = nothing)
MultipleShooting(nshoots::Int; kwargs...)
MultipleShooting(nshoots::Int, ode_alg; kwargs...)
MultipleShooting(nshoots::Int, ode_alg, nlsolve; kwargs...)
Multiple Shooting method, reduces BVP to an initial value problem and solves the IVP. Significantly more stable than Single Shooting.
Arguments
nshoots
: Number of shooting points.ode_alg
: ODE algorithm to use for solving the IVP. Any solver which conforms to the SciMLODEProblem
interface can be used! (Defaults tonothing
which will use poly-algorithm ifDifferentialEquations.jl
is loaded else this must be supplied)nlsolve
: Internal Nonlinear solver. Any solver which conforms to the SciMLNonlinearProblem
interface can be used.jac_alg
: Jacobian Algorithm used for the nonlinear solver. Defaults toBVPJacobianAlgorithm()
, which automatically decides the best algorithm to use based on the input types and problem type.- For
TwoPointBVProblem
, onlydiffmode
is used (defaults toAutoSparse(AutoForwardDiff())
if possible elseAutoSparse(AutoFiniteDiff())
). - For
BVProblem
,bc_diffmode
andnonbc_diffmode
are used. Fornonbc_diffmode
we default toAutoSparse(AutoForwardDiff())
if possible elseAutoSparse(AutoFiniteDiff())
. Forbc_diffmode
, we default toAutoForwardDiff
if possible elseAutoFiniteDiff
.
- For
grid_coarsening
: Coarsening the multiple-shooting grid to generate a stable IVP solution. Possible Choices:true
: Halve the grid size, till we reach a grid size of 1.false
: Do not coarsen the grid. Solve a Multiple Shooting Problem and finally solve a Single Shooting Problem.AbstractVector{<:Int}
orNtuple{N, <:Integer}
: Use the provided grid coarsening. For example, ifnshoots = 10
andgrid_coarsening = [5, 2]
, then the grid will be coarsened to[5, 2]
. Note that1
should not be present in the grid coarsening.Function
: Takes the current number of shooting points and returns the next number of shooting points. For example, ifnshoots = 10
andgrid_coarsening = n -> n ÷ 2
, then the grid will be coarsened to[5, 2]
.