import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# This makes the plots appear inside the notebook
%matplotlib inline
#the next line makes graphs look better on HD monitors, you can delete it if you want
%config InlineBackend.figure_format='retina'
#this is the library function we are going to use to numericaly solve the ODE
from scipy.integrate import odeint
InitState=[0]
t=np.linspace(0,np.pi/2,1000)
def myODE (S,t):
#initialize the values of k and m
R=1 #units meters
g=9.81 #units m/s^2
#return a vector based on our definition of the ODE
return [2*R*g*np.sin(t)]
SOL=odeint(myODE,InitState,t)
df=pd.DataFrame(SOL,columns=['v2'])
df['t']=t
df['ac']=-df['v2']
df['gy']=9.81*np.cos(df['t'])
df['Fn']=df['gy']+df['ac']
df['ABS']=np.abs(df['Fn'])
min=df['ABS'].idxmin()
df['t'].iloc[min]