Debugging Mathematica 5 work program with Mathematica 7

I am currently reading Mathematica guides for programming, and I tried to develop one of the first book programs. Basically, when I run the following program:

Plot3D[{Re[Exp[1/(x + I y)]]}, {x, -0.02, 0.022}, {y, -0.04, 0.042}, 
 PlotRange -> {-1, 8}, PlotPoints -> 120, Mesh -> False, 
 ColorFunction -> Function[{x1, x2, x3}, Hue[Arg[Exp[1/(x1 + I x2)]]]]]

either I get a 1/0 error and an e ^ \ infinity error, or if I omit the options PlotPoints, say 60, an overflow error. Although I have a working way out, but this is not what it should have been. The hue seems to scatter from the left corner, while it should scatter the origin (as seen on the original output )

Here is the original program, which apparently runs on Mathematica 5 (Trott, Mathematica Guidebook for Programming):

Off[Plot3D::gval];

Plot3D[{Re[Exp[1/(x + I y)]], Hue[Arg[Exp[1/(x + I y)]]]},
       {x, -0.02, 0.022}, {y, -0.04, 0.042},
       PlotRange -> {-1, 8}, PlotPoints -> 120, Mesh -> False]

Off[Plot3D::gval];

ColorFunction, ( Plot3D), , .

, , !

+2
2

- . - << Version5`Graphics` Plot3D, Mathematica V5. , , , .

, ( ) , Rescale, :

Plot3D[Evaluate[Re[f[x, y]]], {x, -.02, .022}, {y, -0.04, 0.042},
PlotRange -> {-1, 2}, PlotPoints -> 120, Mesh -> False,
ColorFunction -> Function[{x, y, z}, Hue@Rescale[Arg[f[x, y]], {-π, π}]],
ColorFunctionScaling -> False,
ClippingStyle -> None]

, Mathematica [-Pi, Pi] . , .

+1

Mathematica, , , Hue[Arg[Exp[1/(x + I y)]]], .

, , -, Exp[1/(x1 + I x2)] - 1/0. , 1/, ( Mathematica 7) , , , . , .

+2

Source: https://habr.com/ru/post/1786049/


All Articles