Skip to content
/ ctrw Public

This is a python implementation of the algorithm purposed in a Paper of D. Fulger et. al in 2008 to simulate Continuous-time random walks

License

Notifications You must be signed in to change notification settings

DanielZlm/ctrw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monte Carlo Simulation of uncoupled Continuous-time random walks

This is a python implementation of the algorithm purposed in a Paper of D. Fulger et. al in 2008.

Example of a CTRW realization

References

  • Fulger, D., Scalas, E., & Germano, G. (2008). Monte Carlo simulation of uncoupled continuous-time random walks yielding a stochastic solution of the space-time fractional diffusion equation. Physical Review E - Statistical, Nonlinear, and Soft Matter Physics, 77(2), 1–7. https://doi.org/10.1103/PhysRevE.77.021122

Dependencies

Just numpy.

Install

Just move the ctrw folder to a subdirectory of your python script where you want to use it. Then import it e.g. as

from ctrw import CTRW

Usage

Run example_ctrw.py without any arguments to create a two dimensional CTRW and plot it versus time.

Note: You have to have matplotlib installed to run the example

import ctrw
import matplotlib.pyplot as plt

process = ctrw.CTRW(100,gamma_x=1,gamma_t=1,alpha=2,beta=1,ndim=2)
x = process.get_samples()
t = process.times(2e-3)
plt.title(ctrw.__copyright__)
plt.plot(t,x)
plt.show()

About

This is a python implementation of the algorithm purposed in a Paper of D. Fulger et. al in 2008 to simulate Continuous-time random walks

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages