Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pde = D[u[x, t], {t, 2}] ==D[u[x, t], {x, 2}] + NeumannValue[0, x == 1];
- bc = {u[0, t] == 0};
- ic = {u[x, 0] == x^2 - 2*x};
- pbc = {PeriodicBoundaryCondition[u[x, t],t == 1 && 0 < x < 1,Function[xy, xy - {0, 1 - xy[[1]]}]]}
- U = NDSolveValue[{ pde, ic, bc, pbc}, u, {x, 0, 1}, {t, 0, 1}]
- Plot[U[x, 1] - U[x, x/2], {x, 0, 1}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement