You are on page 1of 26

ADVANCE CONTROL SYSTEMS

LAB FILE

Name : Prateek Pandey


Enroll. No : 43113204918
Batch: EEE 4th yr
Index

Sr.no Name of Experiment Date Remarks


1 Transfer Function & State‐Space System : 19/8/2021
1(i) Using state‐variable technique simulate a series
resistance‐inductance‐ capacitance (R‐L‐Ca) circuit
with time varying input u(t) as applied voltage, v(t)
= Vm sin ωt, while output y(t) is current i(t), as
described through the state and output equations:
dx(t)/dt = A x(t) + B u(t), y(t) = C x(t) + D u(t),
where x(t) is state vector. Assuming R = 8 ohm, L =
150 mH, Ca = 125 μF, Vm = 325 Volts, ω = 314
rad/sec, find the transfer function of the system.
1(ii) For the given transfer function Y(s)/U(s) = [s2 + 6s
+5] / [s (s + 2) (s + 3)], find the state space model
in terms of A, B, C, & D matrices / vectors.
1(iii) With a system described in terms of its output y
and input u through the higher order differential
equation, d2 y/dt2 + 7 dy/dt + 5 y + 6 ∫y.dt =du/dt
+ 3u + 2 ∫u.dt, find matrix A, and vectors B, C, D.
1(iv) With the set of state equations and output
equation given below, find the Transfer Function.
X1.=x2,x2.=x3,and x3.=‐6x1‐11x2‐6x3 +6u,while y=x1
2 For a Single‐Input Single‐Output System described 26/8/2021
by the A, B, C, & D matrices / vectors as given
below, find time response of system
corresponding to unity step input [u(t) = 1]
assuming zero initial condition for the states.
A=[0 1; ‐2 ‐3], B=[0;1] , C=[1 0],D=[0]
3 Eigen value‐Eigen Vector: 2/9/2021
3(i) Find eigenvalues and eigenvectors for the system
Matrix A as given by A=[4 3 ‐1;‐2 0 2;3 3 0]
3(ii) For the third order system given below,
considering 1 out 3 roots as distinctive eigenvalue,
find eigenvectors. A=[0 6 ‐5;1 0 2;3 2 4]
3(iii) For the system A given by the following, find its
Diagonal Canonical Form expressed in terms of its
all the distinct eigenvalues.
A=[0 1 0;0 0 1; ‐6 ‐11 ‐6]
3(iv) For the system A given by the following, with 1 out
3 roots as distinctive eigenvalue, find its Jordan
Canonical Form . A=[0 6 ‐5;1 0 2;3 2 4]
4 Controllability & Observability 16/9/2021
Sr.no Name of Experiment Date Remarks
4(i) For the SISO system having 4 distinct eigenvalues
of –1, –2, –3, –4 in the Diagonal Canonical Form of
representation and null D, with the following B
and C vectors, check for controllability and
observability. B=[1 1 1 1]T ,C=[1 1 1 1]
4(ii) Check for controllability and observability of
system having representation in state‐space form
through A, B, C, and D matrices / vectors as A=[0 1
0 0 0;1 0 ‐1 0 1;0 0 0 1 0;0 ‐1 0 ‐1 0],B=[0 0;1 ‐1;0 0
;0 0;1 1],C=[1 1 1 1],D=[0 0]
4(iii) With the Jordan Canonical Form representation of
system check for complete controllability and
observability of system given that A=[‐1 1 0 0;0 ‐1
0 0 ;0 0 ‐3 0;0 0 0 ‐4],B=[0 ; 1; 1;1],C=[1 0 1
1],D=[0]
5
6
7
Experiment – 1(i)
Aim: Transfer Function & State‐Space System: Using state‐variable technique
simulate a series resistance‐inductance‐ capacitance (R‐L‐Ca) circuit with time
varying input u(t) as applied voltage, v(t) = Vm sin ωt, while output y(t) is
current i(t), as described through the state and output equations: dx(t)/dt = A
x(t) + B u(t), y(t) = C x(t) + D u(t), where x(t) is state vector. Assuming R = 8
ohm, L = 150 mH, Ca = 125 μF, Vm = 325 Volts, ω = 314 rad/sec, find the
transfer function of the system.

Software Used: MATLAB R2020a


Theory: State Space analysis (also known as state variable analysis) is
a commonly used method nowadays for analysing the control
system. The analysis that involves providing a complete idea about the
behaviour of the system at any given time utilizing the history of the
system is known as state-space analysis

Programme:
clc;
close all;
clear all;
A=[0 1 0 ; 0 0 1 ; -6 -11 -6];
B=[0 ; 5 ; -10];
C=[1 0 0];
D=[0];
[num,den]=ss2tf(A,B,C,D)
G=tf(num,den)
Output:
Experiment – 1(ii)
Aim: Transfer Function & State‐Space System: For the given transfer function
Y(s)/U(s) = [s2 + 6s +5] / [s (s + 2) (s + 3)], find the state space model in terms of
A, B, C, & D matrices / vectors.

