On Jul 25, 2009, at 4:59 PM, David Joyner wrote:

>
> This work in pure python.
>
> The problem in sage is with the line
>
> s = sin(2*pi*50*t)+sin(2*pi*70*t+pi/4)
>
> However, I don't know how to get Sage to
> evaluate the sin of a numpy.ndarray.
> For example,
>
> sage: sample_rate=1000.00
> sage: import numpy
> sage: s=numpy.sin(2*numpy.pi*50*t)+numpy.sin(2*numpy.pi*70*t 
> +numpy.pi/4)
> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent  
> call last)
>
> /home/wdj/.sage/temp/hera/27292/_home_wdj__sage_init_sage_0.py in  
> <module>()
>
> AttributeError: sin


Won't Sage preparse it so the 2, 50, 70, and 4 become Sage integers?

If I recall correctly, putting r after the appropriate constants  
should fix it.

Cheers,

Tim.

---
Tim Lahey
PhD Candidate, Systems Design Engineering
University of Waterloo
http://www.linkedin.com/in/timlahey


--~--~---------~--~----~------------~-------~--~----~
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-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to