Use Python to solve the Phyics problem. A ball, starting from an initial height
ID: 3888399 • Letter: U
Question
Use Python to solve the Phyics problem.
A ball, starting from an initial height of 10 m above the ground, is thrown straight downward with an initial speed of 1.0 m/s in the presence of gravity
a) Using python, make plots of 1) height versus time and 2) velocity versus time for the duration that the ball is moving. Let the y axis point upward with y=0 m at ground level.
b) Using your plots, determine how long it takes for the ball to hit the ground.
c) Use python to calculate how long it takes for the ball to hit the ground.
Explanation / Answer
#importing required modules
import math
import matplotlib.pyplot as gplt
#importing and changing its name as 'nmpy'' for handy use
import numpy as nmpy
#time is intialised to zero
time=0
#as height changes from 10 to zero
height_range=range(10, 0)
height=nmpy.array(height_range)
#using newton's laws of motion s=u*t+1/2*a*t^2
#taking g=-10m/sec^2 ,u=-1m/sec and intially s=10
height= 10-time-10*time**2
#plotting the graph
gplt.plot(time, height)
#showing the graph
gplt.show()
#giving velocity max and min limit
velocity=nmpy.array(range(1,int(math.sqrt(201)))
#using v=u+a*t
#here u=1m/sec,a=10m/sec^2
velocity=1+10*time
gplt.plot(time, velocity)
gplt.show()
#s=u*t+1/2*a*t^2 is the newtons law of motion equation where 's' denotes the distance travelled
# 't' denotes the time and 'a' denotes the acceleration
#here acceleration is due to gravity which is 9.8 (approx. 10)
#v=u+a*t is his 1st law equation where 'u' is intial velocity ,'t is time'
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.