Skip to content

Commit

Permalink
Fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
patnr committed Sep 15, 2023
1 parent 791c680 commit f3db742
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 5 additions & 6 deletions notebooks/T7 - Chaos & Lorenz (optional).ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -358,17 +358,16 @@
"cell_type": "code",
"execution_count": null,
"id": "2121eb11",
"metadata": {
"lines_to_end_of_cell_marker": 0,
"lines_to_next_cell": 1
},
"metadata": {},
"outputs": [],
"source": [
"def s(vector, n):\n",
" return np.roll(vector, -n)\n",
"\n",
"def dxdt96(x, time, Force):\n",
" return (s(x, 1) - s(x, -2)) * s(x, -1) - x + Force"
" return (s(x, 1) - s(x, -2)) * s(x, -1) - x + Force\n",
"\n",
"ylims = -10, 20"
]
},
{
Expand Down Expand Up @@ -420,7 +419,7 @@
"source": [
"@interact()\n",
"def Hovmoller():\n",
" plt.contourf(store[0][0], cmap=\"viridis\", vmin=bounds[0], vmax=bounds[1])\n",
" plt.contourf(store[0][0], cmap=\"viridis\", vmin=ylims[0], vmax=ylims[1])\n",
" plt.colorbar();\n",
" plt.show()"
]
Expand Down
4 changes: 3 additions & 1 deletion notebooks/scripts/T7 - Chaos & Lorenz (optional).py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ def s(vector, n):

def dxdt96(x, time, Force):
return (s(x, 1) - s(x, -2)) * s(x, -1) - x + Force

ylims = -10, 20
# -

store = ["placeholder"]
Expand Down Expand Up @@ -264,7 +266,7 @@ def plot_lorenz96(xDim=40, N=2, Force=8, ε=0.01, Time=

@interact()
def Hovmoller():
plt.contourf(store[0][0], cmap="viridis", vmin=bounds[0], vmax=bounds[1])
plt.contourf(store[0][0], cmap="viridis", vmin=ylims[0], vmax=ylims[1])
plt.colorbar();
plt.show()

Expand Down

0 comments on commit f3db742

Please sign in to comment.