Tutorials

Tutorial 0 (getting started) walks the whole path once; the shorter ones after it go deeper, from a first eigenvalue problem to a GPU run, keeping a registry of runs, importing a Dedalus script, covariant Lyapunov vectors and Lagrangian tracers. Each one is a plain Python script, shown piece by piece on its page, that ends by checking its result against a published value or a closed form (an assert, with the reference in a comment). The output printed on each page is the output of that script, executed as it is shown; the table below says when it last ran and whether it passed.

Prerequisites: Installation with the tutorials extra (pip install "conatus[tutorials]": matplotlib for the figures, xarray for tutorial 16), and some familiarity with spectral methods. Run a tutorial with python docs/site/tutorials/code/<script>.py from a copy of the repository. Tutorial 2b needs a GPU; the check script of tutorial 14 (14b) needs Dedalus.

#

Tutorial

You will learn

Reference value

—

Getting started in ten minutes

ten minutes: one equation written as on paper, a simulation, a plot, one physical number, four guided changes

Cole (1951), Hopf (1950)

0

0. Getting started: convection between two plates

the whole path once: a native model, explain(), stability, the onset by critical, a simulation, the heat flux, the Methods paragraph, the run registry

Reid & Harris (1958)

1

1. A first eigenvalue problem: Orr–Sommerfeld

a native model, conditions by wall name, eigenvalues with residuals, critical parameters, verify

Orszag (1971)

2

2. A first initial-value problem: Rayleigh–Bénard 2D, CPU then GPU

a simulation on CPU, then on GPU; time steppers, CFL, the Methods paragraph

linear growth rate, CPU/GPU agreement

3

3. Symmetries and symmetry subspaces

linearizing a native model, symmetry subspaces: the same eigenvalue with half the unknowns

Reid & Harris (1958)

4

4. Nonlinear boundary-value problems and continuation: Bratu

a nonlinear boundary-value model, Newton on the exact Jacobian, pseudo-arclength continuation, folds

Bratu (1914), Gelfand (1963)

5

5. Invariant solutions: Kuramoto–Sivashinsky, L = 22

equilibria, travelling waves and periodic orbits of a native model by Newton–Krylov–hookstep, Floquet exponents

Cvitanović et al. (2010), Ding & Cvitanović (2016)

8

8. Polar geometry: a drum, a pipe, two rotating cylinders

polar and cylindrical geometry: a drum on cn.Disk, ready pipe and Taylor–Couette problems

Bessel zeros, Meseguer & Trefethen (2003), Recktenwald et al. (1993)

10

10. Bifurcations: branch switching, cycles, codimension 2, normal forms

branch switching, cycles, codimension 2, normal forms, Landau and Ginzburg–Landau

Lorenz (1963), Kuznetsov (2004), Cross & Hohenberg (1993)

11

11. Record, query, reproduce: the run registry

the run registry on a native simulation: record, certify, query, compare, reproduce bit for bit, cache only on request

heat equation, closed form

12

12. Chaos and ensembles: Lyapunov spectrum, covariant vectors, Poincaré map, basins

Lyapunov spectrum, covariant vectors, Kaplan–Yorke, Poincaré map, basins from one ensemble

Sprott (Lorenz), exact divergence

13

13. Where a global mode is born, and what the data say about it

direct and adjoint global modes, wavemaker, base-flow sensitivity; DMD in the exact norm

Chomaz (2005) closed forms, Towne et al. (2018)

14

14. Coming from Dedalus

a convection cell as a native model, then read from a Dedalus script: line-by-line report, run, native vs translated; optional check against Dedalus

Dedalus itself (same method, rounding; check script, needs Dedalus)

15

15. Covariant Lyapunov vectors of Kuramoto–Sivashinsky: tangencies and the physical modes

sim.lyapunov with covariant vectors: exponents with errors, covariance residual, tangencies, domination and the physical modes

Cvitanović et al. (2010), Ding et al. (2016)

16

16. Lagrangian tracers and a numerical dye

sim.particles and m.dye: exact velocity at the tracers, observed order in time, a dye whose mass is measured

Taylor–Green and Couette closed forms

Execution status

Script

Last execution

Time

Run

t00_first_steps.py

{.cn-pass}PASS

30.5 s

— ()

t00_getting_started.py

{.cn-pass}PASS

138.6 s

— ()

t01_orr_sommerfeld.py

{.cn-pass}PASS

29.6 s

— ()

t02a_rayleigh_benard_cpu.py

{.cn-pass}PASS

32.2 s

— ()

t02b_rayleigh_benard_gpu.py

{.cn-pass}PASS

14.5 s

— ()

t03_symmetries.py

{.cn-pass}PASS

3.5 s

— ()

t04_bratu.py

{.cn-pass}PASS

8.9 s

— ()

t05_ks_orbits.py

{.cn-pass}PASS

68.7 s

— ()

t08_polar.py

{.cn-pass}PASS

33.7 s

— ()

t10_bifurcations.py

{.cn-pass}PASS

28.7 s

— ()

t11_runs.py

{.cn-pass}PASS

26.6 s

— ()

t12_chaos_ensembles.py

{.cn-pass}PASS

165.3 s

— ()

t13_sensitivity_data.py

{.cn-pass}PASS

24.9 s

— ()

t14_from_dedalus.py

{.cn-pass}PASS

10.8 s

— ()

t14b_dedalus_check.py

{.cn-pass}PASS

21.8 s

— ()

t15_ks_covariant.py

{.cn-pass}PASS

52.4 s

— ()

t16_particles_dye.py

{.cn-pass}PASS

47.1 s

— ()

Scripts are executed by docs/site/run_tutorials.py, on a CPU and, for the GPU parts, on a GPU; only passing outputs are copied into the pages.