BEEE2364 Lab 2 - Transfer Function
BEEE2364 Lab 2 - Transfer Function
CONTROL PRINCIPLES
1.
2.
3.
PROGRAMME 2 BERT
SECTION /
GROUP
DATE
1.
NAME OF
INSTRUCTOR(S)
2.
Page 1 of 7
Rev Date Author(s) Description
.
No.
4.0 16 NOV Ts. Dr. Hafez Sarkawi 1. Update new faculty name.
2023 2. Revised the procedures.
Page 2 of 7
1.0 OBJECTIVES
To find a mathematical model, called a transfer function, for a linear time-invariant system of
electrical system using MATLAB.
2.0 EQUIPMENT/COMPONENTS
i) Computer
ii) MATLAB Software
Through this experiment, student will apply transfer function for an electrical system. Student
needs to derive out the equivalent transfer function from the physical system given.
Then, the student will attempt the similar procedures using MATLAB.
Example 1
Given an electrical network as shown in Figure 1, find the equivalent transfer function for that system.
I 1 ( s) I 2 ( s) V R (s) V R (s)
Find G 1 ( s )= , G 2 ( s )= and G 3 ( s )= . Find for the given parameters: L1=1
V ( s) V ( s) V (s) V (s)
H, L2=1H, C=1F, and R=1Ω.
Figure 1
MATLAB Coding:
syms C R L1 L2 t v(t) vL1(t) vL2(t) vC(t) vR(t) i1(t) i2(t) s V I1 I2 tau
vL1(t) = L1 * diff(i1(t));
vC(t) = 1/C * (int(i1(tau), tau, [0 t]) - int(i2(tau), tau, [0 t]));
Loop1_t = v(t) == vL1(t) + vC(t)
vL2(t) = L2 * diff(i2(t));
vR(t) = R * i2(t);
Loop2_t = 0 == -vC(t) + vL2(t) + vR(t)
Loop1_s = laplace(Loop1_t)
Loop2_s = laplace(Loop2_t)
Page 3 of 7
Loop2_s = subs(Loop2_s,[i1(0), i2(0), laplace(v(t), t, s), laplace(i1(t),
t, s), laplace(i2(t), t, s)], [0, 0, V, I1, I2])
pretty(Loop1_s)
pretty(Loop2_s)
L1 = 1; L2 = 1; C = 1; R = 1;
G3 = subs(G3); pretty(G3)
4.0 PROCEDURE
Table 1
Line Details
vL1(t) = L1 * diff(i1(t));
vC(t) = 1/C * (int(i1(tau), tau, [0 t]) - int(i2(tau),
tau, [0 t]));
MATLAB
Loop1_t = v(t) == vL1(t) + vC(t)
Command
vL2(t) = L2 * diff(i2(t));
vR(t) = R * i2(t);
1 Loop2_t = 0 == -vC(t) + vL2(t) + vR(t)
MATLAB
Output
Explanation
MATLAB
Loop1_s = laplace(Loop1_t)
Command Loop2_s = laplace(Loop2_t)
MATLAB
2
Output
Explanation
Page 4 of 7
V, I1, I2])
MATLAB
Output
Explanation
MATLAB
pretty(Loop1_s)
Command pretty(Loop2_s)
MATLAB
4
Output
Explanation
MATLAB
[A, b] = equationsToMatrix([Loop1_s, Loop2_s], [I1, I2])
Command
MATLAB
5
Output
Explanation
MATLAB I = inv(A) * b
Command
MATLAB
6
Output
Explanation
7 MATLAB
Output
Explanation
MATLAB
L1 = 1; L2 = 1; C = 1; R = 1;
Command G3 = subs(G3); pretty(G3)
MATLAB
8
Output
Explanation
Page 5 of 7
V C 1( s) V C 2 (s)
3) Using MATLAB coding, find and for the electrical circuit given in Figure 2.
V i (s) V i (s)
Write down your work in Table 2 below.
Figure 2
Table 2
MATLAB Coding MATLAB Output
V C 1( s) V C 2 (s)
4) For each parameter in Table 3, find the transfer function and manually and
V i (s) V i (s)
by using MATLAB and write them in Table 4.
Table 3
L1 C1 L2 C2 R
Parameter (H) (F (H) (F) ()
)
Parameter 1 5 5 6 6 10
Page 6 of 7
Parameter 2 2 2 7 7 5
Table 4
MATLAB Coding MATLAB Output
Transfer
V C 1( s)
function
V i (s)
for Parameter 1
Transfer
V C 2 (s)
function
V i (s)
for Parameter 1
Transfer
V C 1( s)
function
V i (s)
for Parameter 2
Transfer
V C 2 (s)
function
V i (s)
for Parameter 2
Page 7 of 7