Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
| Download
Views: 1735
Image: ubuntu1804
Kernel: Python 2 (system-wide)

import numpy as np import matplotlib.pyplot as plt x = np.linspace(0,5,100) y = x*0 y[0] = -6 h = x[1]-x[0] for j in range(len(x)-1): y[j+1] = y[j] + 0.6*h*y[j]-h plt.plot(x,y)
[<matplotlib.lines.Line2D at 0x7f7892c36a50>]
Image in a Jupyter notebook
x = np.linspace(0,5,100) h = x[1]-x[0] y0 = np.arange(-6,6,0.5) for i in y0: y = x*0 y[0] = i for j in range(len(x)-1): y[j+1] = h*np.sin(y[j])+y[j]-2*h plt.plot(x,y)
Image in a Jupyter notebook