I'm trying to learn how to use the @interact command.

The examples 
here: http://doc.sagemath.org/html/en/prep/Quickstarts/Interact.html do not 
work. I get a stack traces complaining about variable types etc.

Other examples I tried:

https://wiki.sagemath.org/interact/calculus#Some_polar_parametric_curves

With that I get:

π™Έπš—πšπšŽπš›πšŠπšŒπšπš’πšŸπšŽπšπšžπš—πšŒπšπš’πš˜πš—<πšπšžπš—πšŒπšπš’πš˜πš—πš™πšŠπš›πšŠπšŠπšπŸΆπš‘πŸ½πšπšŠπš‹πŸΉπŸΌπšŽπŸΆπŸΎπšŒπšπŸΎ>πš πš’πšπš‘πŸ»πš πš’πšπšπšŽπšπšœπš—πŸ·:π™΄πšŸπšŠπš•πšƒπšŽπš‘πš(πšŸπšŠπš•πšžπšŽ=𝚞'πš‚πš•πš’πšπšŽπš›:π™½πš˜πš—πšŽ[𝟷⎯⎯|𝟸|⎯⎯⎯𝟻]',πšπšŽπšœπšŒπš›πš’πš™πšπš’πš˜πš—=𝚞'πš—πŸ·')πš—πŸΈ:π™΄πšŸπšŠπš•πšƒπšŽπš‘πš(πšŸπšŠπš•πšžπšŽ=𝚞'πš‚πš•πš’πšπšŽπš›:π™½πš˜πš—πšŽ[𝟷⎯⎯|𝟹|⎯⎯⎯𝟻]',πšπšŽπšœπšŒπš›πš’πš™πšπš’πš˜πš—=𝚞'πš—πŸΈ')𝚊𝟷:π™΄πšŸπšŠπš•πšƒπšŽπš‘πš(πšŸπšŠπš•πšžπšŽ=𝚞'πš‚πš•πš’πšπšŽπš›:π™½πš˜πš—πšŽ[𝟷⎯⎯|𝟼/𝟻|⎯⎯⎯𝟷𝟢]',πšπšŽπšœπšŒπš›πš’πš™πšπš’πš˜πš—=𝚞'𝚊𝟷')𝚊𝟸:π™΄πšŸπšŠπš•πšƒπšŽπš‘πš(πšŸπšŠπš•πšžπšŽ=𝚞'πš‚πš•πš’πšπšŽπš›:π™½πš˜πš—πšŽ[𝟷⎯⎯|𝟼|⎯⎯⎯𝟷𝟢]',πšπšŽπšœπšŒπš›πš’πš™πšπš’πš˜πš—=𝚞'𝚊𝟸')πš‹:π™΄πšŸπšŠπš•πšƒπšŽπš‘πš(πšŸπšŠπš•πšžπšŽ=𝚞'πš‚πš•πš’πšπšŽπš›:π™½πš˜πš—πšŽ[𝟢⎯⎯|𝟢|⎯⎯⎯𝟸]',πšπšŽπšœπšŒπš›πš’πš™πšπš’πš˜πš—=𝚞'πš‹')

TypeError                                 Traceback (most recent call last)
<ipython-input-105-fc4092c2f8fe> in <module>()
      6     show(p, figsize = [Integer(5),Integer(5)], xmin = 
-Integer(2)-b, xmax = Integer(2)+b, ymin = -Integer(2)-b, ymax = 
Integer(2)+b, axes = False)
      7 
----> 8 para()

<ipython-input-105-fc4092c2f8fe> in para(n1, n2, a1, a2, b)
      2 def para(n1 = slider(Integer(1),Integer(5),Integer(1),default = 
Integer(2)), n2 = slider(Integer(1),Integer(5),Integer(1),default = 
Integer(3)), a1 = 
slider(Integer(1),Integer(10),Integer(1)/Integer(10),Integer(6)/Integer(5)), 
a2 = slider(Integer(1),Integer(10),Integer(1)/Integer(10),Integer(6)), b = 
slider(Integer(0),Integer(2),Integer(1)/Integer(50),Integer(0))):
      3     var('t')
----> 4     pretty_print(html('$r=' + latex(b+sin(a1*t)**n1 + 
cos(a2*t)**n2)+'$'))
      5     p = parametric_plot((cos(t)*(b+sin(a1*t)**n1 + cos(a2*t)**n2), 
sin(t)*(b+sin(a1*t)**n1 + cos(a2*t)**n2)), (t,Integer(0), Integer(20)*pi), 
plot_points = Integer(1024), rgbcolor = (Integer(0),Integer(0),Integer(0)))
      6     show(p, figsize = [Integer(5),Integer(5)], xmin = 
-Integer(2)-b, xmax = Integer(2)+b, ymin = -Integer(2)-b, ymax = 
Integer(2)+b, axes = False)

TypeError: unsupported operand type(s) for *: 'instance' and 
'sage.symbolic.expression.Expression'

Any hints on how to make this work?

Thanks,

Andy

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to