I am solving the wave equation with initial position and velocity function:

Remove[y]

equetions =

{D[y[x, t], {t, 2}] == (c^2)*D[y[x, t], {x, 2}],

y[x, 0] == Sin[x], Derivative[0, 1][y][x, 0] == Sin[x]}

NDSolve[equetions, {t, 0, 100}, {x, -100, 100}]

I am getting the following message:

NDSolve::underdet: There are more dependent variables, {y[x,0],y[x,t],(y^(0,1))[x,0],(y^(0,2))[x,t]}, than equations, so the system is underdetermined. >>

=================

3

Don’t you need to specify boundary conditions as well?

– march

Aug 18 ’15 at 1:06

=================

1 Answer

1

=================

You cannot have a variable c in your equations that doesn’t has a value when you use NDSolve. The function NDSolve is a numerical solver and all parameters need to be specified.

Furthermore, you are missing some boundary conditions for your problem. They are needed to be specified accordingly. Here is a working example of your problem:

eq = {

D[y[x, t], {t, 2}] == (c^2)*D[y[x, t], {x, 2}],

y[x, 0] == Sin[x],

Derivative[0, 1][y][x, 0] == Sin[x],

y[-Pi, t] == y[Pi, t]

} /. c -> 1.2

NDSolve[eq, y, {t, 0, 10}, {x, -Pi, Pi}]

why do you need y[-Pi, t] == y[Pi, t] isn’t initial position and velocity determines everything ?

– user47376

Aug 18 ’15 at 9:48