Skip to content

Commit e1c6b5c

Browse files
committed
some fixes + additional hints
1 parent cbc4082 commit e1c6b5c

File tree

2 files changed

+41
-6
lines changed

2 files changed

+41
-6
lines changed

content/05-scipy/scipy-basics-2.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@
357357
"source": [
358358
"```{note}\n",
359359
"What about uncertainties in both $x$ and $y$? SciPy has an\n",
360-
"[orthogonsl distance regression](https://docs.scipy.org/doc/scipy/reference/odr.html) implementation based on ODRPACK for this.\n",
360+
"[orthogonal distance regression](https://docs.scipy.org/doc/scipy/reference/odr.html) implementation based on ODRPACK for this.\n",
361361
"```"
362362
]
363363
},
@@ -1219,7 +1219,7 @@
12191219
"name": "python",
12201220
"nbconvert_exporter": "python",
12211221
"pygments_lexer": "ipython3",
1222-
"version": "3.12.2"
1222+
"version": "3.12.4"
12231223
}
12241224
},
12251225
"nbformat": 4,

content/05-scipy/scipy-basics.ipynb

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,10 @@
919919
"cell_type": "markdown",
920920
"metadata": {},
921921
"source": [
922-
"This system of ODEs is the Lorenz system:\n",
922+
"The [Lorenz system](https://en.wikipedia.org/wiki/Lorenz_system) is a very simple\n",
923+
"model of convection in our atmosphere, but demonstrates the idea of chaos well.\n",
924+
"\n",
925+
"This system of ODEs for the Lorenz system is:\n",
923926
"\n",
924927
"$$\\frac{dx}{dt} = \\sigma (y - x)$$\n",
925928
"$$\\frac{dy}{dt} = rx - y - xz$$\n",
@@ -929,10 +932,12 @@
929932
"\n",
930933
"$${\\bf f}({\\bf x}) = \n",
931934
"\\left (\n",
932-
"\\sigma (y -x), \n",
933-
"rx - y -xz, \n",
935+
"\\begin{array}{c}\n",
936+
"\\sigma (y -x) \\\\\n",
937+
"rx - y -xz \\\\\n",
934938
"xy - bz\n",
935-
"\\right )^\\intercal\n",
939+
"\\end{array}\n",
940+
"\\right )\n",
936941
"= 0$$\n"
937942
]
938943
},
@@ -1019,6 +1024,18 @@
10191024
"fig.set_size_inches(8.0,6.0)"
10201025
]
10211026
},
1027+
{
1028+
"cell_type": "markdown",
1029+
"metadata": {},
1030+
"source": [
1031+
"```{admonition} try it\n",
1032+
"Rerun the integration, but change the initial conditions by 1 part in $10^6$ for one of the components.\n",
1033+
"The make a plot of $x$ vs. $t$ comparing the solutions. You'll see that the 2 solutions track well\n",
1034+
"for some time but then greatly diverged. This is the sensitivity to initial conditions that is the\n",
1035+
"hallmark of chaos.\n",
1036+
"```"
1037+
]
1038+
},
10221039
{
10231040
"cell_type": "markdown",
10241041
"metadata": {},
@@ -1246,6 +1263,24 @@
12461263
"\n",
12471264
"plt.legend(loc=\"best\", frameon=False)"
12481265
]
1266+
},
1267+
{
1268+
"cell_type": "markdown",
1269+
"metadata": {},
1270+
"source": [
1271+
"```{admonition} try it\n",
1272+
"Redo this integration, but now use the `RK45` solver instead of `BDF`. Does it work?\n",
1273+
"\n",
1274+
"You may need to use the `kernel` menu in Jupyter to interrupt the kernel if you get impatient.\n",
1275+
"```"
1276+
]
1277+
},
1278+
{
1279+
"cell_type": "code",
1280+
"execution_count": null,
1281+
"metadata": {},
1282+
"outputs": [],
1283+
"source": []
12491284
}
12501285
],
12511286
"metadata": {

0 commit comments

Comments
 (0)