DiffusionX is a multi-threaded high-performance Rust library for random number/stochastic process simulation.
Usage
use ;
// Brownian motion simulation
let bm = new?; // Create Brownian motion object: initial position 0, diffusion coefficient 1, duration 1
let time_step = 0.01; // Time step
let = bm.simulate?; // Simulate Brownian motion trajectory
// Monte Carlo simulation of Brownian motion statistics
let mean = bm.mean?; // Mean bm.raw_moment(time_step, 1, 1000)?;
let msd = bm.msd?; // 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?;
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.