Skip to content

Commit

Permalink
G/B to 0 for non-impedant branches in AMPL (#75)
Browse files Browse the repository at this point in the history
Signed-off-by: p-arvy <pierre.arvy@artelys.com>
  • Loading branch information
p-arvy authored Jul 31, 2024
1 parent 6b191c5 commit ae78bb3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
8 changes: 4 additions & 4 deletions open-reac/src/main/resources/openreac/acopf.mod
Original file line number Diff line number Diff line change
Expand Up @@ -109,27 +109,27 @@ var branch_Ror_var{(qq,m,n) in BRANCHCC_REGL_VAR}
var Red_Tran_Act_Dir{(qq,m,n) in BRANCHCC } =
V[n] * branch_admi[qq,m,n] * sin(teta[m]-teta[n]+branch_dephor[qq,m,n]-branch_angper[qq,m,n])
* (if (qq,m,n) in BRANCHCC_REGL_VAR then branch_Ror_var[qq,m,n]*branch_cstratio[1,qq,m,n] else branch_Ror[qq,m,n])
+ V[m] * (branch_admi[qq,m,n]*sin(branch_angper[qq,m,n])+branch_Gor[1,qq,m,n])
+ V[m] * (branch_admi[qq,m,n]*sin(branch_angper[qq,m,n])+branch_Gor_mod[qq,m,n])
* (if (qq,m,n) in BRANCHCC_REGL_VAR then branch_Ror_var[qq,m,n]*branch_cstratio[1,qq,m,n] else branch_Ror[qq,m,n])**2
;

var Red_Tran_Rea_Dir{(qq,m,n) in BRANCHCC } =
- V[n] * branch_admi[qq,m,n] * cos(teta[m]-teta[n]+branch_dephor[qq,m,n]-branch_angper[qq,m,n])
* (if (qq,m,n) in BRANCHCC_REGL_VAR then branch_Ror_var[qq,m,n]*branch_cstratio[1,qq,m,n] else branch_Ror[qq,m,n])
+ V[m] * (branch_admi[qq,m,n]*cos(branch_angper[qq,m,n])-branch_Bor[1,qq,m,n])
+ V[m] * (branch_admi[qq,m,n]*cos(branch_angper[qq,m,n])-branch_Bor_mod[qq,m,n])
* (if (qq,m,n) in BRANCHCC_REGL_VAR then branch_Ror_var[qq,m,n]*branch_cstratio[1,qq,m,n] else branch_Ror[qq,m,n])^2
;

var Red_Tran_Act_Inv{(qq,m,n) in BRANCHCC } =
V[m] * branch_admi[qq,m,n] * sin(teta[n]-teta[m]-branch_dephor[qq,m,n]-branch_angper[qq,m,n])
* (if (qq,m,n) in BRANCHCC_REGL_VAR then branch_Ror_var[qq,m,n]*branch_cstratio[1,qq,m,n] else branch_Ror[qq,m,n])
+ V[n] * (branch_admi[qq,m,n]*sin(branch_angper[qq,m,n])+branch_Gex[1,qq,m,n])
+ V[n] * (branch_admi[qq,m,n]*sin(branch_angper[qq,m,n])+branch_Gex_mod[qq,m,n])
;

var Red_Tran_Rea_Inv{(qq,m,n) in BRANCHCC } =
- V[m] * branch_admi[qq,m,n] * cos(teta[n]-teta[m]-branch_dephor[qq,m,n]-branch_angper[qq,m,n])
* (if (qq,m,n) in BRANCHCC_REGL_VAR then branch_Ror_var[qq,m,n]*branch_cstratio[1,qq,m,n] else branch_Ror[qq,m,n])
+ V[n] * (branch_admi[qq,m,n]*cos(branch_angper[qq,m,n])-branch_Bex[1,qq,m,n])
+ V[n] * (branch_admi[qq,m,n]*cos(branch_angper[qq,m,n])-branch_Bex_mod[qq,m,n])
;


Expand Down
17 changes: 17 additions & 0 deletions open-reac/src/main/resources/openreac/commons.mod
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,23 @@ param branch_X_mod{(qq,m,n) in BRANCHCC} :=
else branch_X[1,qq,m,n];
check {(qq,m,n) in BRANCHCC}: abs(branch_X_mod[qq,m,n]) > 0;

# If in BRANCHZNULL, then set Gor/Gex/Bor/Bex to 0
param branch_Gor_mod{(qq,m,n) in BRANCHCC} :=
if (qq,m,n) in BRANCHZNULL then 0
else branch_Gor[1,qq,m,n];

param branch_Gex_mod{(qq,m,n) in BRANCHCC} :=
if (qq,m,n) in BRANCHZNULL then 0
else branch_Gex[1,qq,m,n];

param branch_Bor_mod{(qq,m,n) in BRANCHCC} :=
if (qq,m,n) in BRANCHZNULL then 0
else branch_Bor[1,qq,m,n];

param branch_Bex_mod{(qq,m,n) in BRANCHCC} :=
if (qq,m,n) in BRANCHZNULL then 0
else branch_Bex[1,qq,m,n];

# Busses with valid voltage value
set BUSVV := {n in BUSCC : bus_V0[1,n] >= min_plausible_low_voltage_limit};

Expand Down

0 comments on commit ae78bb3

Please sign in to comment.