diffusionx 0.1.0

A library for random number/stochastic process simulation with high performance.
Documentation

DiffusionX is a multi-threaded high-performance Rust library for random number/stochastic process simulation.

Usage

use diffusionx::simulation::{Bm, Simulation, Functional};
// Brownian motion simulation
let bm = Bm::new(0.0, 1.0, 1.0)?;  // Create Brownian motion object: initial position 0, diffusion coefficient 1, duration 1
let time_step = 0.01;  // Time step
let (times, positions) = bm.simulate(time_step)?;  // Simulate Brownian motion trajectory
// Monte Carlo simulation of Brownian motion statistics
let mean = bm.mean(time_step, 1000)?;  // Mean  bm.raw_moment(time_step, 1, 1000)?;
let msd = bm.msd(time_step, 1000)?;  // Mean square displacement  bm.central_moment(time_step, 2, 1000)?;
// First passage time of Brownian motion
let max_duration = 1000; // if over this duration, the simulation will be terminated and return None
let fpt = bm.fpt(time_step, (-1.0, 1.0), max_duration)?;

Progress

Random Number Generation

  • Normal distribution
  • Uniform distribution
  • Exponential distribution
  • Poisson distribution
  • Alpha-stable distribution

Stochastic Processes

  • Brownian motion
  • Alpha-stable Lévy process
  • Fractional Brownian motion
  • Poisson process
  • Compound Poisson process
  • Langevin equation

License

This project is dual-licensed under:

You can choose to use either license.