octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Octave-bug-tracker] [bug #63393] [octave forge] (control) Bode plot


From: Doug Stewart
Subject: Re: [Octave-bug-tracker] [bug #63393] [octave forge] (control) Bode plot problem. Different results between MATLAB and Octave.
Date: Thu, 02 Feb 2023 17:49:49 -0000

I looked into this last year, and I found that octave with double precision math is not able to resolve the roots to an accuracy that you would require.
If you start with the roots and make a big polynomial, then factor that polynomial back to the roots, then you will see the problem.

If we sent the original roots directly to the Bode plot code then I believe you would get what you want.
To try this , you could copy the bode.m file and modify it to have the roots that you want and then see how well it plots the frequency response.

One other possibility is to use the symbolic pkg. and use VPA with 50 or more digits of accuracy to prove my point.
 


On Thu, 2 Feb 2023 at 11:19, Luiz Antonio Maccari Jr. <luizmaccari@gmail.com> wrote:
For this specific example. I am trying to plot a system with some resonances. You are correct. The system is unstable. However, Matlab can cope with the frequency response but Octave doesn't.  Could be this the reason?

Atenciosamente,

Luiz Antonio Maccari Jr.



Em qui., 2 de fev. de 2023 às 13:12, Luiz Antonio Maccari Jr. <luizmaccari@gmail.com> escreveu:
Hi Mr. Stewart,

I am doing a robust stability analysis. For my analysis I need to plot the inverse of the closed-loop system and compare it with the frequency response of a multiplicative error. As the closed-loop system has non-minimum phase zeros I am plotting this unstable system.

Best Regards.

Luiz Antonio Maccari Jr.



Em qui., 2 de fev. de 2023 às 11:57, Doug Stewart <doug.dastew@gmail.com> escreveu:
If you do a rlocus plot you will see that you have Right hand Poles and Zeroes.

Why do you want a bode plot of an unstable system?



On Thu, 2 Feb 2023 at 09:13, Luiz Antonio Maccari Junior <INVALID.NOREPLY@gnu.org> wrote:
Follow-up Comment #12, bug #63393 (project octave):

Now I was working again with the bode function an I have realized that the
different behaviour is not only because Matlab reducing the order of the model
or something like that.

Please see the following example:


num =[                   0;
                         0;
     3.297563545330486e-05;
    -6.662437436850499e-05;
    -2.565172417884272e-04;
     1.098159870753534e-03;
    -1.616164103992111e-03;
     1.098654441170365e-03;
    -2.570132570435638e-04;
    -6.641072266842919e-05;
     3.293973876807465e-05;
     1.834542499710346e-11;];

den =[      1.000000000000000e+00;
    -1.079593440596339e+01;
     5.316681632945271e+01;
    -1.576732947973972e+02;
     3.128986175251184e+02;
    -4.363042796274709e+02;
     4.362158752637891e+02;
    -3.127087912934111e+02;
     1.575144575020965e+02;
    -5.309223626372895e+01;
     1.077659943863232e+01;
    -9.978296711173387e-01 ;];

TF = tf(num',den',5e-05)

freq =[1:1:2*pi*0.5/5e-05];
bode(TF,freq)


Results are in image b1.png and a zoom can be seen in b2.png. Matlab result is
in the left and octave result in the right.

As one can notice the "noise" appears only in Octave image. The order of both
results are the same however the octave result shows a lot of numerical
errors.

This type of behaviour for the case high-order systems makes impossible to
correct evaluate the results from octave. Takes from example other system
which I working now the figure b3.png. The results from octave seems to be
completely wrong.

Best Regards.





(file #54298, file #54299, file #54300)

    _______________________________________________________

Additional Item Attachment:

File name: b1.PNG                         Size:65 KB
    <https://file.savannah.gnu.org/file/b1.PNG?file_id=54298>

File name: b3.PNG                         Size:72 KB
    <https://file.savannah.gnu.org/file/b3.PNG?file_id=54299>

File name: b2.PNG                         Size:82 KB
    <https://file.savannah.gnu.org/file/b2.PNG?file_id=54300>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63393>

_______________________________________________
Mensagem enviada pelo Savannah
https://savannah.gnu.org/



--
DASCertificate for 206392



--
DASCertificate for 206392


reply via email to

[Prev in Thread] Current Thread [Next in Thread]