Résolvez un problème de Dirichlet pour l'équation de Helmholtz
Spécifiez une équation de Helmholtz en 2D.
In[1]:=
![Click for copyable input](assets.fr/solve-a-dirichlet-problem-for-the-helmholtz-equati/In_24.png)
heqn = {Laplacian[u[x, y], {x, y}] + 5 u[x, y] == 0};
Définissez les conditions de Dirichlet pour l'équation dans un rectangle.
In[2]:=
![Click for copyable input](assets.fr/solve-a-dirichlet-problem-for-the-helmholtz-equati/In_25.png)
bc = {u[x, 0] == UnitTriangle[x - 2]/2, u[x, 2] == 0, u[0, y] == 0,
u[4, y] == 0};
Résolvez le problème de Dirichlet en utilisant DSolveValue.
In[3]:=
![Click for copyable input](assets.fr/solve-a-dirichlet-problem-for-the-helmholtz-equati/In_26.png)
(sol = DSolveValue[{heqn, bc}, u[x, y], {x, y}]) // TraditionalForm
Out[3]//TraditionalForm=
![](assets.fr/solve-a-dirichlet-problem-for-the-helmholtz-equati/O_13.png)
Extrayez les 30 premiers termes de la somme Inactive.
In[4]:=
![Click for copyable input](assets.fr/solve-a-dirichlet-problem-for-the-helmholtz-equati/In_27.png)
fsol = sol /. \[Infinity] -> 30 // Activate;
Visualisez la solution approximative.
In[5]:=
![Click for copyable input](assets.fr/solve-a-dirichlet-problem-for-the-helmholtz-equati/In_28.png)
Plot3D[fsol // Evaluate, {x, 0, 4}, {y, 0, 2}, PlotRange -> All,
PlotTheme -> "Scientific"]
Out[5]=
![](assets.fr/solve-a-dirichlet-problem-for-the-helmholtz-equati/O_14.png)