Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Strategy for overly long computations?

  • To: mathgroup at
  • Subject: [mg35379] Re: Strategy for overly long computations?
  • From: "Rasmus Debitsch" <Debitsch at>
  • Date: Wed, 10 Jul 2002 02:19:49 -0400 (EDT)
  • References: <agbfnf$jf1$>
  • Sender: owner-wri-mathgroup at


while solving the system Mathematica must handle huge terms of symbolic
values (x1, y1, ...).

Using the two step strategy (eliminate and solve), you can improve the
performance by replacing the coefficients of x, y and z in the new equation
by new variables.


x2 y1 z-x1 y2 z+x1 yv z-x2 yv z-x2 y z1+x y2 z1-x yv z1+x2 yv z1+x1 y z2-
    x y1 z2+x yv z2-x1 yv z2-x1 y zv+x2 y zv+x y1 zv-x2 y1 zv-x y2 zv+
    x1 y2 zv==xv (y1 z-y2 z-y z1+y2 z1+y z2-y1 z2)


x2 y1 z-xv (y1-y2) z-x1 y2 z+x1 yv z-x2 yv z-x2 y z1+x y2 z1-x yv z1+x2 yv
  x1 y z2-x y1 z2+x yv z2-x1 yv z2-xv y (-z1+z2)-xv (y2 z1-y1 z2)-x1 y zv+
  x2 y zv+x y1 zv-x2 y1 zv-x y2 zv+x1 y2 zv


      y2 z1-yv z1-y1 z2+yv z2+y1 zv-y2 zv},{{0,1,0},-x2 z1+xv z1+x1 z2-xv
        x1 zv+x2 zv},{{0,0,1},
      x2 y1-xv y1-x1 y2+xv y2+x1 yv-x2 yv},{{0,0,0},-xv y2 z1+x2 yv z1+
        xv y1 z2-x1 yv z2-x2 y1 zv+x1 y2 zv}},{x,y,z}}

elim3 = a1 x + a2 y + a3 z + a4

Solve gives a solution then:

sol = Solve[{elim3 == 0, cn1, cn2}, {x, y, z}]

and you can replace the new symbols:

solc = sol /. {a1 -> coeffs[[1, 1, 2]],
      a2 -> coeffs[[1, 2, 2]],
      a3 -> coeffs[[1, 3, 2]]],
      a4 -> coeffs[[1, 4, 2]]}

You can try to simplify the solution. But using simplify will take a long
time, too.

The code below is not faster, but gives some feedback. This can be used for
a first estimate of the complete processing time.

solx = x /. solc[[]1, 1]];
      If[LeafCount[#] > 100,
        Print["(", LeafCount[#], ") ", Short[#]]
      sols = Simplify[#];
      If[LeafCount[#] > 100,
        Print[" --> (", LeafCount[sols], ") ", Short[sols]]
      ) &,

I don't think, that the solution is of any use. If no miracle happens during
Simplify, the solution will have thousends of term. My suggestion: Use
"real" numbers or try to reformulate the problem.



  • Prev by Date: Re: Sovling integrals: non-algebraic???
  • Next by Date: Simple Recursive Map
  • Previous by thread: RE: Strategy for overly long computations?
  • Next by thread: Re: Strategy for overly long computations?