Ejemplo n.º 1
0
experiment_model_2 = Model(thermostat = therm.HarshCurtailedThermostat(strategy = greedy_strategy), time_step_in_hours = timestep)
experiment_model_3 = Model(thermostat = therm.UpsideCurtailedThermostat(strategy = greedy_strategy), time_step_in_hours = timestep)

total_cost_control = 0
total_cost_experiment = 0
total_cost_experiment_2 = 0
total_cost_experiment_3 = 0

max_temp_control = 0
max_temp_exp = 0
max_temp_exp_2 = 0
max_temp_exp_3 = 0

for i in range(1, tempdata.timespan):
  ext_temp = tempdata.external_temp(i)
  no_cooling_model.iterate(ext_temp)
  control_model.iterate(ext_temp)
  d = tempdata.steptime_to_date(i)
  greedy_strategy.iterate(d)
  experiment_model.iterate(ext_temp)
  experiment_model_2.iterate(ext_temp)
  experiment_model_3.iterate(ext_temp)
  price_mwh = pricedata.price(d)
  control_cost = control_model.power_cost(price_mwh)
  experiment_cost = experiment_model.power_cost(price_mwh)
  experiment_cost_2 = experiment_model_2.power_cost(price_mwh)
  experiment_cost_3 = experiment_model_3.power_cost(price_mwh)
  if greedy_strategy.current_swing > 0:
    total_cost_control += control_cost
    total_cost_experiment += experiment_cost
    total_cost_experiment_2 += experiment_cost_2
Ejemplo n.º 2
0
Archivo: test.py Proyecto: sweis/thermo
timestep = 1/60.0
tempdata = Tempdata("hourly-temp.csv", timestep)

no_cooling_model = Model(thermostat = NoThermostat(), time_step_in_hours = timestep)
control_model = Model(thermostat = ControlThermostat(deadband_delta_celcius = 0.5), time_step_in_hours = timestep)
control_model_2 = Model(thermostat = ControlThermostat(deadband_delta_celcius = 1.0), time_step_in_hours = timestep)


control_model.temp = util.f_to_c(78)
control_model.therm.state = 1
i = 0
while control_model.therm.state:
  #print i, util.c_to_f(control_model.temp)
  i+=1
  control_model.iterate(util.f_to_c(85))


no_cooling_model = Model(thermostat = NoThermostat(), time_step_in_hours = timestep, internal_temp_celcius = util.f_to_c(68))
no_cooling_model_2 = Model(thermostat = NoThermostat(), time_step_in_hours = timestep, internal_temp_celcius = util.f_to_c(68))
no_cooling_model_3 = Model(thermostat = NoThermostat(), time_step_in_hours = timestep, internal_temp_celcius = util.f_to_c(68))

i = 0
while no_cooling_model.temp < util.f_to_c(85) and i < 420:
  print i, util.c_to_f(no_cooling_model.temp)
  i+=1
  no_cooling_model.iterate(util.f_to_c(85))

#for i in range(0, 200):
#  print "%d, %s, %s, %s" % (i, util.c_to_f(no_cooling_model.temp), util.c_to_f(no_cooling_model_2.temp), util.c_to_f(no_cooling_model_3.temp))
#  no_cooling_model.iterate(util.f_to_c(85))