Re: Strategy for overly long computations?
- To: mathgroup at smc.vnet.net
- Subject: [mg35451] Re: Strategy for overly long computations?
- From: Peter <petsie at arcor.de>
- Date: Sat, 13 Jul 2002 03:48:23 -0400 (EDT)
- References: <agbfnf$jf1$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Peter S. Shenkin wrote: > Hi, > > I'm trying to solve a set of 5 eqns in 5 unknowns, three of which > are quadratic and two of which are linear. I'm only interested > in three of the unknowns, so first I eliminate the other two. <snip> > cn1 = ( x - x1 )^2 + ( y - y1 )^2 + ( z - z1 )^2 == r1^2 > cn2 = ( x - x2 )^2 + ( y - y2 )^2 + ( z - z2 )^2 == r2^2 > lgrx = ( x - xv ) + lm1 * ( x - x1 ) + lm2 * ( x - x2 ) == 0 > lgry = ( y - yv ) + lm1 * ( y - y1 ) + lm2 * ( y - y2 ) == 0 > lgrz = ( z - zv ) + lm1 * ( z - z1 ) + lm2 * ( z - z2 ) == 0 > > lgrxyz = { lgrx, lgry, lgrz } <snap> > > -P. > > -- > > work: shenkin at schrodinger.com = 100% > play: shenkin at mindspring.com = 0% > Peter S. Shenkin = Dull boy > > -- > Hi Peter, Rasmus gave some valuable hints, but another possibility is to reduce the number of parameters. If applicable to your problem, make your coordinates be simpler. You could let the origin be the center of your 1st sphere and put the center of the second one onto the x-axis: Solve[Flatten[{lgrxyz,cn1,cn2}/.Thread[Rule[{x1,y1,z1,y2,z2},0]]], {x,y,z},{lm1,lm2}] gives a quick answer (0.56 seconds on my `silly`con box). Regards, Peter -- mailto:petsie at arcor.de | mailto:peter.pein at gmx.de >> Quidquid latine dictum sit, audit viditur. << ^^øøøø.øøøøøøø.^øøøøøøøøø^^^^^^øøø---------------