help-octave
[Top][All Lists]

## Re: Does dlyap (control package) works?

 From: Hernán J . González Subject: Re: Does dlyap (control package) works? Date: Thu, 8 Dec 2016 00:02:49 -0300

On Wed, Dec 7, 2016 at 11:52 PM, Nicholas Jankowski wrote:
On Wed, Dec 7, 2016 at 5:31 PM, Hernán J. González wrote:
I'm not sure if I'm missing something stupid.

My issue is with dlyap function from "control" package

dlyap(C,D)

is supposed to solve

C*X*C' + D = X

but it does not seem to work for me:

p=0.3, q=1-p;
C=[ q p 0 ;  q 0 p ; q 0 0];
D = [0 0 0; 0 0 0 ; p p p];

X1=dlyap(C,D)
0.034394   0.029959   0.023144
0.029959   0.055090   0.021713
0.023144   0.021713   0.316853

C*X1*C'+D

0.034394   0.029959   0.023144
0.029959   0.055090   0.021713
0.323144   0.321713   0.316853

See the discrepancy in the last row.

The correct solution seems to be

A =
0.50518   0.47078   0.36057
0.53824   0.50828   0.38328
0.64640   0.62326   0.54754

I'm using :
GNU Octave Version: 4.0.2
Operating System: MINGW32_NT-6.1 Windows 7 Service Pack 1 i686
package control 3.0.0

_______________________________________________
Help-octave mailing list
https://lists.gnu.org/mailman/listinfo/help-octave

I can confirm the same results using Octave 4.2.0 on Windows 7, 64-bit and control 3.0.0

I don't know the purpose of the function, but it definitely falls under the matlab-incompatible category:

Matlab 2016b:

>> p=0.3, q=1-p;
p =
0.3000
>> C=[ q p 0 ;  q 0 p ; q 0 0];
>> D = [0 0 0; 0 0 0 ; p p p];
>> X1=dlyap(C,D)
X1 =
0.5052    0.4708    0.3606
0.5382    0.5083    0.3833
0.6464    0.6232    0.5475
>> C*X1*C'+D
ans =
0.5052    0.4708    0.3606
0.5382    0.5083    0.3833
0.6464    0.6232    0.5475

unless someone can explain why not, this appears to be something that could be filed as a bug at bugs.octave.org.  Hernan, would you mind doing so?

--
Hernán J. González
Buenos Aires, Argentina