Skip to content

Commit

Permalink
Add mathieu example page to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kburns committed Aug 8, 2022
1 parent 8c80451 commit f71cdcb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
# Using _images/ is a hack to get relocated images which have been included in the pages
nbsphinx_thumbnails = {
'pages/examples/evp_1d_waves_on_a_string': '_images/waves_on_a_string.png',
'pages/examples/evp_1d_mathieu': '_images/mathieu_eigenvalues.png',
'pages/examples/ivp_1d_kdv_burgers': '_images/kdv_burgers.png',
'pages/examples/ivp_2d_rayleigh_benard': '_images/rayleigh_benard.png',
'pages/examples/ivp_2d_shear_flow': '_images/shear_flow.png',
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 4 additions & 5 deletions examples/evp_1d_mathieu/mathieu_evp.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# Parameters
N = 32
q_list = np.linspace(0, 10, 100)
q_list = np.linspace(0, 30, 100)

# Basis
coord = d3.Coordinate('x')
Expand Down Expand Up @@ -52,14 +52,13 @@ def eigenvalues(q):
evals = np.array([eigenvalues(q)[:10] for q in q_list])

# Plot
fig = plt.figure(figsize=(6,6))
fig = plt.figure(figsize=(6, 4))
plt.plot(q_list, evals[:, 0::2], '.-', c='C0')
plt.plot(q_list, evals[:, 1::2], '.-', c='C1')
plt.xlim(q_list.min(), q_list.max())
plt.ylim(-10, 20)
plt.ylim(-10, 30)
plt.xlabel("q")
plt.ylabel("eigenvalues")
plt.title("Mathieu eigenvalues")
plt.grid()
plt.tight_layout()
plt.savefig("mathieu_eigenvalues.pdf")
plt.savefig("mathieu_eigenvalues.png", dpi=200)

0 comments on commit f71cdcb

Please sign in to comment.