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

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

[Octave-bug-tracker] [bug #56560] [octave forge] (control) Error by addi


From: Jonas Frischknecht
Subject: [Octave-bug-tracker] [bug #56560] [octave forge] (control) Error by addition of two frd objects
Date: Fri, 28 Jun 2019 06:26:50 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36

Follow-up Comment #11, bug #56560 (project octave):

Sure. Here you go

% System to simulate measured vectors
Example_System = tf([1 10],[1 0.56 12]);
[Mag, Pha, W] = bode(Example_System);
% sampling time
Ts = 1e-3;
Tn = 1;
% Calculate complex response
for k=1:length(W)
   cmpl(k,1) = 10^(Mag(k)/20)*(cosd(Pha(k))+1i*sind(Pha(k)));
end
% Generate frd object
P = frd(cmpl,W,Ts);
% Controller
C = c2d(tf([Tn 1],[Tn 0]),Ts,'tustin');
% Calculate closed loop
OpLo = P*C;
T = OpLo/(1 + OpLo);
% plot bode
figure(1)
bode(P,C,OpLo,T)


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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