Why are G1 and G2 outputs different?

2 次查看(过去 30 天)
clear
clc
Ts=0.0001;
kc=9000;
w0=400*2*pi;
z=tf('z',Ts);
QZ=(0.25+0.5*z^(-1)+0.25*z^(-2));
m=2;
kr=1;
RCZ=(kr*QZ*z^(-199+m)/(1-QZ*z^(-199)));
PI=(w0^2*(Ts*z)/(z-1)+2*w0);
Grc=((1+RCZ)*PI);
U1Y2=((z-1)*Grc)/(z-1+Ts*Grc);
U1Y1=kc*(Grc*Ts)/(z-1+Ts*Grc);
Gbot1=U1Y1+U1Y2
Gbot2=(((z-1)*Grc)+kc*(Grc*Ts))/(z-1+Ts*Grc)

回答(2 个)

VBBV
VBBV 2024-4-29
编辑:VBBV 2024-4-29
The order of mathematical operations in evaluating G1 and G2 are different. In case of G1 , individual terms are evaluated first and then added. In case if G2 , the numerator terms are added first and later divided by common denominator expression. You can try to use simplify function to verify that both results are essentially same.

宏伟 张
宏伟 张 2024-4-29
clear
clc
Ts=0.0001;
kc=9000;
w0=400*2*pi;
z=tf('z',Ts);
QZ=(0.25+0.5*z^(-1)+0.25*z^(-2));
m=2;
kr=1;
RCZ=(kr*QZ*z^(-199+m)/(1-QZ*z^(-199)));
PI=(w0^2*(Ts*z)/(z-1)+2*w0);
Grc=((1+RCZ)*PI);
U1Y2=((z-1)*Grc)/(z-1+Ts*Grc);
U1Y1=kc*(Grc*Ts)/(z-1+Ts*Grc);
Gbot3=(z*Grc-Grc+kc*Grc*Ts)/(z-1+Ts*Grc)

类别

Help CenterFile Exchange 中查找有关 Entering Commands 的更多信息

产品


版本

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by