Clear Filters
Clear Filters

Why are G1 and G2 outputs different?

3 views (last 30 days)
宏伟 张
宏伟 张 on 29 Apr 2024
Answered: 宏伟 张 on 29 Apr 2024
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)

Answers (2)

VBBV
VBBV on 29 Apr 2024
Edited: VBBV on 29 Apr 2024
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.
  1 Comment
宏伟 张
宏伟 张 on 29 Apr 2024
Thanks,"Gbot3=(z*Grc-Grc+kc*Grc*Ts)/(z-1+Ts*Grc)" is correct!

Sign in to comment.


宏伟 张
宏伟 张 on 29 Apr 2024
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)

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!