Re: anything faster than Solve[] for solving sets of polynomial equations symbolically?
- To: mathgroup at smc.vnet.net
- Subject: [mg118594] Re: anything faster than Solve[] for solving sets of polynomial equations symbolically?
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Wed, 4 May 2011 06:32:13 -0400 (EDT)
dantimatter wrote: > Hi Everyone, > > I've got a set of equations and I'd really like to determine the number of real solutions in terms of the unspecified parameters. The equations are: > > eqs = {-k5 x1 x3+k6 x4==0, k1 x1-k4 x2-2 k2 x2^2+2 k3 x3+k7 x4==0, k2 x2^2-k3 x3-k5 x1 x3+k6 x4==0,x1+x4-Xtot==0}; > > where x1, x2, x3, and x4 are the variables I'd like to solve for and k1, k2, k3, k4, k5, k6, k7, and Xtot are real numbers that are greater than or equal to zero. I've tried doing > > Solve[eqs, {x1, x2, x3, x4}, Reals] > > but after days and days I still have no solution. Perhaps there's a faster or better way to do this? > > Thanks, > Dan > This sort of thing is, in general, a hard problem. One way to get a start on it would be to eliminate three of the variables, and solve for the last one. It will give an upper bound at least on the number of real solutions, and provide some hints as to what parameter expressions might need closer inspection. polys = {-(k5*x1*x3) + k6*x4, k1*x1 - k4*x2 - 2*k2*x2^2 + 2*k3*x3 + k7*x4, k2*x2^2 - k3*x3 - k5*x1*x3 + k6*x4, x1 + x4 - Xtot}; gb = GroebnerBasis[polys, {x1}, {x2, x3, x4}, CoefficientDomain->RationalFunctions]; InputForm[Solve[gb[[1]]==0, x1, Cubics->False]] Out[20]//InputForm= {{x1 -> Root[-(k3*k4^2*k6*Xtot) + (k3*k4^2*k6 + k2*k5*k7^2*Xtot^2)*#1 + (2*k1*k2*k5*k7*Xtot - 2*k2*k5*k7^2*Xtot)*#1^2 + (k1^2*k2*k5 - 2*k1*k2*k5*k7 + k2*k5*k7^2)*#1^3 & , 1]}, {x1 -> Root[-(k3*k4^2*k6*Xtot) + (k3*k4^2*k6 + k2*k5*k7^2*Xtot^2)*#1 + (2*k1*k2*k5*k7*Xtot - 2*k2*k5*k7^2*Xtot)*#1^2 + (k1^2*k2*k5 - 2*k1*k2*k5*k7 + k2*k5*k7^2)*#1^3 & , 2]}, {x1 -> Root[-(k3*k4^2*k6*Xtot) + (k3*k4^2*k6 + k2*k5*k7^2*Xtot^2)*#1 + (2*k1*k2*k5*k7*Xtot - 2*k2*k5*k7^2*Xtot)*#1^2 + (k1^2*k2*k5 - 2*k1*k2*k5*k7 + k2*k5*k7^2)*#1^3 & , 3]}} So we have one or three real solutions. Moreover you can see the coefficients as expressions in the parameters (actually you get this already from gb[[1]]). Possibly Resolve or Reduce could be used to determine parameter settings that will give one vs. three real solutions. Daniel Lichtblau Wolfram Research