HP Forums

Full Version: Complex plotting question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When plotting the real and imaginary parts of a complex-valued function, the Prime draws one plot first, then the other. For example, in the Function app:



This results in the function being evaluated twice for the same input values. Is there a way to plot both parts with one function or otherwise avoid the repetitive calculation?

I don't know if you meant plotting the real values on the x axis and imaginary parts on the y axis?

If so, I would suggest using the Parametric App:

X1(T) = RE(function)
Y1(T) = IM(function)
Let T vary.

I am not sure how we can prevent two calculations when there are two calculations.

No, I meant plotting both parts on the X axis, like this graph . The same equations in the Parametric app produce this other graph, both from the Riemann Zeta Function page on Wikipedia.

In the former case, the Function app has to recompute the same values twice, which is what I'm trying to avoid.
Recomputing twice isn't particularly a concern here, since it is actually going to be evaluated thousands or possibly tens of thousands of times. Smile

I don't think there is a way to avoid it. There is no "caching" of intermediate results like this across different defined functions because the complexity basically costs more then just calculating it. You'd have to lookup that the intermediate results matched, and do quite a bit of checking to make sure nothing funny was going on. I suspect it might end up being slower then just recalculating it.

Until we get some sort of a complex support in the plotter, you'll need to split it like this to do what you want I believe.
(04-02-2018 04:42 PM)Tim Wessman Wrote: [ -> ]Until we get some sort of a complex support in the plotter ...

That would be excellent! Smile
Reference URL's