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

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

[Octave-bug-tracker] [bug #60155] Incorrect result on "step()" function


From: Henrique José Avelar
Subject: [Octave-bug-tracker] [bug #60155] Incorrect result on "step()" function when plotting the continuous and discrete step responses
Date: Tue, 2 Mar 2021 07:58:39 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36 Edg/88.0.705.81

URL:
  <https://savannah.gnu.org/bugs/?60155>

                 Summary: Incorrect result on "step()" function when plotting
the continuous and discrete step responses
                 Project: GNU Octave
            Submitted by: hjavelar
            Submitted on: Ter 02 Mar 2021 12:58:37 UTC
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Henrique José Avelar
        Originator Email: 
             Open/Closed: Open
                 Release: 5.2.0
         Discussion Lock: Any
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

% BUG: Incorrect result on "step()" function on the "control" package:
%   when plotting the continuous and discrete step responses, 
%   with the 'zoh', both plots need to match in common points
%   but they didn't with some sample periods.
%
% I found the problem in the following commands:
clear all
pkg load control
Gs=tf(1000,[1 20 10000])
figure(1); T=0.063148; Gz=c2d(Gs,T); step(Gs,Gz); %Plots don't match
figure(2); T=0.06314 ; Gz=c2d(Gs,T); step(Gs,Gz); %Plots don't match
figure(3); T=0.0631  ; Gz=c2d(Gs,T); step(Gs,Gz); %Plots don't match
figure(4); T=0.06    ; Gz=c2d(Gs,T); step(Gs,Gz); %Plots match
figure(5); T=0.05    ; Gz=c2d(Gs,T); step(Gs,Gz); %Plots match
%
pause;
%
% Even when the function is ran separately, the incorrect result is founded:
figure(1); hold off; T=0.063148; Gz=c2d(Gs,T); 
step(Gs); hold on; step(Gz);  % Plots don't match
figure(2); hold off; T=0.06314 ; Gz=c2d(Gs,T); 
step(Gs); hold on; step(Gz);  % Plots don't match
figure(3); hold off; T=0.0631  ; Gz=c2d(Gs,T);
step(Gs); hold on; step(Gz);  % Plots don't match
figure(4); hold off; T=0.06    ; Gz=c2d(Gs,T);
step(Gs); hold on; step(Gz);  % Plots match
figure(5); hold off; T=0.05    ; Gz=c2d(Gs,T);
step(Gs); hold on; step(Gz);  % Plots match
%
% It's also strange that the last plot (no matter how many) uses only one
color (blue) and the legend only shows Gz. 
% In the previous figures the legend shows Gs (red) and Gz (blue).




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Ter 02 Mar 2021 12:58:37 UTC  Name: bug_in_step_function.m  Size: 3KiB  
By: hjavelar

<http://savannah.gnu.org/bugs/download.php?file_id=50969>

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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