Re: Re: Trouble with a system of equations
- To: mathgroup at smc.vnet.net
- Subject: [mg77766] Re: [mg77722] Re: Trouble with a system of equations
- From: Carl Woll <carlw at wolfram.com>
- Date: Sat, 16 Jun 2007 03:30:30 -0400 (EDT)
- References: <f4lb44$fvv$1@smc.vnet.net><200706131142.HAA07187@smc.vnet.net> <200706150844.EAA16248@smc.vnet.net>
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[[1]]] & , terms], params}] > > >Inverting it for 2 variables works >Solve @@ mapping[2] > >But for 3 variables it takes too long >Solve @@ mapping[3] > >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[3][[1]]], mapping[3][[2]]}] //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[41]:= mapping[3][[1]] /. solution // Simplify Out[41]= {True,True,True,True,True,True,True,True} I tried this procedure for mapping[7], and it took about 12 seconds. Carl Woll Wolfram Research
- References:
- Re: Trouble with a system of equations
- From: Yaroslav Bulatov <yaroslavvb@gmail.com>
- Re: Trouble with a system of equations
- From: Yaroslav Bulatov <yaroslavvb@gmail.com>
- Re: Trouble with a system of equations