Professional Documents
Culture Documents
ACS PracticalFile IshaVerma PDF
ACS PracticalFile IshaVerma PDF
Practical File
SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENT FOR
THE AWARD OF THE DEGREE OF
BACHELOR OF TECHNOLOGY
(Electrical & Electronics Engineering)
SUBMITTED BY:
Isha Verma
(42113204917)
7th Sem
SUBMITTED TO:
Mrs. Deepali Sharma
DEPARTMENT OF EEE
GURU TEGH BAHADUR INSTITUTE OF TECHNOLOGY
(AFFILIATED TO GURU GOBIND SINGH INDRAPRASTHA UNIVERSITY, DELHI)
NEW DELHI – 110064
NOVEMBER 2020
INDEX
b).
clc;
clear;
close all;
A = [0 1; -2 -3];
B = [0 ; 1];
C = [1 2;0 2];
a= input('enter no. of rows ');
b= input('enter no. of columns ');
for i=1:a
for j=1:b
D(i,j)= input('enter values ');
end
end
D= reshape(D,a,b)
G= ss(A,B,C,D)
x0= [-1;0];
t=0:0.05:10;
initial(G,x0,t)
grid on;
title('step response plot');
xlabel('time t(sec)');
ylabel('output');
Output -
a).
b).
Conclusion - Step response obtained
EXPERIMENT 2
Aim - Conversion of Transfer Function to state model of LTI system and vice
versa.
a. Conversion of state space model to transfer function
b. Conversion of transfer function to state space model
c. Conversion of transfer function to state space model using convolution
d. To find transfer function of given state space model
Software used - MATLAB R2020b
MATLAB Code -
a).
clc;
clear;
close all;
A = [0 1 0; 0 0 1; -1 -5 -3];
B = [0; 5; -10];
C = [1 0 0];
D = [0];
[num, den] = ss2tf(A, B, C, D)
b).
clc;
clear;
close all;
num = [0 0 1 0];
den = [1 12 60 124];
[A, B, C, D] = tf2ss(num, den)
c).
clc;
clear;
close all;
num = [2 8 4];
a = conv([1 0], [1 2]);
den = conv(a, [2 5]);
[A B C D] = tf2ss(num, den)
d).
clc;
clear;
close all;
A = [0 1 0; 0 0 1; -5 -13 -7];
B = [0; 0; 7];
C = [1 0 0];
D = [0];
[num, den] = ss2tf(A, B, C, D)
G = tf(num, den)
Output -
a).
b).
c).
d).
MATLAB Code -
a).
clc;
clear;
close all;
A=[0 1;4 2];
n=2;
B=[1 ;0];
C=[0 1];
P=ctrb(A,B)
K=rank(P)
if K==n
disp(' system is controllable ')
else
disp(' system is uncontrollable ')
end
Q=obsv(A,C)
L=rank(Q)
if L==n
disp(' system is observable ')
else
disp(' system is unobservable ')
end
b).
clc;
close all;
%The eigen values are -1, -2, -3, -4
A=[1 0 0 0; 2 0 1 0 ; 0 0 4 5; 1 0 2 0];
n=4;
B=[1 ;1 ;1 ;1];
C=[1 1 1 0];
P=ctrb(A,B)
K=rank(P)
if K==n
disp(' system is controllable ')
else
disp(' system is uncontrollable ')
end
Q=obsv(A,C)
L=rank(Q)
if L==n
disp(' system is observable ')
else
disp(' system is unobservable ')
end
c).
clc;
close all;
%The eigen values are -1, -2, -3, -4
A=[1 0 0 0; 2 0 1 0 ; 0 0 4 5; 1 0 2 0];
n=4;
B=[0 ;1 ;1 ;0];
C=[1 0 1 0];
P=ctrb(A,B)
K=rank(P)
if K==n
disp(' system is controllable ')
else
disp(' system is uncontrollable ')
end
Q=obsv(A,C)
L=rank(Q)
if L==n
disp(' system is observable ')
else
disp(' system is unobservable ')
end
Output -
a).
b).
c).
b).
clc;
clear;
close all;
A = [0 6 -5; 1 0 2; 3 2 4];
[V, J]=jordan(A)
c).
clc;
clear;
close all;
a= input('enter no. of rows');
b= input('enter no. of columns');
for i=1:a
for j=1:b
A(i,j)= input('enter values');
end
end
A=reshape(A,a,b)
X=int(A)
[V, J] = jordan(X)
d).
clc;
clear;
close all;
A = [0 1 0; 0 0 1; -6 -11 -6];
B = eig(A)
T = [1 1 1;-1 -2 -3; 1 4 9];
C = inv(T)*A*T
e).
clc;
clear;
close all;
a= input('enter no. of rows ');
b= input('enter no. of columns ');
for i=1:a
for j=1:b
A(i,j)= input('enter values ');
end
end
A= reshape(A,a,b)
B = eig(A)
T = [1 1 1;B';(B.^2)'];
C = inv(T)*A*T
Output -
a).
b).
c).
d).
e).
b).
clc;
clear;
close all;
num=[0 1 2 3]
den=[2 3 4 5]
G=tf(num,den)
gd=c2d(G,0.1,'zoh')
gd1=c2d(G,0.1,'zoh')
td=0:0.1:0.2
step(gd,td)
step(gd1,td)
grid on;
title('step response plot');
xlabel('discrete time');
ylabel('amplitude');
c).
clc;
clear;
close all;
A = [0 1; -24 -4];
B = [1 1 ;0 1];
C = [1 0;0 1];
D = [0 0; 0 0];
ts=0.01;
[F,G,H,J]= c2dm(A,B,C,D,ts,'zoh')
d).
clc;
clear;
close all;
A = [0 1; -24 -4];
B = [1 1 ;0 1];
C = [1 0;0 1];
D = [0 0; 0 0];
ts=0.01;
[F,G,H,J]= c2dm(A,B,C,D,ts,'foh')
Output -
a).
b).
c).
d).
Conclusion - Conversion of transfer function to state model of discrete time
is obtained.
EXPERIMENT 6
Aim - To find the State Transition Matrix of a given system.
Software used - MATLAB R2020b
MATLAB Code -
clc;
close all;
a=input('Enter the system matrix')
S=s;
I= eye(2,2);
y=[S*I];
z= [y-a];
x= inv(z);
STM= ilaplace(x)
Output -