Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
1932 views
ubuntu2004
Kernel: Python 3 (system-wide)
import numpy as np import matplotlib.pyplot as plt from scipy.integrate import odeint import test #y0=[theta, change in theta, radius, change in radius] y0 = [0 ,2 ,1 ,1] #time points t = np.linspace(0,10,101) #Solving the ODE sul = odeint(test.Atwood, y0, t, args=(M,m,g)) plt.plot(sul[:,0], sul[:,1], 'r', label='theta (x) vs theta dot (y)') #Phase plot plt.legend(loc='best') plt.grid() plt.show()
Image in a Jupyter notebook