https://github.com/chiefenne/pywos
Monte Carlo method based on a recursive walk-on-spheres implementation in Python.
https://github.com/chiefenne/pywos
Last synced: about 1 year ago
JSON representation
Monte Carlo method based on a recursive walk-on-spheres implementation in Python.
- Host: GitHub
- URL: https://github.com/chiefenne/pywos
- Owner: chiefenne
- License: mit
- Created: 2022-10-28T06:40:11.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-01T06:57:38.000Z (over 3 years ago)
- Last Synced: 2025-02-14T05:41:18.029Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 383 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
```diff
- 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](https://youtu.be/bZbuKOxH71o) by Keenan Crane from Carnegie Mellon University and a code snippet he provided [here](https://www.cs.cmu.edu/~kmcrane/Projects/MonteCarloGeometryProcessing/WoSPoisson2D.cpp.html).
The version presented here utilizes recursion.
Associated literature and [video](https://youtu.be/dXROl0KGPXc) from the original author:
["Grid-Free Monte Carlo for PDEs with Spatially Varying Coefficients"](https://arxiv.org/abs/2201.13240) by Sawhney, Seyb, Jarosz, Crane.
## Usage
Print help on usage:
```code
python Random_walks_Poisson_solver.py -h
```
Do a single walk and plot it.
```code
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.
```code
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](https://github.com/chiefenne/PyWOS/blob/main/LICENSE.md) for more information.