Software Used: MATLAB R2020a


Theory: [ b , a ] = ss2tf( A , B , C , D ) converts a state-space
representation of a system into an equivalent transfer function. ss2tf
returns the Laplace-transform transfer function for continuous-time
systems and the Z-transform transfer function for discrete-time systems.

Programme:
clc;
clear all;
close all;
num=[1 6 5]
a=conv([1 0],[1 2])
den=conv(a,[1;3])
[A,B,C,D]=tf2ss(num,den)

Output:
Experiment – 1(iii)
Aim: Transfer Function & State‐Space System: With a system described in
terms of its output y and input u through the higher order differential
equation, d2 y/dt2 + 7 dy/dt + 5 y + 6 ∫y.dt = du/dt + 3u + 2 ∫u.dt, find matrix A,
and vectors B, C, D.

Software Used: MATLAB R2020a


Theory: d2 y/dt2 + 7 dy/dt + 5 y + 6 ∫y.dt = du/dt + 3u + 2 ∫u.dt this equation
first need to be converted int o transfer function than by using standrad
MATLAB function tf2ss(num,den) we can convert it into state space.Transfer
Function is found out to be: (s2 +3s+2)/(s3+7s2+5s+6)

Programme:
Experiment – 1(iv)
Aim: Transfer Function & State‐Space System: With the set of state equations
and output equation given below, find the Transfer Function.
X1.=x2,x2.=x3,and x3.=‐6x1‐11x2‐6x3 +6u,while y=x1

Software Used: MATLAB R2020a


Theory: Converting from state space form to a transfer function is
straightforward because the transfer function form is unique. Converting
from transfer function to state space is more involved, largely because
there are many state space forms to describe a system.

Programme:
clear all;
close all;
clc;
A=[0 1 0; 0 0 1; -6 -11 -6]
B=[0;0;6]
C=[1 0 0]
D=[0]
[num ,den]=ss2tf(A,B,C,D)
G=tf(num,den)

Output:
Experiment – 2
Aim:For a Single‐Input Single‐Output System described by the A, B, C, & D
matrices / vectors as given below, find time response of system corresponding
to unity step input [u(t) = 1] assuming zero initial condition for the states.
A=[0 1; ‐2 ‐3], B=[0;1] , C=[1 0],D=[0]

Software Used: MATLAB R2020a


Theory: step(sys) plots the response of a dynamic system model to
a step input of unit amplitude. The model sys can be continuous- or
discrete-time, and SISO or MIMO. For MIMO systems, the plot displays
the step responses for each I/O channel. step automatically determines
the time steps and duration of the simulation based on the system
dynamics. step(sys,t) plots the step response at the times that you
specify in the vector t.

Programme:
clc;
clear all;
close all;
A=[0 1;-2 -3];
B=[0;1];
C=[1 0];
D=[0];
sys=ss(A,B,C,D)
step(sys,1)
xlabel('time')
ylabel('output')
title('step response')
grid on;
Output:
Experiment – 3(i)
Aim:Find eigenvalues and eigenvectors for the system Matrix A as given by
A=[4 3 ‐1;‐2 0 2;3 3 0]

Software Used: MATLAB R2020a


Theory:e = eig(A) returns a column vector containing the eigenvalues
of square matrix A.
[V,D] = eig(A) returns diagonal matrix D of eigenvalues and
matrix V whose columns are the corresponding right eigenvectors, so
that A*V = V*D.
The eigenvalue problem is to determine the solution to the
equation Av = λv, where A is an n-by-n matrix, v is a column vector of
length n, and λ is a scalar. The values of λ that satisfy the equation are
the eigenvalues. The corresponding values of v that satisfy the equation
are the right eigenvectors. The left eigenvectors, w, satisfy the
equation w’A = λw’.
Programme:
clear all;
close all;
A=[4 3 -1; -2 0 2;3 3 0]
[V,D]=eig(A)

Output:
Experiment – 3(ii)
Aim: For the third order system given below, considering 1 out 3 roots as
distinctive eigenvalue, find eigenvectors. A=[0 6 ‐5;1 0 2;3 2 4]

Software Used: MATLAB R2020a


Theory: e = eig(A,B) returns a column vector containing the generalized
eigenvalues of square matrices A and B.
[V,D,W] = eig(A) also returns full matrix W whose columns are the
corresponding left eigenvectors, so that W'*A = D*W'.
Programme:
%programme 3-1
%Prateek Pandey-43113204918
clear all;
close all;
clc;
A=[0 6 -5; 1 0 2; 3 2 4]
[V,D]=eig(A)

Output:
Experiment – 3(iii)
Aim: For the system A given by the following, find its Diagonal Canonical
Form expressed in terms of its all the distinct eigenvalues.
A=[0 1 0;0 0 1; ‐6 ‐11 ‐6]

Software Used: MATLAB R2020a


