5
$\begingroup$

I want to solve Laplace equation over a Isosceles trapezoidal domain.

enter image description here

I need an analytical solution . would you please guide me writing the code in mathematica. how to add the boundary conditions for non-parallel sides of the trapezium ?

    regA = Polygon[{{0,0},{1, 1}, {2, 1},{3, 0}}]

Graphics[regA]

solV = DSolve[{D[u[x, y], x, x] + D[u[x, y], y, y] == 0,

   DirichletCondition[u[x, y] == Exp[x]*Cos[y],0<=x<=1],

   DirichletCondition[u[x, y] == Exp[x]*Cos[y], 2<=x<=3],

   DirichletCondition[u[x, y] == Exp[x]*Cos[y], y == 0],

   DirichletCondition[u[x, y] == Exp[x]*Cos[y], y == 1]},

   u, {x, y} \[Element] regA]
$\endgroup$
  • $\begingroup$ anyone with any idea ? please guide me on how to include boundary conditions for the non-parallel sides and how to extract an analytical solution. $\endgroup$ – Mohammad Nabil Jan 20 at 10:21
1
$\begingroup$

I suspect that DSolve will be able to give you an analytical solution. Here is a numerical one, if you are interested.

regA = Polygon[{{0, 0}, {1, 1}, {2, 1}, {3, 0}}];

RegionPlot[regA, AspectRatio -> 0.5]

enter image description here

op = D[u[x, y], x, x] + D[u[x, y], y, y];

BCs = {DirichletCondition[u[x, y] == 0., 0 <= x <= 1 && y == 0.], 
   DirichletCondition[u[x, y] == Exp[x]*Cos[y], 1 < x < 2 && y == 0.],
   DirichletCondition[u[x, y] == 0., 2 <= x <= 3 && y == 0], 
   DirichletCondition[u[x, y] == Exp[x]*Cos[y], 1 <= x <= 2 && y == 1], 
   DirichletCondition[u[x, y] == Exp[x]*Cos[y], 2 <= x <= 3 && y == -x + 3], 
   DirichletCondition[u[x, y] == Exp[x]*Cos[y], 0 <= x <= 1 && y == x]};

ufun = NDSolveValue[{op == 0, BCs}, u, {x, y} \[Element] regA]

ContourPlot[ufun[x, y], {x, y} \[Element] regA, AspectRatio -> 0.5] // Quiet

enter image description here

$\endgroup$
0
$\begingroup$

Is this a trick question?

pde = D[u[x, y], x, x] + D[u[x, y], y, y] == 0

u[x_, y_] = E^x Cos[y]

pde
(*True*)

Satisfies the pde and bc's.

reg = Polygon[{{0, 0}, {1, 1}, {2, 1}, {3, 0}}];

ContourPlot[u[x, y], {x, y} ∈ reg, AspectRatio -> 0.5]

enter image description here

$\endgroup$
  • $\begingroup$ thanks Bill Watts. but could you help me with matlab? I actually did not solve pde in matlab. don't know how to insert dirichlet condition there $\endgroup$ – Mohammad Nabil Feb 4 at 13:49
  • $\begingroup$ Sorry, I don't have Matlab. $\endgroup$ – Bill Watts Feb 4 at 18:41

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.