Wouldn't it be better to use

a = Abs(sin(w))/cos(w) + Abs(w)
a.replace(Abs, Id)

rather than deal with strings?

Best,
Renato

On Thu, Jul 9, 2015 at 12:10 PM, AMiT Kumar <[email protected]> wrote:

> Hi brombo,
>
> The simplest thing, I can think of as of now:
>
> In [23]: a = (Abs(sin(w))/cos(w)) + Abs(w)
>
> In [24]: S(str(a).replace('Abs', ''))
> Out[24]: w + sin(w)/cos(w)
>
>
>
> *AMiT Kumar*
>
> On Thursday, July 9, 2015 at 5:57:15 PM UTC+5:30, brombo wrote:
>>
>> Is there a simple way of removing all absolute values from an
>> expression.  For example if the expression is (Abs(sin(w))/cos(w)) + Abs(w)
>> return (sin(w)/cos(w)) + w.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/ca8e56be-e29f-48a4-bb57-06a30d7b957f%40googlegroups.com
> <https://groups.google.com/d/msgid/sympy/ca8e56be-e29f-48a4-bb57-06a30d7b957f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAF1_OVsmAi9e6vCCqYt_FcjdC0fPuba0W6CiT8zUjeWXZFiveg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to