3
$\begingroup$

I am trying to get an analytical solution to the 2D Laplace equation with Dirichlet boundary conditions on the left and right sides of the domain and Neumann boundary conditions on the top and bottom. I know there is an analytical solution and I know what it is, but I would like to see if DSolve will return it. Below is the code I have written where DSolve is returning the input without evaluating anything.

ClearAll["Global`*"]
x1 = 0;
y1 = 0;
x2 = 10*10^-6;
y2 = 0.01;
phi1 = -5;
phi2 = 0;
bc = {DirichletCondition[phi[x, y] == phi1, (x == x1 && y1 < y < y2)],
    DirichletCondition[phi[x, y] == phi2, (x == x2 && y1 < y < y2)]};
diffeq = Laplacian[phi[x, y], {x, y}] == 
   0 + NeumannValue[0, y == y1 || y == y2];
sol[x_, y_] = 
 DSolve[{diffeq, bc}, phi[x, y], {x, x1, x2}, {y, y1, y2}]

I know the analytical solution is a Fourier series. Is there something wrong with my syntax and DSolve does not realize there is something to be evaluated? Or is DSolve not capable of solving this type of problem?

$\endgroup$
5
$\begingroup$

Yes, DSolve can solve it

ClearAll["Global`*"];
pde = Laplacian[phi[x, y], {x, y}] == 0;
L0 = 10*10^-6;
H0 = 1/100;
phi1 = -5;
phi2 = 0;
bcLeft = phi[0, y] == phi1;
bcRight = phi[L0, y] == phi2;
bcTop = Derivative[0, 1][phi][x, H0] == 0;
bcBottom = Derivative[0, 1][phi][x, 0] == 0;
bc = {bcLeft, bcRight, bcTop, bcBottom};
sol = DSolve[{pde, bc}, phi[x, y], {x, y}, 
  Assumptions -> {0 <= x <= L0 && 0 <= y <= H0}]

$$ \left\{\left\{\phi (x,y)\to \underset{K[1]=1}{\overset{\infty }{\sum }}0-500000 \left(\frac{1}{100000}-x\right)\right\}\right\} $$

(Mathematica should really have removed the sum above, since it is zero, but it is not a big problem)

 Simplify[Activate@sol]

$$ \{\{\phi (x,y)\to 500000 x-5\}\} $$

Verified using Maple

restart;
interface(showassumed=0);
pde := diff(phi(x,y),x$2)+diff(phi(x,y),y$2)=0;
L0 := 10*10^(-6);
H0 := 1/100;
phi1 := -5;
phi2 := 0;
bcLeft := phi(0, y) = phi1;
bcRight := phi(L0, y) = phi2;
bcTop := D[2](phi)(x, H0) = 0;
bcBottom := D[2](phi)(x, 0)= 0;
bc:=bcLeft, bcRight, bcTop, bcBottom;
pdsolve([pde,bc],phi(x,y)) assuming(0<=x and x<=L0 and 0<=y and y<=H0)

$$ \phi \left( x,y \right) =-5+500000\,x $$

btw, it is not a good idea to use inexact numbers in Mathematica with functions meant to obtain exact analytical results like DSolve

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