PDA changes to improve convergence

This commit is contained in:
Lew Rossman
2020-11-19 16:23:24 -05:00
parent 9525d73cf3
commit 533466b796
2 changed files with 5 additions and 1 deletions

View File

@@ -553,6 +553,10 @@ void newdemandflows(Project *pr, Hydbalance *hbal, double *qsum, double *dqsum)
dh = hyd->NodeHead[i] - net->Node[i].El - hyd->Pmin;
dq = (hloss - dh) / hgrad;
dq *= hyd->RelaxFactor;
// Prevent a flow change greater than full demand //(2.2.1)
if (fabs(dq) > hyd->NodeDemand[i])
dq = 0.5 * SGN(dq) * hyd->NodeDemand[i];
hyd->DemandFlow[i] -= dq;
// Update system flow summation