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

import matplotlib.pyplot as plt import numpy as np import math x = np.linspace(0.00001,0.01,1000) y = (1-np.cos(x))/x**2 plt.plot(x,y)
/usr/local/lib/python2.7/dist-packages/ipykernel/__main__.py:7: RuntimeWarning: invalid value encountered in divide
[<matplotlib.lines.Line2D at 0x7f745c0dafd0>]
Image in a Jupyter notebook
y = np.sin(x)/x plt.plot(x,y)
/usr/local/lib/python2.7/dist-packages/ipykernel/__main__.py:1: RuntimeWarning: invalid value encountered in divide if __name__ == '__main__':
[<matplotlib.lines.Line2D at 0x7f745c059110>]
Image in a Jupyter notebook
import math x = x = np.linspace(0,4*math.pi,1000) y = np.sin(2*x) y = x*0 p = True plt.figure(figsize = (10,10)) def nigzeret(n): global p if n%2 == 0: return 0 if p: p = False return 2**n p = True return -(2**n) for i in range(30): plt.subplot(6,5,i+1) y = y + nigzeret(i)*(x**i)/math.factorial(i) plt.plot(x,y)
Image in a Jupyter notebook