Join free to take this lesson
Anyone can look around, but taking a lesson needs a free account. With one, your answers are checked step by step and your progress is saved, so you can stop and pick up where you left off on any device.
11 steps ยท about 30 min
By the end you can
- Keep a rope in two arrays: heights y and speeds vy, both made with np.zeros
- Lift a hump into the rope with a slice: y[40:61] = 0.2 * bump
- Work out every inner piece's acceleration at once with y[2:], y[1:-1] and y[:-2]
- Step the whole rope: a, then vy[1:-1], then y[1:-1]
Who it is for: Anyone who has done lesson 16.1, and lessons 14.2-14.3 (slices) and 15.1 (np.zeros).
The steps
- Two arrays
- A hump
- Lift a hump
- Every piece's acceleration
- Every piece at once
- Which piece is a[0]?
- One step for the whole rope
- Change the speeds
- Move the pieces
- Why the speeds first?
- Two arrays, three lines
Discussion 0 comments
Log in to join the discussion.