-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB3_Inv_PVC_Shell.py
More file actions
351 lines (297 loc) · 21.1 KB
/
Copy pathB3_Inv_PVC_Shell.py
File metadata and controls
351 lines (297 loc) · 21.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 9 13:52:56 2019
@author: daniel
"""
import B3_Inv_PVC_HouseModel as HouseADMM
import time
import pyomo
import pyomo.opt
import datetime
import csv
from pyomo.environ import *
import pandas as pd
import numpy as np
#import random
""" Implementing the VVCModel class. Also interfaces prosumer, previously called Shell. """
class VVCModel():
def __init__(self,consumerfile,pricefile,Ro,Bat): # Input: prosumer file with ENERGY demand (for power see lines 50-70) and generation; price file with time-of-use and Feed-in-tariff
self.Starting(consumerfile,pricefile,Ro,Bat)
self.consumer_data = pd.read_csv(consumerfile) # Reading CSV file of prosumer data with Pandas. Transforms into a dataframe.
self.consumer_data.columns = self.consumer_data.columns.str.strip() # Removes spaces from dataframe headers.
self.consumer_data.set_index('T',inplace=True) # Defining index for set within the dataframe. Only 1 set, for time \mathcal{T}.
self.T_set = self.consumer_data.index.unique() # Extracting the values of T (e.g., 0, 0.5, 1, ... 23.5 for 30-minutes windows wihtin a day).
self.createModel()
""" Creating a concrete prosumer model for this individual prosumer. """
def Starting(self,consumerfile,pricefile,Ro,Bat):
time_start = time.time()
self.HouseX = HouseADMM.HouseholdModel(consumerfile,pricefile,Ro,Bat)
self.HouseX.model.cost_PVC.deactivate()
self.HouseX.model.cost.deactivate()
self.HouseX.model.cost_initial.activate()
self.HouseX.solve()
self.HouseX.model.cost_initial.deactivate()
self.HouseX.model.cost.activate()
def createModel(self):
self.VVC_M = ConcreteModel()
""" SETS """
self.VVC_M.T = Set(initialize = self.T_set) # Creates set T - time periods based on \mathcal{T}
""" PARAMETERS """
self.VVC_M.Lambda_v_k = Param(self.VVC_M.T, initialize = 0, mutable = True)
self.VVC_M.Lambda_q_VVC_k = Param(self.VVC_M.T, initialize = 0, mutable = True)
self.VVC_M.Rho_v = Param(initialize = 1, mutable = True)
self.VVC_M.Rho_q_VVC = Param(initialize = 1, mutable = True)
self.VVC_M.Qmax = Param(initialize = value(self.HouseX.model.Qmax)) # Original
# self.VVC_M.Qmax = Param(initialize = 0, mutable = True) # Low Pass Filter LPF
self.VVC_M.V_low = Param(initialize = 216, mutable = True) # 216, 225, 244, 253
self.VVC_M.V_high = Param(initialize = 253, mutable = True) # 216, 225, 244, 253
# self.VVC_M.v_net_kp1 = Param(self.VVC_M.T, initialize = 230, mutable = True) # Volt. p.u.
self.VVC_M.v_net_kp1 = Param(self.VVC_M.T, initialize = 1, mutable = True) # Volt. p.u.
self.VVC_M.q_net_kp1 = Param(self.VVC_M.T, initialize = 0, mutable = True)
self.VVC_M.store_v = Param(self.VVC_M.T, initialize = 0, mutable = True) # ADMM, PVC: For better dual residual calculations
self.VVC_M.store_Q = Param(self.VVC_M.T, initialize = 0, mutable = True) # ADMM, VVC: For better dual residual calculations
# print(value(self.VVC_M.Qmax))
""" DECISION VARIABLES """
self.VVC_M.q_VVC = Var(self.VVC_M.T, bounds=((-1)*self.VVC_M.Qmax, self.VVC_M.Qmax))
# self.VVC_M.v_VVC = Var(self.VVC_M.T, bounds=(215.9, 253.1)) # Volt. p.u.
self.VVC_M.v_VVC = Var(self.VVC_M.T, bounds=(0.9387, 1.1004)) # Volt. p.u.
self.VVC_M.Cost_Partial_t = Var(self.VVC_M.T)
self.VVC_M.q_VVC_CF = Param(self.VVC_M.T, initialize=0, mutable = True)
self.VVC_M.v_VVC_CF = Param(self.VVC_M.T, initialize=0, mutable = True) # Volt. p.u.
""" CONSTRAINTS """
# def VVC_Volt_Rule_Interval_1 (VVC_M, t):
# return self.VVC_M.v_VVC[t] <= self.VVC_M.V_low
# def VVC_Volt_Rule_Interval_2 (VVC_M, t):
# return inequality(self.VVC_M.V_low, self.VVC_M.v_VVC[t], 225)
# def VVC_Volt_Rule_Interval_3 (VVC_M, t):
# return inequality(225, self.VVC_M.v_VVC[t], 244) #, strict = True)
# def VVC_Volt_Rule_Interval_4 (VVC_M, t):
# return inequality(244, self.VVC_M.v_VVC[t], self.VVC_M.V_high)
# def VVC_Volt_Rule_Interval_5 (VVC_M, t):
# return self.VVC_M.V_high <= self.VVC_M.v_VVC[t]
### Volt. p.u. ###
# Split compound inequalities into separate constraints per Pyomo requirements
def VVC_Volt_Rule_Interval_1 (VVC_M, t):
return self.VVC_M.v_VVC[t] <= 0.9392
def VVC_Volt_Rule_Interval_2_lower (VVC_M, t):
return self.VVC_M.v_VVC[t] >= 0.9392
def VVC_Volt_Rule_Interval_2_upper (VVC_M, t):
return self.VVC_M.v_VVC[t] <= 0.97826087
def VVC_Volt_Rule_Interval_3_lower (VVC_M, t):
return self.VVC_M.v_VVC[t] >= 0.97826087
def VVC_Volt_Rule_Interval_3_upper (VVC_M, t):
return self.VVC_M.v_VVC[t] <= 1.060869565
def VVC_Volt_Rule_Interval_4_lower (VVC_M, t):
return self.VVC_M.v_VVC[t] >= 1.060869565
def VVC_Volt_Rule_Interval_4_upper (VVC_M, t):
return self.VVC_M.v_VVC[t] <= 1.1
def VVC_Volt_Rule_Interval_5 (VVC_M, t):
return self.VVC_M.v_VVC[t] >= 1.1
# Using strict = True results in:
# ValueError: Constraint 'VVC_Volt_Interval_3[0.0]' encountered a strict inequality expression ('>' or '<'). All constraints must be formulated using using '<=', '>=', or '=='.
# Register the voltage interval constraints
self.VVC_M.VVC_Volt_Interval_1 = Constraint(self.VVC_M.T, rule=VVC_Volt_Rule_Interval_1)
self.VVC_M.VVC_Volt_Interval_1.deactivate()
self.VVC_M.VVC_Volt_Interval_2_lower = Constraint(self.VVC_M.T, rule=VVC_Volt_Rule_Interval_2_lower)
self.VVC_M.VVC_Volt_Interval_2_lower.deactivate()
self.VVC_M.VVC_Volt_Interval_2_upper = Constraint(self.VVC_M.T, rule=VVC_Volt_Rule_Interval_2_upper)
self.VVC_M.VVC_Volt_Interval_2_upper.deactivate()
self.VVC_M.VVC_Volt_Interval_3_lower = Constraint(self.VVC_M.T, rule=VVC_Volt_Rule_Interval_3_lower)
self.VVC_M.VVC_Volt_Interval_3_lower.deactivate()
self.VVC_M.VVC_Volt_Interval_3_upper = Constraint(self.VVC_M.T, rule=VVC_Volt_Rule_Interval_3_upper)
self.VVC_M.VVC_Volt_Interval_3_upper.deactivate()
self.VVC_M.VVC_Volt_Interval_4_lower = Constraint(self.VVC_M.T, rule=VVC_Volt_Rule_Interval_4_lower)
self.VVC_M.VVC_Volt_Interval_4_lower.deactivate()
self.VVC_M.VVC_Volt_Interval_4_upper = Constraint(self.VVC_M.T, rule=VVC_Volt_Rule_Interval_4_upper)
self.VVC_M.VVC_Volt_Interval_4_upper.deactivate()
self.VVC_M.VVC_Volt_Interval_5 = Constraint(self.VVC_M.T, rule=VVC_Volt_Rule_Interval_5)
self.VVC_M.VVC_Volt_Interval_5.deactivate()
# def VVC_Rule_Interval_1 (VVC_M, t):
# return self.VVC_M.q_VVC[t] == self.VVC_M.Qmax
# def VVC_Rule_Interval_2 (VVC_M, t):
# return self.VVC_M.q_VVC[t] == self.VVC_M.Qmax*(225-self.VVC_M.v_VVC[t])/9
# def VVC_Rule_Interval_3 (VVC_M, t):
# return self.VVC_M.q_VVC[t] == 0
# def VVC_Rule_Interval_4 (VVC_M, t):
# return self.VVC_M.q_VVC[t] == (-1)*self.VVC_M.Qmax*(self.VVC_M.v_VVC[t]-244)/9
# def VVC_Rule_Interval_5 (VVC_M, t):
# return self.VVC_M.q_VVC[t] == (-1)*self.VVC_M.Qmax
### Voltage p.u. ### Reactive power p.u. ###
def VVC_Rule_Interval_1 (VVC_M, t):
return self.VVC_M.q_VVC[t] * 50 == self.VVC_M.Qmax
def VVC_Rule_Interval_2 (VVC_M, t):
return self.VVC_M.q_VVC[t] * 50 == self.VVC_M.Qmax*(0.97826087-self.VVC_M.v_VVC[t])/(0.03906087)
def VVC_Rule_Interval_3 (VVC_M, t):
return self.VVC_M.q_VVC[t] * 50 == 0
def VVC_Rule_Interval_4 (VVC_M, t):
return self.VVC_M.q_VVC[t] * 50 == (-1)*self.VVC_M.Qmax*(self.VVC_M.v_VVC[t]-1.060869565)/(0.039130435)
def VVC_Rule_Interval_5 (VVC_M, t):
return self.VVC_M.q_VVC[t] * 50 == (-1)*self.VVC_M.Qmax
self.VVC_M.VVC_Interval_1 = Constraint(self.VVC_M.T, rule=VVC_Rule_Interval_1); self.VVC_M.VVC_Interval_1.deactivate()
self.VVC_M.VVC_Interval_2 = Constraint(self.VVC_M.T, rule=VVC_Rule_Interval_2); self.VVC_M.VVC_Interval_2.deactivate()
self.VVC_M.VVC_Interval_3 = Constraint(self.VVC_M.T, rule=VVC_Rule_Interval_3); self.VVC_M.VVC_Interval_3.deactivate()
self.VVC_M.VVC_Interval_4 = Constraint(self.VVC_M.T, rule=VVC_Rule_Interval_4); self.VVC_M.VVC_Interval_4.deactivate()
self.VVC_M.VVC_Interval_5 = Constraint(self.VVC_M.T, rule=VVC_Rule_Interval_5); self.VVC_M.VVC_Interval_5.deactivate()
def Cost_Partial_rule (VVC_M, t):
return self.VVC_M.Cost_Partial_t[t] == (self.VVC_M.Lambda_v_k[t] * (self.VVC_M.v_net_kp1[t] - self.VVC_M.v_VVC[t]) + self.VVC_M.Rho_v * (self.VVC_M.v_net_kp1[t] - self.VVC_M.v_VVC[t])**2 + self.VVC_M.Lambda_q_VVC_k[t] * (self.VVC_M.q_net_kp1[t] - self.VVC_M.q_VVC[t]) + self.VVC_M.Rho_q_VVC * (self.VVC_M.q_net_kp1[t] - self.VVC_M.q_VVC[t])**2)
self.VVC_M.Cost_Partial_Constraint = Constraint(self.VVC_M.T, rule=Cost_Partial_rule)
""" OBJECTIVE """
def cost_rule(model):
#return sum((self.VVC_M.Lambda_v_k[t] * (self.VVC_M.v_net_kp1[t] - self.VVC_M.v_VVC[t]) + self.VVC_M.Rho_v * (self.VVC_M.v_net_kp1[t] - self.VVC_M.v_VVC[t])**2
# + self.VVC_M.Lambda_q_VVC_k * (self.VVC_M.q_net_kp1[t] - self.VVC_M.q_VVC[t]) + self.VVC_M.Rho_q_VVC * (self.VVC_M.q_net_kp1[t] - self.VVC_M.q_VVC[t])**2) for t in self.VVC_M.T)
return sum((self.VVC_M.Cost_Partial_t[t]) for t in self.VVC_M.T)
self.VVC_M.cost = Objective(rule=cost_rule)
""" Prosumer Solver function"""
def Solver(self):
self.HouseX.solve()
# def partial_cost(self, t):
# return (value(self.VVC_M.Lambda_v_k[t]) * (value(self.VVC_M.v_net_kp1[t]) - value(self.VVC_M.v_VVC[t])) + value(self.VVC_M.Rho_v) * (
# value(self.VVC_M.v_net_kp1[t]) - value(self.VVC_M.v_VVC[t]))**2 + value(self.VVC_M.Lambda_q_VVC_k) * (value(self.VVC_M.q_net_kp1[t])
# - value(self.VVC_M.q_VVC[t])) + value(self.VVC_M.Rho_q_VVC) * (value(self.VVC_M.q_net_kp1[t]) - value(self.VVC_M.q_VVC[t]))**2)
def VVC_Solver(self):
time_start = time.time() # Setting initial timer for control of solving phase.
solver = pyomo.opt.SolverFactory('ipopt') # Calls the solver for the problem. Will be utilized at every instance of the problem.
# Prefer a portable linear solver. Original authors recommended HSL MA27 which is often unavailable.
# Set to 'mumps' by default here; change to 'ma27' if you have an HSL-enabled IPOPT build.
try:
solver.options['linear_solver'] = 'mumps'
except Exception:
pass
# solver = pyomo.opt.SolverFactory('cplex', executable="C:/Program Files/IBM/ILOG/CPLEX_Studio_Community129/cplex/bin/x64_win64/cplex")
self.Dict_Results = {}; self.v_VVC_results = {}; self.q_VVC_results = {} ## See bottom of the code for example of data structure.
### Defining five intervals for five solutions ###
# Interval 4:
self.VVC_M.VVC_Volt_Interval_4_lower.activate()
self.VVC_M.VVC_Volt_Interval_4_upper.activate()
self.VVC_M.VVC_Interval_4.activate()
results = solver.solve(self.VVC_M)
self.VVC_M.VVC_Volt_Interval_1.deactivate(); self.VVC_M.VVC_Interval_1.deactivate()
for t in sorted (self.VVC_M.T):
#self.Dict_Results[t] = [partial_cost(t)], [value(self.VVC_M.v_VVC[t])], [value(self.VVC_M.q_VVC[t])] ## See bottom of the code for example of data structure.
self.Dict_Results[t] = [value(self.VVC_M.Cost_Partial_t[t])], [value(self.VVC_M.v_VVC[t])], [value(self.VVC_M.q_VVC[t])] ## See bottom of the code for example of data structure.
# Interval 2:
self.VVC_M.VVC_Volt_Interval_2_lower.activate()
self.VVC_M.VVC_Volt_Interval_2_upper.activate()
self.VVC_M.VVC_Interval_2.activate()
results = solver.solve(self.VVC_M)
self.VVC_M.VVC_Volt_Interval_2_lower.deactivate()
self.VVC_M.VVC_Volt_Interval_2_upper.deactivate()
self.VVC_M.VVC_Interval_2.deactivate()
sumcheck_v = 0; sumcheck_q = 0
for t in sorted (self.VVC_M.T):
self.Dict_Results[t][0].append(value(self.VVC_M.Cost_Partial_t[t])); self.Dict_Results[t][1].append(value(self.VVC_M.v_VVC[t])); self.Dict_Results[t][2].append(value(self.VVC_M.q_VVC[t]));
#
# self.VVC_M.v_VVC_CF[t] = ( self.VVC_M.Lambda_v_k[t] + 0.5 * self.VVC_M.Rho_v * self.VVC_M.v_net_kp1[t] +
# (1 / (0.03906087) ) * self.VVC_M.Qmax * ((1 / 0.03906087 ) * 0.97826087 * self.VVC_M.Rho_q_VVC * self.VVC_M.Qmax ) -
# self.VVC_M.Lambda_q_VVC_k[t] - 0.5 * self.VVC_M.Rho_q_VVC * self.VVC_M.q_net_kp1[t] ) / ( self.VVC_M.Rho_v +
# (1 / 0.001525752 ) * self.VVC_M.Rho_q_VVC * self.VVC_M.Qmax)
# if 0.97826087 < value(self.VVC_M.v_VVC_CF[t]) :
# self.VVC_M.v_VVC_CF[t] = 0.97826087
# elif value(self.VVC_M.v_VVC_CF[t]) < 0.9392:
# self.VVC_M.v_VVC_CF[t] = 0.9392
# #
# self.VVC_M.q_VVC_CF[t] = self.VVC_M.Qmax*(0.97826087-self.VVC_M.v_VVC_CF[t])/(0.03906087)
# sumcheck_v += value(self.VVC_M.v_VVC[t]) - value(self.VVC_M.v_VVC_CF[t])
# sumcheck_q += value(self.VVC_M.q_VVC[t]) - value(self.VVC_M.q_VVC_CF[t])
#
# print (sumcheck_q, sumcheck_v)
# Interval 3:
self.VVC_M.VVC_Volt_Interval_3_lower.activate()
self.VVC_M.VVC_Volt_Interval_3_upper.activate()
self.VVC_M.VVC_Interval_3.activate()
results = solver.solve(self.VVC_M)
self.VVC_M.VVC_Volt_Interval_3_lower.deactivate()
self.VVC_M.VVC_Volt_Interval_3_upper.deactivate()
self.VVC_M.VVC_Interval_3.deactivate()
for t in sorted (self.VVC_M.T):
self.Dict_Results[t][0].append(value(self.VVC_M.Cost_Partial_t[t])); self.Dict_Results[t][1].append(value(self.VVC_M.v_VVC[t])); self.Dict_Results[t][2].append(value(self.VVC_M.q_VVC[t]));
# Interval 4:
self.VVC_M.VVC_Volt_Interval_4_lower.activate()
self.VVC_M.VVC_Volt_Interval_4_upper.activate()
self.VVC_M.VVC_Interval_4.activate()
results = solver.solve(self.VVC_M)
self.VVC_M.VVC_Volt_Interval_4_lower.deactivate()
self.VVC_M.VVC_Volt_Interval_4_upper.deactivate()
self.VVC_M.VVC_Interval_4.deactivate()
for t in sorted (self.VVC_M.T):
self.Dict_Results[t][0].append(value(self.VVC_M.Cost_Partial_t[t])); self.Dict_Results[t][1].append(value(self.VVC_M.v_VVC[t])); self.Dict_Results[t][2].append(value(self.VVC_M.q_VVC[t]));
# Interval 5:
self.VVC_M.VVC_Volt_Interval_5.activate(); self.VVC_M.VVC_Interval_5.activate()
results = solver.solve(self.VVC_M)
self.VVC_M.VVC_Volt_Interval_5.deactivate(); self.VVC_M.VVC_Interval_5.deactivate()
for t in sorted (self.VVC_M.T):
self.Dict_Results[t][0].append(value(self.VVC_M.Cost_Partial_t[t])); self.Dict_Results[t][1].append(value(self.VVC_M.v_VVC[t])); self.Dict_Results[t][2].append(value(self.VVC_M.q_VVC[t]));
### Defining end solutions ###
#print(self.Dict_Results)
for t in sorted (self.VVC_M.T):
lowest_idx = np.argmin(self.Dict_Results[t][0]) # Selecting index of lowest objective value at each time interval t
self.v_VVC_results[t] = self.Dict_Results[t][1][lowest_idx]
self.q_VVC_results[t] = self.Dict_Results[t][2][lowest_idx]
# Alternatively, closed-form solution:
# if x5
# self.VVC_M.v_VVC_CF[t] = ( self.VVC_M.Lambda_v_k[t] + 0.5 * self.VVC_M.Rho_v * self.VVC_M.v_net_kp1[t] +
# (1 / (0.03906087) ) * self.VVC_M.Qmax ) * ((1 / (0.03906087) ) * 0.97826087 * self.VVC_M.Rho_q_VVC * self.VVC_M.Qmax ) -
# self.VVC_M.Lambda_q_VVC_k[t] - 0.5 * self.VVC_M.Rho_q_VVC * self.VVC_M.q_net_kp1[t] / ( self.VVC_M.Rho_v +
# (1 / 0.001525752 ) * self.VVC_M.Rho_q_VVC * self.VVC_M.Qmax)
#
# if 0.97826087 < self.VVC_M.v_VVC_CF[t] :
# self.VVC_M.v_VVC_CF[t] = 0.97826087
# elif self.VVC_M.v_VVC_CF[t] < 0.9392:
# self.VVC_M.v_VVC_CF[t] = 0.9392
#
# self.VVC_M.q_VVC_CF[t] = self.VVC_M.Qmax*(0.97826087-self.VVC_M.v_VVC_CF[t])/(0.03906087)
#
#
#
#
#
# if v_ht > smth then smth; elif < smth2 then smth2;
# q_ht = qmax * ...
#
#
#
#
# def VVC_Volt_Rule_Interval_1 (VVC_M, t):
# return self.VVC_M.v_VVC[t] <= 0.9392
# def VVC_Volt_Rule_Interval_2 (VVC_M, t):
# #return inequality(0.9392, self.VVC_M.v_VVC[t], 0.97826087)
# return 0.9392 <= self.VVC_M.v_VVC[t] <= 0.97826087
# def VVC_Volt_Rule_Interval_3 (VVC_M, t):
# #return inequality(0.97826087, self.VVC_M.v_VVC[t], 1.060869565) #, strict = True)
# return 0.97826087 <= self.VVC_M.v_VVC[t] <= 1.060869565 #, strict = True)
# def VVC_Volt_Rule_Interval_4 (VVC_M, t):
# #return inequality(1.060869565, self.VVC_M.v_VVC[t], 1.1)
# return 1.060869565 <= self.VVC_M.v_VVC[t] <= 1.1
# def VVC_Volt_Rule_Interval_5 (VVC_M, t):
# return 1.1 <= self.VVC_M.v_VVC[t]
#
#
# self.VVC_M.Lambda_v_k = Param(self.VVC_M.T, initialize = 0, mutable = True)
# self.VVC_M.Lambda_q_VVC_k = Param(self.VVC_M.T, initialize = 0, mutable = True)
# self.VVC_M.Rho_v = Param(initialize = 1, mutable = True)
# self.VVC_M.Rho_q_VVC = Param(initialize = 1, mutable = True)
#
# self.VVC_M.Qmax = Param(initialize = value(self.HouseX.model.Qmax))
# self.VVC_M.V_low = Param(initialize = 216, mutable = True) # 216, 225, 244, 253
# self.VVC_M.V_high = Param(initialize = 253, mutable = True) # 216, 225, 244, 253
# # self.VVC_M.v_net_kp1 = Param(self.VVC_M.T, initialize = 230, mutable = True) # Volt. p.u.
# self.VVC_M.v_net_kp1 = Param(self.VVC_M.T, initialize = 1, mutable = True) # Volt. p.u.
# self.VVC_M.q_net_kp1 = Param(self.VVC_M.T, initialize = 0, mutable = True)
#
# self.VVC_M.store_v = Param(self.VVC_M.T, initialize = 0, mutable = True) # ADMM, PVC: For better dual residual calculations
# self.VVC_M.store_Q = Param(self.VVC_M.T, initialize = 0, mutable = True) # ADMM, VVC: For better dual residual calculations
#
# # print(value(self.VVC_M.Qmax))
#
# """ DECISION VARIABLES """
# self.VVC_M.q_VVC = Var(self.VVC_M.T, bounds=((-1)*self.VVC_M.Qmax, self.VVC_M.Qmax))
# # self.VVC_M.v_VVC = Var(self.VVC_M.T, bounds=(215.9, 253.1)) # Volt. p.u.
# self.VVC_M.v_VVC = Var(self.VVC_M.T, bounds=(0.9387, 1.1004)) # Volt. p.u.
# self.VVC_M.Cost_Partial_t = Var(self.VVC_M.T)
# Dict_Results = {
# 0: [cost_1, ..., cost_5], [v_1, ..., v_5], [q_1, ..., q_5]
# 0.5:
# 1:
# 1.5:
# }