Skip to content

Commit

Permalink
Update pde.py
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisGMM committed May 6, 2022
1 parent 412f5ba commit 4df50e0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/numericalmethods/pde.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,5 +326,11 @@ def hyperbolic(h: float, k: float, x0: float, xf: float, t0: float, tf: float, u
sol[1:-1, 0] = u0(x)

sol[1:-1, 1] = 1/2 * rho * (u0(x+h)[1:-1] - u0(x-h)[1:-1]) + (1 - rho) * u0(x)

for ti in range(2, LEN_T):
sol[1:-1, ti] = rho*sol[2:, ti] + 2*(1 - rho)*sol[:, ti] + rho*sol[:-2, ti] - sol[:, ti-1]

return sol, x, t

def elliptic(h: float, k: float, x0: float, xf: float, t0: float, tf: float, u0: Callable) -> Tuple[np.ndarray]:
raise NotImplementedError()

0 comments on commit 4df50e0

Please sign in to comment.