# Need help on block reduction technique tutorial

Discussion in 'Homework Help' started by xiaoqiang072, Jul 24, 2011.

1. ### xiaoqiang072 Thread Starter New Member

Jul 24, 2011
1
0
I need to prove that the closed loop Transfer function of both box diagram is same using matlab..

here is my coding for 1st diagram
----------------------------------
num1=[1 -1];
den1=[1 2];

num2=[1];
den2=[1 0];

[num3,den3]=feedback(num1,den1,num2,den2);

num4=[1];
den4=[1 0 0];

[num5,den5]=feedback(num3,den3,num4,den4);

num6=[1 1];
den6=[1 -4];

[num7,den7]=feedback(num5,den5,num6,den6);

tf(num7,den7)
---------------------------------------
for 2nd diagram

num1=[1 -1];
den1=[1 2];

num2=[1 2 -3 -4];
den2=[1 -4 0 0];

[num3,den3]=feedback(num1,den1,num2,den2);

tf(num3,den3)
-----------------------------------------

but the result show in matlab promt is different

for coding 1
Transfer function:
s^5 - 5 s^4 + 4 s^3
--------------------------------
2 s^5 - s^4 - 13 s^3 - s^2 + 4 s

for coding 2
Transfer function:
s^4 - 5 s^3 + 4 s^2
----------------------------
2 s^4 - s^3 - 13 s^2 - s + 4

it seems like i got an extra s ~ can i know where is the part i done wrong?? i need help ..thx~

File size:
5.4 KB
Views:
27
File size:
8.8 KB
Views:
31
2. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
For starters, you are using the feedback function wrong. Its syntax is
sys=feedback(sys1,sys2) for negative feedback or
sys=feedback(sys1,sys2) for positive feedback
where sys1 is on the forward branch and sys2 on the feedback loop.

Try this one and come back with your results.

note: I am referring to version 2010b

3. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
Heh, on second look, look if you can simplify the tf on your first coding. Sometimes Matlab results can be deceiving.

Oh, and your method works too.

4. ### kevinarms New Member

Jun 29, 2011
6
2
you could also try using the minreal function to simplify the transfer functions you end up with

5. ### kevinarms New Member

Jun 29, 2011
6
2
I just checked your transfer functions myself and they are equal when you simplify them with the minreal function: if you just do sys1 = tf(num7,den7) and sys2 = tf(num3,den3), then you can do minreal(sys1) and minreal(sys2) and they will be the same.

Another suggestion for syntax is that instead of repeatedly using numerators and denominators separately to represent your transfer functions, you could simply store them as a transfer function. For example, you could do tf1 = tf(num1,den1); tf2 = tf(num2,den2); etc... Then you could do tf3 = feedback(tf1,tf2) (which is the syntax that georacer suggested). In my opinion this just saves some typing and makes things a little bit simpler/clearer, but its really just a matter of preference and what you are comfortable with.