Control Systems Lab 3
Control Systems Lab 3
CPE325
Lab 03
Registration
CIIT/FA19-BCE-022/ISB
Number
Class BCE-6A
Determine the transfer function relating the capacitor voltage,V c (s) to the input voltage, V (s).
1 4
Use L= H , R=1 Ω , C= F .
4 3
Transfer Function Calculations :
In-Lab Tasks
Task 1:
Find and plot response of the system in prelab task using MATLAB commands for the
following Inputs
i. Unit Step
ii. Unit Impulse
iii. Ramp
iv. Sinusoidal
Hint: use the following commands
a. tf(num, den)
b. step(sys)
c. impulse(sys)
d. lsim (sys, u, t)
Unit Step :
clc
clear all
close all
syms s
t = 0:0.01:10;
num = [3];
den = [1 4 3];
x = tf(num,den)
h = step(x,t)
plot(h,'Linewidth',2)
xlabel('x-axis')
ylabel('y-axis')
legend( 'Step Response')
Unit Impulse:
clc
clear all
close all
syms s
t = 0:0.01:10;
num = [3];
den = [1 4 3];
x = tf(num,den)
i = impulse(x,t)
plot(i,'Linewidth',2)
xlabel('x-axis')
ylabel('y-axis')
legend('impulse Response')
Ramp:
clc
clear all
close all
syms s
t = 0:0.01:10;
num = [3];
den = [1 4 3];
x = tf(num,den)
ramp= t;
u = ramp
q = lsim(x,u,t)
plot(q,'Linewidth',2)
xlabel('x-axis')
ylabel('y-axis')
legend('Ramp Response')
Sinusoidal:
clc
clear all
close all
syms s
t = 0:0.01:10;
num = [3];
den = [1 4 3];
x = tf(num,den)
w = sin(t)
y = lsim(x,w,t)
plot(y,'Linewidth',2)
xlabel('x-axis')
ylabel('y-axis')
legend('SinuSignal')
Task 2:
Code:
i. Unit Step
ii. Unit Impulse
iii. Ramp
iv. Sinusoidal
Task 3:
i. Transfer Function,
ii. Find and plot step and impulse response using MATLAB commands
iii. Implement any one of the systemsin SIMULINK, plot the step and impulse response
iv. Compare the results of part ii and iii.
(a) (b)
(c) (d)
(a) .
(b).
Code of A:
clc
clear all
close all
syms s
num = [-1];
den = [8 4/3 1 0];
a = tf(num,den);
h = step(a);
plot(h,'linewidth',2)
legend('step responce')
Code of B:
clc
clear all
close all
syms s
clc
clear all
close all
syms s
num = [6 0];
den = [8 6 1];
a = tf(num,den);
h = step(a);
plot(h,'linewidth',2)
legend('step responce')
Code of D:
clc
clear all
close all
syms s
clc
clear all
close all
syms s
num = [-1 0 ];
den = [2 2 1];
a = tf(num,den);
h = step(a);
subplot(2,2,1)
plot(h,'linewidth',2)
legend('step responce')
i = impulse(a);
subplot(2,2,2)
plot(i,'linewidth',2)
legend('impulse responce')
t = linspace(0,10,100);
ramp = t*2;
u = ramp;
q = lsim (a, u, t);
subplot(2,2,3)
plot(q,'linewidth',2)
legend('ramp responce')
w = sin(t);
t = lsim (a, w, t);
subplot(2,2,4)
plot(t,'linewidth',2)
legend('sino responce')
Critical Analysis:
In this lab, We learnt about the electrical systems and there responses using both
circuits and Also check the behavior of RLC Circuits. We Analyze the
Performance Viva
Total/15
(10 Marks) (5 Marks )
Performance /6
Results /3
Critical Analysis /1