       Re: Solve's Strange Output

• To: mathgroup at smc.vnet.net
• Subject: [mg89094] Re: Solve's Strange Output
• From: DrMajorBob <drmajorbob at att.net>
• Date: Sun, 25 May 2008 06:26:39 -0400 (EDT)
• References: <23447542.1211696555486.JavaMail.root@m08>

```Bruce,

It's an artifact of using algebraic methods on machine precision numbers.

Here's a rationalized alternative:

{x, y} = Rationalize at {10.5, 6.08};
{x, y} = Rationalize at {3.23, 14.4};
{x, y} = Rationalize@{18, 12.7};
m = Rationalize at 16.1;
soln = Solve[{a + c == 0, b + d == m*g,
d (x - x) == c (y - y),
a (y - y) == b (x - x)}, {a, b, c, d}]

{{a -> -((8778525 g)/1105274), b -> (5023200 g)/552637,
c -> (8778525 g)/1105274, d -> (38742557 g)/5526370}}

N@%

{{a -> -7.9424 g, b -> 9.08951 g, c -> 7.9424 g, d -> 7.01049 g}}

The general (completely algebraic) result has all variables divisible by
g*m:

Clear[m, x, y]
{a, b, c, d}/(g m) /.
First@Solve[{a + c == 0, b + d == m*g,
d (x - x) == c (y - y),
a (y - y) == b (x - x)}, {a, b, c, d}] //
Simplify // Column

-(((x-x) (x-x))/(x (y-y)+x (y-y)+x
(-y+y)))
-(((x-x) (y-y))/(x (y-y)+x (y-y)+x
(-y+y)))
((x-x) (x-x))/(x (y-y)+x (y-y)+x
(-y+y))
((x-x) (y-y))/(x (y-y)+x (y-y)+x
(-y+y))

Bobby

On Sun, 25 May 2008 01:04:20 -0500, Bruce Colletti
<bwcolletti at verizon.net> wrote:

> Re 6.0.2 under WinXP.
>
> This code's output is strange:  what does 0.-7.9424 g mean?  Ditto for
> all values returned by Solve.
>
> Thankx.
>
> Bruce
>
>
> {x,y}={10.5,6.08};
> {x,y}={3.23,14.4};
> {x,y}={18,12.7};
> m=16.1;
>
> Solve[{a+c==0,b+d==m*g,d(x-x)==c(y-y),a(y-y)==b(x-x)},{a,b,c,d}]
>
> Out= {{a->0.-7.9424 g,b->0.+9.08951 g,c->0.+7.9424 g,d->0.+7.01049
> g}}
>
>

--

DrMajorBob at longhorns.com

```

• Prev by Date: Re: Solve's Strange Output
• Next by Date: Re: "Reduce" wierdness (or too slow?)
• Previous by thread: Re: Re: Solve's Strange Output
• Next by thread: NDSolve limits