Automatic switching between Natural and PALC

This is one of the continuation methods implemented in the package. It is set by the option AutoSwitch() in continuation. See also AutoSwitch for more information.

This algorithm uses a Natural continuation when the branch is "horizontal" and switches to PALC otherwise.

Example

We provide an example of use. We define a BifurcationProblem as usual and pass the continuation algorithm AutoSwitch.

using Plots
using BifurcationKit
const BK = BifurcationKit

function F(x, p)
	(;α) = p
	f = similar(x)

	f[1] = (-2x[1]+x[2]) + α * exp(x[1])
	f[2] = ( x[1]-2x[2]) + α * exp(x[2])

	return f
end

sol0 = zeros(2)
par = (α = 0.0, )
prob = BifurcationProblem(F, sol0, par, (@optic _.α))
┌─ Bifurcation Problem with uType Vector{Float64}
├─ Inplace:  false
├─ Symmetric: false
└─ Parameter: α
opts = ContinuationPar(dsmax = 0.15, max_steps = 40, )

br = continuation(prob, AutoSwitch(), opts, normC = norminf)
 ┌─ Curve type: EquilibriumCont
 ├─ Number of points: 41
 ├─ Type of vectors: Vector{Float64}
 ├─ Parameter α starts at 0.0, ends at 0.0037504194992568863
 ├─ Algo: AutoSwitch
 └─ Special points:

- #  1,       bp at α ≈ +0.35676608 ∈ (+0.35676608, +0.36285736), |δp|=6e-03, [    guess], δ = ( 1,  0), step =  11
- #  2,       bp at α ≈ +0.11540873 ∈ (+0.11540873, +0.15405030), |δp|=4e-02, [    guess], δ = ( 1,  0), step =  20
- #  3, endpoint at α ≈ +0.00311805,                                                                     step =  41

You can plot the result as usual:

plot(br)
Example block output