Question: Please use python 3. Thank you Part C (6 points) (adapted from Langtangen 5.28) A certain type of wave packet is defined by the function

Please use python 3. Thank you  Please use python 3. Thank you Part C (6 points) (adapted

Part C (6 points) (adapted from Langtangen 5.28) A certain type of wave packet is defined by the function This describes a traveling wave propagating through some medium; the shape of the packet remains fixed as it travels. To see this, let's make a plot Your plot should have the following content: It should be a plot versus x, over the range -10 s s 10. It should show the wave packet function y(x.r) above versus x, for five values of t-2,-1, 0, 1, and 2 Each plot ox, t) for a given value of f should be drawn as a different color of the form t = X, labeling each curve with the value of as an integer. (Remember string formating? Now Ne really nned to get a nice-looking plot legend) To discourage you from ust using copy and-paste, Ive included a function stub plot xave.acket (s. o) below, which you can fact, you're only allowed to call plt. plot 0 inside of plot vave packet (x, ) just to make sure you're not f five values of t with this function, a for loop would be helpful.) empted to copy-and-paste.(To teraie over tho (Note on functions and pyp operate on the global state with plt.plot O and other operations, and the plot will be created and shown in whatover cell you call plot ave packet from) lot: since pyplot in general uses a single 'global state per cel, your function doesn T have to return anything at al, t can just If you're bothered by how the legend most likely ends up overlapping part of your plot, have a look at the bbox to,anchor plt. lesendO, and see if you can fix the problem. (This part is optional, but a useful thing to know aboutl) keyword argument to : mport natplotlib.pyplot as plt isport nunpy as np def plot wave packet (, t)

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 Databases Questions!