Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. eq = D[f[t, x], {t, 2}] - D[f[t, x], {x, 2}] - D[f[t, x], {t, 2},{x, 2}]==0
  2.  
  3. shape = Cos[32*Pi*(-0.5 + x)]/E^(120.*(x-0.5)^2);
  4. ics ={f[0, x] == shape, Derivative[1,0][f][0,x]==0};
  5. Plot[shape,{x,0,1},Frame->True, PlotLabel->{"x","f[0,x]","initial shape"]}]
  6.  
  7. sol=NDSolveValue[{eq, ics} // Flatten, f, {t, 0, 0.25}, {x} [Element]region,
  8. Method -> {"FiniteElement", "MeshOptions" -> {"MaxCellMeasure" -> 0.005}}];
  9.  
  10. eq2 = D[f[t, x], {t, 2}] - D[f[t, x], {x, 2}]==0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement