Skip to content

Commit a25d58d

Browse files
committed
Some updates to POWER BALANCE POLAR model.
- Have the angle variables unconstrained. - Some experimentation with setting limits for generator bus voltages. Reverted for now.
1 parent 3644751 commit a25d58d

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/opflow/model/power_bal_polar/pbpol.cpp

+16-5
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,19 @@ PetscErrorCode OPFLOWSetVariableBounds_PBPOL(OPFLOW opflow, Vec Xl, Vec Xu) {
6666
/* Bounds on bus variables */
6767
loc = bus->startxVloc;
6868

69-
xl[loc] = -PETSC_PI;
70-
xu[loc] = PETSC_PI;
69+
xl[loc] = PETSC_NINFINITY;
70+
xu[loc] = PETSC_INFINITY;
7171

7272
if (opflow->genbusvoltagetype == VARIABLE_WITHIN_BOUNDS) {
73-
xl[loc + 1] = bus->Vmin;
74-
xu[loc + 1] = bus->Vmax;
73+
if(bus->ngenON && (bus->ide == REF_BUS || bus->ide == PV_BUS)) {
74+
// bus->Vmin = 0.98*bus->vm;
75+
// bus->Vmax = 1.02*bus->vm;
76+
xl[loc + 1] = bus->Vmin;
77+
xu[loc + 1] = bus->Vmax;
78+
} else {
79+
xl[loc + 1] = bus->Vmin;
80+
xu[loc + 1] = bus->Vmax;
81+
}
7582
} else if (opflow->genbusvoltagetype == FIXED_WITHIN_QBOUNDS) {
7683
if (bus->ide == REF_BUS || bus->ide == PV_BUS) {
7784
xl[loc + 1] = 0.0;
@@ -332,7 +339,11 @@ PetscErrorCode OPFLOWSetInitialGuess_PBPOL(OPFLOW opflow, Vec X, Vec Lambda) {
332339
if (opflow->initializationtype == OPFLOWINIT_MIDPOINT) {
333340
/* Initial guess for voltage angles and bounds on voltage magnitudes */
334341
x[loc] = (xl[loc] + xu[loc]) / 2.0;
335-
x[loc + 1] = (xl[loc + 1] + xu[loc + 1]) / 2.0;
342+
if(bus->ngenON && (bus->ide == REF_BUS || bus->ide == PV_BUS)) {
343+
x[loc + 1] = (bus->Vmin + bus->Vmax) / 2.0; //bus->vm;
344+
} else {
345+
x[loc + 1] = (bus->Vmin + bus->Vmax) / 2.0;
346+
}
336347
} else if (opflow->initializationtype == OPFLOWINIT_FROMFILE ||
337348
opflow->initializationtype == OPFLOWINIT_ACPF ||
338349
opflow->initializationtype == OPFLOWINIT_DCOPF) {

0 commit comments

Comments
 (0)