-
Notifications
You must be signed in to change notification settings - Fork 1
/
post_proc1.run
26 lines (20 loc) · 2.03 KB
/
post_proc1.run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
let S_cond_share := (sum {t in time, (l,n,m) in branch} Scond[t,l,n,m])/(card(time)*card(branch));
let S_over_max := sum {t in time, (l,n,m) in branch} (if P[t,l,n,m]^2+Q[t,l,n,m]^2>1.001*Sl_max[l]^2 then 1 else 0);
let S_at_max := sum {t in time, (l,n,m) in branch} (if P[t,l,n,m]^2+Q[t,l,n,m]^2>0.999*Sl_max[l]^2 and P[t,l,n,m]^2+Q[t,l,n,m]^2<1.001*Sl_max[l]^2 then 1 else 0);
let primal_value:= sum {t in time, g in gen} (c2[g]*Pgen[t,g]^2 + c1[g]*Pgen[t,g] + c0[g]);
let dual_value :=
-sum {t in time, es in es_bus} (qbat[t]*lambda1[t,es]+qqbat[t]*lambda2[t,es])
-sum {t in time, g in gen: c2[g]>0} (c1[g]+mi1max[t,g]-mi1min[t,g]+sum{(n,g) in bus_gen} lambda1[t,n])^2/(4*c2[g])
+sum {t in time, n in refbus} fit[t,n]*lambda7[t,n]
+sum {t in time, g in gen} (c0[g]-pg_max[g]*mi1max[t,g]+pg_min[g]*mi1min[t,g]-qg_max[g]*mi2max[t,g]+qg_min[g]*mi2min[t,g])
-sum {t in time, (l,n,m) in branch_from: Vcond[t,l,n,m]} (lambda17[t,l,n,m]+lambda20[t,l,n,m])/2
+sum {t in time, n in bus} ((Vt[t,n]-vmax[n])*mi3max[t,n] + (vmin[n]-Vt[t,n])*mi3min[t,n])
-sum {t in time, (n,lo) in bus_load} (pd[lo]*load_f[t]*lambda1[t,n]+qd[lo]*load_f[t]*lambda2[t,n])
-sum {t in time, (n,sh) in bus_shunt} (gs[sh]*Vt[t,n]^2*lambda1[t,n]-bs[sh]*Vt[t,n]^2*lambda2[t,n])
+sum {t in time, (n,m) in buspair: Ccond[t,n,m]} ((3/4)*lambda15[t,n,m] - (5/4)*lambda16[t,n,m])
-sum {t in time, (n,m) in buspair:!Ccond[t,n,m]} lambda22[t,n,m]
-sum {t in time, (l,n,m) in branch_from} ((gl[l]+gl_fr[l])*lambda3[t,l,n,m]-(bl[l]+bl_fr[l])*lambda5[t,l,n,m])*Vt[t,n]^2/tap[l]^2
-sum {t in time, (l,n,m) in branch_to} ((gl[l]+gl_to[l])*lambda4[t,l,n,m]-(bl[l]+bl_to[l])*lambda6[t,l,n,m])*Vt[t,n]^2
-sum {t in time, (l,n,m) in branch: Scond[t,l,n,m]} Sl_max[l]*lambda13[t,l,n,m];
let duality_gap_perc := 100*(primal_value-dual_value)/((primal_value+dual_value)/2);
let claimed_profit := UpQPOF;