Man
Man

Reputation: 3

Nonlinear PDE solving in Mathematica

I am trying to solve the following non linear coupled PDE equation related with ginzburg landau using NDsolve.I am new to Mathematica. I am getting the following error.What is the mistake I am doing?

pde = {D[u[t, x, y], t] == 
D[u[t, x, y], {x, x}] + 
 D[u[t, x, y], {y, 
   y}] - (1/u[t, x, y])^3*(D[v[t, x, y], y]^2 + 
    D[v[t, x, y], x]^2) - u[t, x, y] + u[t, x, y]^3, 
   D[v[t, x, y], t] == 
D[v[t, x, y], {x, x}] + D[v[t, x, y], {y, y}] - 
 v[t, x, y]*u[t, x, y] + 
       (2/u[t, x, y])*(D[u[t, x, y], x]*D[v[t, x, y], x] - 
    D[u[t, x, y], y]*D[v[t, x, y], y])};bc = {u[0, x, y] == 0, v[0, x, y]== 0, u[t, 5, y] == 1, u[t, x, 5] == 1, D[v[t, 0, y], x] == 0, D[v[t, x, 0], y] == 0};
NDSolve[{pde, bc}, {u, v}, {x, 0, 5}, {y, 0, 5}, {t, 0, 2}]

'Error: NDSolve::deqn: Equation or list of equations expected instead of True in the first argument {{(u^(1,0,0))[t,x,y]==-u[t,x,y]+u[t,x,y]^3+(u^(0,0,y))[t,x,y]-((<<1>>^(<<3>>))[<<3>>]^2+(<<1>>^(<<3>>))[<<3>>]^2)/u[t,x,y]^3+(u^(0,x,0))[t,x,y],(v^(1,0,0))[t,x,y]==-u[t,x,y] v[t,x,y]+(v^(0,0,y))[t,x,y]+(2 (-(<<1>>^(<<3>>))[<<3>>] (<<1>>^(<<3>>))[<<3>>]+(<<1>>^(<<3>>))[<<3>>] (<<1>>^(<<3>>))[<<3>>]))/u[t,x,y]+(v^(0,x,0))[t,x,y]},{u[0,x,y]==0,v[0,x,y]==0,u[t,5,y]==1,u[t,x,5]==1,True,True}}.

NDSolve[{{Derivative[1, 0, 0][u][t, x, y] == -u[t, x, y] + 
     u[t, x, y]^3 + Derivative[0, 0, y][u][t, x, y] - 
              (Derivative[0, 0, 1][v][t, x, y]^2 + 
     Derivative[0, 1, 0][v][t, x, y]^2)/u[t, x, y]^3 + 
     Derivative[0, x, 0][u][t, x, y], 
       Derivative[1, 0, 0][v][t, x, y] == (-u[t, x, y])*v[t, x, y] + 
     Derivative[0, 0, y][v][t, x, y] + 
           (2*((-Derivative[0, 0, 1][u][t, x, y])*
           Derivative[0, 0, 1][v][t, x, y] + 
          Derivative[0, 1, 0][u][t, x, y]*
           Derivative[0, 1, 0][v][t, x, y]))/u[t, x, y] + 
           Derivative[0, x, 0][v][t, x, y]}, {u[0, x, y] == 0, 
   v[0, x, y] == 0, u[t, 5, y] == 1, u[t, x, 5] == 1, True, 
   True}}, {u, v}, {x, 0, 5}, {y, 0, 5}, {t, 0, 2}]

Upvotes: 0

Views: 472

Answers (1)

Bill
Bill

Reputation: 3957

If you look at the value of bc you will see

bc = {u[0, x, y] == 0, v[0, x, y] == 0, u[t, 5, y] == 1, 
u[t, x, 5] == 1, D[v[t, 0, y], x] == 0, D[v[t, x, 0], y] == 0}

gives you

{u[0, x, y] == 0, v[0, x, y] == 0, u[t, 5, y] == 1, u[t, x, 5] == 1, True, True}

That is where your error message about True is coming from.

What you were doing was differentiating an expression with respect to x, but the expression had no x in it, thus the result was zero. And 0==0 is always True. Likewise with y. So let's change the way you are trying to tell it the boundary conditions.

bc = {u[0, x, y] == 0, v[0, x, y] == 0, u[t, 5, y] == 1, u[t, x, 5] == 1,
Derivative[0, 1, 0][v][t, 0, y] == 0, Derivative[0, 0, 1][v][t, x, 0] == 0}

or

bc = {u[0, x, y] == 0, v[0, x, y] == 0, u[t, 5, y] == 1, u[t, x, 5] == 1,
D[v[t, x, y], x] == 0/.x->0, D[v[t, x, y], y] == 0/.y->0}

either of which I think should give you what you are looking for.

Once you fix those then you get a different error about Derivative order and non-negative integer.

I believe you fix that by changing your pde from {x,x} and {y,y} to {x,2} and {y,2} like this

pde = {D[u[t, x, y], t] == D[u[t, x, y], {x, 2}] + D[u[t, x, y], {y, 2}] -
  (1/u[t, x, y])^3*(D[v[t, x, y], y]^2 + D[v[t, x, y], x]^2) - u[t, x, y] +
  u[t, x, y]^3,
  D[v[t, x, y], t] == D[v[t, x, y], {x, 2}] + D[v[t, x, y], {y, 2}] - v[t, x, y]*
  u[t, x, y] + (2/u[t, x, y])*(D[u[t, x, y], x]*D[v[t, x, y], x] - D[u[t, x, y], y]*
  D[v[t, x, y], y])};

Which makes that error go away.

Once you have fixed that and try your NDSolve then zeros in your denominators start to bite you.

Fixing those looks like more than just understanding MMA syntax. That may require understanding your problem and seeing if you can eliminate those zero denominators.

Upvotes: 1

Related Questions