numra-nonlinear 0.1.2

Nonlinear solvers for Numra: Newton-Raphson with line search, analytical or finite-difference Jacobians.
Documentation

numra-nonlinear

Nonlinear solvers for the Numra workspace — Newton-Raphson with Wolfe line-search globalization, analytical or finite-difference Jacobians.

Crates.io docs.rs

Iterative methods for systems of nonlinear equations F(x) = 0. The same machinery underlies every implicit ODE stage and every gradient-based optimizer's inner solve in the workspace.

Example

use numra_nonlinear::{Newton, NonlinearSystem};

// Solve x² = 2 by finding a root of F(x) = x² − 2.
struct SquareRoot;

impl NonlinearSystem<f64> for SquareRoot {
    fn dim(&self) -> usize { 1 }
    fn eval
        (&self, x: &[f64], f: &mut [f64]) {
        f[0] = x[0] * x[0] - 2.0;
    }
}

let solver = Newton::default_solver();
let r = solver.solve(&SquareRoot, &[1.5]).unwrap();
assert!((r.x[0] - std::f64::consts::SQRT_2).abs() < 1e-10);

What's in this crate

  • Newton — Newton-Raphson with optional Wolfe line search
  • newton_solve / NewtonOptions / NewtonResult — function form with full control over tolerances, max-iterations, and FD Jacobian step
  • NonlinearSystem trait — user-defined F(x) and optional analytical Jacobian
  • wolfe_line_search / WolfeOptions — standalone strong-Wolfe line search for use outside the Newton solver

Composes with

  • numra-linalg for the linear-system solve at each Newton step
  • numra-ode for the implicit-stage and BDF nonlinear correction
  • numra-optim for SQP and augmented-Lagrangian inner solves

Install

[dependencies]
numra-nonlinear = "0.1"

Or via the umbrella crate:

[dependencies]
numra = "0.1"

Documentation

License

Numra Academic & Research License (Non-Commercial). Academic and research use is free; commercial use requires a separate license — contact contact@spectralautomata.com. See LICENSE.