c2d Tustin not matching analytical method
古いコメントを表示
I have a second order lowpass filter. Discrete transter function using c2d with tustin method does not match the analytical solution (see the code below with bode comparison). Analytical solution was obtained by subing s = 2/Ts * (z-1)/(z+1) in continuous transfer function which is apparantly consistent with Matlab c2d tsting option with the difference that the Matlab code is first converting TF to PZK and then fomulating c2d (see reference folders below) which is not an exact match to my fomulation but I did not expect this big of a difference. Thoughts appreciated.
/Applications/MATLAB_R2024b.app/toolbox/shared/controllib/engine/+ltipack/@tfdata/c2d.m % ltipack.tfdata method
/Applications/MATLAB_R2024b.app/toolbox/shared/controllib/engine/+ltipack/@zpkdata/c2d.m % ltipack.zpkdata method
%% Filter Specs
Ts = 0.01;
zeta = 1;
wn_rps = 30 *2*pi;
%% C2D (tustin)
s = tf('s');
tf_cont = wn_rps^2 / (s^2 + 2*zeta*wn_rps*s + wn_rps^2);
tf_disc = c2d(tf_cont, Ts, 'Method','tustin');
%% Analytical (tustin)
% s = 2/Ts * (z-1)/(z+1)
K = 2/Ts;
num = wn_rps^2 * [1 2 1];
den = [ K^2 + 2*zeta*wn_rps*K + wn_rps^2, ...
-2*K^2 + 2*wn_rps^2, ...
K^2 - 2*zeta*wn_rps*K + wn_rps^2 ];
tf_disc_analytical = tf(num, den, Ts);
%% Plot
figure, bode(tf_disc), hold on, bode(tf_disc_analytical)
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Switches and Breakers についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
