Skip to content

Commit

Permalink
Updated multiplier scaling for output
Browse files Browse the repository at this point in the history
  • Loading branch information
abhyshr committed Jan 5, 2025
1 parent 4e90387 commit 71a9a91
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/opflow/model/power_bal_polar/pbpol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,16 +425,16 @@ PetscErrorCode OPFLOWSetInitialGuess_PBPOL(OPFLOW opflow, Vec X, Vec Lambda) {
}

gloc = bus->starteqloc;
lambda[gloc] = bus->mult_pmis;
lambda[gloc + 1] = bus->mult_qmis;
lambda[gloc] = bus->mult_pmis*ps->MVAbase;
lambda[gloc + 1] = bus->mult_qmis*ps->MVAbase;
}

PetscScalar *lambdai = lambda + opflow->nconeq;
for(i = 0; i < opflow->nlinesmon; i++) {
line = &ps->line[opflow->linesmon[i]];
gloc = line->startineqloc;
lambdai[gloc] = line->mult_sf;
lambdai[gloc + 1] = line->mult_st;
lambdai[gloc] = line->mult_sf*ps->MVAbase*ps->MVAbase/(2*line->rateA);
lambdai[gloc + 1] = line->mult_st*ps->MVAbase*ps->MVAbase/(2*line->rateA);
}


Expand Down Expand Up @@ -2990,8 +2990,8 @@ PetscErrorCode OPFLOWSolutionToPS_PBPOL(OPFLOW opflow) {
bus->vm = x[loc + 1];

gloc = bus->starteqloc;
bus->mult_pmis = lambdae[gloc];
bus->mult_qmis = lambdae[gloc + 1];
bus->mult_pmis = lambdae[gloc]/ps->MVAbase;
bus->mult_qmis = lambdae[gloc + 1]/ps->MVAbase;

if (opflow->include_powerimbalance_variables) {
loc = bus->startxpimbloc;
Expand Down Expand Up @@ -3093,8 +3093,8 @@ PetscErrorCode OPFLOWSolutionToPS_PBPOL(OPFLOW opflow) {
if (line->isdcline)
continue;
gloc = line->startineqloc;
line->mult_sf = lambdai[gloc];
line->mult_st = lambdai[gloc + 1];
line->mult_sf = (2*lambdai[gloc]*line->rateA/ps->MVAbase)/ps->MVAbase;
line->mult_st = (2*lambdai[gloc + 1]*line->rateA/ps->MVAbase)/ps->MVAbase;
}

ierr = VecRestoreArrayRead(X, &x);
Expand Down

0 comments on commit 71a9a91

Please sign in to comment.