Professional Documents
Culture Documents
Programme
Q2. Design and simulate the RLC circuit given in last lab in M ATLAB with
the following input
Vi(t)=1/2 3/2cos(2t)
Q3. A system has a transfer function
X(s)/R(s)=2.5s+15 / 15s2+3s+15
Find the response of this system if the input is a ramp function with slop equal to 4.
G(s)=C(s)/R(s)
C(s)=G(s) x R(s)
r(t)=delta(t)
R(s)=1
C(s)=G(s) x 1
Putting the value of G(s)
C(s)=1/s2+0.2s+1
We also know that
e-at sin(wt)= w /(s+a)2+w2 =>eq.(a)
adding and subtracting 0.01 in the above equation
C(s)=1/s2+0.2s+1+0.01-0.01
C(s)=1/s2+0.2s+0.01+1-0.01
C(s)=1/s2+2(s2)(0.1)+0.12+(0.99)
And (0.99)1/2=0.9949874371
So C(s) becomes
C(s)=1/(s+0.1)2+(0.9949874371)2
Multiplying and dividing our above equation with
0.9949874371
C(s)=(1.005037815) x
(0.9949874371/
2
2
(s+0.1) +(0.9949874371) )
Using the eq.(a)
c(t) =(1.005037815) x e-0.1t sin(0.9949874371t)
c(t) is our impulse response which is in time domain
Matlab code:%---------------------------% Question#1
%---------------------------% Using builtin command
num=[1]
den=[1 0.2 1]
LTIsys=tf(num,den)
subplot(2,1,1)
impulse(LTIsys)
grid on
% Using manual computation
t=0:0.01:60
y=(1.005037815).*(exp(-0.1.*t).*sin(0.9949874371.*t))
subplot(2,1,2)
plot(t,y)
xlabel('Time(seconds)')
ylabel('Amplitude')
title('Impulse Response using manual computation')
grid on
Results:Impulse Response
1
Amplitude
0.5
0
-0.5
-1
10
20
30
40
50
60
50
60
Time (seconds)
Amplitude
0.5
0
-0.5
-1
10
20
30
Time(seconds)
40
R(s)=Input of system
G(s)=C(s)/R(s)
C(s)=G(s) x R(s)
r(t)=u(t)
R(s)=1/s
C(s)=G(s) x 1/s
Putting the value of G(s)
C(s)=(s/s2+0.2s+1) x (1/s)
C(s)=(1/s2+0.2s+1)
We also know that
e-at sin(wt)= w /(s+a)2+w2 =>eq.(a)
adding and subtracting 0.01 in the above equation
C(s)=1/s2+0.2s+1+0.01-0.01
C(s)=1/s2+0.2s+0.01+1-0.01
C(s)=1/s2+2(s2)(0.1)+0.12+(0.99)
And (0.99)1/2=0.9949874371
So C(s) becomes
C(s)=1/(s+0.1)2+(0.9949874371)2
Multiplying and dividing our above equation with
0.9949874371
C(s)=(1.005037815) x
(0.9949874371/
(s+0.1)2+(0.9949874371)2)
Using the eq.(a)
c(t) =(1.005037815) x e-0.1t sin(0.9949874371t)
c(t) is our step response which is in time domain
Matlab code:%---------------------------% Question#2
%---------------------------% Using builtin command
num=[0 1 0]
den=[1 0.2 1]
LTIsys=tf(num,den)
subplot(2,1,1)
step(LTIsys)
grid on
% Using manual computation
t=0:0.01:60
y=(1.005037815).*(exp(-0.1.*t).*sin(0.9949874371.*t))
subplot(2,1,2)
plot(t,y)
xlabel('Time(seconds)')
ylabel('Amplitude')
title('Step Response using manual computation')
grid on
Results:Step Response
1
Amplitude
0.5
0
-0.5
-1
10
20
30
40
50
60
50
60
Time (seconds)
Amplitude
0.5
0
-0.5
-1
10
20
30
Time(seconds)
40
Q2(ans.):-
Results:-
1.5
Amplitude
0.5
-0.5
-1
20
40
60
80
100
120
Time (seconds)
t=0:0.01:120;
num=[0 0 0 10 60]
den=[15 3 15 0 0]
LTIsys=tf(num,den)
% When input is a ramp with slope 4
r_t=4.*t;
lsim(LTIsys,r_t,t)
grid on
Results:6
x 10
4.5
4
3.5
Amplitude
3
2.5
2
1.5
1
0.5
0
20
40
60
Time (seconds)
80
100
120