Skip to content

Commit d2679c2

Browse files
authored
Fix bug in NewtonDiagnostics, should fix #13409 (#13546)
1 parent 043e1c2 commit d2679c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

OMCompiler/SimulationRuntime/c/simulation/solver/newton_diagnostics.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ double maxNonLinearResiduals( unsigned m, unsigned l, unsigned* z_idx,
213213
// Calculate the absolute maximum value of the non-linear residuals r_x0 = f_x0 + fz * (z1 - z0)
214214
// at iteration point x0, where z1 - z0 = dx and fz = J for the linear values and equations.
215215

216-
// l = m - p: number of linear dependables or equations
216+
// l = m - q: number of linear unknowns
217217
// z_idx : index of linear dependable in f, fx, dx
218218

219219
double r_x0, fz_dz;
@@ -1338,7 +1338,7 @@ void newtonDiagnostics(DATA* data, threadData_t *threadData, int sysNumber)
13381338

13391339
// --------------------------------------------------------------------------------------------------------------------------------
13401340

1341-
double maxRes = maxNonLinearResiduals(m, m - p, z_idx, f, fx, dx);
1341+
double maxRes = maxNonLinearResiduals(m, m - q, z_idx, f, fx, dx);
13421342

13431343
double* alpha = calcAlpha(data, threadData, sysNumber, m, p, q, n_idx, w_idx, x0, dx, f, fxx, lambda, maxRes);
13441344

0 commit comments

Comments
 (0)