0% found this document useful (0 votes)
8 views

Control Systems Lab 3

This document describes a lab report on modeling electrical systems and calculating various responses. It includes tasks on finding transfer functions and plotting step, impulse, ramp and sinusoidal responses of RLC circuits using MATLAB commands and Simulink. Comparisons are made between the results from the two methods.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Control Systems Lab 3

This document describes a lab report on modeling electrical systems and calculating various responses. It includes tasks on finding transfer functions and plotting step, impulse, ramp and sinusoidal responses of RLC circuits using MATLAB commands and Simulink. Comparisons are made between the results from the two methods.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Control Systems

CPE325

Lab 03

Name Waqar Asif

Registration
CIIT/FA19-BCE-022/ISB
Number

Class BCE-6A

Instructor’s Dr. Ali Khaqan


Name
Lab# 3 Modelling of Electrical Systems and to calculate its various
responses
Pre Lab Tasks
Consider an RLC network given in Figure 3.2.

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:

1. Implement the differential equations found in pre lab task in SIMULINK


2. Find Response of the system for following Inputs
i. Unit Step
ii. Unit Impulse
iii. Ramp
iv. Sinusoidal
3. Compare the results obtained in task 1 and task 2.

Code:

i. Unit Step
ii. Unit Impulse

iii. Ramp
iv. Sinusoidal
Task 3:

For the following circuits, Find

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.

Use R L=3 Ω, L=4 H∧C=2 F .

(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

num = [-24 0 0];


den = [24 4 3];
a = tf(num,den);
h = step(a);
plot(h,'linewidth',2)
legend('step responce')
Code of C:

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

num = [-8 0 1];


den = [8 0 2 0];
a = tf(num,den);
h = step(a);
plot(h,'linewidth',2)
legend('step responce')
SimuLink:
Post Lab:
Task:
I2 (s )
Given the network of Figure 3.3, find the transfer function,
. Find and plot response of
V (s )
this system using MATLAB commands for step, impulse, ramp, and sinusoidal inputs.
Assume value of each component equals 1.

Figure 3.3 Two loops network


Calculations:
Code:

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

commands in MATLAB and Simulink. We implement the different functions

such as step response, ramp response, impulse response and sinusoidal

responses. We check the behavior of resistor, Inductor and capacitor in different

circuits and Also check the behavior of RLC Circuits. We Analyze the

calculated results by using MATLAB commands and Simulink.

Performance Viva
Total/15
(10 Marks) (5 Marks )

Performance /6

Results /3

Critical Analysis /1

You might also like