Wed 2017-01-04 14:55:36 UTC+1, Fjordforsk A/S: > > I am trying to plot a trigonometric function, but get a strange result: > > plot3d(lambda > x,t:((cos(2^(0.5)*x)*sech(2^(0.5)*t)+I*2^0.5*tanh(2*t))/(2^(0.5)-cos(2^(0.5)*x)*sech(2^(0,5)*t)))*e^(2*I*t).real_part(),(x,-3*pi,3*pi),(t,-5,5),adaptive=True,color=cmsel) > > /home/sem/SageMath/sage-7.4/src/sage/rings/integer.pyx in > sage.rings.integer.Integer.__pow__ > (/home/sem/SageMath/sage-7.4/src/build/cythonized/sage/rings/integer.c:13508)() > 2031 nn = pyobject_to_long(n) > 2032 except TypeError: > -> 2033 s = parent_c(n)(self) > 2034 return s**n > 2035 except OverflowError: > > > > *TypeError: 'sage.rings.integer.Integer' object is not iterable*What have > I written wrongly? >
It seems you have an instance of 0,5 instead of 0.5. Some side remarks. First, defining r2 = RDF(2).sqrt() and then using r2 everywhere instead of 2^0.5 might be more readable, and possibly faster. First, e^(2*I*t).real_part() will always return 1. If you meant exp(2*I*t).real_part(), just write cos(2*t). Or maybe you need to rework your parentheses. Actually I'm guessing this is what you want: sage: r2 = RDF(2).sqrt() sage: three_pi = 3*RDF.pi() sage: f = lambda x, t: (((cos(r2*x)*sech(r2*t)+I*r2*tanh(2*t))/(r2-cos(r2*x)*sech(r2*t)))*exp(2*I*t)).real_part() sage: plot3d(f, (-three_pi, three_pi), (-5, 5), adaptive=True) -- 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.