Cyber-Physical Systems (BIL-435), week 2 of 14

Continuous Dynamics: Batteries, Buildings and Grid Frequency

Prof. Dr. Utku Kose, Süleyman Demirel University

Continuous dynamics lab

Two parts of this interactive lab are virtual laboratories in three dimensions (3D) with the hardware in the foreground. Part A runs nights in the climate room of the library, with its radiators, the heating controller, a thermostat and a data logger. Part C puts the frequency of the island on a flywheel bench, a model at the scale 1:1000. Parts B and C compute the formulas of the lecture step by step, and Part D asks for the values of stage 2 by hand. Part E is a field task with the heat meter of the library, read as on site. In the calculators every intermediate value is rounded, and the next step continues with the rounded value. The results of Parts A and C can be copied into the Colab notebook. Each laboratory first shows its room. Start moves the view to the bench, and the view returns to the room at the end. The laboratories work best with a mouse or a touchpad on a computer.

Part A: The climate room of the library

The reading room of the library is the climate room of this laboratory. The heating of the library delivers up to 60 kW through radiators, and the heating controller on the wall shows its power. A thermostat on the wall shows the indoor temperature, and a data logger beside it records one sample per minute. The screen on the wall draws the night from 20:00 to 8:00, which passes in about twelve seconds. Every night starts at 20:00 with the room at 21 °C.

Set the outdoor temperature, the power of the heating and the hour at which the heating starts, then press Run the night. Your missions: First, find the power that holds 21 °C all night at 5 °C outside. Second, with the heating off from 20:00 and 60 kW later, find the latest start that still gives 20 °C at 8:00. Type both answers into the fields below.

NightOutside (°C)Heating (kW)Start (h after 20:00)At 8:00 (°C)Energy (kWh)

Back to the lecture: A building as a heat capacitor, where the text continues after the box of this part.
Continue in Colab, section 3: Paste your nights into MY_NIGHTS and compare them with the model.

Part B: The model of the building, step by step

The calculator repeats the worked example of the library one step at a time. Its sliders set the outdoor temperature, the power of the heater, the starting temperature and the time. The figure shows the temperature over the next 24 hours.

Back to the lecture: A building as a heat capacitor, where the text continues after the box of this part.
Continue in Colab, section 3: Simulate the library and compute the time to reach a target.

Part C: The flywheel bench

The flywheel bench is a model of the island at the scale 1:1000: One watt on the bench stands for one kilowatt of the island. An electric machine on the shaft of the flywheel feeds the load bank. The speed of the shaft is therefore the frequency of the bench, 3000 revolutions per minute at 50 Hz. Each steel disc of 24 cm stores 1 kJ at this speed and adds 40 W·s/Hz. One, two or four discs therefore stand for an inertia M of 40, 80 or 160 kW·s/Hz. The load bank switches steps of 22 W, each one a charging car of 22 kW on the island, and a frequency meter shows the deviation. A switch enables the droop of the battery with 125 W/Hz, which stands for K = 125 kW/Hz. The damping of the loads is 12 W/Hz. Power and inertia shrink by the same factor, so the frequency moves exactly as on the island, and the controls below use the values of the island.

Choose the inertia, the load step and the droop below the view and press Switch on the load. The meter measures the initial rate of change of frequency (RoCoF) over the first 0.1 s, and the screen draws the next ten seconds. Your mission: Run at least four steps, including one with twice the inertia and one with the droop, and compare the measured RoCoF with the formula of the lecture. With the droop on, the battery already responds within these 0.1 s, so the meter reads a little less than the formula.

TrialInertiaStep (kW)DroopRoCoF (Hz/s)FormulaOutcome

The calculator below repeats the worked example of the swing equation one step at a time. Its sliders set the load step, the inertia and the droop gain.

Back to the lecture: Grid frequency: The swing of the island, where the text continues after the box of this part.
Continue in Colab, section 4: Paste your load steps into MY_STEPS and compare them with the model.

Part D: By hand: Stage 2 of the microgrid

The battery of 500 kWh with an efficiency of 0.95 starts at a state of charge of 0.8. It discharges 150 kW for 2 hours: Compute the final state of charge to three decimals. The library with $R = 0.4$ K/kW is heated with 50 kW at -2 °C outside: Compute its steady-state temperature. Finally, a load step of 44 kW hits the island with $M = 80$ kW·s/Hz: Compute the RoCoF in Hz/s to three decimals.

Back to the lecture: The campus microgrid, stage 2: Dynamic models of the battery, the library and the frequency, where the text continues after the box of this part.
Continue in Colab, section 5: Compute the results of stage 2 of the campus microgrid.

Part E: Field task: Reading the heat meter

The heating power of Part A is measured in the plant room of the library by a heat meter on the heating circuit. A flow sensor in the return pipe counts the water, and a pair of temperature sensors measures the supply and the return. The meter shows its values one after another on a small display, and a single button steps through them. It is 22:00, and it is 5 °C outside, as in the first mission of Part A.

Back to the lecture: In the field: Reading a heat meter, where the text continues after the box of this part.