You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-3Lines changed: 24 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ All other circles are waypoints that must be visited on the way down.
32
32
## Concept
33
33
34
34
The idea is for students to use the surface implemented in `soapboxslide` to simulate the dynamics of a particle (or a connected set of particles) sliding down.
35
-
In addition to correctly implementing the dynamics, students are instructed to find the physical parameters that allow the point mass(es) to reach the final target as quickly as possible, without missing any of the intermediate waypoints.
35
+
In addition to correctly implementing the dynamics, students are instructed to find the physical parameters for which the point mass(es) to reach the final target as quickly as possible, without missing any of the intermediate waypoints.
36
36
37
37
Two classes of physical models can be considered:
38
38
@@ -123,10 +123,31 @@ Note that the above surface plots show dashed circles centered on the waypoints,
123
123
124
124
The `Slide` class also features two potentially useful methods:
125
125
126
-
-`Slide.plot` can be used to prepare a drawing of the slide on which one can overlay additional results.
127
126
-`Slide.get_hits` can be used to check which waypoints were reached by a given trajectory.
127
+
-`Slide.plot` can be used to prepare a drawing of the slide on which one can overlay additional results.
128
+
It supports several keyword arguments to customize the surface.
129
+
130
+
This is a minimal example using the `Slide.plot` method, to which one can easily add more matplotlib code:
131
+
132
+
```python
133
+
import matplotlib.pyplot as plt
134
+
135
+
from soapboxslide import Slide
136
+
137
+
# Prepare plot with slide surface
138
+
slide = Slide.from_file("boxcar_blitz.toml")
139
+
fig, ax = plt.subplots(figsize=(8, 7))
140
+
slide.plot(fig, ax)
141
+
142
+
# Customize plot
143
+
ax.set(title="You can put here whatever you want")
0 commit comments