# solving pde by matlab

I need to solve wave equation using Matlab. How to solve this PDE by Matlab?

$u_{tt}=c^{2}u_{xx}$ for $0<x<l$

B.C: $u_x(0,t)=0$; $u(l,t)=0$

I.C: $u(x,0)=f(x); u_t(x,0)=-cf'(x)$

Thanks!

-
MATLAB has not any software so that it can solve PDE. So we can only solve any PDE manually. – doraemonpaul Jul 25 '12 at 9:33

MATLAB could NOT solve this kind of PDEs analytically, but MATLAB could solve them numerically.

You need to formulate a numerical scheme to solve this equation in MATLAB numerically, either finite difference method, or finite element(same with FDM in 1D), is OK. There are lots of MATLAB scripts for solving 1D wave equation already out there on the internet, for example, this.

Also, MATLAB has a PDE tool box that could handle wave equation, you could launch the GUI of PDE tool box from the start menu of MATLAB, for a step-by-step instruction please see the link above.

-