Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

This question already has an answer here:

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

share|improve this question

marked as duplicate by Sjoerd C. de Vries, m_goldberg, Artes, Michael E2, rasher Apr 6 at 19:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Have a look at Zeta, Re, Im and Plot. –  Sjoerd C. de Vries Apr 6 at 11:38
    
Kevin, can you mark my answer as correct, if it did help? –  Philipp Apr 7 at 9:16

2 Answers 2

up vote 1 down vote accepted

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

share|improve this answer
    
Thank You very much Dear Phillip. –  Kevin67 Apr 6 at 17:55

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

share|improve this answer
    
Thank You very much . –  Kevin67 Apr 8 at 15:45

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