Skip to content

Add a series of getting started tutorials - #47

Merged
brosaplanella merged 1 commit into
mainfrom
getting-started-tutorials
Oct 31, 2026
Merged

brosaplanella merged 1 commit into
mainfrom
getting-started-tutorials

Conversation

@brosaplanella

Copy link
Copy Markdown
Contributor

Summary

Six short notebooks in examples/getting_started/, each showing one thing, as a gentle on-ramp before the capability notebooks:

  1. Running a model: three lines to run a model, simulation.plot(), reading outputs and their unit twins, the same code on a packed bed.
  2. Finned-tube models: the geometry and equations, the sharp-front and mush models, a map of the melting front, and resolved vs averaged runs of both models with timings.
  3. Packed-bed models: the geometry and equations, the model against the measurements of Nallusamy et al. (2007), the temperature inside a capsule, resolved vs averaged.
  4. Changing parameter values: by hand and with update, "[input]" sweeps, and composing sets from layers (copper fins, a paraffin, a PCM of your own).
  5. Plotting: interactive and static QuickPlot, the standard plots of pytes.plotting, your own matplotlib figures, the ember colourmap and the PyTES colour cycle.
  6. Experiments: Inlet, Power and Rest steps, terminations, discharge-rest-charge cycles, and time-varying flow (two draws with idle periods between them).

The documentation site renders them under a new Getting started section of the examples (docs/conf.py now also copies examples/getting_started/), and the README and the getting started page point to them.

Notes for review

  • The notebooks are executed with their widget state stored, so the dynamic_plot figures appear on the site (with the slider at t = 0). The existing capability notebooks were saved without it, so their interactive plots render blank on the site today; re-running them the same way would fix that (not done here).
  • Tutorial 2 runs the resolved mush model on a 10x10x10 mesh (about 4 s); the default mesh takes about 90 s and gives the same outlet temperature to within 0.2 K.
  • QuickPlot calls pass spatial_unit="m", as PyBaMM's default is micrometres.

Checks

  • Each notebook executed in place; pytest --nbmake passes on tutorial 3 (the one that reads ../data/).
  • sphinx-build -W --keep-going passes.
  • ruff check and ruff format pass on the notebooks.

The model documentation pages follow in a separate PR, stacked on this one.

🤖 Generated with Claude Code

Six short notebooks in examples/getting_started/, each showing one thing:
running a model, the finned-tube models, the packed-bed models, changing
parameter values, plotting, and experiments. The documentation site renders
them under a new Getting started section of the examples, and the README and
the getting started page point to them.

The notebooks are run with their widget state stored, so that the interactive
plots appear on the site as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brosaplanella
brosaplanella merged commit ab390f7 into main Oct 31, 2026
19 of 20 checks passed
@brosaplanella
brosaplanella deleted the getting-started-tutorials branch October 31, 2026 12:57
@brosaplanella brosaplanella mentioned this pull request Nov 2, 2026
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant