Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Use time-averaged dA in discharge calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
kandread committed Sep 18, 2019
1 parent e19d646 commit 9bfda98
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions confluence/integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def objective(self, x):
if dA is None:
dA = np.array([(w[r] + W[np.argmin(A[:, r]), r]) / 2 * (h[r] - H[np.argmin(A[:, r]), r])
for r in range(self.nreaches)]).T
else:
dA = np.mean(dA, axis=0)
Q0 = 1 / self.n * (self.A0 + dA)**(5 / 3) * w**(-2 / 3) * np.mean(
S, axis=0)**(1 / 2)
Q = 1 / n * (A0 + dA)**(5 / 3) * w**(-2 / 3) * np.mean(S,
Expand All @@ -44,6 +46,8 @@ def constraint(self, i, x):
if dA is None:
dA = np.array([(w[r] + W[np.argmin(A[:, r]), r]) / 2 * (h[r] - H[np.argmin(A[:, r]), r])
for r in range(self.nreaches)]).T
else:
dA = np.mean(dA, axis=0)
Q = 1 / n * (A0 + dA)**(5 / 3) * w**(-2 / 3) * np.mean(S,
axis=0)**(1 / 2)
return Q[i] - Q[i + 1]
Expand Down

0 comments on commit 9bfda98

Please sign in to comment.