# Math Help - Help with numerical solution of PDE

1. ## Help with numerical solution of PDE

I'm just learning Mathematica and I'm having trouble with the PDE solver NDSolve... I use Freefem usually for PDEs but I just want a quick and dirty way of solving here.

The PDE is given by

sol = D[u[x, y, t], t] - 1 -
a*{D[u[x, y, t], x, x] + D[u[x, y, t], y, y]} -
b*Norm[{D[u[x, y, t], x], D[u[x, y, t], y]}] == 0
with a and b specified earlier.

Then we have the periodic conditions

cond = u[x+2*Pi,y+2*Pi,t] == u[x,y,t]

and the initial condition
cond2 = u[x,0,0] = 0

Then I should use

NDSolve[{sol,cond,cond2},u,{x,0,1},{y,0,1},{t,0,1}]

Unfortunately I get errors.

NDSolve:verdet: There are fewer dependent variables, {u[x,y,t]}, than equations, so the system is overdetermined. >>

but I've specified three equations. If I relax that IC and just use the periodic conditions I get the same error. If I remove the periodic conditions and just use the IC I get

NDSolve::bcedge: Boundary condition u[x,0,0]==0 is not specified on a single edge of the boundary of the computational domain. >>

Which I can't seem to fix.

So I'm bringing this to a community of people... I need your help! This is just my dummy problem for a larger class of PDES I'm trying to solve, so I really need to figure this out... and for the life of me I cant!

P.S.

I really want to use u(x,y,0) = 0 but this cannot be used because setting that as cond2 returns true, not an equation. Is there a way around this?

2. First make sure you use double equal signs when forming an expression such as u(x,0,t)==0, also, use parentheses to group items in an equation not brackets. What I would do is start small and then scale up. So I started with the construct for a 1D heat equation, got that error free, then scaled up to a simple 2D heat equation with five boundary conditions and got that error free. Then I tried your equation with those same conditions but ran into a problem with the Norm so I just used a square root for the norm but I still specified five sides of the box as the boundary conditions and initial conditions using just the exponential function $e^{-(x^2+y^2)}$. If you like, you can start with my code below and see if you can gradually change it into the IBVP you desire.

Clear[u]
myEqn = D[u[x, y, t], t] - 1 - (D[u[x, y, t], {x, 2}] +
D[u[x, y, t], {y, 2}]) + Sqrt[D[u[x, y, t], x]^2 +
D[u[x, y, t], y]^2] == 0
sol = NDSolve[{myEqn, u[x, 0, t] == Exp[-x^2],
u[x, 1, t] == Exp[-(x^2 + 1)],
u[0, y, t] == Exp[-y^2],
u[1, y, t] == Exp[-(1 + y^2)],
u[x, y, 0] == Exp[-(x^2 + y^2)]},
u, {x, 0, 1}, {y, 0, 1}, {t, 0, 1}]

3. Thanks for the detailed help!

My problem, however is the need for these periodic boundary conditions. If I use the conditions like you explain, it works okay (with some boundary inconsistencies) but even if I remove all of the boundary and initial conditions, and use as my second equation

u[x+2*Pi,y+2*Pi,t] == u[x,y,t]

I get an overdetermined error... which I can't fix even if I just do the periodic condition for one variable...

4. Forget that... the overdetermined problem was that I was setting x + 2*pi = x

when I should have just worried about the boundaries... this was a continuum of equations... setting u[0,y,t] = u[1,y,t] fixes it.

But I still hav eother issues...

I want to have this be an annulus, essentially. I've been trying to get it to work on a square with a smaller square removed but I can't seem to figure out how to input this to NDSolve.