On Thu, Mar 18, 2010 at 5:10 PM, G B <[email protected]> wrote:
> Thanks.  I tried that but it's causing different problems:
> -----------------------
> from sympy import atan2
> var('omega,t,x,y,r,Theta')
> Theta(t)=omega*t
> x(t)=r*cos(Theta(t))
> y(t)=r*sin(Theta(t))
> dx=diff(x,t)
> ddx=diff(dx,t)
> dy=diff(y,t)
> ddy=diff(dy,t)
> v_a(t)=atan2(dy(t),dx(t))
> v_a
> --------------------------
>
> I get: AttributeError: 'atan2' object has no attribute '_sage_'

This is a bug in sympy, I've fixed that in sympy, currently the
patches are waiting for a review. When we update the sympy package in
sage, here is what you'll get:

sage: var('omega,t,x,y,r,Theta')
(omega, t, x, y, r, Theta)
sage: Theta(t)=omega*t
sage: x(t)=r*cos(Theta(t))
sage: y(t)=r*sin(Theta(t))
sage: dx=diff(x,t)
sage: ddx=diff(dx,t)
sage: dy=diff(y,t)
sage: ddy=diff(dy,t)
sage: v_a(t)=atan2(dy(t),dx(t))
sage: v_a
t |--> arctan2(omega*r*cos(omega*t), -omega*r*sin(omega*t))


>
> My original code had this for that second last line:
> v_a(t)=atan2(dy(t),dx(t)).substitute(r=10,omega=(2*pi/60))
>
>
> and it throws: AttributeError: 'atan2' object has no attribute
> 'substitute'

in the above code, you are using sympy, and thus you have to use:

sage: atan2(dy(t),dx(t)).subs({r:10, omega:2*pi/60})
arctan2(1/3*pi*cos(1/30*pi*t), -1/3*pi*sin(1/30*pi*t))

and it should work. Note that this doesn't work in the current sage,
but it will work when we update sympy.

We are also facing some technical problem, that the latest mpmath in
sympy doesn't work with sage:

http://code.google.com/p/sympy/issues/detail?id=1865

so the newest sympy fails to import, but we'll fix it too.

Ondrej

-- 
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
URL: http://www.sagemath.org

To unsubscribe from this group, send email to 
sage-support+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to