Scientific Computing in Rust
- Initial value problem solving
- Root finding algorithms
- Polynomial Interpolation
- Scientific Constants
- Special functions/polynomials
- Numeric quadrature
- Numeric differentiation
Explanations of the features can be found here.
Initial Value Problems
There are two adaptive Runge-Kutta methods, two
Adams predictor-correctors, and two adaptive Backwards Differentiation
Formulas implemented. The interface to all of the solvers is the same.
As an example, this code solves
y' = y using the Runge-Kutta-Fehlberg
use ; use SVector;
There is also a
solve_ivp function in
bacon_sci::ivp that tries a fifth-order
predictor-corrector followed by the Runge-Kutta-Fehlberg method followed by
Root Finding Algorithms
bacon_sci::roots implements the bisection method, Newton's method,
the secant method, Newton's method for polynomials, and Müller's method
As an example, the following code snippet finds the root of
initial guesses of
use secant; use SVector;
Polynomials and Polynomial Interpolation
bacon_sci::polynomial implements a polynomial struct.
Lagrange interpolation, Hermite interpolation, and cubic spline interpolation.
Several scientific constants are defined in
bacon_sci::constants. The data
comes from NIST. The 2018 CODATA complete listing is available as a hashmap.
Special Functions and Polynomials
bacon_sci::special allows you to get Legendre polynomials, Hermite polynomials,
Laguerre polynomials, and Chebyshev polynomials.
Numeric Differentiation and Quadrature
bacon_sci::differentiate allows first- and second-derivative evaluation numerically.
bacon_sci::integrate implements Tanh-Sinh quadrature, adaptive Simpson's rule,
Romberg integration, and several adaptive Gaussian integration schemes.