I am new into programming. Here, I am trying to simulate the motion of a cannonball until it hits the ground using python programming. I have used both analytical and numerical(Euler method) to plot its trajectory. But, I am not sure if my output is correct for both methods, especially for the analytical solution. For analytical solution, is there any way to show that for t=0, x=1m which is true. Please look at the code below, and point out my mistakes.import matplotlib.pyplot as pltv=0.0      #Initial 0 velocityh=0.01     #dtx=1        #Canonball is at a distance of 1m from the ground initially     t=0.0m=2.0g=9.81 ta,xa,xb=[],[],[]   #xa for numerical and xb for analytical solutionwhile x>=0.0:    ta.append(t)    xa.append(x)    xb.append(-0.5*g*t**2.0)  #Analytical solution    F=-m*g                       #Numerical solution    v=v+(F/m)*h    x=x+v*h    t=t+hplt.figure()plt.plot(ta,xa)plt.plot(ta,xb,'ro-')plt.show()
Python program to simulate the trajectory of a cannonball
python