On Oct 23, 8:56 am, "William Stein" <[EMAIL PROTECTED]> wrote:
> Here's me doing this in sage-3.2.alpha0.  Note that not all the same
> commands and conventions as with Sage's usual symbolic variables
> are yet supported.  However, the good thing is that the final substitution
> takes 1.81 ms on sage.math instead of 10 seconds.
>
> [EMAIL PROTECTED]:~/build/sage-3.2.alpha0$ ./sage
> ----------------------------------------------------------------------
> | SAGE Version 3.2.alpha0, Release Date: 2008-10-20                  |
> | Type notebook() for the GUI, and license() for information.        |
> ----------------------------------------------------------------------
>
> sage: var('x,y',ns=1)    #note the ns=1, which will go away in the future...
> (x, y)
> sage: F = sin(x^2 + y^2) * cos(y) * exp(-0.5*(x^2+y^2))
> sage: G=F.diff(x,1).diff(x,1); G

or G=F.diff(x,2)

> -exp(-(0.500000000000000)*x^2 - (0.500000000000000)*y^2)*sin(x^2 +
> y^2)*cos(y) + 2*exp(-(0.500000000000000)*x^2 -
> (0.500000000000000)*y^2)*cos(x^2 + y^2)*cos(y) -
> (3.00000000000000)*exp(-(0.500000000000000)*x^2 -
> (0.500000000000000)*y^2)*sin(x^2 + y^2)*cos(y)*x^2 -
> (4.00000000000000)*exp(-(0.500000000000000)*x^2 -
> (0.500000000000000)*y^2)*cos(x^2 + y^2)*cos(y)*x^2
> sage: G.subs(x=1.2).subs(y=1.2)
> 0.193703001636676
> sage: timeit('G.subs(x=1.2).subs(y=1.2)')
> 125 loops, best of 3: 1.81 ms per loop
>
> William

Great! That's much better.

  John


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

Reply via email to