[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #62186] [Octave Forge](Control) 'bode' produce
From: |
Torsten Lilge |
Subject: |
[Octave-bug-tracker] [bug #62186] [Octave Forge](Control) 'bode' produces plots with inappropriate frequency ranges |
Date: |
Thu, 17 Mar 2022 15:51:27 -0400 (EDT) |
Update of bug #62186 (project octave):
Operating System: Microsoft Windows => Any
Summary: Function 'bode' produces possibly correct but
mis-presented result => [Octave Forge](Control) 'bode' produces plots with
inappropriate frequency ranges
_______________________________________________________
Follow-up Comment #1:
Thank you for the report. I think the cause for this behavior is that, due to
numerical issues, the zeros of system(3,1) are not located at the origin of
the complex plane but at
-7.8505e-16 + 5.6037e-08i
-7.8505e-16 - 5.6037e-08i
which causes bode() to compute a strange frequency range in order to include
these zeros.
Please find below a patch for __frequency_vector__.m, which can be edited by
"edit __frequency_vector__":
@@ -138,8 +138,8 @@
endif
else
## continuous
- iip = find (abs(pol) > norm(pol)*eps);
- iiz = find (abs(zer) > norm(zer)*eps);
+ iip = find ((abs(pol) > eps) && (abs(pol) > norm(pol)*eps));
+ iiz = find ((abs(zer) > eps) && (abs(zer) > norm(zer)*eps));
if (! isempty (zer))
czer = zer(iiz);
With this patch applied, zeros and poles are included in the frequency range
if they are relevant relative to the norm of the vector of all zeros and poles
resp. *and*, which is new, if the zeros and poles are absolutely relevant,
too. I am not yet totally sure if there might be unwanted side effects in
other cases.
cc-ing Doug since he is currently working on a bug related to the bode
function, too.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62186>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/