Every model in this course goes through the same stages. The order matters less than making each stage explicit, so that you and your reader can check it.
From question to model
Formulate. State the question. Choose state variables and parameters. Write one term for each process you include, and say why you left the others out.
Nondimensionalize. Rescale the variables so that the model has the fewest possible parameter groups. In the budworm model this reduces four parameters to two (Strogatz 2024, sec. 3.7; ludwig1978qualitative?).
Analyse. Find equilibria and their stability, and see how they change with the parameters. This often answers the question without any simulation.
Simulate. Integrate the model numerically. Use simulation for what the analysis cannot give you: transients, global behaviour, many parameter values.
Validate. Compare with data and with limiting cases whose answer you already know.
Criticize. List the assumptions again. Which one would change the conclusion if it failed?
Why nondimensionalize?
A model with units has redundant parameters. Rescaling time and state by natural scales groups the parameters into dimensionless combinations. You learn which combinations control the behaviour, and you reduce the parameter space you need to explore. Sections 3.5 and 3.7 of Strogatz (2024) show the procedure on worked examples, and you will apply it to the budworm in The Spruce Budworm Model.
The lab workflow
Laboratory sessions follow six steps. You will see them as section headings in the lab pages.
Prediction. Before you run anything, write down what you expect: how many equilibria, which one is stable, whether the solution oscillates.
Implementation. Write the right-hand side, the solver call and the plots. Keep functions small and documented.
Validation. Check the code against something you know: a conserved quantity, an equilibrium, an analytical formula.
Experiment. Change one parameter or initial condition at a time and record what changes.
Interpretation. Explain the result in terms of the model: which term dominates, which equilibrium the trajectory approaches.
Limitations. Say what the simulation cannot tell you, and which assumption is responsible.
Each lab has a core activity that everyone should complete, and optional extensions for those who finish early.
Exercise
The exponential decay model \(\dot y = -\lambda y\) with \(y(0) = y_0\) has solution \(y(t) = y_0 e^{-\lambda t}\). Use it to design one validation test for a numerical ODE solver.
Solution
Solve the model numerically with \(\lambda = 0.5\), \(y_0 = 2\) on \([0, 10]\) and compare with the exact solution. The maximum absolute error should be small and should decrease when you tighten the tolerances.
---title: "The Modelling Workflow"subtitle: "Module 1: Low-Dimensional Dynamics"format: html---Every model in this course goes through the same stages. The order matters less than making each stage explicit, so that you and your reader can check it.## From question to model- **Formulate.** State the question. Choose state variables and parameters. Write one term for each process you include, and say why you left the others out.- **Nondimensionalize.** Rescale the variables so that the model has the fewest possible parameter groups. In the budworm model this reduces four parameters to two [@strogatz2024nonlinear, Section 3.7; @ludwig1978qualitative].- **Analyse.** Find equilibria and their stability, and see how they change with the parameters. This often answers the question without any simulation.- **Simulate.** Integrate the model numerically. Use simulation for what the analysis cannot give you: transients, global behaviour, many parameter values.- **Validate.** Compare with data and with limiting cases whose answer you already know.- **Criticize.** List the assumptions again. Which one would change the conclusion if it failed?## Why nondimensionalize?A model with units has redundant parameters. Rescaling time and state by natural scales groups the parameters into dimensionless combinations. You learn which combinations control the behaviour, and you reduce the parameter space you need to explore. Sections 3.5 and 3.7 of @strogatz2024nonlinear show the procedure on worked examples, and you will apply it to the budworm in [The Spruce Budworm Model](budworm-model.qmd).## The lab workflowLaboratory sessions follow six steps. You will see them as section headings in the lab pages.- **Prediction.** Before you run anything, write down what you expect: how many equilibria, which one is stable, whether the solution oscillates.- **Implementation.** Write the right-hand side, the solver call and the plots. Keep functions small and documented.- **Validation.** Check the code against something you know: a conserved quantity, an equilibrium, an analytical formula.- **Experiment.** Change one parameter or initial condition at a time and record what changes.- **Interpretation.** Explain the result in terms of the model: which term dominates, which equilibrium the trajectory approaches.- **Limitations.** Say what the simulation cannot tell you, and which assumption is responsible.Each lab has a **core activity** that everyone should complete, and optional extensions for those who finish early.::: {.callout-note}## ExerciseThe exponential decay model $\dot y = -\lambda y$ with $y(0) = y_0$ has solution $y(t) = y_0 e^{-\lambda t}$. Use it to design one validation test for a numerical ODE solver.:::::: {.callout-tip collapse="true"}## SolutionSolve the model numerically with $\lambda = 0.5$, $y_0 = 2$ on $[0, 10]$ and compare with the exact solution. The maximum absolute error should be small and should decrease when you tighten the tolerances.```{python}import numpy as npfrom scipy.integrate import solve_ivpsol = solve_ivp(lambda t, y: -0.5* y, (0, 10), [2.0], t_eval=np.linspace(0, 10, 50), rtol=1e-8)error = np.max(np.abs(sol.y[0] -2.0* np.exp(-0.5* sol.t)))print(f"Maximum error: {error:.2e}")```:::## Next