I have a very simple code to compute the vertical movement. I have set some initial conditions (in this case v0s
). Instead to run a for loop over each one of the v0s
, is that any way to "apply" each v0
to the x linspace
and have a array of numpy arrays.
import numpy as np
v0s = [1, 2, 3]
g = 9.81
def VerticalPosition(v0,g,t):
return(v0*t - 0.5 * g * t**2)
def Solution(v0,g):
return(2*v0/g)
def Apex(v0,g):
return(VerticalPosition(v0,g,v0/g))
x=np.linspace(0,Solution(max(v0s),g),101)
y=[]
for v0 in v0s:
y.append(VerticalPosition(v0,g,x))