Work on the following problem. Name it as P3.py You should be able to run it as
ID: 3595211 • Letter: W
Question
Work on the following problem. Name it as P3.py You should be able to run it as python P3,py 12.55, which will generate 3 curves on the same figure. (Hint, use the hold() function to plot multiple curves on the same figure) 3. Plot a formula for several parameters. Make a program that reads a set of vo values from the line and plots the corresponding curves y(t) = tot-0.5gt2 in the same figure (set g 9.81). Let t e l0.2tb/g] for each curve, which implies that you need a different vector of t coordinates for each curve.Explanation / Answer
# importing the required modules
from __future__ import division
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import numpy as np
v = input("Enter initial speed ")
k= float(v)
g=9.8
r=k/g
# setting the t - coordinates
t = np.arange(0, 2*k, 0.01)
# setting the corresponding y - coordinates
y = k*t - 0.5*g*t*t
# potting the points
plt.plot(t, y)
# function to show the plot
plt.show()
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.