In this chapter

Chapter 8 of 13

  1. 8.1State vector
  2. 8.2The four sub-models
  3. 8.3Why the heating is sluggish
  4. 8.4From the system of differential equations to the clock
  5. 8.5Sensors and valves
All chapters
  1. 01Initial situation
  2. 02Objective and approach
  3. 03State of the art
  4. 04Requirements
  5. 05Solution approaches and concept decision
  6. 06System architecture
  7. 07The test rig
  8. 08The heated-tank model
  9. 09The simulation cycle
  10. 10Five test scenarios
  11. 11Result and limits
  12. 12Outlook
  13. 13Preliminary projects

Chapter 08 Model

The heated-tank model

State vector, four sub-models and explicit Euler method

By Chapter 8 of 13 4 min read Updated: 30 September 2026

Summary

The heated-tank model describes a pressure vessel with water and a headspace of steam and air by five state variables. Four sub-models (mass balance of the water, energy balance, pressure calculation and a delayed heating element) are advanced with the explicit Euler method in the time step Δt = 50 ms. The digital sensors B1 to B4, which correspond to the signals of the exam board, are derived from the state.

The technical core of the thesis is the derivation of the model. What is replicated is a pressure vessel with a volume of 0.5 m³, containing water, above it a headspace of steam and air (steam space), heated with up to 150 kW (Fig. 7a).

Pressure vessel of 0.5 m³, water and steam space, heater with PT1 behaviour (τ = 12 s) and the system boundary of the model.
Fig. 7a Heated-tank model, schematic: system boundary, water body, steam space and heating elementSource: Own illustration

State vector

5state variables
0.05sstep size
150kWmaximum heating power

The state vector x(k) holds the water mass, the internal energy of the water, the steam mass, the air mass and the currently effective heating power. Everything else is calculated from it: the water temperature from energy and mass (ϑ_w = E_w / (m_w · c_w) with c_w = 4180 J/(kg·K)) and the pressure from the partial pressures of steam and air according to the ideal gas equation.

Water mass, internal energy, steam mass, air mass and heating power as the state x(k).
Fig. 11a State vector and energy balance per time stepSource: Own illustration

The four sub-models

The model consists of four coupled parts (Fig. 11b):

  • Mass balance of the water: The water mass grows via the inlet valves and decreases via the outflow and the evaporation. The outflow rate depends on the square root of the pressure.
  • Energy balance: It adds the heating energy and subtracts the evaporation energy and the outflow loss.
  • Pressure calculation: The pressure in the headspace follows from steam mass and air mass with their gas constants; the partial pressures are added according to Dalton.
  • Heating element: The heating power follows the setpoint with a delay (section “Why the heating is sluggish”).
Mass balance of the water, evaporation and pressure calculation according to Dalton with the gas constants for steam and air.
Fig. 11b Mass balance, evaporation and pressure calculation according to DaltonSource: Own illustration

Whether water evaporates at all is decided by the saturation pressure, which is calculated from the temperature with the Antoine equation: if it exceeds the pressure in the tank, the water boils (Fig. 10). It rises steeply with temperature. At 100 °C it is about 1.01 bar; the alarm threshold B4 is at 2.8 bar, the safety valve at 3.5 bar.

Curve of the saturation pressure over temperature with alarm threshold B4 (2.8 bar) and safety valve (3.5 bar).
Fig. 10 Saturation pressure over temperature with alarm threshold B4 and safety valveSource: Own illustration

Why the heating is sluggish

A heating element does not become hot abruptly. It is modelled as a first-order lag element (PT1 element) with a time constant of τ = 12 s: after one time constant the heating power has reached 63.2 % of its final value, after three time constants about 95 %, after five 99.3 % (Fig. 8). A higher-order model would require more parameters without adding anything for the purpose of the thesis.

Heating power after a step: 63.2 % after one time constant, 95 % after three, 99.3 % after five.
Fig. 8 Step response of the PT1 heating element with the characteristic points at τ, 3τ and 5τSource: Own illustration

From the system of differential equations to the clock

The coupled equations are discretised with the explicit Euler method: x(k+1) = x(k) + f(x(k), u(k)) · Δt with Δt = 50 ms. This is the simplest one-step method, and that is precisely an advantage here: it fits into a fixed cycle, can be followed step by step and can be checked against the analytical solution (Chapter 10). For the PT1 element, the method is stable as long as Δt/τ < 2 holds; here the ratio is about 0.004 (Fig. 11b). This statement concerns only the heating element.

The five state variables and their update per time step with energy balance, mass balance, pressure calculation and PT1 heating.
Fig. 11 Relationship between state vector and energy balanceSource: Own illustration

Sensors and valves

Digital sensors are derived from the state: B1 reports the upper fill level from 450 l, B2 the lower fill level at 50 l or less, B3 the temperature from 95 °C and B4 the pressure from 2.8 bar. The plant is actuated via the inlet valves Y1 and Y2, the drain valve Y3, the vent valve Y4 and the heating command E1. These are exactly the signals that would also be present at the exam board of the heated tank (Chapter 1).

Labelled snapshot of the heated tank in operation (tank about 84 % full, heating command E1 active): water body, steam space, heating element, valves Y1–Y4 and the sensors B1–B4.
Fig. 7b The running simulation in the browser with valves, sensors and process valuesSource: Own photograph

How the model is called in the fixed cycle is described in Chapter 9; the check against expected values follows in Chapter 10.