Question
I am having trouble generating a plot. in this program, the program takes a final time (tF) value and the initial time (tI) value and
I am having trouble generating a plot. in this program, the program takes a final time (tF) value and the initial time (tI) value and subtracts them to get a (delta T) that delta T is then plugged into the terminal velocity equation (vT). The goal is to take the delta T and vT and place them into a plot. (Terminal velocity cannot exceed 2). the plot is generated however, there is no data point on that plot. Please help!!
import numpy as np import matplotlib.pyplot as plt
def problem4C():
tF = 0.008 vI = 0 g = 10 m = 10 c = 50 tI = 0 vMax = 2 i=0
#Loops for certain number of delta T's
while True: for i in range(14):
#delta T
t = tF-tI
#Terminal velocity equation
vT = vI+(g -((c/m)*vI))*(t)
#Replaces V inital with terminal velocity answer vI = vT
i = i+1 #print(vT)
#reaches 14 interations
if i == 14:
if vT > vMax: tF = tF-0.0001 continue elif vT
#Error eT = ((vMax - vT) / vMax)*100
#round error to 2 decimal places
eT = round(eT,2)
#checks to see if velocity is 99.99 percent correct if eT != 0.01:
tF = tF + 0.001
continue
elif eT == 0.01:
print("Time required to reach 99.99 percent terminal velocity:",round(tF,4), "s")
#plot t = np.array() plt.plot(t,vT) plt.show()
break
def main(): #problem4A() problem4C()
main()
import numpy as np import matplotlib.pyplot as plt def problem4c(): t = 0.008 VI = 0 g = 10 m = 10 c=50 tI = 0 VMax - 2 i=0 #Loops for certain number of delta T's while True: for i in range (14): #delta T t = t-tI #Terminal velocity equation VT = vI+(g -((c/m) *VI)) * (t) #Replaces V inital with terminal velocity answer VI = VT i = 1+1 #print (VT) #reaches 14 interations if i = 14: if vt > VMax: t = tf-0.0001 continue elif VT VMax: t = tF-0.0001 continue elif VTStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started