Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
A cyclist's speed in m/s at the times 0, 1, 2, ..., 10 seconds is 0, 2, 4, 6, 8, 8, 8, 6, 4, 2, 0. The distance travelled is the area under the speed graph. Find it by adding, for each second, the average of the two speeds at its ends times the one second. Check your answer with np.trapezoid(v, t).
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Plan. Each second is a trapezoid under the graph. Its area is the average of the two heights times the width: . Add up the ten trapezoids.
Check. The pieces are 1, 3, 5, 7, 8, 8, 7, 5, 3 and 1, which add up to 48. np.trapezoid does the same sum and gives 48.0. A second check: the whole graph is a big trapezoid. The bottom is 10 s long, the level top is from 4 s to 6 s, so it is 2 s long, and the height is 8 m/s. The area of a trapezoid is .
Answer: 48 m.
Log in to join the discussion.
Loading…