Internals

Internals

Continuation problem

Definition of continuation problem.

Numerical continuation algorithms find curves in $\mathbb R^{N}$ implicitly defined by

\[H(u) = 0\]

where $H: \mathbb R^{N} \to \mathbb R^{N-1}$.

A continuation problem type (a subtype of AbstractContinuationProblem) defines problems for such algorithms to solve by providing how to compute:

source
AbstractProblemCache{P <: AbstractContinuationProblem}

Cache for computing $H$ and its Jacobian.

source
residual(u, cache) ↦ H

Compute $H(u) \in \mathbb R^{N - 1}$ (aka in-place computation). The definition of $H$ is specified by cache.

The name residual of the function is came from the problem we are to solve: i.e., find the set of $u$ such that $H(u) = 0$. Thus, the vector returned by residual(u, cache) is considered to be a residual.

Arguments

  • u::AbstractVector (size: (N,))
  • cache::AbstractProblemCache
source
residual!(H, u, cache) ↦ H

Compute $H(u) \in \mathbb R^{N - 1}$ and store the result in H (aka out-of-place computation). The definition of $H$ is specified by cache.

See also: residual

Arguments

  • H::AbstractVector (size: (N - 1,))
  • u::AbstractVector (size: (N,))
  • cache::AbstractProblemCache
source
residual_jacobian!(H, J, u, cache) ↦ (H, J)

Compute $H(u)$ and its Jacobian $\partial H / \partial u$.

Arguments

  • H::AbstractVector (size: (N - 1,)) $= H(u)$
  • J::AbstractMatrix (size: (N - 1, N)) $= \partial H / \partial u$
  • u::AbstractVector (size: (N,))
  • cache::AbstractProblemCache
source
isindomain(u, cache) :: Bool

Arguments

  • u::AbstractVector (size: (N,))
  • cache::AbstractProblemCache
source
get_prob_cache(prob::AbstractContinuationProblem) :: AbstractProblemCache
source
get_u0(prob::AbstractContinuationProblem) ↦ u0
source

Continuation algorithm

Cache for Euler-Newton continuation method.

See AbstractContinuationProblem for the mathematical setup.

Fields

  • prob_cache
  • u (size: (N,))
  • H (size: (N - 1,)) $= H(u)$
  • J (size: (N - 1, N)) $= \partial H / \partial u$
  • Q (size: (N - 1, N)): temporary array for the QR decomposition
  • h::Real: step size
  • direction::Int: +1 or -1
  • corrector_success::Bool
  • adaptation_success::Bool
  • simple_bifurcation::Bool
source

Bifurcation problem

Fixed point bifurcation problem.

See also: AbstractContinuationProblem

Fields

  • homotopy::Function: A function to compute $H(x, t)$ where $H$ is a homotopy $H: \mathbb R^N \times \mathbb R \to \mathbb R^N$. Function homotopy must be callable in one of the following form: homotopy(x, p, t) ↦ H (return H) for mutable state type or homotopy(H, x, p, t) (mutate H) for immutable state type.
  • homotopy_jacobian::Union{Function, Nothing}: A function to compute $H(x, t)$ and its Jacobian $J = \partial H / \partial (x, t) \in \mathbb R^{N \times (N+1)}$. Function homotopy_jacobian must be callable in one of the following form: homotopy_jacobian(x, p, t) ↦ (H, J) (return (H, J)) or homotopy_jacobian(H, J, x, p, t) (mutate H and J).
  • u0::Union{AbstractArray, Real}: Initial state.
  • t0::Real: Initial parameter.
  • t_domain::Tuple{<:Real, <:Real}: Range of the parameter.
  • phase_space::Tuple{typeof(u0), typeof(u0)}: A pair of lower and upper bound of the phase space. Default is unbounded.
  • p: Model parameter (constants).
source