gpt4 book ai didi

wolfram-mathematica - 在Mathematica中绘制复杂函数

转载 作者:行者123 更新时间:2023-12-03 11:35:25 26 4
gpt4 key购买 nike

我该如何制作Mathematica图形来复制sage中complex_plot的行为?即

... 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).



这是一个zeta函数的示例(从 Neutral Drifts的M. Hampton偷来的),具有叠加的绝对值轮廓:

在Mathematica文档页面 Functions Of Complex Variables中,您可以使用 ContourPlotDensityPlot“可能按阶段着色”来可视化复杂函数。但是问题出在两种类型的绘图上, ColorFunction仅采用一个与该点处的轮廓或密度相等的变量-因此似乎不可能在绘制绝对值时使其着色相位/自变量。请注意,这不是 Plot3D的问题,所有3个参数 (x,y,z)都传递给 ColorFunction

我知道还有其他可视化复杂功能的方法-例如 Plot3D docs中的“整洁示例”,但这不是我想要的。

另外,我确实有 one solution below(实际上已用于生成Wikipedia中使用的某些图形),但是它定义了一个相当低级别的函数,并且我认为应该可以使用 ContourPlotDensityPlot这样的高级函数。但这不应该阻止您提供您喜欢的使用较低级别结构的方法!

编辑:在Mathematica期刊上,Michael Trott发表了一些不错的文章,内容如下:
可视化黎曼曲面 of algebraic functionsIIaIIbIIcIId
可视化黎曼曲面 demo
The Return of Riemann surfaces (updates for Mma v6)

当然,迈克尔·特洛特(Michael Trott)编写了 Mathematica guide books,其中包含许多精美的图形,但似乎落后于Mathematica加速发布的时间表!

最佳答案

这是我的尝试。我有点色彩功能。

ParametricPlot[
(*just need a vis function that will allow x and y to be in the color function*)
{x, y}, {x, -6, 3}, {y, -3, 3},

(*color and mesh functions don't trigger refinement, so just use a big grid*)
PlotPoints -> 50, MaxRecursion -> 0, Mesh -> 50,

(*turn off scaling so we can do computations with the actual complex values*)
ColorFunctionScaling -> False,

ColorFunction -> (Hue[
(*hue according to argument, with shift so arg(z)==0 is red*)
Rescale[Arg[Zeta[# + I #2]], {-Pi, Pi}, {0, 1} + 0.5], 1,

(*fudge brightness a bit:
0.1 keeps things from getting too dark,
2 forces some actual bright areas*)
Rescale[Log[Abs[Zeta[# + I #2]]], {-Infinity, Infinity}, {0.1, 2}]] &),

(*mesh lines according to magnitude, scaled to avoid the pole at z=1*)
MeshFunctions -> {Log[Abs[Zeta[#1 + I #2]]] &},

(*turn off axes, because I don't like them with frames*)
Axes -> False
]

我还没有想过让网格线颜色变化的好方法。最简单的方法可能是使用 ContourPlot而不是 MeshFunctions生成它们。

关于wolfram-mathematica - 在Mathematica中绘制复杂函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5385103/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com