0
$\begingroup$

I'm trying to do a basic 2D wave equation PDE in mathematica (version 11). I have a set of equations

Edit: I have infact made sure I cleared u

Clear[u]

wave2deqs = {
D[u[t, x, y], t, t] - Laplacian[u[t, x, y] , {x, y}] == 0, 
u[0, x, y] == Exp[-((x - 1)^2 + (y - 1)^2)],
D[u[0, x, y], t] == 0}

This works fine except for

D[u[0, x, y], t] == 0

evaluates to 'True', and then when I put this into

wave2d = NDSolveValue[wave2deqs, u, {t, 0, 1}, {x, 0, 1}, {y, 0, 1} ]

I naturally get an error that eqlist is not a list of equations.

So my question is, why would

D[u[0, x, y], t] == 0

even evaluate to a boolean rather than being another equation?

I followed this examples for reference: https://www.wolfram.com/mathematica/new-in-10/pdes-and-finite-elements/solve-a-wave-equation-in-2d.html which is in mathematica 10, but seems ridiculous that this wouldn't work.

$\endgroup$
  • $\begingroup$ You probably have lingering definitions. Try Clear[u] followed by NDSolveValue again. $\endgroup$ – Carl Woll Apr 12 '17 at 21:03
  • $\begingroup$ I definitely do this, I just didn't include it here. Sorry, I'll add it above. Thanks. Edit: That wasn't the issue btw. $\endgroup$ – Escap3faith Apr 12 '17 at 21:19
  • 2
    $\begingroup$ You're right. The problem is u[0,x,y] doesn't have t, so the derivative is 0. Perhaps Derivative[1,0,0][u][0,x,y] == 0 would work better. $\endgroup$ – Carl Woll Apr 12 '17 at 21:30
5
$\begingroup$

There is no way that D[u[0,x,y],t]==0 is not true. You are asking Mathematica to calculate the derivative of an expression of a parameter that the expression does not contain. u[0,x,y] is such an expression - no t involved. So the derivative is quite naturally and correctly equal to zero.

What you need to do is to tell Mathematica that you like to calculate the (first) derivative of u of its first parameter and that that derivative shall be zero.

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

This is, by the way, the method used on the website you refer to.

| improve this answer | |
$\endgroup$
  • $\begingroup$ I figured something like this would probably be the problem. I have seldom seen this notation for a derivative though. Thanks, I'll have to read up on the difference between D[...] and Derivative[]. $\endgroup$ – Escap3faith Apr 12 '17 at 21:51
3
$\begingroup$

Another way is, first take derivative w.r.t t using D[u[t, x, y], t] then replace the variable t by a specific value using /.value.

Thus the derivative condition can be describe alternatively like this,

(D[u[t, x, y], t] /. t -> 0) == 0
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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