Ask Your Question
0

How to combine the @interact command with complex plot?

asked 2013-05-24 22:33:16 +0200

updated 2015-01-23 22:04:09 +0200

FrédéricC gravatar image

How to combine the @interact command with complex plot? Hi, I'm trying to create a code to combine the @interact command with complex plot. I have created the complex plot using

sage: f(z) = z^5 + z - 1 + 1/z
sage: complex_plot(f, (-3, 3), (-3, 3))

but I wish to change the z^5 term to z^x where I can create a slider for the value of x using the @interact command. Does anyone know how I should start with this? I'm currently a high student working for a project but I don't know much about sage. If you know anything and can explain in simple terms it will be greatly appreciated. THANK YOU

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2013-05-25 04:10:59 +0200

vdelecroix gravatar image

Hi,

You should have a look at the documentation of interact. You can access the documentation with

sage: interact?

For your specific example, you can do

var('z')
@interact
def my_interact(a=(1,5,1)):
    f(z) = z^a + z - 1 + 1/z
    complex_plot(f, (-3, 3), (-3, 3)).show()
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-05-24 22:33:16 +0200

Seen: 281 times

Last updated: May 25 '13