<aside> 📘

Tutorial 12 of the Kalix tutorial series. You'll calibrate the Stringybark Creek model from a terminal using kalix optimise — reading an optimisation config file, watching the live convergence plot, and saving a calibrated model ready to run. Expected time: about 20 minutes.

</aside>

What you'll build

A working command-line calibration of the Stringybark catchment model. You'll point kalix optimise at an optimisation config file and a model file, let the Differential Evolution optimiser tune 18 parameters against an observed flow record, watch it converge in the terminal, and write out a calibrated model file ready to simulate.

image.png

image.png

Prerequisites

Project layout

012/
├── data/
│   ├── climate_data.csv             # rain_mm + pet_mm
│   └── observed.csv                 # obs — the streamflow we calibrate against
└── models/
    ├── stringybark.ini              # the starting model
    ├── optimisation_config.ini      # the calibration recipe
    └── stringybark_calibrated.ini   # the result (we'll regenerate this)

The model uses trailhead paths (^/data/...), so it runs from any depth — exactly as you set up in Tutorial 3. All commands below assume you've changed into 012/models/.

The two ingredients

Calibration on the command line needs two files:

  1. The model file (stringybark.ini) — the thing being calibrated. It's an ordinary Kalix model with starting parameter values. The optimiser overwrites the parameters listed in the config and leaves everything else untouched.
  2. The optimisation config (optimisation_config.ini) — the recipe: which parameters to tune, over what ranges, against which observed data, using which objective and algorithm.

This mirrors kalix simulate from Tutorial 4, which took a single model file. kalix optimise takes the config and the model.

Anatomy of the optimisation config

Open optimisation_config.ini. It has three parts.

The [optimisation] section — the algorithm