BoundaryValueDiffEqShooting
Single shooting method and multiple shooting method. To only use the Shooting methods form BoundaryValueDiffEq.jl, you need to install them use the Julia package manager:
using Pkg
Pkg.add("BoundaryValueDiffEqShooting")solve(prob::BVProblem, alg; kwargs...)
solve(prob::TwoPointBVProblem, alg; kwargs...)Shooting methods should be use together with ODE solvers:
BoundaryValueDiffEqShooting.Shooting
BoundaryValueDiffEqShooting.MultipleShootingFull 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, optimize = 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 SciMLODEProbleminterface can be used! (Defaults tonothingwhich will use poly-algorithm ifDifferentialEquations.jlis loaded else this must be supplied)nlsolve: Internal Nonlinear solver. Any solver which conforms to the SciMLNonlinearProbleminterface can be used. Note that any autodiff argument for the solver will be ignored and a custom jacobian algorithm will be used.optimize: Internal Optimization solver. Any solver which conforms to the SciMLOptimizationProbleminterface 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.adexists 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. IfBVPJacobianAlgorithmis provided, onlydiffmodeis used (defaults toAutoForwardDiffif possible elseAutoFiniteDiff).
BoundaryValueDiffEqShooting.MultipleShooting — TypeMultipleShooting(; nshoots::Int, ode_alg = nothing, nlsolve = nothing,
optimize = 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 SciMLODEProbleminterface can be used! (Defaults tonothingwhich will use poly-algorithm ifDifferentialEquations.jlis loaded else this must be supplied)nlsolve: Internal Nonlinear solver. Any solver which conforms to the SciMLNonlinearProbleminterface can be used.optimize: Internal Optimization solver. Any solver which conforms to the SciMLOptimizationProbleminterface 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, onlydiffmodeis used (defaults toAutoSparse(AutoForwardDiff())if possible elseAutoSparse(AutoFiniteDiff())). - For
BVProblem,bc_diffmodeandnonbc_diffmodeare used. Fornonbc_diffmodewe default toAutoSparse(AutoForwardDiff())if possible elseAutoSparse(AutoFiniteDiff()). Forbc_diffmode, we default toAutoForwardDiffif 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 = 10andgrid_coarsening = [5, 2], then the grid will be coarsened to[5, 2]. Note that1should 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 = 10andgrid_coarsening = n -> n ÷ 2, then the grid will be coarsened to[5, 2].