Re: Re: Simplifying equations for Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg65875] Re: [mg65863] Re: Simplifying equations for Mathematica
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Thu, 20 Apr 2006 05:15:01 -0400 (EDT)
- References: <200604160749.DAA11245@smc.vnet.net> <e22h8k$e56$1@smc.vnet.net> <200604190854.EAA05819@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Maxim wrote:
> On Tue, 18 Apr 2006 11:07:00 +0000 (UTC), Daniel Lichtblau
> <danl at wolfram.com> wrote:
> [tripe expunged...dl]
>
> I have my doubts about this method,
Me too, now that you point it out.
> because the rule (Exp[a_] :> a) will
> be tried first and so it will replace E^(t1 + t2) with (t1 + t2).
> Numerical tests show that after we replace ti with Log[ti] and get rid of
> denominators one of the solutions is t1 == t2 == -1, t5 == 0. This
> suggests that the ordering of the variables can matter:
>
> In[1]:= f[t1_, t2_, t3_, t4_, t5_] :=
> Log[Exp[0] + Exp[t1] + Exp[t2] + Exp[t1 + t2] + Exp[t5] +
> Exp[t5 + t1 + t2] + Exp[t5 + t2 + t4] + Exp[t1 + t2 + t3 + t4 + t5]]
>
> In[2]:= Lvar = {t1, t2, t3, t4, t5};
> Lvar2 = {t4, t3, t2, t1, t5};
> Lm = {m1, m2, m3, m4, m5};
> Lexpr = D[f @@ Lvar, {Lvar}] - Lm;
> Lexpr2 = Lexpr /. Thread[Lvar -> Log[Lvar]] // Together // Numerator;
>
> In[7]:= SetOptions[Roots, Cubics -> False, Quartics -> False];
> (Lsol = Solve[GroebnerBasis[Lexpr2, Lvar2] == 0, Lvar2] //
> Simplify) // ByteCount // Timing
>
> Out[8]= {10.922*Second, 204216}
>
> The last three seem to be generic solutions:
>
> In[9]:= Lexpr /. Thread[Lvar -> Log[Lvar /. #]]& /@ Rest@ Lsol /.
> Thread[Lm -> Array[Random[Real, {-10, 10}, 20]&, Length@ Lm]] //
> MatrixQ[#, # == 0&]&
>
> Out[9]= True
>
> Maxim Rytin
> m.r at inbox.ru
Good catch. There may be some defects in the supply of sacrificial
virgins. That, or I caught something contagious from an unusual Limit
thread.
As to the order dependency, one thing I noticed is that variable order
makes a considerable difference for the Groebner basis computation even
to complete. A way to encourage it to do so is to use Sort->True. Then
one can call Solve and hope it discerns the "correct" order (use the one
for which we already have a Groebner basis). Or else mess with
Internal`DistributedTermsList to figure out the order used by
GroebnerBasis, and pass that to Solve with Sort->False.
Daniel Lichtblau
Wolfram Research
- References:
- Simplifying equations for Mathematica
- From: Yaroslav Bulatov <yaroslavvb@gmailnospa.com>
- Re: Simplifying equations for Mathematica
- From: Maxim <m.r@inbox.ru>
- Simplifying equations for Mathematica