Skip to content

Commit

Permalink
Merge branch 'issue83_fivezonemodel' of https://github.com/terrancelu…
Browse files Browse the repository at this point in the history
…92/mpc-drl-tl into issue83_fivezonemodel
  • Loading branch information
terrancelu92 committed Dec 10, 2021
2 parents a5f9c76 + c0f3e63 commit 1b292ad
Show file tree
Hide file tree
Showing 41 changed files with 362 additions and 342 deletions.
Binary file not shown.
Binary file not shown.
19 changes: 13 additions & 6 deletions testcases/models/high_fidelity_models/single-zone/SingleZoneVAV.mo
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package SingleZoneVAV
"Cooling setpoint during on";
parameter Modelica.SIunits.Temperature TCooOff=303.15
"Cooling setpoint during off";
parameter Real mSenFac = 1 "Thermal mass scalor in the zone";

BaseClasses.Control.ChillerDXHeatingEconomizerController con(
minAirFlo=0.1,
Expand All @@ -41,7 +42,9 @@ package SingleZoneVAV
BaseClasses.Room zon(
redeclare package MediumA = MediumA,
mAir_flow_nominal=0.75,
lat=weaDat.lat) "Thermal envelope of single zone"
lat=weaDat.lat,
roo(mSenFac=mSenFac))
"Thermal envelope of single zone"
annotation (Placement(transformation(extent={{40,-20},{80,20}})));
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
computeWetBulbTemperature=false, filNam=
Expand Down Expand Up @@ -298,6 +301,7 @@ First implementation.
"Cooling setpoint during on";
parameter Modelica.SIunits.Temperature TCooOff=303.15
"Cooling setpoint during off";
parameter Real mSenFac = 1 "Thermal mass scalor in the zone";

BaseClasses.Control.ChillerDXHeatingEconomizerController con(
minAirFlo=0.1,
Expand All @@ -321,7 +325,8 @@ First implementation.
BaseClasses.Room zon(
redeclare package MediumA = MediumA,
mAir_flow_nominal=0.75,
lat=weaDat.lat) "Thermal envelope of single zone"
lat=weaDat.lat,
roo(mSenFac=mSenFac)) "Thermal envelope of single zone"
annotation (Placement(transformation(extent={{40,-20},{80,20}})));
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
computeWetBulbTemperature=false, filNam=
Expand Down Expand Up @@ -576,6 +581,7 @@ First implementation.
"Cooling setpoint during on";
parameter Modelica.SIunits.Temperature TCooOff=303.15
"Cooling setpoint during off";
parameter Real mSenFac = 1 "Thermal mass scalor in the zone";

BaseClasses.Control.ChillerDXHeatingEconomizerController con(
minAirFlo=0.1,
Expand All @@ -598,7 +604,8 @@ First implementation.
BaseClasses.Room zon(
redeclare package MediumA = MediumA,
mAir_flow_nominal=0.75,
lat=weaDat.lat) "Thermal envelope of single zone"
lat=weaDat.lat,
roo(mSenFac=mSenFac)) "Thermal envelope of single zone"
annotation (Placement(transformation(extent={{40,-20},{80,20}})));
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
computeWetBulbTemperature=false, filNam=
Expand Down Expand Up @@ -866,6 +873,7 @@ First implementation.
"Cooling setpoint during on";
parameter Modelica.SIunits.Temperature TCooOff=303.15
"Cooling setpoint during off";
parameter Real mSenFac = 4 "Thermal mass scalor in the zone";

BaseClasses.Control.ChillerDXHeatingEconomizerController con(
minAirFlo=0.1,
Expand All @@ -889,7 +897,7 @@ First implementation.
redeclare package MediumA = MediumA,
mAir_flow_nominal=0.75,
lat=weaDat.lat,
roo(mSenFac=4)) "Thermal envelope of single zone"
roo(mSenFac=mSenFac)) "Thermal envelope of single zone"
annotation (Placement(transformation(extent={{40,-20},{80,20}})));
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
computeWetBulbTemperature=false, filNam=
Expand Down Expand Up @@ -1145,8 +1153,7 @@ First implementation.
extends Modelica.Icons.BasesPackage;
model Room "Room model for test case"
extends Buildings.Air.Systems.SingleZone.VAV.Examples.BaseClasses.Room(
roo(use_C_flow=true,
mSenFac=4, nPorts=6),
roo(use_C_flow=true, nPorts=6),
sinInf(use_C_in=true),
TRooAir(unit="K"));
Modelica.Blocks.Math.Gain gaiCO2Gen(k=2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ docker run^
-v %CD%:/mnt/shared^
-i^
-t^
mpcdrl /bin/bash -c "cd /mnt/shared && python2 /mnt/shared/compile_fmu.py"
yangyangfu/mpcdrl:cpu_py3 /bin/bash -c "cd /mnt/shared && python2 /mnt/shared/compile_fmu.py"
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ docker run --name fmuc^
-v %CD%:/mnt/shared^
-i^
-t^
mpcdrl /bin/bash -c^
"source activate base && export PYTHONPATH=$PYFMI_PY3_CONDA_PATH:$PYTHONPATH && cd /mnt/shared && python /mnt/shared/generate_training_data.py"
yangyangfu/mpcdrl:cpu_py3 /bin/bash -c "source activate base && export PYTHONPATH=$PYFMI_PY3_CONDA_PATH:$PYTHONPATH && cd /mnt/shared && python /mnt/shared/generate_training_data.py"

Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"test": {"error_mean": -0.18797262123778807, "mse": 0.4348028561307629, "nrmse": 0.032246986700762856, "r2": 0.961475206123683}, "train": {"error_mean": -0.003588103621155987, "mse": 0.23796288904618743, "nrmse": 0.023374465434156635, "r2": 0.9697037667041808}}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def autocorrection(self,Tz_his_meas, Tz_his_pred):
correction = np.mean(np.array(Tz_his_meas)-np.array(Tz_his_pred))

return float(correction)


def predict(self,Tz_his_meas, Tz_his_pred, To_his_meas, mz, Tsa):
"""This is to provide a complete prediction with autocorrection term
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 1b292ad

Please sign in to comment.