# Mathematica 之微分特征系统

1 1

2 1

Mathematica关于微分特征系统的应用部分示例如下:

In[1]:=qho = -(\[HBar]^2/(2 m)) Laplacian[u[x], {x}] + (m \[Omega]^2)/2 x^2 u[x];

In[2]:=sol = DEigensystem[qho, u[x], {x, -\[Infinity], \[Infinity]},4, Assumptions->\[HBar] > 0 && m > 0 && \[Omega] > 0,Method ->"Normalize"]

In[3]:=\[Psi][x_, t_] = Total[MapThread[1/2 Exp[I E t #1/\[HBar]] #2 &, sol]]

，这样计算的值将接近 1 的量级.

In[4]:=m = QuantityMagnitude[(Entity["Element", "Carbon"][EntityProperty["Element", "AtomicMass"]] Entity["Element","Oxygen"][EntityProperty["Element", "AtomicMass"]])/(Entity["Element", "Carbon"][EntityProperty["Element", "AtomicMass"]] + Entity["Element", "Oxygen"][ EntityProperty["Element", "AtomicMass"]]), "AtomicMassUnits"]

In[5]:=\[Omega] = Sqrt[QuantityMagnitude[Quantity[1.86, "Kilonewtons"/"Meters"],"AtomicMassUnit"/"Femtoseconds"^2]/m]

In[6]:=\[HBar] = QuantityMagnitude[Quantity[1., "ReducedPlanckConstant"], "AtomicMassUnit"*"Picometers"^2/"Femtoseconds"]

In[7]:=\[Rho][x_, t_] = FullSimplify[ComplexExpand[Conjugate[\[Psi][x, t]] \[Psi][x, t]]]

，ρ 在实数上的积分都为 1.

‍‍ In[8]:=Chop[Integrate[\[Rho][x, t], {x, -\[Infinity], \[Infinity]}]]

In[9]:=Animate[Plot[\[Rho][x, t], {x, -25, 25}, PlotRange -> {0, .16}, PlotTheme -> "Detailed", FrameLabel -> {Row[{x, RawBoxes@RowBox[{"(", "\"pm\"", ")"}]}," "], None}, LabelStyle -> Larger,PlotLegends ->Placed[{Row[{HoldForm[\[Rho]][x,Quantity[NumberForm[t, {2, 1}], "Femtoseconds"]], RawBoxes@RowBox[{"(", SuperscriptBox["\"pm\"", -1], ")"}]}, " "]}, Above]], {t, 0., 5.7, ImageSize -> Small}, AnimationRate -> 1, SaveDefinitions -> True, Alignment -> Center]

Out[1]:=

In[2]:=

In[3]:=bdr = BoundaryDiscretizeGraphics[boundary]

Out[3]:=

In[4]:={vals, funs}=NDEigensystem[{-Laplacian[u[x,y], {x, y}]},u[x, y], {x, y}\[Element] bdr,6];

In[5]:=vals

Out[5]:=

In[6]:=Show[img,ContourPlot[funs[[2]],{x, y} \[Element] bdr, Axes -> None, Frame -> None, AspectRatio -> Automatic, ColorFunction -> Function[f, {Opacity[0.75], ColorData["TemperatureMap"][f]}]], ImageSize -> Automatic]

Out[6]:=

In[1]:=\[ScriptCapitalL] = -Laplacian[u[x, y, z], {x, y, z}];

In[2]:=\[ScriptCapitalB] = DirichletCondition[u[x, y, z] == 0, True];

In[3]:=\[CapitalOmega] = Ball[{0, 0, 0}, 2];

In[4]:={vals, funs} = DEigensystem[{\[ScriptCapitalL], \[ScriptCapitalB]}, u[x, y, z], {x, y, z} \[Element] \[CapitalOmega], 16];

In[6]:=Grid[Partition[ParallelTable[DensityPlot3D[ funs[[i]]// N // Evaluate, {x, y, z} \[Element] \[CapitalOmega], Boxed -> False, Axes -> False, ColorFunction -> Hue, Method -> {"ShrinkWrap" -> True}, ImageSize -> 125], {i, 16}], 4]]

Out[6]:=

296 篇文章57 人订阅

0 条评论

## 相关文章

49320

35750

### 函数式编程与面向对象编程[3]:Scala的OOP-FP混合式编程与抽象代数理论

Scala是纯种的面向对象的语言。从概念上讲，每一个值都是一个对象，每一个操作都是一个方法调用。语言支持通过类和特征的高级组件架构。

13920

11430

35970

565110

19230

### 5行位运算，map靠边站——位操作进阶

Given an array of integers, every element appears three times except for one. F...

13410

34260

28990