Skip to main content

Crate russell_nonlin

Crate russell_nonlin 

Source
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, λ) = 0

where 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 solves G(u, λ) = 0 at 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 variable s and solves G(u(s), λ(s)) = 0. Can navigate folds, turning points, and other singularities.

§Main types

TypeRole
SystemDefines G(u, λ) and its Jacobian ∂G/∂u via callbacks
ConfigSolver settings: method, tolerances, step control, linear solver
SolverMain entry point; created from a Config and a System
StopStopping criterion (target λ, target u-component, or number of steps)
DeltaLambdaStep strategy: automatic, constant, or list-based Δλ
OutputCollects accepted-step results and/or runs a user callback
StatsBenchmarking 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
DeltaLambda
Defines how Δλ is adjusted between steps
Output
Collects accepted-step results and optionally triggers a user callback
SampleBsplineArgs
Holds extra arguments for the B-spline problem
Samples
Holds a collection of nonlinear problems
Solver
Solver for parameterized nonlinear systems using Numerical Continuation
SolverArclength
Implements the pseudo-arclength continuation method to solve G(u, λ) = 0
SolverNatural
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.
RdiffType
Defines the type of the relative difference used in the stepsize control using the tangent vector
SoderlindClass
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

Type Aliases§

NoArgs
Indicates that the system functions do not require extra arguments
StrError
Defines the error output as a static string