Solución de un problema de Dirichlet para la ecuación de Helmholtz
Especifique una ecuación de Helmholtz en 2D.
In[1]:=
![Click for copyable input](assets.es/solve-a-dirichlet-problem-for-the-helmholtz-equati/In_24.png)
heqn = {Laplacian[u[x, y], {x, y}] + 5 u[x, y] == 0};
Establezca las condiciones de Dirichlet para la ecuación en un rectángulo.
In[2]:=
![Click for copyable input](assets.es/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};
Resuelva el problema de Dirichlet usando DSolveValue.
In[3]:=
![Click for copyable input](assets.es/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.es/solve-a-dirichlet-problem-for-the-helmholtz-equati/O_13.png)
Extraiga los primeros 30 términos de la suma de Inactive.
In[4]:=
![Click for copyable input](assets.es/solve-a-dirichlet-problem-for-the-helmholtz-equati/In_27.png)
fsol = sol /. \[Infinity] -> 30 // Activate;
Visualice la solución aproximada.
In[5]:=
![Click for copyable input](assets.es/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.es/solve-a-dirichlet-problem-for-the-helmholtz-equati/O_14.png)