Theory: Where a system has only real and distinct poles, one
alternative is the diagonal canonical form. ... Being diagonal, this has
some advantages although the states have less meaning and partial
fractions are required. Here we are using matlab to find it by
C=inv(T)*A*T.

Programme:
clear all;
close all;
clc;
A=[0 1 0; 0 0 1 ; -6 11 6]
b=eig(A)
T=[1 1 1;b(1) b(2) b(3);b(1)*b(1) b(2)*b(2)
b(3)*b(3)]
C=inv(T)*A*T
Output:
Experiment – 3(iv)
Aim: For the system A given by the following, with 1 out 3 roots as distinctive
eigenvalue, find its Jordan Canonical Form . A=[0 6 ‐5;1 0 2;3 2 4]

Software Used: MATLAB R2020a


Theory: The Jordan canonical form (Jordan normal form) results from
attempts to convert a matrix to its diagonal form by a similarity
transformation. For a given matrix A, find a nonsingular matrix V, so
that inv(V)*A*V, or, more succinctly, J = V\A*V, is “as close to
diagonal as possible.” For almost all matrices, the Jordan canonical
form is the diagonal matrix of eigenvalues and the columns of the
transformation matrix are the eigenvectors. This always happens if the
matrix is symmetric or if it has distinct eigenvalues

Programme:
clear all;
close all;
clc;
A=[0 6 -5; 1 0 2; 3 2 4]
[V,J]=jordan(A)
Output:
Experiment – 4(i)
Aim: Check for controllability and observability of system having
representation in state‐space form through A, B, C, and D matrices / vectors as
A=[0 1 0 0 0;1 0 ‐1 0 1;0 0 0 1 0;0 ‐1 0 ‐1 0],B=[0 0;1 ‐1;0 0 ;0 0;1 1],C=[1 1 1
1],D=[0 0]

Software Used: MATLAB R2020a


Theory: Controllability measures the ability of a particular actuator
configuration to control all the states of the system; conversely,
observability measures the ability of the particular sensor configuration
to supply all the information necessary to estimate all the states of the
system.The system is controllable if the controllability matrix is full
rank, and observable if the observability matrix is full rank.

Programme:
clear all;
close all;
clc;
A=[0 1 0 0 0 ; 1 0 -1 0 1 ; 0 0 0 1 0; 0 0 0 0 -1; 0 -1 0 -1
0];
B=[0 0 ;1 -1; 0 0 ; 0 0 ; 1 1];
C=[1 1 1 1 1];
P=ctrb(A,B) %controability expression
[m,n]=size(A);
k=rank(P);
if k==n
disp('sys is controllable')
else
disp('sys is uncontrollable')
end
Q=obsv(A,C) %observability expression
l=rank(Q);
if l==n
disp('sys is observable')
else
disp('sys is unobservable')
end
Output:
Experiment – 4(ii)
Aim: For the SISO system having 4 distinct eigenvalues of –1, –2, –3, –4 in the
Diagonal Canonical Form of representation and null D, with the following B and
C vectors, check for controllability and observability. B=[1 1 1 1]T ,C=[1 1 1 1]

Software Used: MATLAB R2020a


Theory: In this first we form A matrix from the eign values given in the
diagonal canonical form then simply by using MATLAB we find out that the
matrix is controllable and observable by using inbuilt command ctrb for
controllable and obsv for observability.

Programme:
clear all;
close all;
clc;
A=[-1 0 0 0; 0 -2 0 0 ; 0 0 -3 0 ; 0 0 0 -4];
B=transpose([1 1 1 1]);
C=[1 1 1 1];
P=ctrb(A,B)
k=rank(P);
[m,n]=size(A);
if k==n
disp('sys is controllable')
else
disp('sys is uncontrollable')
end
Q=obsv(A,C)
l=rank(Q);
if l==n
disp('sys is observable')
else
disp('sys is unobservable')
end
Output:
Experiment – 4(iii)
Aim: With the Jordan Canonical Form representation of system check for
complete controllability and observability of system given that A=[‐1 1 0 0;0 ‐1
0 0 ;0 0 ‐3 0;0 0 0 ‐4],B=[0 ; 1; 1;1],C=[1 0 1 1],D=[0]

Software Used: MATLAB R2020a


Theory:
Programme:
clear all;
close all;
clc;
A=[-1 1 0 0;0 -1 0 0;0 0 -3 0;0 0 0 -4];
B=[0 ; 1 ; 1 ; 1];
C=[1 0 1 1];
D=[0];
P=ctrb(A,B) %controability expression
[m,n]=size(A);
k=rank(P);
if k==n
disp('sys is controllable')
else
disp('sys is uncontrollable')
end
Q=obsv(A,C) %observability
l=rank(Q);
[m,n]=size(A);
if l==n
disp('sys is observable')
else
disp('sys is unobservable')
end
Output:
Experiment –
Aim:
Software Used: MATLAB R2020a
Theory:
Programme:

You might also like