Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OpenReac parameters interface #43

Merged
merged 31 commits into from
Apr 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7c201cd
Add two params to control consistency of voltage limits.
p-arvy Nov 3, 2023
34fbc8e
Add interface for min/max voltage limit parameters.
p-arvy Nov 10, 2023
d440d7a
Fix codesmell.
p-arvy Nov 10, 2023
efdf25f
Fix.
p-arvy Nov 10, 2023
72cacc1
Add unit test with comparison of input file exported.
p-arvy Nov 10, 2023
b5421e8
Refactor java code.
p-arvy Nov 10, 2023
3ce751b
Refactor ampl code.
p-arvy Nov 10, 2023
1259368
Refactor unit test.
p-arvy Nov 10, 2023
0ac46c9
Add openreac parameters in OpenReacParameters.
p-arvy Nov 13, 2023
dac3c18
Add methods to access/set OpenReac parameters.
p-arvy Nov 15, 2023
7bd8d98
Remove algoParam map and replace with OpenReac interfaces.
p-arvy Nov 16, 2023
faebf3b
Improve unit tests.
p-arvy Nov 16, 2023
7819ec6
Add last OpenReac parameters in Java.
p-arvy Nov 16, 2023
e4ee12c
Add methods and unit tests.
p-arvy Nov 17, 2023
1e00536
Add unit tests and default_param_algo.txt file to OpenReac resources.
p-arvy Nov 17, 2023
28fe3f2
Refactor.
p-arvy Nov 20, 2023
d99d63d
Merge remote-tracking branch 'origin/main' into add_openreac_paramete…
p-arvy Nov 20, 2023
99c523f
Merge branch 'main' into add_openreac_parameters_interface
p-arvy Nov 28, 2023
54210a8
Refactor TU.
p-arvy Nov 28, 2023
e330673
Refactor.
p-arvy Nov 29, 2023
6747d37
Refactor.
p-arvy Nov 29, 2023
ddbbc6e
Merge branch 'main' into add_openreac_parameters_interface
p-arvy Feb 7, 2024
2dcef61
refactor.
p-arvy Feb 7, 2024
aaec339
Merge branch 'main' into add_openreac_parameters_interface
p-arvy Apr 8, 2024
bc7158e
add comments.
p-arvy Apr 8, 2024
78ca814
rename parameters.
p-arvy Apr 8, 2024
ca2cd9d
Merge branch 'refs/heads/main' into add_openreac_parameters_interface
p-arvy Apr 17, 2024
d94cd78
Update merge.
p-arvy Apr 17, 2024
599e59d
Revert modifications on ParamAlgoDeserializer.
p-arvy Apr 17, 2024
b49014d
Refactor json tests to fix code smell.
p-arvy Apr 17, 2024
325c6fe
Refactor alphaCoefficient parameter into activePowerVariationRate.
p-arvy Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add two params to control consistency of voltage limits.
Signed-off-by: parvy <pierre.arvy@artelys.com>
  • Loading branch information
p-arvy committed Nov 3, 2023
commit 7c201cd9170a9f017bd06c5a4beda3bd9fb815dc
33 changes: 18 additions & 15 deletions open-reac/src/main/resources/openreac/reactiveopf.mod
Original file line number Diff line number Diff line change
@@ -42,20 +42,20 @@ check 1 in TIME;
check card({(t,s) in SUBSTATIONS: substation_Vnomi[t,s] >= epsilon_nominal_voltage}) > 1;

# Voltage bounds
check{(t,s) in SUBSTATIONS: substation_Vmin[t,s] >= epsilon_min_voltage and substation_Vmax[t,s] >= epsilon_min_voltage}:
substation_Vmin[t,s] < substation_Vmax[t,s];
# Parameter below will be used to force voltage to be in interval [epsilon;2-epsilon].
# Typical value is 0.5 although academics would use 0.9 or 0.95
check epsilon_min_voltage > 0 and epsilon_min_voltage < 1;
# Bounds below will be used for substations without bounds or with bad bounds (eg 0.01pu or 20pu are bad values)
check{(t,s) in SUBSTATIONS: substation_Vmin[t,s] >= consistent_min_voltage and substation_Vmax[t,s] >= consistent_min_voltage}:
substation_Vmin[t,s] < substation_Vmax[t,s];

