2
$\begingroup$

I am trying to make a complex function grapher (code below), and have made real and imaginary output 3d graphs, and have created functions to "slice" the graph into two dimensional contour plots for any given x, y or z, (leaving the other two variables as the axes for this). Often seeing layers of a graph is a lot easier to understand than the 3d planes the first function creates. I would like to create a "skeleton graph", in which you can see the x y and z intercept plots on the 3d graph so that you can understand the general shape of the function. I am unable to do this, and am asking for help with this. Code left below.

complexfunctiongraph[f_] := 
 Show[Plot3D[
   z = Re[f[x + (y*I)]], {x, Xrange[[1]], Xrange[[2]]}, {y, 
    Yrange[[1]], Yrange[[2]]}, 
   PlotRange -> {Zrange[[1]], Zrange[[2]]}, Boxed -> False, 
   AxesStyle -> {Red, Green, Blue}, 
   AxesLabel -> {"Re Input", "Im Input", "Output"}, 
   PlotStyle -> {Green, Thick}], 
  Plot3D[z = Im[f[x + (y*I)]], {x, Xrange[[1]], Xrange[[2]]}, {y, 
    Yrange[[1]], Yrange[[2]]}, 
   PlotRange -> {Zrange[[1]], Zrange[[2]]}, Boxed -> False, 
   AxesStyle -> {Red, Green, Blue}, 
   AxesLabel -> {"Re Input", "Im Input", "Output"}, 
   PlotStyle -> {Blue, Opacity[.5]}]]
complexfunctionzeroX[f_, n_] :=
 Show[ContourPlot[
   Re[f[n + (y*I)]] == z, {y, Yrange[[1]], Yrange[[2]]}, {z, 
    Zrange[[1]], Zrange[[2]]}, ContourStyle -> Green, 
   FrameStyle -> {Blue, Green}, FrameLabel -> {"IM input", "Output"}],
   ContourPlot[
   Im[f[n + (y*I)]] == z, {y, Yrange[[1]], Yrange[[2]]}, {z, 
    Zrange[[1]], Zrange[[2]]}, ContourStyle -> {Blue, Opacity[.5]}, 
   AxesStyle -> {Blue, Green}, AxesLabel -> {"IM imput", "Output"}]]
complexfunctionzeroY[f_, n_] :=
 Show[ContourPlot[
   Re[f[x + (n*I)]] == z, {x, Xrange[[1]], Xrange[[2]]}, {z, 
    Zrange[[1]], Zrange[[2]]}, ContourStyle -> Green, 
   FrameStyle -> {Blue, Red}, FrameLabel -> {"RE input", "Output"}], 
  ContourPlot[
   Im[f[x + (n*I)]] == z, {x, Xrange[[1]], Xrange[[2]]}, {z, 
    Zrange[[1]], Zrange[[2]]}, ContourStyle -> {Blue, Opacity[.5]}, 
   FrameStyle -> {Blue, Red}, FrameLabel -> {"RE input", "Output"}]]
complexfunctionzeroZ[f_, n_] := 
 Show[ContourPlot[
   Re[f[x + (y*I)]] == n, {x, Xrange[[1]], Xrange[[2]]}, {y, 
    Yrange[[1]], Yrange[[2]]}, ContourStyle -> Green, 
   FrameStyle -> {Red, Green}, FrameLabel -> {"RE input", "IM input"}],
  ContourPlot[
   Im[f[x + (y*I)]] == n, {x, Xrange[[1]], Xrange[[2]]}, {y, 
    Yrange[[1]], Yrange[[2]]}, ContourStyle -> {Blue, Opacity[.5]}, 
   FrameStyle -> {Red, Green}, 
   FrameLabel -> {"RE input", "IM input"}]]
Xrange = {-10, 10};
Yrange = {-10, 10};
Zrange = {-3, 3};
$\endgroup$
0
$\begingroup$

What is your function f

b = Graphics3D[
   complexfunctionzeroX[Abs, 5][[1]] /. {x_Real, y_Real} -> {x, y, 0}];
a = complexfunctiongraph[Abs];
Show[a, b, PlotRange -> {Xrange, Yrange, Zrange}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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