<aside> 📘

Tutorial 1 of the Kalix tutorial series. You'll build a single-catchment rainfall-runoff model from scratch, run it, and look at the result. Expected time: about 20 minutes.

</aside>

What you'll build

A daily rainfall-runoff model for the (fictional) Stringybark Creek catchment — a Sacramento catchment node feeding a downstream gauge node, driven by ~30 years of daily rainfall and PET data. By the end you'll have a working model file, a simulation, and a chart of simulated vs. observed streamflow.

image.png

Prerequisites

Put both CSVs in the same folder. We'll build the model file (stringybark_sacramento.ini) from scratch in that same folder.

About the dataset

The dataset is a daily time series covering 1980-01-01 to 2009-12-31 (30 years) for a fictional catchment we'll call Stringybark Creek, with a contributing area of 228 km². Each CSV has a Date column plus one or more value columns. Here, climate_data.csv carries two value columns (rain_mm and pet_mm) while observed.csv carries one (obs).

Build the model

We'll build stringybark_sacramento.ini one section at a time. Open Kalix IDE and create a new empty model file in the same folder as the two CSVs.

Step 1 — The [kalix] section

The [kalix] section holds top-level model settings. We'll use it to lock the simulation period to the 30 years our data covers.

[kalix]
start = 1980-01-01
end = 2009-12-31

If you leave start and end out, Kalix will infer the simulation period from the available input data. Setting them explicitly is good practice — it documents your intent and lets you simulate a sub-period without touching the data files.

Step 2 — The [inputs] section

The [inputs] section lists the data files the model will load. Bare filenames are resolved relative to the model file's folder, which is what we want here.

[inputs]
climate_data.csv
observed.csv

A single CSV can hold any number of value columns, so the count of files you list here doesn't dictate how many inputs your model can wire up. Here climate_data.csv carries both the rainfall and PET series; we'll wire each column up to the right input on the node in the next step.