Wolfram言語

偏微分方程式

直方体内のポアソン方程式を周期境界条件で解く

領域の右辺側からの解が左辺側に投影される周期境界条件で,直方体内のポアソン方程式を解く.

In[1]:=
Click for copyable input
\[CapitalOmega] = Cuboid[{0, 0, 0}, {5, 1, 1}]; ufun = NDSolveValue[{-Laplacian[u[x, y, z], {x, y, z}] == 1, DirichletCondition[u[x, y, z] == 0, 0 < x < 5], PeriodicBoundaryCondition[u[x, y, z], x == 0, TranslationTransform[{5, 0, 0}]]}, u, {x, y, z} \[Element] \[CapitalOmega]]
Out[1]=

解を可視化する.

In[2]:=
Click for copyable input
SliceContourPlot3D[ ufun[x, y, z], {{"XStackedPlanes", {0, 1.5, 3.5, 5}}, {"YStackedPlanes", 1}, {"ZStackedPlanes", 1}}, {x, y, z} \[Element] \[CapitalOmega], ColorFunction -> "TemperatureMap", Boxed -> False, Axes -> False]
Out[2]=

関連する例

de en es fr ko pt-br ru zh