计算科赫雪花上的谱
生成一个递归的科赫雪花.
In[1]:=
KochStep[{p1_, p2_}] :=
With[{q1 = p1 + (p2 - p1)/3, q3 = p1 + 2 (p2 - p1)/3,
q2 = (p1 + (p2 - p1)/3) + RotationMatrix[-\[Pi]/3].(p2 - p1)/3},
{p1, q1, q2, q3, p2}];
KochStep[pp : {{_, _} ..}] :=
Join[Partition[Flatten[Most /@ (KochStep /@ Partition[pp, 2, 1])],
2], {pp[[-1]]}];
vertices =
Nest[KochStep,
N[{{3 Sqrt[3]/4, 3/4}, {-3 Sqrt[3]/4,
3/4}, {0, -3/2}, {3 Sqrt[3]/4, 3/4}}], 4];
region = Polygon[vertices];
设定拉普拉斯算子.
In[2]:=
\[ScriptCapitalL] = -Laplacian[u[x, y], {x, y}];
设定狄利克雷边界条件.
In[3]:=
\[ScriptCapitalB] = DirichletCondition[u[x, y] == 0, True];
计算拉普拉斯算子的九个特征值和特征函数.
In[4]:=
{vals, funs} =
NDEigensystem[{\[ScriptCapitalL], \[ScriptCapitalB]},
u[x, y], {x, y} \[Element] region, 9];
查看特征值.
In[5]:=
vals
Out[5]=
可视化特征函数.
显示完整的 Wolfram 语言输入
Out[6]=