1

i'm trying to plot the following formula using gnuplot, but i get an error message says "all points y value undefined!", what is the problem and what can i do to solve it?

Here is the code:

gnuplot> i = {0.0,1.0}                              
gnuplot>  plot [y=1:100] 1 + (0. + 0.2440625921544017*i)*(0.9680598247711271/y**5 + 0.4600760626004062/y**4 + 0.31009952311074734/y**3 + 0.3289857649601461/y**2 + 0.7029129290126906/y)

Where i is the complex number (Sqrt[-1]).

2
  • Seems that your code is not formatted. Edit your question. Commented Dec 2, 2016 at 13:50
  • @MichaelO. i edited it. Commented Dec 2, 2016 at 14:02

1 Answer 1

1

You cannot directly plot a function with complex values. You must decide which parts of the function you want to plot, use e.g. abs(), imag() or real():

i = {0.0, 1.0}
f(x) = 1 + (0. + 0.2440625921544017*i)*(0.9680598247711271/x**5 + 0.4600760626004062/x**4 + 0.31009952311074734/x**3 + 0.3289857649601461/x**2 + 0.7029129290126906/x)

set xrange [1:10]
plot abs(f(x))

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Also helpful is to use arg() for the phase/angle of the complex value, see help arg.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.