Skip to content

Commit

Permalink
add docs on codim2 jacobians
Browse files Browse the repository at this point in the history
  • Loading branch information
rveltz committed Oct 7, 2024
1 parent c33592a commit d29643a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 14 deletions.
7 changes: 4 additions & 3 deletions docs/src/FoldContinuationPO.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ You can detect the following codim 2 bifurcation points by using the keyword arg

In order to apply the newton algorithm to the Fold functional, one needs to invert the jacobian. This is not completely trivial as one must compute this jacobian and then invert it. You can select the following jacobians for your computations (see below):

- [Default] for `jacobian_ma = :autodiff`, automatic differentiation is applied to the Fold functional and the matrix is then inverted using the provided linear solver. In particular, the jacobian is formed. This is very well suited for small dimensions (say < 100)
- for `jacobian_ma = :finiteDifferences`, same as `jacobian_ma = :autodiff` but the jacobian is computed using finite differences.
- for `jacobian_ma = :minaug`, a specific procedure for evaluating the jacobian and inverting it (without forming the jacobian!) is used. This is well suited for large dimensions.
- `jacobian_ma = :autodiff` [Default]: automatic differentiation is applied to the Fold functional and the matrix is then inverted using the provided linear solver. In particular, the jacobian is formed. This is very well suited for small dimensions (say < 100)
- `jacobian_ma = :finiteDifferences`: same as `jacobian_ma = :autodiff` but the jacobian is computed using finite differences.
- `jacobian_ma = :minaug`: a specific procedure for evaluating the jacobian and inverting it (without forming the jacobian!) is used. This is well suited for large dimensions and for matrix-free version.
- `jacobian_ma = :MinAugMatrixBased` the jacobian matrix is evaluated using analytical formula. This is faster than `:autodiff`.

## Codim 2 continuation

Expand Down
6 changes: 4 additions & 2 deletions docs/src/NSContinuationPO.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ You can detect the following codim 2 bifurcation points by using the keyword arg

In order to apply the newton algorithm to the PD functional, one needs to invert the jacobian. This is not completely trivial as one must compute this jacobian and then invert it. You can select the following jacobians for your computations (see below):

- [Default] for `jacobian_ma = :autodiff`, automatic differentiation is applied to the PD functional and the matrix is then inverted using the provided linear solver. In particular, the jacobian is formed. This is very well suited for small dimensions (say < 100)
- for `jacobian_ma = :finiteDifferences`, same as `jacobian_ma = :autodiff` but the jacobian is computed using finite differences.
- `jacobian_ma = :autodiff` [Default]: automatic differentiation is applied to the NS functional and the matrix is then inverted using the provided linear solver. In particular, the jacobian is formed. This is very well suited for small dimensions (say < 100)
- `jacobian_ma = :finiteDifferences`: same as `jacobian_ma = :autodiff` but the jacobian is computed using finite differences.
- `jacobian_ma = :minaug`: a specific procedure for evaluating the jacobian and inverting it (without forming the jacobian!) is used. This is well suited for large dimensions and for matrix-free version.
- `jacobian_ma = :MinAugMatrixBased` the jacobian matrix is evaluated using analytical formula. This is faster than `:autodiff`.

## Codim 2 continuation

Expand Down
7 changes: 4 additions & 3 deletions docs/src/PDContinuationPO.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ You can detect the following codim 2 bifurcation points by using the option `det

In order to apply the newton algorithm to the PD functional, one needs to invert the jacobian. This is not completely trivial as one must compute this jacobian and then invert it. You can select the following jacobians for your computations (see below):

- [Default] for `jacobian_ma = :autodiff`, automatic differentiation is applied to the PD functional and the matrix is then inverted using the provided linear solver. In particular, the jacobian is formed. This is very well suited for small dimensions (say < 100)
- for `jacobian_ma = :finiteDifferences`, same as `jacobian_ma = :autodiff` but the jacobian is computed using finite differences.
- for `jacobian_ma = :minaug`, a specific procedure for evaluating the jacobian and inverting it (without forming the jacobian!) is used. This is well suited for large dimensions.
- `jacobian_ma = :autodiff` [Default]: automatic differentiation is applied to the PD functional and the matrix is then inverted using the provided linear solver. In particular, the jacobian is formed. This is very well suited for small dimensions (say < 100)
- `jacobian_ma = :finiteDifferences`: same as `jacobian_ma = :autodiff` but the jacobian is computed using finite differences.
- `jacobian_ma = :minaug`: a specific procedure for evaluating the jacobian and inverting it (without forming the jacobian!) is used. This is well suited for large dimensions and for matrix-free version.
- `jacobian_ma = :MinAugMatrixBased` the jacobian matrix is evaluated using analytical formula. This is faster than `:autodiff`.

> For the case `jacobian_ma = :minaug`, when the shooting method is employed, the adjoint of the flow is required. This can usually be computed with `ReverseDiff.jl`.
Expand Down
7 changes: 5 additions & 2 deletions docs/src/codim2Continuation.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@ You can detect the following codim 2 bifurcation points by using the option `det

