|
View:
New views
9 Messages
—
Rating Filter:
Alert me
|
|
|
Discrete feedback loopHi,
I have tried to create a discrete feedback system with the control package (1.0.11 with octave 3.0.1), but got unexpected results. I create the system with: sysUNIT = tf(1, 1, 1); sysB1 = tf([8e-9 -5.6e-9], [1 -1], 1); sysB2 = tf([125e6], [1 -1], 1); sysB3 = sysmult(sysB1, sysB2); sysCL2 = feedback(sysUNIT, sysB3); sysout(sysCL2, 'tf'); The resulting transfer function is 1*z^2 - 2*z^1 + 0.20215 ----------------------- 1*z^2 - 1*z^1 + 0.3 However, the correct result should be 1*z^2 - 2*z^1 + 1 ----------------------- 1*z^2 - 1*z^1 + 0.3 When I do not use the sysmult function but do the multiplication of sysB1 and sysB2 by myself, I get the correct result: sysA1 = tf([1 -.7], [1 -2 1], 1); sysCL = feedback(sysUNIT, sysA1); sysout(sysCL, 'tf'); 1*z^2 - 2*z^1 + 1 ------------------- 1*z^2 - 1*z^1 + 0.3 Am I doing something wrong here? Do you get the same results? I got several warnings from the sysgroup command during the execution of this script, e.g. warning: sysgroup: changed output name 2 to y_1_2 should I take these serious? Thank you, 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 Octave-dev@... https://lists.sourceforge.net/lists/listinfo/octave-dev |
|
|
Re: Discrete feedback loopHi Christian, thanks for your report.
No, you're not ;-) I'm using Octave 3.2.3 and control-1.0.17 (get it from and I get transfer function form: 1*z^2 - 2*z^1 + 0.15744 ----------------------- 1*z^2 - 1*z^1 + 0.3 which is obviously wrong.
BTW: I'm currently developing a new control package which is object-oriented and offers better Matlab compatibility. It delivers the expected results for your calculations, doesn't convert to state-space and doesn't show such warnings :-) However, it is not ready for daily use because it lacks important features like bode or step. If you're interested, take a look at Please note that I'm just an engineering student and I do this in my free time. Let me know if you have further questions. Regards, Lukas
------------------------------------------------------------------------------ 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 Octave-dev@... https://lists.sourceforge.net/lists/listinfo/octave-dev |
|
|
Re: Discrete feedback loopHi Christian.
Sorry for not replying to your email in previous days. I had lost it. I don't know if I'll be able to fix this (both because of lack of time and knowledge), but I hope at least to add your example as a (failing) test case somewhere. Added to my TODO list :) . Thanks for your report, Luca Favatella On 20/10/2009, Lukas Reichlin <lukas.reichlin@...> wrote: > Hi Christian, thanks for your report. > >> Hi, >> I have tried to create a discrete feedback system with the control >> package (1.0.11 with octave 3.0.1), but got unexpected results. [...] ------------------------------------------------------------------------------ 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 Octave-dev@... https://lists.sourceforge.net/lists/listinfo/octave-dev |
|
|
Re: Discrete feedback loopFrom: lukas.reichlin@... To: christian.riesch@...; octave-dev@... Date: Tue, 20 Oct 2009 13:43:14 +0200 Subject: Re: [OctDev] Discrete feedback loop Hi Christian, thanks for your report.
No, you're not ;-) I'm using Octave 3.2.3 and control-1.0.17 (get it from and I get transfer function form: 1*z^2 - 2*z^1 + 0.15744 ----------------------- 1*z^2 - 1*z^1 + 0.3 which is obviously wrong.
BTW: I'm currently developing a new control package which is object-oriented and offers better Matlab compatibility. It delivers the expected results for your calculations, doesn't convert to state-space and doesn't show such warnings :-) However, it is not ready for daily use because it lacks important features like bode or step. If you're interested, take a look at Please note that I'm just an engineering student and I do this in my free time. Let me know if you have further questions. Regards, Lukas
------------------------------------------------------------------------------ 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 Octave-dev@... https://lists.sourceforge.net/lists/listinfo/octave-dev |
|
|
Re: Discrete feedback loopHi 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 Octave-dev@... https://lists.sourceforge.net/lists/listinfo/octave-dev |
|
|
Bugs in control/tzero function (was Re: Discrete feedback loop)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 > 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 > Octave-dev@... > 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 Octave-dev@... https://lists.sourceforge.net/lists/listinfo/octave-dev |
|
|
Re: Bugs in control/tzero function (was Re: Discrete feedback loop)> From: lukas.reichlin@... > Date: Tue, 10 Nov 2009 09:41:52 +0100 > To: christian.riesch@...; octave-dev@... > Subject: [OctDev] Bugs in control/tzero function (was Re: Discrete feedback loop) > > 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 > > try using tzero2, it works for me on your example. What the difference is I don't know. Doug Stewart ------------------------------------------------------------------------------ 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 Octave-dev@... https://lists.sourceforge.net/lists/listinfo/octave-dev |
|
|
Re: Bugs in control/tzero function (was Re: Discrete feedback loop)On 10.11.2009, at 20:32, <dastew@...> <dastew@...> wrote:
Hi Doug, That's strange. I tried tzero2 on my PPC- as well as on my Intel-Mac and I get -1 -1 -1 -1 -1 -10 That's even worse than tzero, because tzero got at least one out of three zeros right ;-) Regards Lukas ------------------------------------------------------------------------------ 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 Octave-dev@... https://lists.sourceforge.net/lists/listinfo/octave-dev |
|
|
Re: Bugs in control/tzero function (was Re: Discrete feedback loop)From: lukas.reichlin@... To: dastew@... Date: Tue, 10 Nov 2009 21:19:49 +0100 CC: octave-dev@... Subject: Re: [OctDev] Bugs in control/tzero function (was Re: Discrete feedback loop) On 10.11.2009, at 20:32, <dastew@...> <dastew@...> wrote:
Hi Doug, That's strange. I tried tzero2 on my PPC- as well as on my Intel-Mac and I get -1 -1 -1 -1 -1 -10 That's even worse than tzero, because tzero got at least one out of three zeros right ;-) Regards Lukas
octave-3.0.1:1> tzzero z = -13.275931 12.577369 -0.015526 and tzzero.m is A = [ -0.7 -0.0458 -12.2 0 0 -0.014 -0.2904 -0.562 1 -0.0057 -1.4 0 1 0 0 0 ]; B = [ -19.1 -3.1 -0.0119 -0.0096 -0.14 -0.72 0 0 ]; C = [ 0 0 -1 1 0 0 0.733 0 ]; D = [ 0 0 0.0768 0.1134 ]; sys = ss (A, B, C, D); z = tzero2 (A,B,C,D) % Expected Results from the "Dark Side"%% -13.2759% 12.5774% -0.0155%% Results from tzero.m%% -5.708333% -0.015561% 31.509741 So I don't know why you are getting a different answer. ------------------------------------------------------------------------------ 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 Octave-dev@... https://lists.sourceforge.net/lists/listinfo/octave-dev |
| Free embeddable forum powered by Nabble | Forum Help |