'eigenvectors' failed..



Datum: Tue, 03 Apr 2007 15:28:09 +0100
Von: "Jaime E. Villate" <villate at fe.up.pt>
Betreff: Re: [Maxima] \'eigenvectors\' failed..


> I've also run across that problem in the past, even with much
> simpler 2x2 matrices, and I find it annoying. To see where the
> problem is originating, consider the following example:
> 
> (%i1) eq1:[1.41*x+1.73*y,   2.1*1.41*x+2.1*1.73*y]$
> 
> (%i2) eq2:[1.414*x+1.732*y, 2.1*1.414*x+2.1*1.732*y]$
> 
> (%i3) eq3:[1.414*x+1.732*y, 2.1*(1.414*x+1.732*y)]$
> 
> Equations eq1 and eq2 are different, but one would expect
> that the degree of computing difficulty would be similar
> for both. On the other hand, eq2 and eq3 are identical.
> Now look at the results of solving the systems with algsys:
> 
> (%i4) algsys(eq1,[x,y]);
> 
> (%o4) [[x = %r4,y = -141*%r4/173]]
> 
> (%i5) algsys(eq2,[x,y]);
> 
> (%o5) [[x = 0,y = 0]]
> 
> (%i6) algsys(eq3,[x,y]);
> 
> (%o6) [[x = %r2,y = -707*%r2/866]]
> 
> algsys fails to find all the solutions to such a simple system
> as eq2. 

hi
i don't think that one should expect to get the same solutins for equations eq2 and eq3. these equations have floating point coefficients and are numerically very instable. Espacially I am not surprised that the solution of the second equation is [[x = 0,y = 0]], but I am rather surpised about the solutions of eq1 and eq3. I don't know what algsys is doing. but if I use solve instead of algsys I also get the solution [[x = 0,y = 0]] and I see why:

(%i18) solve(eq2,[x,y]);
`rat' replaced 1.414 by 707/500 = 1.414

`rat' replaced 1.732 by 433/250 = 1.732

`rat' replaced 2.9694 by 12421/4183 = 2.969399952187426

`rat' replaced 3.6372 by 9093/2500 = 3.6372
(%o18) 			       [[x = 0, y = 0]]

The determinant of the rationalized system is !=0 and therefore the solution is [[x = 0, y = 0]]. If I want rational equations and exact solutions I must input

(%i19) eq5:[1414/1000*x+1732/1000*y, 21/10*1414/1000*x+21/10*1732/1000*y];
			433 y   707 x  9093 y   14847 x
(%o19) 		       [----- + -----, ------ + -------]
			 250	 500    2500	 5000
(%i20) solve(eq5,[x,y]);
Dependent equations eliminated:  (2)
				  866 %r9
(%o20) 			  [[x = - -------, y = %r9]]
				    707


if I solve eq1 and eq2 with octave I get:

octave:5> [1.414, 1.732; 2.1*1.414, 2.1*1.732] \ [0; 0]
warning: matrix singular to machine precision, rcond = 9.73848e-18
warning: attempting to find minimum norm solution
ans =

  0
  0

octave:6> [1.41, 1.73; 2.1*1.41, 2.1*1.73] \ [0; 0]
warning: matrix singular to machine precision, rcond = 6.27292e-18
warning: attempting to find minimum norm solution
ans =

  0
  0

mfg guenter


-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail