数学:填充无限深的势阱
注释:数学问题的合适页面是https://mathematica.stackexchange.com/
我想想象一个潜在的井,一个粒子在一个盒子里的数学,类似于第二张图片来自维基百科这里。我已经定义了我的函数
(*Length of the box*)
L = 4;
(*Infinitly deep potential well between 0 and L*)
V[x_] := Piecewise[{
{\[Infinity], x <= 0},
{0, 0 < x < L},
{\[Infinity], L <= x}}]并且想要得到一个地块函数,它给出一个充满的区域,在这个区域中,势到达无穷大。
不幸的是,我的尝试结束在潜在的“零区域”之间的阴影区域,而我希望在无穷大区域有阴影。
Table[Plot[V[x], {x, -5, 10},
Filling -> f], {f, {Top, Bottom, Axis, 0.3}}]发布于 2013-08-04 19:43:53
问题是Infinity对情节来说太多了。所以,让我们给它一些其他的大数字。但是,为了防止它重新标度y轴,我们需要对上面的绘图范围进行具体说明。
Block[{\[Infinity] = 1*^1},
Plot[V[x], {x, -5, 10}, Filling -> Bottom,
PlotRange -> {Automatic, 1}]
]或者,你可以用V[x]/.\[Infinity]->1*^1代替Block,但我更喜欢Block的方式。
发布于 2013-08-04 14:52:08
只需给它值而不是无穷大:
(*Length of the box*)L = 4;
(*Infinitly deep potential well between 0 and L*)
V[x_] := Piecewise[{{1, x <= 0}, {0, 0 < x < L}, {1, L <= x}}]
Plot[V[x], {x, -5, 10}, Filling -> Bottom]

另一种使用图形原语的方法:
wellLeft = 0;
leftBorder = wellLeft - 1;
rightBorder = L + 1;
wellRight = L;
top = 5;
Graphics[{
Hue[0.67, 0.6, 0.6],
Opacity[0.2],
Rectangle[{leftBorder, 0}, {wellLeft, top}],
Rectangle[{wellRight, 0}, {rightBorder, top}]
}, Axes -> True]

https://stackoverflow.com/questions/18044017
复制相似问题