For Programmers: Free Programming Magazines  


Home > Archive > Mathematica > June 2005 > Simplify expression









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Simplify expression
Mukhtar Bekkali

2005-06-08, 9:01 am

I need to solve system of equations f1[x1,x2]=0,f2[x1,x2]==0, however,
some elements of these equation have the form Sqrt[(x1^2-x2^2)^2]. It
takes really long time to solve. If, however, I manually simplify
those elements, for example, Sqrt[(x1^2-x2^2)^2]=x1^2-x2^2 then solve
is fast. Therefore, the question is how I can force mathematica
simplify expressions of this sort (another elements are fractions that
depend on x1 and x2 in Mathematica's mind but in reality they cancel
out and fraction becomes a number). I do not want to use FindRoot since
I want to see all solutions. Thanks, Mukhtar Bekkali

Jens-Peer Kuska

2005-06-09, 9:01 am

Hi,

you can't because Sqrt[[(x1^2-x2^2)^2] is
Abs[x1^2-x2^2]

Regards
Jens

"Mukhtar Bekkali" <mbekkali@gmail.com> schrieb im
Newsbeitrag news:d8697g$c9t$1@smc.vnet.net...
>I need to solve system of equations
>f1[x1,x2]=0,f2[x1,x2]==0, however,
> some elements of these equation have the form
> Sqrt[(x1^2-x2^2)^2]. It
> takes really long time to solve. If, however, I
> manually simplify
> those elements, for example,
> Sqrt[(x1^2-x2^2)^2]=x1^2-x2^2 then solve
> is fast. Therefore, the question is how I can
> force mathematica
> simplify expressions of this sort (another
> elements are fractions that
> depend on x1 and x2 in Mathematica's mind but in
> reality they cancel
> out and fraction becomes a number). I do not
> want to use FindRoot since
> I want to see all solutions. Thanks, Mukhtar
> Bekkali
>



Bill Rowe

2005-06-09, 9:01 am

On 6/8/05 at 3:21 AM, mbekkali@gmail.com (Mukhtar Bekkali) wrote:

>I need to solve system of equations f1[x1,x2]=0,f2[x1,x2]==0,
>however, some elements of these equation have the form
>Sqrt[(x1^2-x2^2)^2]. It takes really long time to solve. If,
>however, I manually simplify those elements, for example,
>Sqrt[(x1^2-x2^2)^2]=x1^2-x2^2 then solve is fast. Therefore, the
>question is how I can force mathematica simplify expressions of
>this sort (another elements are fractions that depend on x1 and x2
>in Mathematica's mind but in reality they cancel out and fraction
>becomes a number). I do not want to use FindRoot since I want to
>see all solutions. Thanks, Mukhtar Bekkali


I think PowerExpand is what you are looking for, i.e.

PowerExpand[Sqrt[(x1^2-x2^2)^2]] yields

x1^2 - x2^2

Solve doesn't use PowerExpand as one of the transforms to try since it will not yield valid results for all possible conditions.
--
To reply via email subtract one hundred and four

dh

2005-06-09, 9:01 am

Hi Muktar,
what you want to do involves assumptions that you must specify. E.g.:

Assuming[x1^2 > x2^2, Sqrt[(x1^2 - x2^2)^2] // Simplify]

will do what you want.
sincerely, Daniel

Mukhtar Bekkali wrote:
> I need to solve system of equations f1[x1,x2]=0,f2[x1,x2]==0, however,
> some elements of these equation have the form Sqrt[(x1^2-x2^2)^2]. It
> takes really long time to solve. If, however, I manually simplify
> those elements, for example, Sqrt[(x1^2-x2^2)^2]=x1^2-x2^2 then solve
> is fast. Therefore, the question is how I can force mathematica
> simplify expressions of this sort (another elements are fractions that
> depend on x1 and x2 in Mathematica's mind but in reality they cancel
> out and fraction becomes a number). I do not want to use FindRoot since
> I want to see all solutions. Thanks, Mukhtar Bekkali
>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com