1
$\begingroup$

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. >>

$\endgroup$
1
  • 3
    $\begingroup$ Don't you need to specify boundary conditions as well? $\endgroup$
    – march
    Commented Aug 18, 2015 at 1:06

1 Answer 1

4
$\begingroup$

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}]

Mathematica graphics

$\endgroup$
1
  • $\begingroup$ why do you need y[-Pi, t] == y[Pi, t] isn't initial position and velocity determines everything ? $\endgroup$
    – user47376
    Commented Aug 18, 2015 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.