Hi,

i´ve got the following problem on my sage installation.
The folloing code from 
http://www.math.washington.edu/~jkantor/Numerical_Sage/node11.html
Didn´t work for me:

import numpy
j=numpy.complex(0,1)
num_points=50
u=numpy.zeros((num_points,num_points),dtype=float)
pi_c=float(pi)
x=numpy.r_[0.0:pi_c:num_points*j]
u[0,:]=numpy.sin(x)
---------------------------------------------------------------------------
<type 'exceptions.AttributeError'>        Traceback (most recent call
last)

/home/volker/<ipython console> in <module>()

<type 'exceptions.AttributeError'>: 'float' object has no attribute
'sin'

I can use this (its the same, because sin(x[-1])=0)

u[0, :-1]=numpy.sin(x[ :-1])

And using real instead of float, and everything works as aspected

pi_c = real(pi)
x=numpy.r_[0.0:pi_c:num_points*j]
u[0,:]=numpy.sin(x)

Is this a bug in sage? On my normal python + numpy session the first
code runs just find.

volker


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to