Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. pde = D[u[x, t], {t, 2}] ==D[u[x, t], {x, 2}] + NeumannValue[0, x == 1];
  2. bc = {u[0, t] == 0};
  3. ic = {u[x, 0] == x^2 - 2*x};
  4. pbc = {PeriodicBoundaryCondition[u[x, t],t == 1 && 0 < x < 1,Function[xy, xy - {0, 1 - xy[[1]]}]]}
  5.  
  6. U = NDSolveValue[{ pde, ic, bc, pbc}, u, {x, 0, 1}, {t, 0, 1}]
  7.  
  8. Plot[U[x, 1] - U[x, x/2], {x, 0, 1}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement