Skip to content

Commit

Permalink
adding Test-Subsystem for testing ModelicaMod #68
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadja-R committed Nov 15, 2019
1 parent aacddd0 commit a3236d0
Showing 1 changed file with 45 additions and 7 deletions.
52 changes: 45 additions & 7 deletions pyDMPC/ControlFramework/Init.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Global paths
glob_lib_paths = [r'D:\Git\pyDMPC\pyDMPC\ModelicaModels\ModelicaModels',
r'D:\Git\modelica-buildings\Buildings',
r'D:\Git\AixLib-master\AixLib']
glob_lib_paths = [#r'N:\Forschung\EBC0332_BMWi_MODI_GA\Students\mba-nre\01-notes\HiWi Nadja\Git\pyDMPC\pyDMPC\ModelicaModels\ModelicaModels',
#r'N:\Forschung\EBC0332_BMWi_MODI_GA\Students\mba-nre\01-notes\HiWi Nadja\Git\modelica-buildings\Buildings',
#r'N:\Forschung\EBC0332_BMWi_MODI_GA\Students\mba-nre\01-notes\HiWi Nadja\Git\AixLib\AixLib',
r'N:\Forschung\EBC0332_BMWi_MODI_GA\Students\mba-nre\01-notes\HiWi Nadja\Git\pyDMPC\pyDMPC\tests\Testing'] #Testing environment
glob_res_path = r'D:\dymola'
glob_dym_path = r'C:\Program Files\Dymola 2018 FD01\Modelica\Library\python_interface\dymola.egg'
glob_dym_path = r'C:\Program Files\Dymola 2020\Modelica\Library\python_interface\dymola.egg'

# Working directory
import time
Expand Down Expand Up @@ -62,6 +63,8 @@
downs_neigh = []
par_neigh = []

factors = []

# Subsystems
sys_id.append(0)
name.append("Heater")
Expand All @@ -84,13 +87,15 @@
lib_paths.append(glob_lib_paths)
res_path.append(glob_res_path + "\\" + name_wkdir)
dym_path.append(glob_dym_path)
mod_path.append(f'{glob_res_path}\\heater')
#mod_path.append(f'{glob_res_path}\\heater')
mod_path.append(r'N:\Forschung\EBC0332_BMWi_MODI_GA\Students\mba-nre\01-notes\HiWi Nadja\Git\pyDMPC\pyDMPC\SpecialStudies\FrozenModels\AHU\heater')
command_names.append(["valveHeater"])
command_variables.append(["decisionVariables.table[1,2]"])
commands.append([[i,i] for i in range(0,100,5)])
traj_points.append([])
traj_var.append([])
cost_fac.append([0.1, 0.0, 1.0])
factors.append(0)

sys_id.append(1)
name.append("Cooler")
Expand All @@ -99,7 +104,7 @@
downs_neigh.append([0])
par_neigh.append(None)
input_names.append(["preHeaterTemperature.T"])
input_variables.append([r"variation.table[1,2]"])
input_variables.append(["external"])
inputs.append([i for i in range(280,325,1)])
output_names.append(["supplyAirTemperature.T"])
set_points.append([303])
Expand All @@ -113,10 +118,43 @@
lib_paths.append(glob_lib_paths)
res_path.append(glob_res_path + "\\" + name_wkdir)
dym_path.append(glob_dym_path)
mod_path.append(f'{glob_res_path}\\cooler')
#mod_path.append(f'{glob_res_path}\\cooler')
mod_path.append(r'N:\Forschung\EBC0332_BMWi_MODI_GA\Students\mba-nre\01-notes\HiWi Nadja\Git\pyDMPC\pyDMPC\SpecialStudies\FrozenModels\AHU\cooler')
command_names.append(["valveCooler"])
command_variables.append(["decisionVariables.table[1,2]"])
commands.append([[i,i] for i in range(0,100,5)])
traj_points.append([])
traj_var.append([])
cost_fac.append([0.0, 1.0, 0])
factors.append(0)

#Test-Subsystem for Modelica: ALWAYS LAST ENTRY
sys_id.append(len(sys_id))
name.append("ModelicaTest")
model_type.append("Modelica")
ups_neigh.append(None)
downs_neigh.append(None)
par_neigh.append(None)
input_names.append(None)
input_variables.append(["testPurposes"])
inputs.append([i for i in range(280,325,1)])
output_names.append(["Test.y"])
set_points.append(None)
state_var_names.append(['TestSystem'])
model_state_var_names.append(['Test.k'])
start.append(0.)
stop.append(3600.)
incr.append(10.)
opt_time.append(600)
samp_time.append(time_incr)
lib_paths.append(glob_lib_paths)
res_path.append(glob_res_path + "\\" + name_wkdir)
dym_path.append(glob_dym_path)
mod_path.append('Testing.Subsystem.ModelicaTest')
command_names.append(None)
command_variables.append(None)
commands.append([i,i] for i in range(0,100,5))
traj_points.append([])
traj_var.append([])
cost_fac.append([0.0, 1.0, 0])
factors.append(0)

0 comments on commit a3236d0

Please sign in to comment.