Objective: Syntax: Pretty
Objective: Syntax: Pretty
LAB # 04
OBJECTIVE
To solve the signal flow graphs and find transfer function by using MATLAB & Masons Gain
Formula.
THEORY
1.
2.
3.
4.
EXERCISE
Task 01:
For the given signal flow graph, find the value of A & B.
Fig 4.1
Sir Syed University of Engineering & Technology
Electronic Engineering Department
Coding:
syms r e1 e2 e3 e4 g1 g2 g3 g4 c h1 h2 h3
v=solve('e1=r-(h1*e2)-(h3*e4)','e2=(g1*e1)+(c*g4)','e3=(g2*e2)(h2*e4)','e4=e3*g3','c=e4',e1,e2,e3,e4,c);
t.f=v.c/r;
pretty(t.f)
Result:
task4a
g1 g2 g3
-------------------------------------------------------g1 h1 + g3 h2 - g2 g3 g4 + g1 g2 g3 h3 + g1 g3 h1 h2 + 1
Coding:
syms a b
v=solve('a=3-(4*b)','b=(10*a)-8',a,b);
A=v.a;
pretty(A)
B=v.b;
pretty(B)
Sir Syed University of Engineering & Technology
Electronic Engineering Department
Result:
task4b
A=
35/41
B=
22/41
Task 03:
Find C/R using Masons Gain Formula.
Fig 4.3
Coding:
syms g1 g2 g3 g4 g5 g6 h1 h2
m1=g1*g2*g3*g4*g5;
m2=g6*g4*g5;
l1=-(h1*g2);
l2=-(h2*g4);
del1=1;
del2=1-(l1);
del=1-(l1+l2)+(l1*l2);
t=((m1*del1)+(m2*del2))/del;
pretty(t)
Result:
task4c
Sir Syed University of Engineering & Technology
Electronic Engineering Department
Conclusion:
In this lab we learn how to implement the masons gain formula of signal flow
graph and calculate the transfer function in matlab using syms, solve, pretty & transfer function
command
LAB ASSIGNMENT
1.
Find C/R of the given signal flow graph by using MATLAB and also by
hand written as you perform in theory.
Sir Syed University of Engineering & Technology
Electronic Engineering Department
Fig 4.4
2.
Find transfer function of the given signal flow graph by using Masons gain formula.
Fig 4-5