3
$\begingroup$

I have a rectangular region: {x,0,1},{y,0,2}, with Neumann conditions on the left and on the right sides and Dirichlet conditions on the others.

Everything works without errors until NDSolveValue.

I get an error:

"PDE parsing error (...). Inconsistent equation dimensions." 

Need help in fixing the problem or a piece of advice what to google. Thanks in advance.

$$u(x_{min}, y) = \sin(y^2)$$ $$u(x_{max}, y) = \cos(3y)$$ $$\left.\dfrac{du}{dy}\right|_{x,y_1} = 10\sin(x^2)$$ $$\left.\dfrac{du}{du}\right|_{x,y_m} = 10\sin(6x)$$

Ω={{x,0,1},{y,0,2}}

(* {{x,0,1},{y,0,2}} *)

op=D[u[x,y],{x,2}] + D[u[x,y],{y,2}]-Exp[-x]-Exp[-y]

(* -E^-x-E^-y+(u^(0,2))[x,y]+(u^(2,0))[x,y] *)

Subscript[Γ,D]={DirichletCondition[u[x,y]==Sin[y^2],x==0 &&  0<=y<=2],DirichletCondition[u[x,y]==Cos[3y],x==1 && 0<= y<= 2]}

(* {DirichletCondition[u[x,y]==Sin[y^2],x==0&&0<=y<=2],DirichletCondition[u[x,y]==Cos[3 y],x==1&&0<=y<=2]} *)

Subscript[Γ,N]={NeumannValue[10*Sin[x^2],0 <= x<= 1 && y==0 ] , NeumannValue[10*Sin[6x], 0<= x <= 1 && y==2] }

(* {NeumannValue[10 Sin[x^2],0<=x<=1&&y==0],NeumannValue[10 Sin[6 x],0<=x<=1&&y==2]} *)

ufun=NDSolveValue[{op==Subscript[Γ,N],Subscript[Γ,D]},u,{x,0,1},{y,0,2}]

(* During evaluation of NDSolveValue: PDE parsing error of {{-E^-x-E^-y+u$8832+u$8833-NeumannValue[10 Sin[x^2],0<=x<=1&&y==0],-E^-x-E^-y+u$8832+u$8833-NeumannValue[10 Sin[6 x],0<=x<=1&&y==2]}}. Inconsistent equation dimensions. *)
$\endgroup$
  • 1
    $\begingroup$ Just a comment: never use capital letters, especially D or N as a variable names. It's a Wolfram functions. $\endgroup$ – m0nhawk Sep 8 '16 at 19:32
  • $\begingroup$ also get rid of all that subscript stuff. causes more trouble than worth it. I have no idea what Subscript[Γ,D]={DirichletCondition[u[x,y].... is supposed to be or do. $\endgroup$ – Nasser Sep 8 '16 at 19:49
3
$\begingroup$

Try this:

ufun = NDSolveValue[{D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] - Exp[-x] - Exp[-y] == 
   NeumannValue[10*Sin[x^2], 0 <= x <= 1 && y == 0] + 
   NeumannValue[10*Sin[6 x], 0 <= x <= 1 && y == 2],
   DirichletCondition[u[x, y] == Sin[y^2], x == 0 && 0 <= y <= 2],
   DirichletCondition[u[x, y] == Cos[3 y], x == 1 && 0 <= y <= 2]},
  u, {x, 0, 1}, {y, 0, 2}]

Plot3D[ufun[x, y], {x, 0, 1}, {y, 0, 2}]

enter image description here

|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.