Skip to content
Snippets Groups Projects
Commit 558752ea authored by David Preiss's avatar David Preiss
Browse files

Update week1/README.md

parent a6f0474d
Branches
No related tags found
No related merge requests found
......@@ -2,8 +2,11 @@
This week I wanted to start with a "normal" approach that felt pythonic with a particle class and a bunch of for loops / if statements, but still using numpy arrays. Then rewrite it with everything possible vectorized in numpy and see the difference in solve times for each.
Below is a 5000 particle simulation with 2000 time steps that took 0.66 s to solve for (and incidentally much longer to write to a .mp4 file).
![](img/animation_fast.mp4)
Below is a 5000 particle simulation with 1000 time steps that took 0.18 s to solve for (and incidentally much longer to write to a .mp4 or .gif file).
![](img/animation_fast.gif)
https://gitlab.cba.mit.edu/davepreiss/nmm/-/blob/a6f0474d8cdb6bec89cc871ceecbd14fa6b71472/week1/maxwells_demon_fast.py
[](maxwells_demon_fast.py)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment