       Re: Re: Trouble with a system of equations

```Yaroslav Bulatov wrote:

>As Ray Koopman and some others pointed out, the system of equations
>becomes linear with a proper choice of variables. But now getting the
>original variables is problematic.
>
>In particular, if I replace all terms of the form Exp[a+b+c]/1+Exp[a+b
>+c..] with single variables, I will have to solve the following to get
>a,b,c..back
>
>mapping[k_] := Module[{mm, params, tuples},
>  mm = KroneckerProduct @@ Table[{{1, 1}, {1, 0}}, {i, 1, k}];
>  params = (Subscript[t, #1] & ) /@ Range[1, 2^k];
>  tuples = (Plus @@ (params*#1) & ) /@ mm /. a_Plus :> Times @@ a;
>  terms = (#1/(#1 + 1) & ) /@ tuples;
>  {MapIndexed[#1 == Subscript[m, #2[]] & , terms], params}]
>
>
>Inverting it for 2 variables works
>Solve @@ mapping
>
>But for 3 variables it takes too long
>Solve @@ mapping
>
>Making equations polynomial and solving them gives solution in terms
>of "InverseFunction" for 3 variables and takes too long for 4
>
>
>
The mapping[k] equations are trivial to solve if one solves them for
t_1, t_2, etc in order. For example:

tsol =  MapThread[Solve[#1, #2] &, {Reverse[mapping[]],
mapping[]}] //Flatten

tsol solves for the t_i in terms of m_i and lower order t_i. Next, we
replace the t_i in the right hand side with their known values:

solution = Thread[Rule[tsol[[All, 1]], tsol[[All, 2]] //. tsol]];

Finally, let's check that the solution works:

In:= mapping[] /. solution // Simplify

Out= {True,True,True,True,True,True,True,True}

I tried this procedure for mapping, and it took about 12 seconds.

Carl Woll
Wolfram Research

```

• Prev by Date: Re: Eigenvalues
• Next by Date: A question about RegionFunction in ver. 6.0
• Previous by thread: Re: Trouble with a system of equations
• Next by thread: Re: Trouble with a system of equations