On Wed, Apr 16, 2008 at 7:45 AM, Reckoner <[EMAIL PROTECTED]> wrote:
>
>  For posterity, the subtle point that Stein made is that instead of
>  substituting the integer 5, he used the the float 5.0 to get the
>  result.

Thanks.  Sorry for not writing out more about what I was doing
but I was in a hurry when I wrote that.  Thanks for adding that.
It would be good to put an example like this in the tutorial.

William

>
>  On Apr 15, 11:26 am, "William Stein" <[EMAIL PROTECTED]> wrote:
>
>
> > On Tue, Apr 15, 2008 at 11:22 AM, Reckoner <[EMAIL PROTECTED]> wrote:
>  >
>  > >  Suppose I have something like:
>  >
>  > >  sage: x,y,z=var('x y z')
>  > >  sage: eq = cos(x)*sin(y)*tan(x)
>  >
>  > >  and I want to substitute a value for x, say, x=5. Then,
>  > >  I would have
>  >
>  > >  eq = cos(5)*sin(y)*tan(5)
>  >
>  > >  which is what I get when I do .substitute() in sage. However, I want
>  > >  this partially numerically evaluated to obtain
>  >
>  > >  eq = 0.28366*sin(y)*(-3.38051)
>  >
>  > >  How can I do this?
>  >
>  > sage: x,y,z=var('x y z')
>  > sage: eq = cos(x)*sin(y)*tan(x)
>  > sage: eq(x=5.0)
>  > -0.958924274663139*sin(y)
>
>
> >
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
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