Hello Lukas I appreciate your quick reply and I a apologize for the delay in my response. It took me some time to compile octave. Usually I makes use of debian binaries.
a. Relating the results you attached, they seems to me erroneous. I compared the stable eigenvalues of the Hamiltonian: S = Bum*(R\Bum'); H = [Am -S; -Qm -Am']; lambda1 = eig(H) and the eigenvalues of the closed loop system, according to the 'Km' you attached: lambda2 = eig(Am - Bum*Km); and they differ. b. I downloaded octave 3.6.2 source and lapack 3.4.1 from netlib and compiled them. It didn't helped. It gives the following: octave:33> [Km riccPm] = lqr(Am,Bum,Qm,R); error: are: 4: after reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the (generalized) Schur form no longer satisfy the stability condition; this could also be caused due to scaling error: called from: error: /home/ido/octave/control-2.3.51/care.m at line 162, column 15 error: /home/ido/octave/control-2.3.51/lqr.m at line 95, column 16 octave:33> [Km riccPm] = lqr(Am,Bum,Qm,R*3); error: are: 5: the computed dimension of the solution does not equal N error: called from: error: /home/ido/octave/control-2.3.51/care.m at line 162, column 15 error: /home/ido/octave/control-2.3.51/lqr.m at line 95, column 16 octave:33> Ido -----Original Message----- From: Lukas Reichlin <lukas.reichlin.li...@gmail.com> To: Ido Halperin <idoh...@gmail.com> Cc: octave-dev@lists.sourceforge.net Subject: Re: [OctDev] problem in solving CARE (continuos algebraic Riccati's equation) for large model Date: Fri, 15 Jun 2012 12:44:05 +0200 On 15.06.2012, at 11:52, Ido Halperin wrote: > I have been trying to design an LQR for a large LTI state space model > (almost 800 states). I used the code: > > [Km riccPm] = lqr(Am,Bum,Qm,R); > > but I got the error: > > error: are: 5: the computed dimension of the solution does not equal N > error: called from: > error: /usr/share/octave/packages/control-2.3.50/care.m at line 162, > column 15 > error: /usr/share/octave/packages/control-2.3.50/lqr.m at line 95, > column 16 > > Using the same code and matrices (though on different computer) ended > without errors in MATLAB 7.9.0. > > I attached the matrices Am,Bum,Qm and R in the attached 'mat' file. > It seems to have something to do with the routine used for solving the > algebraic Riccati's equation - SB02OD, from the SLICOT library. > > Octave version is 3.6.2 > Additional packages are: > > Package Name | Version | > ----------------+---------+ > communications *| 1.1.1 | > control *| 2.3.50 | > general *| 1.3.1 | > gsl *| 1.0.8 | > image *| 1.0.15 | > io *| 1.0.18 | > java *| 1.2.8 | > linear-algebra *| 2.2.0 | > miscellaneous *| 1.1.0 | > odepkg *| 0.8.2 | > optim *| 1.1.0 | > plot *| 1.1.0 | > signal *| 1.1.3 | > specfun *| 1.1.0 | > splines *| 1.0.7 | > struct *| 1.0.10 | > symbolic *| 1.1.0 | > > the operation system is Debian linux, kernel 3.2.0-2-amd64. > > > I appreciate your help > > Sincerely > Ido > <dat1.mat>-------------------------------------------------- Hi Ido It looks like your BLAS/LAPACK library (most probably ATLAS) is the culprit. First I tested your example with Framework Accelerate of Mac OS X: octave:1> IdoHalperin.m error: invalid call to script /Users/lukas/Desktop/IdoHalperin/IdoHalperin.m octave:1> IdoHalperin error: are: 4: after reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the (generalized) Schur form no longer satisfy the stability condition; this could also be caused due to scaling error: called from: error: /Users/lukas/control/inst/care.m at line 162, column 15 error: /Users/lukas/control/inst/lqr.m at line 95, column 16 error: /Users/lukas/Desktop/IdoHalperin/IdoHalperin.m at line 2, column 15 octave:1> Then I used Reference BLAS/LAPACK from Netlib [1] and it seems to work. Please find Km and riccPm in the attached mat-file. Do the results meet your expectations? You can try to build Octave with Reference BLAS/LAPACK. Note that the SLICOT authors recommend using Reference BLAS/LAPACK. A few weeks ago, I experienced similar problems when I tested some upcoming system identification functions, the problems disappeared when I switched from ATLAS to Reference BLAS/LAPACK. Best regards, Lukas [1] http://www.netlib.org/lapack/ ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev