ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 19 Dec 2020 23:44:26 +0100Implicit plot with complex functionhttps://ask.sagemath.org/question/54765/implicit-plot-with-complex-function/I have a complex function $f:\mathbb{C}\to\mathbb{C}$ and
want to draw the locus where $f$ is in the interval $[0,1]$.
I made the following (where $f$ is my complex function):
x = var('x')
assume(x, 'real')
y = var('y')
assume(y, 'real')
F = f.subs(z == x + I*y)
P = lambda x, y: F.subs(x=x, y=y).real()
Q = lambda x, y: F.subs(x=x, y=y).imag()
region_plot([P(x, y) <= 1, P(x, y) >= 0, Q(x, y) == 0], (x, 0, 5), (y, -1, 1))
That works well for small functions (low degree)
but for big functions it's too long.
For example with
$$ f(z)=-\frac{{\left(z^{4} - 6 z^{3} + 12 z^{2} - 8 \, z\right)} {\left(z - 1\right)}^{3} {\left(z - 3\right)}}{{\left(2z - 3\right)} {\left(z - 2\right)}^{3} z} $$
there is no problem (a few second), but with
$$ f(z)=-\frac{{\left(z^{8} - 16 z^{7} + 108 z^{6} - 400 z^{5} + 886 z^{4} - 1200 z^{3} + 972 z^{2} - 432 z + 81\right)} {\left(z - 2\right)}^{6} {\left(z - 4\right)} z}{{\left(6 z^{4} - 48 z^{3} + 140 z^{2} - 176 z + 81\right)} {\left(z - 1\right)}^{4} {\left(z - 3\right)}^{4}} $$
that's too long.
I think there should be something better. I've seen for example
the function `complex_plot` works well even for big functions
and seems to do something more complex.
Any idea?Gabriel SoranzoSat, 19 Dec 2020 23:44:26 +0100https://ask.sagemath.org/question/54765/