Ask Your Question

Revision history [back]

Implicit plot with complex function

I have a complexe 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. 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.

Does somebody has any idea?

Thanks

Implicit plot with complex function

I have a complexe complex function $f:\mathbb{C}\to\mathbb{C}$, and $f:\mathbb{C}\to\mathbb{C}$ and want to draw the locus where $f$ is in the interval $[0,1]$. $[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))
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) degree) but for big functions it's too long. long. I think there should be something better. I've seen for example example the function complex_plot complex_plot works well even for big functions functions and seems to do something more complex.

Does somebody has any Any idea?

Thanks

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?