Notebooks for CHME 5137, Lecture 8 (2026): solving ODEs with SciPy's solve_ivp.
| Notebook | What it is |
|---|---|
solve-ivp-intro.ipynb |
Worked examples, done in class: decay, rtol and atol, a packed bed, a stiff reaction |
rabbits-and-foxes.ipynb |
The exercise. Started in class, finished for homework |
Each notebook has a paired .py file holding the same cells as plain text (see
Jupytext below).
- Fork this repository to your own GitHub account (button at top right).
- Clone your fork, not this one:
On Explorer, clone it into
git clone git@github.com:YOUR-USERNAME/differential-equations.git # SSH, e.g. on Explorer # or git clone https://github.com/YOUR-USERNAME/differential-equations.git
/courses/CHME5137.202710/students/$USER/. - Open
rabbits-and-foxes.ipynband work through it, using your own kernel (chme5137on Explorer). Commit and push as you go:This is your own fork, so committing ongit add rabbits-and-foxes.ipynb rabbits-and-foxes.py git commit -m "Task 1: solved with default settings and plotted" git pushmainis fine. Don't open a pull request back toCHME5137/differential-equations: that would publish your answers to everyone.
jupytext.toml pairs each notebook with a .py script in the percent format. When
jupytext is installed, saving the notebook updates the .py as well. The .py diffs and
merges cleanly, and you can run it with python rabbits-and-foxes.py. Lecture 9 covers
this properly. Read
notebooks-and-git.md
before then.
- If jupytext isn't installed yet, just edit the
.ipynb. The.pygets out of date, which is fine for now. Once jupytext is installed, runjupytext --sync rabbits-and-foxes.ipynbonce to bring the.pyback in line. - In VS Code, you can open the
.pydirectly and run its# %%cells one at a time. The Jupytext Sync extension keeps the two files in step.
The 2026 revision was written with Claude Code (Claude Opus 5.5) and checked by Prof. West.