Skip to content

Monte Carlo method based on a recursive walk-on-spheres implementation in Python.

License

Notifications You must be signed in to change notification settings

chiefenne/PyWOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

- WORK IN PROGRESS

PyWOS

Monte Carlo method based on a walk-on-spheres implementation for solving a 2D Poisson PDE written in Python.

Based on the excellent video by Keenan Crane from Carnegie Mellon University and a code snippet he provided here.

The version presented here utilizes recursion.

Associated literature and video from the original author: "Grid-Free Monte Carlo for PDEs with Spatially Varying Coefficients" by Sawhney, Seyb, Jarosz, Crane.

Usage

Print help on usage:

python Random_walks_Poisson_solver.py -h 

Do a single walk and plot it.

python Random_walks_Poisson_solver.py -d -v 

Run the solver using dedicated settings for number of walks, accuracy, and maximum number of steps per walk.

python Random_walks_Poisson_solver.py -w 100 -e 0.01 -s 30 

Requirements

  • Python 3.9+ (due to the version of argparse which is used)
  • Numpy
  • Matplotlib

License

2022 Andreas Ennemoser – andreas.ennemoser@aon.at

Distributed under the MIT license. See LICENSE for more information.

About

Monte Carlo method based on a recursive walk-on-spheres implementation in Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages