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")
Require OrdinaryDiffEq

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.ShootingType
Shooting(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 SciML ODEProblem interface can be used! (Defaults to nothing which will use poly-algorithm if DifferentialEquations.jl is loaded else this must be supplied)
  • nlsolve: Internal Nonlinear solver. Any solver which conforms to the SciML NonlinearProblem 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 if nlsolve.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. If BVPJacobianAlgorithm is provided, only diffmode is used (defaults to AutoForwardDiff if possible else AutoFiniteDiff).
source
BoundaryValueDiffEqShooting.MultipleShootingType
MultipleShooting(; 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 SciML ODEProblem interface can be used! (Defaults to nothing which will use poly-algorithm if DifferentialEquations.jl is loaded else this must be supplied)

  • nlsolve: Internal Nonlinear solver. Any solver which conforms to the SciML NonlinearProblem interface can be used.

  • jac_alg: Jacobian Algorithm used for the nonlinear solver. Defaults to BVPJacobianAlgorithm(), which automatically decides the best algorithm to use based on the input types and problem type.

    • For TwoPointBVProblem, only diffmode is used (defaults to AutoSparse(AutoForwardDiff()) if possible else AutoSparse(AutoFiniteDiff())).
    • For BVProblem, bc_diffmode and nonbc_diffmode are used. For nonbc_diffmode we default to AutoSparse(AutoForwardDiff()) if possible else AutoSparse(AutoFiniteDiff()). For bc_diffmode, we default to AutoForwardDiff if possible else AutoFiniteDiff.
  • 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} or Ntuple{N, <:Integer}: Use the provided grid coarsening. For example, if nshoots = 10 and grid_coarsening = [5, 2], then the grid will be coarsened to [5, 2]. Note that 1 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, if nshoots = 10 and grid_coarsening = n -> n ÷ 2, then the grid will be coarsened to [5, 2].
source