<aside> 📘

Tutorial 2 of the Kalix tutorial series. You'll take the model from Tutorial 1 and rewrite its rainfall input as a weighted combination of three gauge stations, then compare runs side-by-side in the Run Manager. Expected time: about 15 minutes.

</aside>

What you'll build

The same Stringybark Creek catchment from Tutorial 1, but with the rainfall input rebuilt from three rain gauge stations instead of a single areal-rainfall series. The new rain is constructed inside the model file using a Kalix expression — a piece of arithmetic that combines data references and literal numbers.

image.png

Prerequisites

Put all five CSVs in the same folder. We'll build the new model file (stringybark_expressions.ini) alongside them.

About expressions

In Tutorial 1 you wrote rain = data.climate_data_csv.by_name.rain_mm — a direct reference to a single column. But that = is more powerful than it looks. Most node properties that accept data actually accept a mathematical expression rather than just a simple data reference.

The expression language is rich. It includes:

A few quick examples to make this concrete: