Message Boards Message Boards

Plot a solution of Laplace equation over a rectangle?

GROUPS:

Please, Help me to plot a graph of the solution of Equation of Laplace over the rectangle [{0.0;0.0},{0.1; 0.05}]. The following code does not work.

H = DSolve[{u''[x, y] + u[x, y] == 0, u[0, y] == 0, u[x, 0] == 0, 
    u[x, 0.05] == 0, u[0.1, y] == 100}, u[x, y], {x, y}];
POSTED BY: Sergio Cabral
Answer
19 days ago

Thank you, Frank. It doesn~t work, though. It is not clear , on the Help,what is the syntax to set 100 V to {x=0.1, 0<y<0.05} and 0 V to {x=0.0,0<y<0.05},{0.0<x<0.1,y=0.0} and {0.0<x<0.1,y=0.05}.

POSTED BY: Sergio Cabral
Answer
19 days ago

posting the code that you say doesn't work will help people figure out what went wrong

POSTED BY: Frank Kampas
Answer
19 days ago

You are right, Frank. Sorry for my fault. Here it goes, attached! I could not find any further information about the function DirichletCondition. I shall insist, however. Scabral

Attachments:
POSTED BY: Sergio Cabral
Answer
18 days ago

You can post your code in your reply using the first icon (code sample)

POSTED BY: Frank Kampas
Answer
18 days ago
leqn = Laplacian[u[x, y], {x, y}] == 0;

\[CapitalOmega] = Rectangle[{0, 0}, {0.1, 0.05}];

dcond = DirichletCondition[
   u[x, y] == Piecewise[{{10, y == 0.00 || y == 0.0}}, 0], True];

sol = DSolveValue[{leqn, dcond}, 
   u[x, y], {x, y} \[Element] \[CapitalOmega]] // FullSimplify

\!\(
TagBox[GridBox[{
{"\[Piecewise]", GridBox[{
{"10.`", 
RowBox[{"y", "==", "0"}]},
{"0", 
TagBox["True",
"PiecewiseDefault",
AutoDelete->True]}
},
AllowedDimensions->{2, Automatic},
Editable->True,
GridBoxAlignment->{
        "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, 
         "Rows" -> {{Baseline}}, "RowsIndexed" -> {}, "Items" -> {}, 
         "ItemsIndexed" -> {}},
GridBoxItemSize->{
        "Columns" -> {{Automatic}}, "ColumnsIndexed" -> {}, 
         "Rows" -> {{1.}}, "RowsIndexed" -> {}, "Items" -> {}, 
         "ItemsIndexed" -> {}},
GridBoxSpacings->{"Columns" -> {
Offset[0.27999999999999997`], {
Offset[0.84]}, 
Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
Offset[0.2], {
Offset[0.4]}, 
Offset[0.2]}, "RowsIndexed" -> {}, "Items" -> {}, 
         "ItemsIndexed" -> {}},
Selectable->True]}
},
GridBoxAlignment->{
     "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, 
      "Rows" -> {{Baseline}}, "RowsIndexed" -> {}, "Items" -> {}, 
      "ItemsIndexed" -> {}},
GridBoxItemSize->{
     "Columns" -> {{Automatic}}, "ColumnsIndexed" -> {}, 
      "Rows" -> {{1.}}, "RowsIndexed" -> {}, "Items" -> {}, 
      "ItemsIndexed" -> {}},
GridBoxSpacings->{"Columns" -> {
Offset[0.27999999999999997`], {
Offset[0.35]}, 
Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
Offset[0.2], {
Offset[0.4]}, 
Offset[0.2]}, "RowsIndexed" -> {}, "Items" -> {}, 
      "ItemsIndexed" -> {}}],
"Piecewise",
DeleteWithContents->True,
Editable->False,
SelectWithContents->True,
Selectable->False]\)

asol = sol /. {\[Infinity] -> 500} // Activate;

Plot3D[asol // Evaluate, {x, y} \[Element] \[CapitalOmega], 
 PlotRange -> All, PlotTheme -> "Business"]
POSTED BY: Sergio Cabral
Answer
18 days ago

Right, dear Frank ! I thinkitĀ“s ok now!

POSTED BY: Sergio Cabral
Answer
18 days ago

Group Abstract Group Abstract