In order to apply the newton algorithm to $F_f$ or $F_h$, one needs to invert the jacobian. This is not completely trivial as one must compute this jacobian and then invert it. You can select the following jacobians for your computations (see below):

- [Default] for `jacobian_ma = :autodiff`, automatic differentiation is applied to $F_f$ (or $F_h$) and the matrix is then inverted using the provided linear solver. In particular, the jacobian is formed. This is very well suited for small dimensions (say < 100)
- for `jacobian_ma = :minaug`, a specific procedure for evaluating the jacobian $F_f$ (or $F_h$) and inverting it (without forming the jacobian!) is used. This is well suited for large dimensions.
- `jacobian_ma = :autodiff` [Default], automatic differentiation is applied to $F_f$ (or $F_h$) and the matrix is then inverted using the provided linear solver. In particular, the jacobian is formed. This is very well suited for small dimensions (say < 100)
- `jacobian_ma = :minaug`, a specific procedure for evaluating the jacobian $F_f$ (or $F_h$) and inverting it (without forming the jacobian!) is used. This is well suited for large dimensions. It can be used for matrix-free (*e.g.* iterative) solvers.
- `jacobian_ma = :MinAugMatrixBased` the jacobian matrix is evaluated using analytical formula. This allows for example to form a sparse matrix when the underlying problem has sparse jacobian.
- `jacobian_ma = :finiteDifferencesMF` the jacobian is evaluated in a matrix-free version using finite differences. Mainly for debugging purposes.
- `jacobian_ma = :finiteDifferences`. The jacobian matrix is evaluated using finite differences.

## Newton refinement

Expand Down
4 changes: 2 additions & 2 deletions docs/src/codim3Continuation.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ and where $w,v$ are chosen in order to have a non-singular matrix $(M_{bt})$. Mo

In order to apply the newton algorithm to $F_{bt}$, one needs to invert the jacobian. This is not completely trivial as one must compute this jacobian and then invert it. You can select the following jacobians for your computations (see below):

- [Default] for `jacobian_ma = :autodiff`, automatic differentiation is applied to $F_{bt}$ and the matrix is then inverted using the provided linear solver. In particular, the jacobian is formed. This is very well suited for small dimensions (say < 100)
- for `jacobian_ma = :minaug`, a specific procedure for evaluating the jacobian $F_{bt}$ and inverting it (without forming the jacobian!) is used. This is well suited for large dimensions.
- `jacobian_ma = :autodiff`: [Default] automatic differentiation is applied to $F_{bt}$ and the matrix is then inverted using the provided linear solver. In particular, the jacobian is formed. This is very well suited for small dimensions (say < 100)
- `jacobian_ma = :minaug`: a specific procedure for evaluating the jacobian $F_{bt}$ and inverting it (without forming the jacobian!) is used. This is well suited for large dimensions.

## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/src/detectionBifurcation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The bifurcations are detected during a call to `br = continuation(prob, alg, con
The bifurcation points are located by looking at the spectrum **e.g.** by monitoring the unstable eigenvalues. The eigenvalue λ is declared unstable if `real(λ) > contParams.tol_stability`. The located bifurcation points are then returned in `br.specialpoint`.

!!! warning "Eigenvalues"
The rightmost eigenvalues are computed by default to detect bifurcations. Hence, the number of eigenvalues with positive real parts must be finite (*e.g.* small). This might require to consider $-F(x,p)=0$ instead of (E).
The rightmost eigenvalues are computed by default to detect bifurcations. Hence, the number of eigenvalues with positive real parts must be finite (*e.g.* small). This might require to consider $-F(x,p)=0$ instead of $F(x,p)$.

## Precise detection of bifurcation points using bisection

Expand Down
2 changes: 1 addition & 1 deletion docs/src/detectionBifurcationPO.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The user must specify the number of eigenvalues to be computed (like `nev = 10`)

## Eigensolver

The user must provide an eigensolver by setting `NewtonOptions.eigsolver` where `newton_options` is located in the parameter `::ContinuationPar` passed to continuation. See [`NewtonPar`](@ref) and [`ContinuationPar`](@ref) for more information on the composite type of the options passed to `newton` and `continuation`.
The user must provide an eigensolver by setting `newton_options.eigsolver` where `newton_options` is located in the parameter `::ContinuationPar` passed to continuation. See [`NewtonPar`](@ref) and [`ContinuationPar`](@ref) for more information on the composite type of the options passed to `newton` and `continuation`.

The eigensolver is highly problem dependent and this is why the user should implement / parametrize its own eigensolver through the abstract type `AbstractEigenSolver` or select one among [List of implemented eigen solvers](@ref).

Expand Down

0 comments on commit d29643a

Please sign in to comment.