Commit 184f3be1 authored by Matthieu Boileau's avatar Matthieu Boileau
Browse files

Add jupyter notebook

parent 07045a0b
.env/
.vscode/
.ipynb_checkpoints/
__pycache__/
numpy
matplotlib
\ No newline at end of file
matplotlib
ffmpeg
jupyter
\ No newline at end of file
%% Cell type:markdown id: tags:
# A simple 2D random walk
Some initializations (import [`srw.py`](srw.py)).
%% Cell type:code id: tags:
``` python
%matplotlib inline
import srw
from matplotlib import rcParams
rcParams['figure.figsize'] = (8., 6.)
rcParams['animation.html'] = 'html5' # to render animation in notebook
```
%% Cell type:markdown id: tags:
Create a matplotlib animation for a `nstep` random walk starting at $(x, y) = (0, 0)$.
%% Cell type:code id: tags:
``` python
anim = srw.generate_animation(nstep=100)
```
%% Cell type:markdown id: tags:
Play animation
%% Cell type:code id: tags:
``` python
anim
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment