On Sat, 5 Dec 2009 03:32:04 -0500
William Stein <[email protected]> wrote:

> On Fri, Dec 4, 2009 at 9:22 PM, taco <[email protected]> wrote:
> >
> > Sooo.... I am currently working on trying to simplify the resulting
> > expressions in sage to shrink them down to a smaller size. Here is
> > the problem: I notice that my expressions contain *a lot* of terms
> > like this, arctan2(0, looooooooooooong_expression).  Now I know that
> > arctan2(0,x) = 0 for all x and so this should simplify my
> > expressions a great deal. However, I cannot get sage to make this
> > simplification for me. Simplify() and simplify_full() do not touch
> > these terms. Does anyone have an idea about how to address this
> > trigonometric simplification?
> 
> You might find this example useful:
> 
> sage: f = arctan2(0,sin(x)^2)  + cos(x^3) + 1/x
> sage: g(x,y) = 0
> sage: f.substitute_function(arctan2, g)
> 1/x + cos(x^3)

Here is another way:

sage: t = arctan2(0,x+y^z) + cos(x) + 1/x
sage: t
1/x + cos(x) + arctan2(0, y^z + x)
sage: w = SR.wild()
sage: t.subs({arctan2(0,w):0})
1/x + cos(x)


Cheers,
Burcin

-- 
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

Reply via email to