Expand description
Numerical Continuation methods to solve nonlinear systems of equations
This crate implements Predictor-Corrector solvers based on the Euler-Newton method for tracing solution branches of parameterized nonlinear systems of the form:
G(u, λ) = 0where u is the state vector and λ is a scalar load/control parameter.
§Methods
Two continuation strategies are available via Method:
-
Method::Natural— Natural parameter continuation. Increments λ step-by-step and solvesG(u, λ) = 0at each step. Simple and efficient on regular branches, but cannot pass folds (limit points) where∂λ/∂s = 0. -
Method::Arclength— Pseudo-arclength continuation. Parametrizes the solution curve by an arclength-like variablesand solvesG(u(s), λ(s)) = 0. Can navigate folds, turning points, and other singularities.
§Main types
| Type | Role |
|---|---|
System | Defines G(u, λ) and its Jacobian ∂G/∂u via callbacks |
Config | Solver settings: method, tolerances, step control, linear solver |
Solver | Main entry point; created from a Config and a System |
Stop | Stopping criterion (target λ, target u-component, or number of steps) |
DeltaLambda | Step strategy: automatic, constant, or list-based Δλ |
Output | Collects accepted-step results and/or runs a user callback |
Stats | Benchmarking counters returned after solving |
§Example
use russell_nonlin::{Config, DeltaLambda, IniDir, Output, Samples, Solver, Stop};
use russell_sparse::Sym;
// G(u, λ) = u - λ → exact solution: u = λ
let (system, mut u, mut l, mut args) = Samples::simple_linear_problem(Sym::No);
// configure the solver (Natural parameter continuation is the default)
let config = Config::new();
let mut solver = Solver::new(&config, system).unwrap();
// record results at each accepted step
let out = &mut Output::new();
out.set_recording(true, &[0], &[]);
// trace from λ = 0 to λ = 1 with constant Δλ = 0.1
solver
.solve(
&mut args,
&mut u,
&mut l,
IniDir::Pos,
Stop::MaxLambda(1.0),
&DeltaLambda::constant(0.1),
Some(out),
)
.unwrap();
assert_eq!(out.get_l_values().len(), 11); // initial point + 10 steps
assert!((u[0] - 1.0).abs() < 1e-14);
assert!((l - 1.0).abs() < 1e-14);Structs§
- Config
- Holds configuration options for the nonlinear solver
- Delta
Lambda - Defines how Δλ is adjusted between steps
- Output
- Collects accepted-step results and optionally triggers a user callback
- Sample
Bspline Args - Holds extra arguments for the B-spline problem
- Samples
- Holds a collection of nonlinear problems
- Solver
- Solver for parameterized nonlinear systems using Numerical Continuation
- Solver
Arclength - Implements the pseudo-arclength continuation method to solve G(u, λ) = 0
- Solver
Natural - Implements the natural parameter continuation method to solve G(u, λ) = 0
- Stats
- Holds statistics and benchmarking data
- System
- Defines the non-linear system of equations
Enums§
- IniDir
- Defines the initial direction of the tangent vector for the pseudo-arclength method or the (constant) sign of Δλ for the Natural method.
- Method
- Specifies the method of continuation to be used.
- Rdiff
Type - Defines the type of the relative difference used in the stepsize control using the tangent vector
- Soderlind
Class - Specifies the problem classes in Soderlind (2003) that can be used to define the stepsize control parameters
- Status
- Specifies Success or Failure
- Stop
- Specifies the stopping criterion for the continuation process.
Constants§
- CONFIG_
H_ MIN - Defines the smallest allowed h
- CONFIG_
TOL_ MIN - Defines the smallest allowed tolerance
- N_
EQUAL_ STEPS - Default number of steps