Acs Pract File 1
Acs Pract File 1
EXPERIMENT 1
AIM:- Study of open and closed loop time/frequency response of first/second
order system LTI system.
1(a) Step response of open loop system
2(b) Step response of closed loop system
1(b)
clc;
clear all;
close all;
A = [0 1; -2 -3];
B = [0 ; 1];
3
C = [1 2;0 2];
OUTPUT:-
1(a)
4
1(b)
5
EXPERIMENT 2
AIM:- Conversion of Transfer Function to state model of LTI system and vice
versa.
2(a) Conversion of state space model to transfer function
2(b) Conversion of transfer function to state space model
2(c) Conversion of transfer function to state space model using convolution
2(d) To find transfer function of given state space model
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)
2(b)
clc;
clear all;
close all;
num = [0 0 1 0];
den = [1 12 60 124];
[A, B, C, D] = tf2ss(num, den)
2(c)
clc;
7
clear all;
close all;
num = [2 8 4];
a = conv([1 0], [1 2]);
den = conv(a, [2 5]);
[A B C D] = tf2ss(num, den)
2(d)
clc;
clear all;
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:-
2(a)
2(b)
8
2(c)
9
2(d)
EXPERIMENT 3
AIM:- Determine State Space Model of a given system and determine it’s
controllability and observability.
3(a) To find controllability and observability of a given state model
3(b) To find controllability and observability of system when eigen values are
given
3(c) ) To find controllability and observability of system when eigen values are
given
3(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
3(c)
clc;
close all;
12
OUTPUT:-
3(a)
13
3(b)
3(c)
14
EXPERIMENT 4
AIM:- 1. For the third order system find the eigen vectors
2. Find the JFC of the system
3. Find the DFC of the system
4(b)
clc;
clear all;
close all;
A = [0 6 -5; 1 0 2; 3 2 4];
[V, J]=jordan(A)
4(c)
clc;
clear all;
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');
16
end
end
A=reshape(A,a,b)
X=int(A)
[V, J] = jordan(X)
4(d)
clc;
clear all;
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
4(e)
clc;
clear all;
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
17
OUTPUT:-
4(a)
4(b)
18
4(c)
4(d)
19
EXPERIMENT 5
AIM:- Conversion of transfer function to state model of discrete time system
5(a) To find transfer function of a system and convert it to discrete time step
response
5(b) To find transfer function of a given system and convert it to discrete time
step response
5(c) To find transfer function of state space model and convert it to discrete
time step reponse
5(d) To find transfer function of a system and convert it to discrete time step
response with given time
5(b)
clc;
clear all;
21
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');
5(c)
clc;
clear all;
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')
5(d)
clc;
clear all;
close all;
A = [0 1; -24 -4];
B = [1 1 ;0 1];
22
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:-
5(a)
23
5(b)
5(c)
24
5(d)
25
EXPERIMET 6
AIM:- To find the State Transition Matrix of a given system.
SOFTWARE USED:- MATLAB R2a2020
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:-