Skip to content

Commit

Permalink
Modify head of param files.
Browse files Browse the repository at this point in the history
Signed-off-by: parvy <pierre.arvy@artelys.com>
  • Loading branch information
p-arvy committed Nov 24, 2023
1 parent 80689a8 commit 93977f4
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected AbstractElementsInput(List<String> elementIds) {

@Override
public void write(BufferedWriter writer, StringToIntMapper<AmplSubset> stringToIntMapper) throws IOException {
writer.write("#amplId powsyblId\n");
writer.write("#num id\n");
for (String elementID : elementIds) {
int amplId = stringToIntMapper.getInt(getElementAmplSubset(), elementID);
String[] tokens = {Integer.toString(amplId), AmplIOUtils.addQuotes(elementID)};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ public OpenReacParameters addVariableTwoWindingsTransformers(List<String> transf
return this;
}

/**
* A list of buses, to which reactive slacks variable will be attached by the optimizer.
*/
public OpenReacParameters addConfiguredReactiveSlackBuses(List<String> busesIds) {
this.configuredReactiveSlackBuses.addAll(busesIds);
return this;
Expand Down Expand Up @@ -200,6 +203,10 @@ public OpenReacParameters setMaxPlausibleHighVoltageLimit(double maxPlausibleHig
return this;
}

/**
* @return the mode used to select which buses will have reactive slack variables attached in the optimization.
* If mode is CONFIGURED, the buses in configuredReactiveSlackBuses are used.
*/
public ReactiveSlackBusesMode getReactiveSlackBusesMode() {
return reactiveSlackBusesMode;
}
Expand Down
8 changes: 4 additions & 4 deletions open-reac/src/main/resources/openreac/reactiveopf.dat
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,17 @@ param: BRANCH: branch_3wt branch_subor branch_subex branch_R branch_X branch_Gor
param: BOUND_OVERRIDES: substation_new_Vmin, substation_new_Vmax, substation_new_checkId := include ampl_network_substations_override.txt;

# param_shunts.txt
#"amplId" "powsyblId"
#"num" "id"
param: PARAM_SHUNT: param_shunt_id := include param_shunts.txt;

# param_generators_reactive.txt
#"amplId" "powsyblId"
#"num" "id"
param: PARAM_UNIT_FIXQ: param_unit_fixq_id := include param_generators_reactive.txt;

# param_transformers.txt
#"amplId" "powsyblId"
#"num" "id"
param: PARAM_TRANSFORMERS_RATIO_VARIABLE: param_transformers_ratio_variable_id := include param_transformers.txt;

# param_buses_with_reactive_slack.txt
#"amplId" "powsyblId"
#"num" "id"
param: PARAM_BUSES_WITH_REACTIVE_SLACK: param_buses_with_reactive_slack_id := include param_buses_with_reactive_slack.txt;
6 changes: 3 additions & 3 deletions open-reac/src/main/resources/openreac/reactiveopf.mod
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ check {(t,qq,m,n) in BRANCH: qq in PARAM_TRANSFORMERS_RATIO_VARIABLE}: branch_id
# Buses with reactive slacks
###############################################################################
# param_buses_with_reactive_slack.txt
# If buses_with_reactive_slacks == "SPECIFIED" then only buses listed in this file will have reactive slacks attached in ACOPF
# If buses_with_reactive_slacks == "CONFIGURED" then only buses listed in this file will have reactive slacks attached in ACOPF
#"num" "id"
set PARAM_BUSES_WITH_REACTIVE_SLACK dimen 1 default {};
param param_buses_with_reactive_slack_id{PARAM_BUSES_WITH_REACTIVE_SLACK} symbolic;
Expand Down Expand Up @@ -949,10 +949,10 @@ subject to ctr_balance_P{PROBLEM_ACOPF,k in BUSCC}:
# Reactive Balance
#

# Reactive balance slack variables at specified nodes
# Reactive balance slack variables at configured nodes
set BUSCC_SLACK := if buses_with_reactive_slacks == "ALL" then BUSCC
else if buses_with_reactive_slacks == "NO_GENERATION" then {n in BUSCC: (card{(g,n) in UNITON: (g,n) not in UNIT_FIXQ}==0 and card{(svc,n) in SVCON}==0 and card{(vscconv,n) in VSCCONVON}==0)}
else BUSCC inter PARAM_BUSES_WITH_REACTIVE_SLACK; # if = "SPECIFIED", buses given as parameter but in connex component
else BUSCC inter PARAM_BUSES_WITH_REACTIVE_SLACK; # if = "CONFIGURED", buses given as parameter but in connex component
var slack1_balance_Q{BUSCC_SLACK} >=0;
var slack2_balance_Q{BUSCC_SLACK} >=0;
#subject to ctr_compl_slack_Q{PROBLEM_ACOPF,k in BUSCC_SLACK}: slack1_balance_Q[k] >= 0 complements slack2_balance_Q[k] >= 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#amplId powsyblId
#num id
1 'VL1_0'

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#amplId powsyblId
#num id
1 'B1-G'

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#amplId powsyblId
#num id
1 'B18-SH'

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#amplId powsyblId
#num id
64 'T4-18-1'

0 comments on commit 93977f4

Please sign in to comment.