How to add a time delay to a diagonal ss from a reside pole function?
Hi,
I have a list of poles (Ak) and residues(Ck) and one delay (tau) that corresponds to the following function:
I have created a ss representation of the rational function and also calculate the function analytically.
I have compared both functions using a bodeplot and they do not match when the time delay is present but match without it.
Can someone help me to find out how to add the time delay correctly?
% Delay problem
Ak = [-0.0633296088793117 + 0.00000000000000i
-0.188476918974608 + 0.00000000000000i
-0.592850411790702 + 0.00000000000000i];
Ck = [2.67546115276169e-05 + 0.00000000000000i
0.000235105989428637 + 0.00000000000000i
0.00132009482602487 + 0.00000000000000i];
D = 0;
tau = 0.001013802649678;
% Express as diagona form
F_A = eye(size(Ak,1),size(Ak,1)).*Ak;
F_B = ones(size(Ak));
F_C = Ck.’;
F_D = D;
Fss = ss(F_A,F_B,F_C,F_D,’OutputDelay’,tau);
% Analytic function
freq = logspace(-3,6,1000);
w = 2*pi*freq;
f = D;
for i = 1:length(Ak)
f = f + Ck(i)./(1j*w – Ak(i));
end
f = f.* exp(-1j*w.*tau);
Fana = frd(f,w);
% Comparison bode plot
opts = bodeoptions;
opts.FreqUnits = ‘Hz’;
opts.FreqScale = ‘Log’;
opts.MagUnits = ‘abs’;
opts.MagScale = ‘Linear’;
opts.grid = ‘on’;
figure, bodeplot(Fss,Fana,w,opts)
title("Bode plot of H")
legend(‘SS model’, ‘Analitic’)
Thanks and BR,
//JHHi,
I have a list of poles (Ak) and residues(Ck) and one delay (tau) that corresponds to the following function:
I have created a ss representation of the rational function and also calculate the function analytically.
I have compared both functions using a bodeplot and they do not match when the time delay is present but match without it.
Can someone help me to find out how to add the time delay correctly?
% Delay problem
Ak = [-0.0633296088793117 + 0.00000000000000i
-0.188476918974608 + 0.00000000000000i
-0.592850411790702 + 0.00000000000000i];
Ck = [2.67546115276169e-05 + 0.00000000000000i
0.000235105989428637 + 0.00000000000000i
0.00132009482602487 + 0.00000000000000i];
D = 0;
tau = 0.001013802649678;
% Express as diagona form
F_A = eye(size(Ak,1),size(Ak,1)).*Ak;
F_B = ones(size(Ak));
F_C = Ck.’;
F_D = D;
Fss = ss(F_A,F_B,F_C,F_D,’OutputDelay’,tau);
% Analytic function
freq = logspace(-3,6,1000);
w = 2*pi*freq;
f = D;
for i = 1:length(Ak)
f = f + Ck(i)./(1j*w – Ak(i));
end
f = f.* exp(-1j*w.*tau);
Fana = frd(f,w);
% Comparison bode plot
opts = bodeoptions;
opts.FreqUnits = ‘Hz’;
opts.FreqScale = ‘Log’;
opts.MagUnits = ‘abs’;
opts.MagScale = ‘Linear’;
opts.grid = ‘on’;
figure, bodeplot(Fss,Fana,w,opts)
title("Bode plot of H")
legend(‘SS model’, ‘Analitic’)
Thanks and BR,
//JH Hi,
I have a list of poles (Ak) and residues(Ck) and one delay (tau) that corresponds to the following function:
I have created a ss representation of the rational function and also calculate the function analytically.
I have compared both functions using a bodeplot and they do not match when the time delay is present but match without it.
Can someone help me to find out how to add the time delay correctly?
% Delay problem
Ak = [-0.0633296088793117 + 0.00000000000000i
-0.188476918974608 + 0.00000000000000i
-0.592850411790702 + 0.00000000000000i];
Ck = [2.67546115276169e-05 + 0.00000000000000i
0.000235105989428637 + 0.00000000000000i
0.00132009482602487 + 0.00000000000000i];
D = 0;
tau = 0.001013802649678;
% Express as diagona form
F_A = eye(size(Ak,1),size(Ak,1)).*Ak;
F_B = ones(size(Ak));
F_C = Ck.’;
F_D = D;
Fss = ss(F_A,F_B,F_C,F_D,’OutputDelay’,tau);
% Analytic function
freq = logspace(-3,6,1000);
w = 2*pi*freq;
f = D;
for i = 1:length(Ak)
f = f + Ck(i)./(1j*w – Ak(i));
end
f = f.* exp(-1j*w.*tau);
Fana = frd(f,w);
% Comparison bode plot
opts = bodeoptions;
opts.FreqUnits = ‘Hz’;
opts.FreqScale = ‘Log’;
opts.MagUnits = ‘abs’;
opts.MagScale = ‘Linear’;
opts.grid = ‘on’;
figure, bodeplot(Fss,Fana,w,opts)
title("Bode plot of H")
legend(‘SS model’, ‘Analitic’)
Thanks and BR,
//JH state space, delays, bode MATLAB Answers — New Questions