> Every page of the ganymede website is listed in https://eugo.io/docs/ganymede/llms.txt.

# Scipy

> Scipy: Fundamental algorithms for scientific computing in Python. A Python demo notebook from ganymede.

Web page: https://eugo.io/docs/ganymede/demo_notebooks/data_processing/scipy/
Notebook: https://eugo.io/docs/ganymede/demo_notebooks/data_processing/scipy/scipy.ipynb (source: https://github.com/eugo-inc/ganymede/blob/main/demo_notebooks/data_processing/scipy.ipynb)

Description:
- Fundamental algorithms for scientific computing in Python.

Resources:
- [GitHub] https://github.com/scipy/scipy
- [Website] https://scipy.org/
- [Docs] https://docs.scipy.org/doc/scipy/

Source and license:
- Some of these examples are adapted from the SciPy tutorial on special functions (the vibrating drum head) (https://docs.scipy.org/doc/scipy/tutorial/special.html), Copyright (c) 2001-2002 Enthought, Inc. 2003, SciPy Developers, licensed under BSD-3-Clause. That code stays under its own license; see [THIRD_PARTY_NOTICES.md](https://github.com/eugo-inc/ganymede/blob/main/THIRD_PARTY_NOTICES.md).

## Example 1

Create a Bessel function with a circular drum head anchored at the edge and plot it.

```python
from scipy import special
import numpy as np
import matplotlib.pyplot as plt


def drumhead_height(n, k, distance, angle, t):
   kth_zero = special.jn_zeros(n, k)[-1]
   return np.cos(t) * np.cos(n*angle) * special.jn(n, distance*kth_zero)

theta = np.r_[0:2*np.pi:50j]
radius = np.r_[0:1:50j]

x = np.array([r * np.cos(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])

fig = plt.figure()
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.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_xticks(np.arange(-1, 1.1, 0.5))
ax.set_yticks(np.arange(-1, 1.1, 0.5))
ax.set_zlabel('Z')
plt.show()
```

<figure class="gn-output"><img src="https://eugo.io/docs/ganymede/demo_notebooks/data_processing/scipy/output-3-1.png" width="512" height="478" alt="Figure drawn by code cell 1" loading="lazy" decoding="async"></figure>
