-
Notifications
You must be signed in to change notification settings - Fork 49
Implement Model a PQU diagram for reactive limits #3612
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
base: main
Are you sure you want to change the base?
Changes from all commits
27b99ea
30dadba
faf1509
b841e82
11a3a9e
d4482c3
6f2bd47
c488f64
351e2ee
26c0a7f
883927f
6ac7a82
6deddde
6fa44e3
2db8797
b9060be
b0a21c2
acb3935
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,61 @@ | ||||||
| /** | ||||||
| * Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium) | ||||||
| * This Source Code Form is subject to the terms of the Mozilla Public | ||||||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||||||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||||||
| * SPDX-License-Identifier: MPL-2.0 | ||||||
| */ | ||||||
| package com.powsybl.iidm.network; | ||||||
|
|
||||||
| /** | ||||||
| * Base interface for <code>Generator</code> reactive capabilities shape limits. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not only for generators no? |
||||||
| * <pre> | ||||||
| * U (kV) ^ | ||||||
| * | | ||||||
| * | +------------------+ | ||||||
| * | /| /| | ||||||
| * | / | / | | ||||||
| * *---*--+---------------* | | ||||||
| * | / | | | | | ||||||
| * |/ | . (P, Q, U) | | | ||||||
| * +---|--|---------------|--+ | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand what these points represent |
||||||
| * | | +---------------|--+ | ||||||
| * | | / | / | ||||||
| * | |/ |/ | ||||||
| * +---|------------------+ | ||||||
| * | | ||||||
| * <-------------------*--------------------------------> P (MW) | ||||||
| * / | ||||||
| * / | ||||||
| * / Q (MVaR) | ||||||
| * | ||||||
| * - P (MW): Active Power (Horizontal Axis) | ||||||
| * - Q (MVaR): Reactive Power (Depth Axis) | ||||||
| * - U (kV): Voltage (Vertical Axis) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is confusing to use U in the javadoc but V in the code. Should it not all be V? |
||||||
| * </pre> | ||||||
| * The bounding box represents the operational limits—the single convex polyhedron defined by your constraints (the listOfPlanes). | ||||||
| * The point (P, Q, U) represents a specific operating point that the isInside function is checking. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The sentence about the (P, Q, U) point should be in the polyhedron javadoc as it is not directly in the ReactiveCapabilityShape object.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or the isInside function could be added to this interface. |
||||||
| * | ||||||
| * @author Fabrice Buscaylet {@literal <fabrice.buscaylet at artelys.com>} | ||||||
| */ | ||||||
| public interface ReactiveCapabilityShape extends ReactiveLimits { | ||||||
|
|
||||||
| /** | ||||||
| * Get the reactive power minimum value at a given active power and voltage values. | ||||||
| * | ||||||
| * @param p the active power | ||||||
| */ | ||||||
| double getMinQ(double p, double v); | ||||||
|
|
||||||
| /** | ||||||
| * Get the reactive power maximum value at a given active power and voltage values. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| * | ||||||
| * @param p the active power | ||||||
| */ | ||||||
| double getMaxQ(double p, double v); | ||||||
|
|
||||||
| /** | ||||||
| * @return the reactive capability shape polyhedron | ||||||
| */ | ||||||
| ReactiveCapabilityShapePolyhedron getPolyhedron(); | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,32 @@ | ||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium) | ||||||||||||||||||||||||||||||
| * This Source Code Form is subject to the terms of the Mozilla Public | ||||||||||||||||||||||||||||||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||||||||||||||||||||||||||||||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||||||||||||||||||||||||||||||
| * SPDX-License-Identifier: MPL-2.0 | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
|
Comment on lines
+1
to
+7
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The copyright is wrong:
Suggested change
|
||||||||||||||||||||||||||||||
| package com.powsybl.iidm.network; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||
| * @author Fabrice Buscaylet {@literal <fabrice.buscaylet at artelys.com>} | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| public interface ReactiveCapabilityShapeAdder { | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * Add the reactive capability shape to the element | ||||||||||||||||||||||||||||||
| * @return the ReactiveCapabilityShape | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| ReactiveCapabilityShape add(); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * Add a reactive capability shape plane to the reactive capability shape | ||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it would be good to reming the place equation here so that the alpha, beta and gamma coefficients are directly understood.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or in the param you could add what the coefficient refers to. |
||||||||||||||||||||||||||||||
| * @param alpha the alpha coefficient | ||||||||||||||||||||||||||||||
| * @param beta the beta coefficient | ||||||||||||||||||||||||||||||
| * @param gamma the gamme right hand side | ||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||
| * @param isGreaterOrEqual true if the inequality is greater or equal, false if the inequality is less or equal | ||||||||||||||||||||||||||||||
| * @return this | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| ReactiveCapabilityShapeAdder addPlane(double alpha, double beta, double gamma, boolean isGreaterOrEqual); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method should be in iidm-impl |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,123 @@ | ||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe this one should be move to impl package, because I don't think it could be reused in the network store iidm impl. |
||||||||||||||||||||||||||||||
| * Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium) | ||||||||||||||||||||||||||||||
| * This Source Code Form is subject to the terms of the Mozilla Public | ||||||||||||||||||||||||||||||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||||||||||||||||||||||||||||||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||||||||||||||||||||||||||||||
| * SPDX-License-Identifier: MPL-2.0 | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
|
Comment on lines
+1
to
+7
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The copyright is wrong:
Suggested change
|
||||||||||||||||||||||||||||||
| package com.powsybl.iidm.network; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * Base interface for <code>Generator</code> reactive capabilities shape limits. | ||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This javadoc is also redundant |
||||||||||||||||||||||||||||||
| * <pre> | ||||||||||||||||||||||||||||||
| * U (kV) ^ | ||||||||||||||||||||||||||||||
| * | | ||||||||||||||||||||||||||||||
| * | +------------------+ | ||||||||||||||||||||||||||||||
| * | /| /| | ||||||||||||||||||||||||||||||
| * | / | / | | ||||||||||||||||||||||||||||||
| * *---*--+---------------* | | ||||||||||||||||||||||||||||||
| * | / | | | | | ||||||||||||||||||||||||||||||
| * |/ | . (P, Q, U) | | | ||||||||||||||||||||||||||||||
| * +---|--|---------------|--+ | ||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same about this line |
||||||||||||||||||||||||||||||
| * | | +---------------|--+ | ||||||||||||||||||||||||||||||
| * | | / | / | ||||||||||||||||||||||||||||||
| * | |/ |/ | ||||||||||||||||||||||||||||||
| * +---|------------------+ | ||||||||||||||||||||||||||||||
| * | | ||||||||||||||||||||||||||||||
| * <-------------------*--------------------------------> P (MW) | ||||||||||||||||||||||||||||||
| * / | ||||||||||||||||||||||||||||||
| * / | ||||||||||||||||||||||||||||||
| * / Q (MVaR) | ||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||
| * - P (MW): Active Power (Horizontal Axis) | ||||||||||||||||||||||||||||||
| * - Q (MVaR): Reactive Power (Depth Axis) | ||||||||||||||||||||||||||||||
| * - U (kV): Voltage (Vertical Axis) | ||||||||||||||||||||||||||||||
| * </pre> | ||||||||||||||||||||||||||||||
| * The bounding box represents the operational limits—the single convex | ||||||||||||||||||||||||||||||
| * polyhedron defined by your constraints(the listOfPlanes). | ||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||
| * The point (P, Q, U) represents a specific operating point that the | ||||||||||||||||||||||||||||||
| * isInside function is checking. | ||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||
| * @author Fabrice Buscaylet {@literal <fabrice.buscaylet at artelys.com>} | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| public final class ReactiveCapabilityShapeImpl implements ReactiveCapabilityShape { | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * The convex polyhedron | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| private final ReactiveCapabilityShapePolyhedron polyhedron; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * @return the kind of reactive limit (SHAPE) | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| @Override | ||||||||||||||||||||||||||||||
| public ReactiveLimitsKind getKind() { | ||||||||||||||||||||||||||||||
| return ReactiveLimitsKind.SHAPE; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * Return the minimum reactive power q for a specific active power p and a specific voltage v | ||||||||||||||||||||||||||||||
| * @param p the active power | ||||||||||||||||||||||||||||||
| * @return he minimum reactive power q for a specific active power p and a specific voltage v | ||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| @Override | ||||||||||||||||||||||||||||||
| public double getMinQ(final double p, final double v) { | ||||||||||||||||||||||||||||||
| return polyhedron.getMinQ(p, v); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * Return the maximum reactive power q for a specific active power p and a specific voltage v | ||||||||||||||||||||||||||||||
| * @param p the active power | ||||||||||||||||||||||||||||||
| * @return the maximum reactive power q for a specific active power p and a specific voltage v | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| @Override | ||||||||||||||||||||||||||||||
| public double getMaxQ(final double p, final double v) { | ||||||||||||||||||||||||||||||
| return polyhedron.getMaxQ(p, v); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * Return the minimum reactive power q for a specific active power p | ||||||||||||||||||||||||||||||
| * @param p the active power | ||||||||||||||||||||||||||||||
| * @return the minimum reactive power q for a specific active power p | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| @Override | ||||||||||||||||||||||||||||||
| public double getMinQ(final double p) { | ||||||||||||||||||||||||||||||
| return polyhedron.getMinQ(p); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * Return the maximum reactive power q for a specific active power p | ||||||||||||||||||||||||||||||
| * @param p the active power | ||||||||||||||||||||||||||||||
| * @return the maximum reactive power q for a specific active power p | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| @Override | ||||||||||||||||||||||||||||||
| public double getMaxQ(final double p) { | ||||||||||||||||||||||||||||||
| return polyhedron.getMaxQ(p); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| @Override | ||||||||||||||||||||||||||||||
| public void applyOwnerBounds(ReactiveLimitsHolder holder) { | ||||||||||||||||||||||||||||||
| polyhedron.withActivePowerBounds(holder.getMinP(), holder.getMaxP()); | ||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem with this approach is that if one change the minP and maxP of the generator for instance, the shape is not up-to date anymore. We probably need to store the holder ot an abstraction on it to always get the current value. |
||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * Constructor | ||||||||||||||||||||||||||||||
| * @param polyhedron the reactive capacility shape polyhedron | ||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| private ReactiveCapabilityShapeImpl(final ReactiveCapabilityShapePolyhedron polyhedron) { | ||||||||||||||||||||||||||||||
| this.polyhedron = polyhedron; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * Builder | ||||||||||||||||||||||||||||||
| * @param polyhedron the reactive capacility shape polyhedron | ||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| public static ReactiveCapabilityShapeImpl build(final ReactiveCapabilityShapePolyhedron polyhedron) { | ||||||||||||||||||||||||||||||
| return new ReactiveCapabilityShapeImpl(polyhedron); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| public ReactiveCapabilityShapePolyhedron getPolyhedron() { | ||||||||||||||||||||||||||||||
| return this.polyhedron; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copyright is wrong: