0 Votes

Getting started with Co-Simulation

Last modified by superadmin on 2025/01/14 17:42

Previous (run_sim)     |     Back to Start     |     Next (setup_Python)

Setting up the ICE model

Start with a default building model image-20220317160045-1.png

Open the zone, then go to advanced and click on the dropdown menu next to “Zone controller” and choose “New custom control…” Give it a relevant name. In this case we will be using the PI controller from MATLAB or Python to control the ideal cooler

image-20220317162200-1.png

Add an “Export” and connect the “Zone” to it. Choose AIRTEMP from the “Zone” side and data[1] (new) from the “Export” side and click on OK

image-20220317155415-2.png

Open the “Export” and change the channel to “ICE_zone”. This is the name of this channel and should have the same name on the MATLAB or Python side later.
The extrapolationLimit can be set to 125 sec just for stability reasons, the order should be set to 0, the variable name in vars can be set to Temp, the deadBand should be set to 0 and the nSync to 0, as well.

image-20220317160122-2.png

Insert an “Import” and connect it to “Central zone control”. Choose data[1] (new) on the “Import” side and COOLING on the “Central zone control” side, then click OK.

Open the “Import” and change the channel to “ICE_heatCtr”. This is the name of this channel and should have the same name in MATLAB or Python.

The extrapolationLIMIT here is set to 125 sec. In general, it should be equal to 2x Maximal timestep + ε. In this case our MATLAB or Python code will deliver a control signal every 60 seconds (timestep).

Continue by changing the order to 0, the variable name in vars to “control-signal” and the deadBand to 0.

image-20220317160933-2.png

Open the “Ideal Cooler” and choose “Central zone control” under Controller. Change the capacity to 500 W. Now the ICE model is ready.

image-20220317161054-3.png

Previous (run_sim)     |     Back to Start     |     Next (setup_Python)