在 Mathematica 中绘制复函数
如何制作复制 行为的 Mathematica 图形鼠尾草中的complex_plot? IE
...采用 1 的复函数 变量,并绘制输出 在指定的 xrange 上运行并且 yrange 如下所示。这 输出的幅度被指示 由亮度(零为 黑色且无穷大为白色)而 参数由色调表示 (红色为正实数,并且 通过橙色、黄色、...增加 随着参数的增加)。
这是 zeta 函数的示例(从 Neutral Drifts 的 M. Hampton 盗取),具有绝对值的重叠轮廓:
在 Mathematica 文档页面 Functions Of Complex Variables 它说您可以使用 ContourPlot
和 DensityPlot
可视化复杂函数“可能着色按阶段”。但问题在于两种类型的绘图中,ColorFunction
仅采用等于该点处的轮廓或密度的单个变量 - 因此在绘制绝对值时似乎不可能使其对相位/参数进行着色。请注意,这对于 Plot3D
来说不是问题,其中所有 3 个参数 (x,y,z)
都传递给 ColorFunction
。
我知道还有其他方法可以可视化复杂函数 - 例如 Plot3D 文档,但这不是我想要的。
另外,我确实有下面的一个解决方案(实际上被用来生成维基百科中使用的一些图形),但它定义了一个相当低级的函数,我认为使用像 ContourPlot 或 DensityPlot 这样的高级函数应该是可能的>。但这并不应该阻止您提供您最喜欢的使用较低级别构造的方法!
编辑: Michael Trott 在 Mathematica 杂志上发表了一些不错的文章:
可视化代数函数的黎曼曲面,IIa, IIb,IIc,IId。
可视化黎曼曲面演示。
黎曼曲面的回归(Mma v6 的更新)
当然,Michael Trott 写了Mathematica 指南,其中包含许多漂亮的图形,但似乎已经落后于加速 Mathematica 发布时间表!
How can I make a Mathematica graphics that copies the behaviour of complex_plot in sage? i.e.
... takes a complex function of one
variable, and plots output of the
function over the specified xrange and
yrange as demonstrated below. The
magnitude of the output is indicated
by the brightness (with zero being
black and infinity being white) while
the argument is represented by the hue
(with red being positive real, and
increasing through orange, yellow, ...
as the argument increases).
Here's an example (stolen from M. Hampton of Neutral Drifts) of the zeta function with overlayed contours of absolute value:
In the Mathematica documentation page Functions Of Complex Variables it says that you can visualize complex functions using ContourPlot
and DensityPlot
"potentially coloring by phase". But the problem is in both types of plots, ColorFunction
only takes a single variable equal to the contour or density at the point - so it seems impossible to make it colour the phase/argument while plotting the absolute value. Note that this is not a problem with Plot3D
where all 3 parameters (x,y,z)
get passed to ColorFunction
.
I know that there are other ways to visualize complex functions - such as the "neat example" in the Plot3D docs, but that's not what I want.
Also, I do have one solution below (that has actually been used to generate some graphics used in Wikipedia), but it defines a fairly low level function, and I think that it should be possible with a high level function like ContourPlot
or DensityPlot
. Not that this should stop you from giving your favourite approach that uses a lower level construction!
Edit: There were some nice articles by Michael Trott in the Mathematica journal on:
Visualizing Riemann surfaces of algebraic functions, IIa, IIb, IIc, IId.
Visualizing Riemann surfaces demo.
The Return of Riemann surfaces (updates for Mma v6)
Of course, Michael Trott wrote the Mathematica guide books, which contain many beautiful graphics, but seem to have fallen behind the accelerated Mathematica release schedule!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是我的尝试。我对颜色函数做了一些修改。
我还没有想到一个让网格线改变颜色的好方法。最简单的可能是使用 ContourPlot 而不是 MeshFunctions 生成它们。
Here's my attempt. I winged the color function a bit.
I haven't thought of a good way to get the mesh lines to vary in color. Easiest is probably to just generate them with
ContourPlot
instead ofMeshFunctions
.这是我对 Axel Boldt 给出的函数的变体,他的灵感来自Jan Homann。两个链接到的页面都有一些漂亮的图形。
来绘制没有轮廓的图
然后我们可以通过运行
我们可以通过复制 Brett 通过在 ComplexGraph 中使用和显示特定的绘图网格:
或与等高线图
Here's my variation on the function given by Axel Boldt who was inspired by Jan Homann. Both of the linked to pages have some nice graphics.
Then we can make the plot without the contours by running
We can add contours by either copying Brett by using and showing a specific plot mesh in the ComplexGraph:
or by combining with a contour plot like
这不是一个正确的答案,有两个原因:
无论如何,对我来说以下内容更容易解释(亮度是......好吧,只是亮度):
Brett 的代码几乎完好无损:
Not a proper answer, for two reasons:
Anyway, for me the following is much more clear to interpret (brightness is ... well, just brightness):
Brett's code almost intact:
对于每个有兴趣在 Python 中实现此目标的人,我创建了 cplot。安装
此绘制 domain-coloring 图en.wikipedia.org/wiki/Taylor_series" rel="nofollow noreferrer">exp 6 次泰勒多项式:
For everyone interested in achieving this in Python, I created cplot. Install with
This plots the domain-coloring plot of the Taylor polynomial of degree 6 of exp: