Re: Re: "Reduce" wierdness (or too slow?)

*To*: mathgroup at smc.vnet.net*Subject*: [mg89123] Re: [mg89095] Re: "Reduce" wierdness (or too slow?)*From*: Andrzej Kozlowski <akoz at mimuw.edu.pl>*Date*: Mon, 26 May 2008 01:31:35 -0400 (EDT)*References*: <200805250602.CAA15503@smc.vnet.net> <200805251026.GAA22882@smc.vnet.net>

I forgot to add the obvious. Why not simply do this: sols = Reduce[{1000 + t2 == t3, 1200 + w1 == w2, 125 + t1 == t2, 125 + t5 == t6, k*t3 == 2*(v2 + z2), t7*z1 + t2*z2 + z3 + z4 == H + (t2^2)/k + (t7^2)/k + w1, t7*z1 + t3*z2 + z3 + z4 == H + (t3^2 + t7^2)/k, t7*z1 + z3 + z4 == 2*H + (t7^2)/k, w1 + t6*z1 + z3 == (t6^2)/k + w1 + w2, w1 == w2 + ((t1 - t2)*(t1 + t2 - k*z2))/k, w2 + t5*z1 + z3 == (t5^2)/k + w1 + w2, w2 == (-t1^2)/k + t1*z2 + z4, z1 == 2*t4/k + v2, z2 == 0}, {H, t1, t2, t3, t4, t5, t6, t7, v2, w1, w2, z1, z2, z3, z4}, Backsubstitution -> True]; sols1 = Reduce[ sols, {H, t1, t2, t3, t4, t5, t6, t7, v2, w1, w2, z1, z2, z3, z4}, Reals]; Now, if you compare sols1 with sols you see that the only difference is that the case k!=0 was replaced by two cases k>0 and k<0. These two, of course, correspond to the assumption that k is real, which is all that is needed in this case to ensure that everything else is real. This is in fact exactly the same solution to the same problem as I suggested earlier - in effect the inequalities (which are automatically added by Reduce if you use the domain restriction to Reals) are separated from the equations. Andrzej Kozlowski On 25 May 2008, at 19:26, Andrzej Kozlowski wrote: > The problem is that using Reduce[...,Reals] in this context amounts to > adding lots of inequalities. To see this, just take a couple of the > equations: > > Reduce[{t7*z1 + t3*z2 + z3 + z4 == H + (t3^2 + t7^2)/k, > t7*z1 + z3 + z4 == 2*H + (t7^2)/k}, {H, t1, t2, t3, t4, t5, t6, t7, > v2, w1, > w2, z1, z2, z3, z4}, Reals, Backsubstitution -> True] > > You will see all the inequalites that had to be added by Reduce to > make all expressions that appear in Reduce real. This is actually > harder rather thans simpler than your original formulation. > > Andrzej Kozlowski > > > On 25 May 2008, at 15:02, TuesdayShopping wrote: > >> Re: Reduce" wierdness (or too slow?). >> Thanks for the input from Andrzej Kozlowski, Daniel Lichtblau, Adam >> Strzebonski and others. OK; No inequations. Below is problem similar >> (not same) to the earlier one, that does not have any inequations >> but still Reduce will not solve it in 600 seconds. Even FindInstance >> will not find a (even partial) solution in 600 seconds. I should >> have got the solution for H, z2, w1, w2, t1, t2, t3, v2 as below. My >> goal is that I would like to solve a class of problems (like the one >> below) for as many variables as I can. >> >> Problem: >> Reduce[{1000 + t2 == t3, 1200 + w1 == w2, 125 + t1 == t2, >> 125 + t5 == t6, k*t3 == 2*(v2 + z2), >> t7*z1 + t2*z2 + z3 + z4 == H + (t2^2)/k + (t7^2)/k + w1, >> t7*z1 + t3*z2 + z3 + z4 == H + (t3^2 + t7^2)/k, >> t7*z1 + z3 + z4 == 2*H + (t7^2)/k, >> w1 + t6*z1 + z3 == (t6^2)/k + w1 + w2, >> w1 == w2 + ((t1 - t2)*(t1 + t2 - k*z2))/k, >> w2 + t5*z1 + z3 == (t5^2)/k + w1 + w2, >> w2 == (-t1^2)/k + t1*z2 + z4, z1 == 2*t4/k + v2, z2 == 0}, {H, t1, >> t2, t3, t4, t5, t6, t7, v2, w1, >> w2, z1, z2, z3, z4}, Reals, Backsubstitution -> True] >> >> (For trying with FindInstance, add variable "k" to list of >> variables, and of course, remove "Backsubstitution -> True" option) >> >> Solutions that must have been found: >> t1 = ((48 * k - 625)/10), >> t2 = ((48 * k + 625)/10), >> t3 = ((48 * k + 10625)/10), >> v2 = ((48 * k^2 + 10625 * k)/20), >> w1 = ((9600 * k + 1125000)/k), >> w2 = ((10800 * k + 1125000)/k), >> z2 = 0, >> H= z4 = ((2304 * k^2 + 1020000 * k + 112890625)/(100 * k)) >> > >

**References**:**Re: "Reduce" wierdness (or too slow?)***From:*TuesdayShopping <TuesdayShopping@yahoo.com>

**Re: "Reduce" wierdness (or too slow?)***From:*Andrzej Kozlowski <akoz@mimuw.edu.pl>