Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
3 views3 pages

Exp Cse

The document outlines various experiments related to control systems, including obtaining poles, zeros, and gain of transfer functions, plotting step and impulse responses, and generating root locus and Nyquist plots. It also covers the conversion between state space and transfer function models using MATLAB/Octave syntax. Each experiment demonstrates different aspects of control theory and system analysis through programming examples.

Uploaded by

NXT ORIGINALS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Exp Cse

The document outlines various experiments related to control systems, including obtaining poles, zeros, and gain of transfer functions, plotting step and impulse responses, and generating root locus and Nyquist plots. It also covers the conversion between state space and transfer function models using MATLAB/Octave syntax. Each experiment demonstrates different aspects of control theory and system analysis through programming examples.

Uploaded by

NXT ORIGINALS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

2nd experiment

% Program for getting poles, zeros & Gain of the transfer function
b= [10 50];
a= [1 4 3]
[z,p,k]=tf2zp(b,a)

% Program for getting transfer function from poles, zeros & Gain
Z= [0];
P=[1-1i-1+1i-21];
K=5;
G=zpk(Z,P,K)
% Program for plotting poles, zeros of the transfer function on s-plane
G=tf([2 5 1],[1 -1 -6])
pzmap(G)

3rd experiment
%Program for step sesponse of 1st order
sys=tf(1,[1 1]);
t-0:0.05:50;
step(sys,t;'r')
hold on
% Program for step response of second order system
sys1=tf(4,[1 1 4]):
sys2=tf(4,[1 2 4]):
sys3=tf(4,[1 7 4]):
sys4=tf(5,[1 7 4]):
t=0:0.05:50;
step(sys1,t,'r');
hold on
step(sys2,t,'b');
hold on
step(sys3,t,'g');
hold on
step(sys4,t,'y');
hold on
% Program for Impulse response of first order system
sys1=tf(1,[1 0.5]):
sys2=tf(1,[1 1]):
sys3=tf(1,[1 2]):
t=0:0.05:20;
Impulse(sys1,t,'g');
hold on
Impulse(sys2,t,'r');
hold on
Impulse(sys3,t,'b');
Hold on;

Experiment 4
% Program for plotting root locus of a control system
sys=tf([2 5 1]),[1 2 3]):
rlocus(sys)
% To interact with the root locus plot and find Gain at a given point
Sys=tf([2 5 1],[1 2 3]):
rlocusx(sys)
% To plot the root locus for a linited range of gain K
sys=tf([2 5 1], [1 2 3);
rlocus(sys,0.1,0,100) % rlocus (sys, increment,min K, Maximum_K)

Experiment 5
num=[1]:
den=[1 3 1];
Gp=t.f (num,den);
H=1;
M-feedback (Gp,H);
step(M)
hold on
grid on
Kp=5;
Ki-10;
Kd-10;
Gc=pid (KP,Ki,Kd);
Nc=feedback (Gc*Gp,H);
step(Nc,'r')
hold on
grid on
Kp=5;
Ki-10;
Ka-0;
Gc=pid(Kp,Ki,Kd);
Nc-feedback (Gc+GP,H);
step(Nc,'g')
hold on
grid on
Kp=5,
Ki=0;
Kd=10;
Gc=pid(Kp,Ki,Kd);
Nc=feedback (Gc*Gp,H);
step(Nc,'black')

Experiment 6
clear all
pkg load control
num-[64 128):
den=[1 3.7 65.6 32 0]:
sys=tf(num,den);
bode(sys)
grid on
xlabel("Frequency on log scale')
[Gm, Pm, Wcp, Wcg ]=margin (sys)

Experiment 7
clear all
pkg load control
num=[1 2]:
den=[1 0 -1]:
sys=tf(num,den):
nyquist(sys,'b');
grid on
title( 'Nyquist Plot of G(s)= (s+2)/[(s+1)(s- 1)]')

Experiment 8
% Conversion of state space model into transfer function model

clc

clear all

pkg load control % Required for Octave

pkg load signal % Required for Octave

A = [-2 -3; 4 2];

B = [3; 5];

C = [1 1];

D = 0;

[b,a] = ss2tf(A,B,C,D);

disp('The transfer function of the given State Model is:-')

sys=tf(b,a)

% Conversion of transfer function model into state space model

b = [24];

a = [1 9 26 24];

disp('The State Model of the given transfer function is:-')

[A,B,C,D] = tf2ss(b,a)

You might also like