Message Boards Message Boards

0
|
4588 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Solve a PDE by using NDSolve?

Posted 6 years ago

I try to solve my equations by using NDsolve. But it does not solve my solution. Can anyone help me to check whether I used correct command or not?

eq1 = {D[Subscript[\[Theta], c][x, y], x] - 
     2/(Y - Y^2)*D[Subscript[\[Theta], c][x, y], y, y] == 0};
ic = {Subscript[\[Theta], c][0, y] == 1};
bc = {DirichletCondition[{Subscript[\[Theta], c][x, y] == 0}, y == 0],NeumannValue[0, y == 1]};

sol = NDSolve[{eq1, ic, bc}, {Subscript[\[Theta], c]}, {x, 0, 1}, {y, 
   0, 1}]
4 Replies

Mirza,

You had several bugs/typos:

  1. Y and y are different variables -- be careful of capitalization
  2. you need a list of equations -- not a list of lists
  3. you use NeumannValue incorrectly -- it is not used in the boundary conditions it is in the equation itself (even though it acts at the boundary)
  4. you use extra lists in places they do not belong (i.e inside of DirichletCondition, the integration variable, etc.)

this computes a solution:

eq1 = {D[Subscript[\[Theta], c][x, y], x] - 
     2/(y - y^2)*D[Subscript[\[Theta], c][x, y], y, y] == 
    NeumannValue[0, y == 1]};
ic = {Subscript[\[Theta], c][0, y] == 1};
bc = {DirichletCondition[Subscript[\[Theta], c][x, y] == 0, y == 0]};

sol = NDSolve[Join[eq1, ic, bc], 
  Subscript[\[Theta], c], {x, 0, 1}, {y, 0, 1}]

Regards,

Neil

POSTED BY: Neil Singer

Thanks for your correction. But still, it does not give me the solution.

When I copy eq1 into Mathematica, I get a message

Syntax::bktmcp: Expression "{D[Subscript[\[Theta],c][x,y],x]-2/(Y-Y^2)*D[Subscript[\[Theta],c][x,y],y,y]==0" has no closing "}".
POSTED BY: Frank Kampas

Thanks for your help. But I checked after correction it does not give me a result.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract