Mathematica does not solve the wave equation for given boundary conditions

Another new Mathematica syntax. When I do this:

DSolve[{ D[u[x, t], {x, 2}] == (1/(v*v))*D[u[x, t], {t, 2}], u[0, t] == 0, u[l, 0] == 0 }, u, {x, t}] 

it just returns what I entered

 DSolve[{(u^(2,0))[x,t]==(u^(0,2))[x,t]/v^2,u[0,t]==0,u[l,0]==0},u,{x,t}] 

However, when I remove the boundary conditions, I get

 {{u->Function[{x,t},C[1][t-(Sqrt[v^2] x)/v^2]+C[2][t+(Sqrt[v^2] x)/v^2]]}} 

with C [1] and C [2] representing functions for the boundary conditions.

Does anyone know why this is happening?

+4
source share
2 answers

2 things:

  • You do not need more boundary and initial conditions than just 2? You have second-order derivatives on the left and right sides, each of which requires 2 conditions. Therefore, the total number is 4. see http://mathworld.wolfram.com/WaveEquation1-Dimensional.html

  • I don’t think DSolve or NDSolve can solve the initial and boundary problems? It seems I once read this somewhere. No time to check now.

+5
source

I think Mathematica does not know how to deal with these boundary conditions for second-order PDEs . How would you like the answer to come back? How is the general Fourier series?

This is mentioned in the Mathematica Cookbook (and possibly elsewhere) ...

By breaking down the problem for Mathematica (with a size factor of v->1 ), you will find

 In[1]:= genSoln = DSolve[D[u[x, t], {x, 2}] == D[u[x, t], {t, 2}], u, {x, t}] // First Out[1]= {u -> Function[{x, t}, C[1][t - x] + C[2][t + x]]} In[2]:= Solve[u[0, t] == 0 /. genSoln] Out[2]= {{C[1][t] -> -C[2][t]}} In[3]:= u[l, 0] == 0 /. genSoln /. C[1][x_] :> -C[2][x] // Simplify Out[3]= C[2][-l] == C[2][l] 

that the solution is written as f(tx)-f(t+x) , where f is periodic over [-l,l] ...

You can no longer do without making assumptions about the smoothness of the decision.

You can check if the standard Fourier series approach will work, for example

 In[4]:= f[x_, t_] := Sin[n Pi (t + x)/l] - Sin[n Pi (t - x)/l] In[5]:= And[D[u[x, t], {x, 2}] == D[u[x, t], {t, 2}], u[0, t] == 0, u[l, 0] == 0] /. u -> f // Reduce[#, n] & // Simplify Out[5]= C[1] \[Element] Integers && (n == 2 C[1] || n == 1 + 2 C[1]) 
+2
source

All Articles