Résolvez un problème de Dirichlet pour l'équation de Laplace
Spécifiez l'équation de Laplace en 2D.
In[1]:=
![Click for copyable input](assets.fr/solve-a-dirichlet-problem-for-the-laplace-equation/In_18.png)
leqn = Laplacian[u[x, y], {x, y}] == 0;
Établissez une condition de Dirichlet pour l'équation dans un rectangle.
In[2]:=
![Click for copyable input](assets.fr/solve-a-dirichlet-problem-for-the-laplace-equation/In_19.png)
\[CapitalOmega] = Rectangle[{0, 0}, {1, 2}];
In[3]:=
![Click for copyable input](assets.fr/solve-a-dirichlet-problem-for-the-laplace-equation/In_20.png)
dcond = DirichletCondition[
u[x, y] ==
Piecewise[{{UnitTriangle[2 x - 1], y == 0 || y == 2}}, 0], True];
Résolvez le problème de Dirichlet.
In[4]:=
![Click for copyable input](assets.fr/solve-a-dirichlet-problem-for-the-laplace-equation/In_21.png)
sol = DSolveValue[{leqn, dcond},
u[x, y], {x, y} \[Element] \[CapitalOmega]] // FullSimplify
Out[4]=
![](assets.fr/solve-a-dirichlet-problem-for-the-laplace-equation/O_11.png)
Extrayez les 300 premiers termes de la somme Inactive.
In[5]:=
![Click for copyable input](assets.fr/solve-a-dirichlet-problem-for-the-laplace-equation/In_22.png)
asol = sol /. {\[Infinity] -> 300} // Activate;
Visualisez la solution dans un rectangle.
In[6]:=
![Click for copyable input](assets.fr/solve-a-dirichlet-problem-for-the-laplace-equation/In_23.png)
Plot3D[asol // Evaluate, {x, y} \[Element] \[CapitalOmega],
PlotRange -> All, PlotTheme -> "Business"]
Out[6]=
![](assets.fr/solve-a-dirichlet-problem-for-the-laplace-equation/O_12.png)