Menu

functions with complex arguments

Help
sibelius
2018-10-28
2018-11-08
  • sibelius

    sibelius - 2018-10-28

    hi everyone, I have a problem with a gnuplot script. I d like to plot a function called sin(z) where z = x+i*y is the generic complex number.
    I attached the script file and any help would be great.
    thank you

     
  • Hans-Bernhard Broeker

    Your multi-step construction of your own sinz function is completely unnecessary. gnuplot's builtin sin() function already supports complex arguments just fine.

    You failed to tell us what problem you have. I'll venture a guess that you didn't get any output, or just a message like "all points undefined". That's because the value you're plotting is complex, and complex values can't really be plotted. You have to decide on a way of extracting a real value from the complex result.

    The plotting command could be as simple as

    splot real(sin(x+{0,1}*z)) w pm3d
    
     
  • Ethan Merritt

    Ethan Merritt - 2018-10-29

    Possibly the online demos for complex trig can provide guidance
    http://gnuplot.sourceforge.net/demo_5.2/complex_trig.html

     
  • sibelius

    sibelius - 2018-11-08

    thank you very much for your help, yes the problem was I wasn t get any output.
    now I understand why, I need just to spend a bit more time to think, anyway the link was very helpfull.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.