Skip to content
Tactiverge

School/□ Systems Engineer/Week 9

Your modelling investigation

Question, model, solve, fit, validate, report. Nine weeks of calculus in one investigation, run on a system you choose.

About 50 min · 3 goals · Checked by automated tests

1.Why should I care?

This is the term project in miniature: model and validate a cooling or falling system. The plan you write today is what makes the result trustworthy, because decisions made before seeing the data cannot be bent to fit it.

  • ◇ Plan a modelling investigation: question, equation, assumptions, parameter, data, fit and validation.
  • ◇ Implement an exact and an Euler solution in code and show they agree as h shrinks.
  • ◇ Write up results that separate what was measured, assumed and inferred.

Safety: Only warm (not boiling) water for cooling experiments, and drops of light paper objects from standing height. Ask an adult before using anything hot.

2.Predict

Which should you decide before you look at the validation data?

Guess first. Being wrong here is how the surprise works.

3.Understand

The plan

Write it before collecting or opening data. Question: what will the model predict? Equation and every assumption. Parameter to fit (k or b) and its units. Data: what, how often, how accurate. Split: which readings fit, which test. Metric: RMS error in stated units. Success: what error would be good enough for the question.

The solution checks

Exact solution where it exists; Euler always; a convergence table (h, h/2, h/4) showing the Euler error halving. Agreement verifies your code. Then fit the parameter on the fit set with a log-linear fit, and predict the test set without changing anything.

The report

One page: the question; the model with assumptions; the fitted parameter with units and method; a validation plot with labelled axes; the held-out error; the residual pattern; limits, each with the direction of its effect. Say clearly whether the data are yours or synthetic. Keep code and parameters so anyone can regenerate every figure.

Explain it another way

A good investigation is a story told in an order that cannot cheat: what I expected, how I checked, what happened, what I still do not know.

Worked example 1

Euler gives T(20) = 40.0 °C with h = 1 and 40.5 °C with h = 0.5. Estimate the error of the h = 0.5 result without the exact solution.

For a first-order method error(h) ≈ 2·error(h/2), so the change between the runs, |40.5 − 40.0| = 0.5 °C, is about the size of the error left in the h = 0.5 run. Both runs are moving upwards, so the exact value is probably near 41.0 °C.

Common mix-ups

  • If the model fails validation, the investigation failed.
    ✓ A clear, quantified failure that identifies the wrong assumption is a successful investigation.
  • Synthetic data validate a model.
    ✓ Data generated from a model can only test your method. Validation needs independent measurements.

4.Discover

Open the Code Lab. Write three functions: exact(t) for your chosen model (cooling or linear-drag fall), euler(h, T) that steps the equation, and rms(model, data). Run Euler with h, h/2 and h/4 and print the error against exact(T): it should halve each time. Use the lab's synthetic data if you have none of your own.

Can't use the interactive? Read a description instead

This lesson's activity is in the Code Lab: writing an exact solution, an Euler stepper and an RMS function, then printing a convergence table in which Euler's error halves each time the step halves. No diagram is needed to follow it.

5.Checkpoint: guided practice

Check what you just discovered before going on. Hints appear after a wrong answer.

Practice 1

Which order is right for a modelling investigation?

6.Practice on your own

Practice, not a test. Wrong answers get a hint and another try.

Practice 2

Euler gives 40.0 at h = 1 and 40.5 at h = 0.5. Using first-order behaviour, what is the estimated size of the error in the h = 0.5 result?

Practice 3

You had no time to collect data and used the lab's synthetic cooling set. What must your report say?

Practice 4 · a fresh version every time

A tank's dye concentration obeys dy/dt = −0.5·y with y(0) = 100 mg/L. Take 3 Euler steps of h = 0.5 min. What is the Euler estimate of y after 1.5 min, in mg/L?

mg/L

Practice 5 · a fresh version every time

An object of mass 0.2 kg is dropped from rest with linear drag b = 0.05 kg/s (g = 9.81 m/s²). Its speed is v(t) = v_T·(1 − e^(−t/τ)) with v_T = mg/b and τ = m/b. What is v at t = 2 s, in m/s?

m/s

7.Apply it

Write your one-page project plan now (question, equation, assumptions with expected effects, parameter, data source, split, metric, success threshold). Then carry out the term project: model and validate a cooling or falling system.

8.Reflect

Concepts: First-order differential equations · Simulation and time stepping · Reproducibility and documentation