"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "doc/source/tutorial/special.rst" between
scipy-1.6.2.tar.xz and scipy-1.6.3.tar.xz

About: SciPy are tools for mathematics, science, and engineering (for Python).

special.rst  (scipy-1.6.2.tar.xz):special.rst  (scipy-1.6.3.tar.xz)
skipping to change at line 49 skipping to change at line 49
>>> def drumhead_height(n, k, distance, angle, t): >>> def drumhead_height(n, k, distance, angle, t):
... kth_zero = special.jn_zeros(n, k)[-1] ... kth_zero = special.jn_zeros(n, k)[-1]
... return np.cos(t) * np.cos(n*angle) * special.jn(n, distance*kth_zero) ... return np.cos(t) * np.cos(n*angle) * special.jn(n, distance*kth_zero)
>>> theta = np.r_[0:2*np.pi:50j] >>> theta = np.r_[0:2*np.pi:50j]
>>> radius = np.r_[0:1:50j] >>> radius = np.r_[0:1:50j]
>>> x = np.array([r * np.cos(theta) for r in radius]) >>> x = np.array([r * np.cos(theta) for r in radius])
>>> y = np.array([r * np.sin(theta) for r in radius]) >>> y = np.array([r * np.sin(theta) for r in radius])
>>> z = np.array([drumhead_height(1, 1, r, theta, 0.5) for r in radius]) >>> z = np.array([drumhead_height(1, 1, r, theta, 0.5) for r in radius])
>>> import matplotlib.pyplot as plt >>> import matplotlib.pyplot as plt
>>> from mpl_toolkits.mplot3d import Axes3D
>>> from matplotlib import cm
>>> fig = plt.figure() >>> fig = plt.figure()
>>> ax = Axes3D(fig, rect=(0, 0.05, 0.95, 0.95)) >>> ax = fig.add_axes(rect=(0, 0.05, 0.95, 0.95), projection='3d')
>>> ax.plot_surface(x, y, z, rstride=1, cstride=1, cmap='RdBu_r', vmin=-0.5, vmax=0.5) >>> ax.plot_surface(x, y, z, rstride=1, cstride=1, cmap='RdBu_r', vmin=-0.5, vmax=0.5)
>>> ax.set_xlabel('X') >>> ax.set_xlabel('X')
>>> ax.set_ylabel('Y') >>> ax.set_ylabel('Y')
>>> ax.set_xticks(np.arange(-1, 1.1, 0.5)) >>> ax.set_xticks(np.arange(-1, 1.1, 0.5))
>>> ax.set_yticks(np.arange(-1, 1.1, 0.5)) >>> ax.set_yticks(np.arange(-1, 1.1, 0.5))
>>> ax.set_zlabel('Z') >>> ax.set_zlabel('Z')
>>> plt.show() >>> plt.show()
.. :caption: Vibrating drum head using .. :caption: Vibrating drum head using
.. :obj:`scipy.special.jn` .. :obj:`scipy.special.jn`
 End of changes. 2 change blocks. 
3 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)