0
$\begingroup$

I want to compute and plot $\Re(\zeta(x+iy)^2)$ and $\Im(\zeta(x+iy)^2)$. How can I do that with Mathematica?

$\endgroup$
2
  • $\begingroup$ Have a look at Zeta, Re, Im and Plot. $\endgroup$ Apr 6, 2014 at 11:38
  • $\begingroup$ Kevin, can you mark my answer as correct, if it did help? $\endgroup$
    – Philipp
    Apr 7, 2014 at 9:16

2 Answers 2

2
$\begingroup$

Just use the corresponding commands. They are like the ones you have used, but with Capitals. Mathematica functions have square brackets. I can use these commands to define two functions

realpart[x_, y_] = Re[(Zeta[x + \[ImaginaryJ] y])^2];
imagpart[x_, y_] = Im[(Zeta[x + \[ImaginaryJ] y])^2];

And then I can plot the result

ContourPlot[realpart[x, y], {x, -1, 1}, {y, -1, 1}]
ContourPlot[imagpart[x, y], {x, -1, 1}, {y, -1, 1}]

Or more nicely using some Options and adding a Legend

ContourPlot[realpart[x, y], {x, -1, 1}, {y, -1, 1}, LabelStyle -> 15,  FrameLabel -> {"x", "y"}, Contours -> 15,  PlotRange -> {All, All, {-15, 15}}, PlotLegends -> Automatic]
ContourPlot[imagpart[x, y], {x, -1, 1}, {y, -1, 1}, LabelStyle -> 15,  FrameLabel -> {"x", "y"}, Contours -> 15,  PlotRange -> {Automatic, Automatic, {-15, 15}},  PlotLegends -> Automatic]

Which will look like:

real imag

$\endgroup$
1
  • $\begingroup$ Thank You very much Dear Phillip. $\endgroup$
    – Kevin67
    Apr 6, 2014 at 17:55
0
$\begingroup$

Why should one have to explicitly break apart a complex-valued function of a complex variable into its real and imaginary parts just to do plotting, when Mathematica already is so adept at calculating directly with complex numbers? In fact, you don't: you could use David Park's Presentations add-on (http://home.comcast.net/~djmpark/DrawGraphicsPage.html), as follows.

Column[{
   Draw2D[
          {
           ComplexCartesianContour[Zeta[z]^2, {z, -1 - I, 1 + I}, Re, 
           Contours -> 23]
          },
          Frame -> True, FrameLabel -> {Re[z], Im[z]}, RotateLabel -> False, 
          PlotLabel -> Row[{"Real part of ", Zeta[z]^2}], BaseStyle -> 12, 
          AspectRatio -> 1, ImageSize -> Scaled[0.5]],

   Draw2D[
          {
           ComplexCartesianContour[Zeta[z]^2, {z, -1 - I, 1 + I}, Im, 
           Contours -> 23]
          },
          Frame -> True, FrameLabel -> {Re[z], Im[z]}, RotateLabel -> False, 
          PlotLabel -> Row[{"Imaginary part of ", Zeta[z]^2}], 
          BaseStyle -> 12, AspectRatio -> 1, ImageSize -> Scaled[0.5]]
}]

enter image description here

$\endgroup$
0

Not the answer you're looking for? Browse other questions tagged or ask your own question.