Skip to content

Commit

Permalink
5.0.8
Browse files Browse the repository at this point in the history
improved NR ability to detect sparse solution errors
  • Loading branch information
SanPen committed Nov 28, 2023
1 parent 02a456a commit 577db2e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/GridCal/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
_current_year_ = datetime.datetime.now().year

# do not forget to keep a three-number version!!!
__GridCal_VERSION__ = "5.0.7"
__GridCal_VERSION__ = "5.0.8"

url = 'https://github.com/SanPen/GridCal'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,24 @@ def NR_LS(Ybus, S0, V0, I0, Y0, pv_, pq_, Qmin, Qmax, tol, max_it=15, mu_0=1.0,
J = AC_jacobian(Ybus, V, pvpq, pq)

# compute update step
dx = linear_solver(J, f)

if np.isnan(dx).any():
try:
dx = linear_solver(J, f)

if np.isnan(dx).any():
end = time.time()
elapsed = end - start
logger.add_error('NR Singular matrix @iter:'.format(iteration))

return NumericPowerFlowResults(V=V0, converged=converged, norm_f=norm_f,
Scalc=S0, ma=None, theta=None, Beq=None,
Ybus=None, Yf=None, Yt=None,
iterations=iteration, elapsed=elapsed)
except RuntimeError:
end = time.time()
elapsed = end - start
# return NumericPowerFlowResults(V0, converged, norm_f, S0,
# None, None, None, None, None, None, iteration, elapsed)

logger.add_error('NR Singular matrix @iter:'.format(iteration))

return NumericPowerFlowResults(V=V0, converged=converged, norm_f=norm_f,
Scalc=S0, ma=None, theta=None, Beq=None,
Ybus=None, Yf=None, Yt=None,
Expand Down
2 changes: 1 addition & 1 deletion src/GridCalEngine/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
_current_year_ = datetime.datetime.now().year

# do not forget to keep a three-number version!!!
__GridCalEngine_VERSION__ = "5.0.7"
__GridCalEngine_VERSION__ = "5.0.8"

url = 'https://github.com/SanPen/GridCal'

Expand Down

0 comments on commit 577db2e

Please sign in to comment.