# Parameters consistent_min_voltage and consistent_max_voltage are used to force voltage to be in interval [consistent_min_voltage;consistent_max_voltage].
# Default value is [0.5;1.5] although academics would use low limit equals to 0.9 or 0.95
# Bounds below will be used for substations without bounds or with bad bounds
param minimal_voltage_lower_bound :=
if card({(t,s) in SUBSTATIONS: substation_Vmin[t,s] > 0}) > 0
then max(epsilon_min_voltage,min{(t,s) in SUBSTATIONS: substation_Vmin[t,s] > 0} substation_Vmin[t,s])
else epsilon_min_voltage;
if card({(t,s) in SUBSTATIONS: substation_Vmin[t,s] > 0}) > 0
then max(consistent_min_voltage,min{(t,s) in SUBSTATIONS: substation_Vmin[t,s] > 0} substation_Vmin[t,s])
else consistent_min_voltage;
param maximal_voltage_upper_bound :=
if card({(t,s) in SUBSTATIONS: substation_Vmin[t,s] > 0}) > 0
then min(2-epsilon_min_voltage,max{(t,s) in SUBSTATIONS: substation_Vmax[t,s] > 0} substation_Vmax[t,s])
else 2-epsilon_min_voltage;
if card({(t,s) in SUBSTATIONS: substation_Vmin[t,s] > 0}) > 0
then min(consistent_max_voltage,max{(t,s) in SUBSTATIONS: substation_Vmax[t,s] > 0} substation_Vmax[t,s])
else consistent_max_voltage;
check minimal_voltage_lower_bound > 0;
check maximal_voltage_upper_bound > minimal_voltage_lower_bound;

@@ -84,6 +84,9 @@ check {(t,s) in SUBSTATIONS: s in BOUND_OVERRIDES}: substation_new_Vmin[s] < sub
# Negative value for substation_Vmin or substation_Vmax means that the value is undefined
# In that case, minimal_voltage_lower_bound or maximal_voltage_upper_bound is used instead

# Note that low and high override are taken into account only if
# substation_new_Vmin > minimal_voltage_lower_bound and substation_new_Vmax < maximal_voltage_upper_bound

