3 unstable releases

0.2.2 Jan 31, 2024
0.2.0 Sep 20, 2023
0.1.0 Sep 1, 2023

#794 in Math

Download history 4/week @ 2024-07-16 17/week @ 2024-07-23 13/week @ 2024-07-30 19/week @ 2024-08-06 3/week @ 2024-08-27 7/week @ 2024-09-03 7/week @ 2024-09-17 21/week @ 2024-09-24 15/week @ 2024-10-01 13/week @ 2024-10-08 16/week @ 2024-10-15 23/week @ 2024-10-22 8/week @ 2024-10-29

60 downloads per month

MPL-2.0 license

7MB
594 lines

Crates.io MIT/Apache docs.rs ci

Rust implementation of Inverse Laplace Transform with Concentrated Matrix-Exponential Functions.

Source: https://inverselaplace.org

Usage

Approximate a sine function where $x = 1$ with a maximum of 50 function evaluations.

The Laplace transform of sine is $h^*(s) = 1 / (s^2 + 1)$.

fn main() {
  let result = iltcme::laplace_inversion(|s| 1.0 / (s.powi(2) + 1.0), 1.0, 50);
  approx::relative_eq!(result, 1.0_f64.sin(), epsilon = 0.001);
}

Implementation details

This crate parses a large list of precomputed parameters from a JSON file and converts them to a Rust file which is internally used. The effect of this is that the build time might be slow, no runtime penalty should be paid though.

Generate manually

To regenerate the Rust coefficient files run the following commands in the root:

cargo run -p gen-coefficients -- --input iltcme.json --output src/coefficients.rs

Dependencies