I made some further investigations (I'm writing pzmap.m for control-oo at the 
moment, which needs to compute the zeros of a system) and came to the 
conclusion that tzero.m from the control package is buggy. The attachment 
contains an example where the discrepancy of the results is big: Matlab gets 
-13.2759, -0.0155, 12.5774, while tzero gets -5.708333, -0.015561, 31.509741. 
Apparently the bug has been undiscovered for about 15 (!) years.

The bad thing is that I reused the code from tzero.m in the control-oo package 
...

Regards,
Lukas


Attachment: zerotest.m
Description: Binary data


> Hi Doug, Luca, and Lukas,
> thanks for your responses.
> 
>> I took a look at this and found that If you change the order in 
>> sysmult then you get the correct answer
>> 
>> try
>> sysUNIT = tf(1, 1, 1);
>> sysB1 = tf([8e-9 -5.6e-9], [1 -1], 1);
>> sysB2 = tf([125e6], [1 -1], 1);
>> sysB3 = sysmult(sysB2, sysB1);
>> sysCL2 = feedback(sysUNIT, sysB3);
>> sysout(sysCL2, 'tf');
> 
> yes, changing the order works for me as well :-)
> 
>> I also found that it has something to do with the size of the 
>> numbers
>> What i did is make sysB1 1000 bigger and sysB2 1000 smaller so
>> that the answer is still the same, and now we get the correct
>> answer either way we multiply it.
> 
> Also worked in my octave installation. Thanks!
> 
> It seems to me that the state space representation of all these systems are 
> equivalent, and I get the correct impulse response no matter in which way I 
> created the system and regardless of the result of sysout(..). So I guess the 
> error occurs during the conversion to the transfer function representation.
> 
> Best regards,
> Christian
> 
> 
> 
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Octave-dev mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/octave-dev

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to