param voltage_lower_bound{(t,s) in SUBSTATIONS} :=
max( minimal_voltage_lower_bound,
if s in BOUND_OVERRIDES then substation_new_Vmin[s] else substation_Vmin[t,s]
@@ -546,7 +549,7 @@ set UNITCC := setof {(1,g,n) in UNIT : n in BUSCC} (g,n);
set BATTERYCC := setof {(1,b,n) in BATTERY : n in BUSCC} (b,n);

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

# Units up and generating:
# Warning: units with Ptarget=0 are considered as out of order
@@ -814,10 +817,10 @@ subject to ctr_null_phase_bus{PROBLEM_ACOPF}: teta[null_phase_bus] = 0;
# Modulus of voltage
var V{n in BUSCC}
<=
if substation_Vnomi[1,bus_substation[1,n]] <= ignore_voltage_bounds then 2-epsilon_min_voltage else
if substation_Vnomi[1,bus_substation[1,n]] <= ignore_voltage_bounds then consistent_max_voltage else
voltage_upper_bound[1,bus_substation[1,n]],
>=
if substation_Vnomi[1,bus_substation[1,n]] <= ignore_voltage_bounds then epsilon_min_voltage else
if substation_Vnomi[1,bus_substation[1,n]] <= ignore_voltage_bounds then consistent_min_voltage else
voltage_lower_bound[1,bus_substation[1,n]];


20 changes: 13 additions & 7 deletions open-reac/src/main/resources/openreac/reactiveopf.run
Original file line number Diff line number Diff line change
@@ -292,19 +292,25 @@ printf{LOG_INFO} "Parameter: for consistency checks of minimum nominal voltages
check epsilon_nominal_voltage > 0;

# Minimum consistency value for voltage in PU
# This value has to be >0 and <1
param epsilon_min_voltage default 0.5;
if "epsilon_min_voltage" in PARAM_ALGO_KEYS then let epsilon_min_voltage := num(PARAM_ALGO_VALUES["epsilon_min_voltage"]);
printf{LOG_INFO} "Parameter: for consistency checks of voltage bounds eps<=Vmin<Vmax<=2-eps, epsilon_min_voltage:= %Q pu\n",epsilon_min_voltage;
check epsilon_min_voltage > 0 and epsilon_min_voltage < 1;
# This value should be < 1
param consistent_min_voltage default 0.5;
if "consistent_min_voltage" in PARAM_ALGO_KEYS then let consistent_min_voltage := num(PARAM_ALGO_VALUES["consistent_min_voltage"]);
printf{LOG_INFO} "Parameter: for consistency of voltage bounds, consistent_min_voltage:= %Q pu\n",consistent_min_voltage;
check consistent_min_voltage > 0;

# Maximum consistency value for voltage in PU
param consistent_max_voltage default 1.5;
if "consistent_max_voltage" in PARAM_ALGO_KEYS then let consistent_max_voltage := num(PARAM_ALGO_VALUES["consistent_max_voltage"]);
printf{LOG_INFO} "Parameter: for consistency of voltage bounds, consistent_max_voltage:= %Q pu\n",consistent_max_voltage;
check consistent_max_voltage > consistent_min_voltage;

# Ignore voltage bounds for buses with nominal voltage lower than this parameter
# For all busses with nominal voltage lower than ignore_voltage_bounds, voltage bonds will be ignored
# and replaced by [epsilon_min_voltage ; 2 - epsilon_min_voltage]
# and replaced by [consistent_min_voltage ; consistent_max_voltage]
param ignore_voltage_bounds default 0;
if "ignore_voltage_bounds" in PARAM_ALGO_KEYS then let ignore_voltage_bounds := num(PARAM_ALGO_VALUES["ignore_voltage_bounds"]);
if ignore_voltage_bounds >= epsilon_nominal_voltage
then printf{LOG_INFO} "Parameter: for all busses with nominal voltage <= ignore_voltage_bounds=%.1f, voltage bounds are ignored and replaced by [%.3f;%.3f]\n",ignore_voltage_bounds,epsilon_min_voltage,2-epsilon_min_voltage;
then printf{LOG_INFO} "Parameter: for all busses with nominal voltage <= ignore_voltage_bounds=%.1f, voltage bounds are ignored and replaced by [%.3f;%.3f]\n",ignore_voltage_bounds,consistent_min_voltage,consistent_max_voltage;
check ignore_voltage_bounds >= 0;

# Consistency maximal value for P and Q
3 changes: 2 additions & 1 deletion open-reac/src/main/resources/openreac/reactiveopfexit.run
Original file line number Diff line number Diff line change
@@ -53,7 +53,8 @@ printf "\n" > (fileOut);
printf "%s %f\n","Pnull",Pnull > (fileOut);
printf "%s %f\n","Znull",Znull > (fileOut);
printf "%s %f\n","epsilon_nominal_voltage",epsilon_nominal_voltage > (fileOut);
printf "%s %f\n","epsilon_min_voltage",epsilon_min_voltage > (fileOut);
printf "%s %f\n","consistent_min_voltage",consistent_min_voltage > (fileOut);
printf "%s %f\n","consistent_max_voltage",consistent_max_voltage > (fileOut);
printf "%s %f\n","ignore_voltage_bounds",ignore_voltage_bounds > (fileOut);
printf "%s %f\n","PQmax",PQmax > (fileOut);
printf "%s %f\n","defaultPmax",defaultPmax > (fileOut);
3 changes: 2 additions & 1 deletion open-reac/src/main/resources/openreac/reactiveopfoutput.run
Original file line number Diff line number Diff line change
@@ -237,7 +237,8 @@ printf "%s %f\n","coeff_alpha",coeff_alpha > (fileOut);
printf "%s %f\n","Pnull",Pnull > (fileOut);
printf "%s %f\n","Znull",Znull > (fileOut);
printf "%s %f\n","epsilon_nominal_voltage",epsilon_nominal_voltage > (fileOut);
printf "%s %f\n","epsilon_min_voltage",epsilon_min_voltage > (fileOut);
printf "%s %f\n","consistent_min_voltage",consistent_min_voltage > (fileOut);
printf "%s %f\n","consistent_max_voltage",consistent_max_voltage > (fileOut);
printf "%s %f\n","ignore_voltage_bounds",ignore_voltage_bounds > (fileOut);
printf "%s %f\n","PQmax",PQmax > (fileOut);
printf "%s %f\n","defaultPmax",defaultPmax > (fileOut);