geqslib - Grant's Equation Solver Library
Geqslib defines several functions for evaluating expressions and solving equations given as strings. The crate provides both single and multiple-variable implementations of the Newton-Raphson root-finding algorithm and provides them for use in other scenarios where expressions may be better represented by a closure than a string.
Most of the provided functions, however, are focused on evaluating expressions or equations as strings:
Example
use solve_equation_from_str;
let = solve_equation_from_str.unwrap;
assert_eq!;
assert!;
Geqslib also provides a SystemBuilder struct for properly constraining a system of equations for later solving.
Example
use ;
use new_context;
let mut ctx = new_context;
// Build up the system:
let mut builder = new.unwrap;
builder.try_constrain_with;
// Convert to a constrained system
let mut sys = builder
.build_system
.expect;
// Specify guess value and domain for variables if desired
sys.specify_variable;
// Specify tolerance and iteration limit, then solve!
let soln = sys.solve
.expect;
// Solution is x = 6.5, y = 2.5
assert!;
assert!;