Question: Animating the Plot We now define a function update _ plot ( i ) that updates all three graphs. The time at time step no

Animating the Plot
We now define a function update_plot (i) that updates all three graphs. The time at time step no.i is
t=t0+i*t
where t is time step size. For our animation, a step size of t=10-3T(i.e.11000 th of the period) works well.
Exercise 3
Complete the function update_plot (i) below. It should update the "ydata" for line1, line 2 and line3 at time t0+i*dt . Do not alter the
return statement (the last line in update_plot ()). Remember that the code inside the function must be indented.
In [10]:
Number of time steps: 2000
In [10]: 1 # This cell is used for internal tests. Do not delete or modify.
The animation
Now we're ready to run the animation. Execute the cell below and scroll up to the plot. When the animation stops, you can replay it by simply running the
code cell below again.
Verify that you see:
the green wave traveling right
the animation code is below this and it is correct but im sure what i am doing wrong with this part in python
Animating the Plot We now define a function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!