Results 1 to 4 of 4

Math Help - Help with numerical solution of PDE

  1. #1
    Newbie
    Joined
    Mar 2010
    Posts
    3

    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?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member
    Joined
    Aug 2008
    Posts
    903
    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}]
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Mar 2010
    Posts
    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...
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Mar 2010
    Posts
    3
    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.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Numerical solution of a (system of?) DE
    Posted in the Advanced Math Topics Forum
    Replies: 3
    Last Post: May 27th 2010, 03:15 PM
  2. Numerical solution in mathematica
    Posted in the Math Software Forum
    Replies: 0
    Last Post: May 12th 2010, 11:22 AM
  3. Numerical solution of a first order ODE
    Posted in the Differential Equations Forum
    Replies: 1
    Last Post: May 1st 2010, 09:52 AM
  4. numerical solution
    Posted in the Calculus Forum
    Replies: 3
    Last Post: May 7th 2008, 05:30 AM
  5. Numerical solution w/o derivative
    Posted in the Calculus Forum
    Replies: 3
    Last Post: October 31st 2007, 05:47 PM

Search Tags


/mathhelpforum @mathhelpforum