1

I am completely new in Mathematica "programming" language. At the university in Electrodynamics, we have gotten a homework to visualise the equipotential surfaces with function ContourPlot3D. I have been able to get the matematical expression for such surface, the equation should be seen on the picture. My lastest try to write the function has been:

ContourPlot3D[
 log (((L/2 + x) + ((((((L/2) + x)^(2)) + ((y)^(2))))^(1/2)))/((-L/2 +
          x) + ((((((-L/2) + x)^(2)) + ((y)^(2))))^(1/2)))) == 
  0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}]

or

ContourPlot3D[(
   ln (((1/2 + 
          x) + ((((((1/2) + x)^(2)) + ((y)^(2))))^(1/2)))/((-1/2 + 
          x) + ((((((-1/2) + x)^(2)) + ((y)^(2))))^(1/2))))) == 
  0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}]

Although I have resigned on any parameters and only the variables stayed, still I can not plot the function. Could anyone to look, where I do a mistake. In all cases is the syntax error, that "more input needed", but I don't know, what more I should define.

enter image description here

Andrew
  • 13
  • 2
  • 1
    Functions in Mathematica, such as Log are called using square brackets, so you'd want to use Log[....] == 0 – b3m2a1 Oct 19 '20 at 21:08
  • 1
    Before trying to get good results with ContourPlot3D (without knowing proper ranges and contours) I would strongly recommend using Plot for fixed x and y or Plot3D for fixed y or x to get a feeling for the potential at hand. For this potential ContourPlot will most definitely be the more insightful then ContourPlot3D, since the potential is axis-symmetric. Further the result for the integral does not hold for arbitrary x, y, and z. – N0va Oct 19 '20 at 21:52
  • ContourPlot3D[(Log@(((1/2 + x) + ((((((1/2) + x)^(2)) + ((y)^(2))))^(1/2)))/((-1/2 + x) + ((((((-1/2) + x)^(2)) + ((y)^(2))))^(1/2))))), {x, -2, 2}, {y, -2, 2}, {z, -2, 2}] – cvgmt Oct 19 '20 at 23:15

1 Answers1

1

Like N0va said:

Try

Plot3D[((1/2 + x + Sqrt[1/4 + x + x^2 + y^2])/(-(1/2) + x + Sqrt[(-(1/2) + x)^2 + y^2])), {x, -2, 2}, {y, -2, 2}]

or

ContourPlot[((1/2 + x + Sqrt[1/4 + x + x^2 + y^2])/(-(1/2) + x + Sqrt[(-(1/2) + x)^2 + y^2])), {x, -2, 2}, {y, -2, 2}]

to see the potential or the equipotential lines.

Andreas
  • 3,297
  • 1
  • 5
  • 12
  • Thank you all very much, I think, that I know at this moment much more and I am able to plot the function. Thank you for your help! – Andrew Oct 20 '20 at 06:10