Mathematica Asked by PewtDmD on October 2, 2021
I’m trying to recreate a graph from a paper, and the function that I’m plotting involves three separate parabolic cylinder functions that all have a complex Nu value. After getting it all typed out, I end up with an empty plot. I’ve gone back to basics and have fiddled around with ParabolicCylinderD
, and have found that I can plot it no problem with a real Nu, but as soon as I make Nu complex I end up with an empty plot. What am I doing wrong?
Edit:
I’ll put in the test code I used while playing with the function to see if it worked, but it’s just a case of using a complex input with the function to see if it works.
Plot[ParabolicCylinderD[2,p],{p,0,50}]
That one worked totally fine, got a good plot from it.
Plot[ParabolicCylinderD[2 I,p],{p,0,50}]
This one didn’t work at all, got an empty plot as a result.
Yes certainly. If you have a fixed complex $nu$ then use ComplexPlot
not Plot
like so:
ComplexPlot[ParabolicCylinderD[0.3 + 0.2 I, z], {z, -1 - I, 1 + I}]
... or if you still want to use Plot
, then take the real and imaginary parts separately:
Plot[{Re[ParabolicCylinderD[0.3 + 0.2 I, x]],
Im[ParabolicCylinderD[0.3 + 0.2 I, x]]}, {x, -3, 3},
PlotStyle -> {Directive[Red], Directive[Blue]}]
For $nu=2mathbf{i}$ we have real and imaginary parts quickly decaying towards zero:
Plot[{
Re[ParabolicCylinderD[2 I, x]],
Im[ParabolicCylinderD[2 I, x]],
Abs[ParabolicCylinderD[2 I, x]]}, {x, 0, 10},
PlotStyle -> {Directive[Red], Directive[Blue], Directive[Thick, Darker@Green]},
PlotRange -> All,
PlotLegends -> {"Re", "Im", "Abs"}]
Answered by flinty on October 2, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP