Sie sind auf Seite 1von 14

Matlab

practicals

Made by:
Roll no.:
ROOT LOCUS:-

1. G(s)H(s)=______K______
s(s+4)(s^2+4s+20)

Code:-
k=1
a=tf([k],[1 8 36 80 0]);
f=feedback(a,1);
t=0:0.1:10;
rlocus(f)

Output:-
2. G(s)H(s)=_______K(s+3)______
S(s+5)(s+6)(s^2+2s+2)
For=-3000<K<3000

Code:-
clc
clear all

for k=-3000:100:3000
num=[k 3*k];
denom=[1 13 54 82 60 0];
t=0:0.1:50;
y=tf(num,denom);
f=feedback(y,1);
rlocus(f);
%plot(t,f2,'r')
hold on
end

Output:-
3. G(s)H(s)=__K(s+2)__
s(s^2+2s+a)
for a=1;1.2;1.185;3

code:-
k=1;
t=0:0.1:10;

a=1
w=tf([k 2*k],[1 2 a 0]);
f=feedback(w,1);
rlocus(f)
hold on

a=1.125
w=tf([k 2*k],[1 2 a 0]);
f=feedback(w,1);
rlocus(f)
hold on

a=1.185
w=tf([k 2*k],[1 2 a 0]);
f=feedback(w,1);
rlocus(f)
hold on

a=3
w=tf([k 2*k],[1 2 a 0]);
f=feedback(w,1);
rlocus(f)

Output:-
Overall output:-

For a=1.2:-

For a=1:-
For a=3:-

For a=1.185:-
Step Response:-
1. G(s)= …………..4500K…………
s(s+4)(s^2+4s+20)
CODE:-
k=7.248;
a=tf([4500*k],[1 361.2 4500*k]);
f=feedback(a,1);
t=0:0.00001:0.5;
[y,t]=step(t,f);
plot(t,y)
hold on

k=14.5
a=tf([4500*k],[1 361.2 4500*k]);
f=feedback(a,1);
[y,t]=step(t,f);
plot(t,y)
hold on

k=181.2
a=tf([4500*k],[1 361.2 4500*k]);
f=feedback(a,1);
[y,t]=step(t,f);
plot(t,y)

Output
2. G(s)= ……………………..1.5x10^7K…………….……………
S^3+3408.3s^2+1204000s+1.5x10^7K
K=7.248;14.5;181.2

Code:-
t=0:0.00001:0.5;

k=7.248;
a=tf([1.5*10^7*k],[1 3408.3 1204000 1.5*10^7*k]);
f=feedback(a,1);
[y,t]=step(t,f);
plot(t,y)
hold on

k=14.5
a=tf([1.5*10^7*k],[1 3408.3 1204000 1.5*10^7*k]);
f=feedback(a,1);
[y,t]=step(t,f);
plot(t,y)
hold on

k=181.2
a=tf([(1.5*10^7)*k],[1 3408.3 1204000 1.5*10^7*k]);
f=feedback(a,1);
[y,t]=step(t,f);
plot(t,y)

Output:-
Bode plot:-

1. L(s)=___2500___
S(s+5)(s+10)
 Find gain cross over frequency & phase margin
 Find phase cross over frequency & gain margin

Code:-

num1=2500;
den1=[1 15 50 0];
L1=tf(num1,den1);
Bode(L1);
Margin(L1);

OUTPUT:-
2. L(s)= ….100(s+5)(s+40)….
S^3(s+100)(s+200)
 Find gain cross over frequency & phase margin
 Find phase cross over frequency
 Discuss i’ts stability

Code:-
s=tf('s');

L1=2500/(s*(s+5)*(s+10));

L2=(100*(s+5)*(s+40))/((s^3)*(s+100)*(s+200));
% num1=[2500];
% den1=[1 15 50 0];
% num2=[100 4500 20000];
% den2=[1 300 20000 0 0 0];
% L1=tf(num1,den1);
% L2=tf(num2,den2);
subplot(1,2,1);
bode(L1);
margin(L1);
subplot(1,2,2);
bode(L2);
margin(L2);

output:-
Nyquist Plot:-

1. L(s)=____k_____ for K<240


S(s+2)(s+10) K>240
Investigate the difference between two point

Code:-
function[nyq_plot]=Nyquist_funct(K)

for i=1:10

s=tf('s');
nyq_plot=K/(s*(s+2)*(s+10));
nyquist(nyq_plot);
hold on
K=K+30;
End

Output:-
2. L(s)= ___K(s+2)___
S^3+3s^2+10

Code:-

function[nyq_plot]=Nyquist_funct_b(K)
for i=1:10

s=tf('s');
nyq_plot=(K*(s+2))/(s^3+3*s^2+10);
nyquist(nyq_plot);
hold on
K=K+30;
End

Output:-
3. (i) L(s)= __K__ T>0
1+Ts
(ii)L(s)=___1___
S(1+Ts)
(iii)L(s)=___K___
S^2(1+Ts)
(iv)L(s)=___K___
s^3(1+Ts)
investigate the difference between i,ii,iii & iv

CODE:-
function[nyq_plot1]=Nyquist_funct_c4(T1)
s=tf('s’);
nyq_plot1=1/(1+s*T1);
subplot(2,2,1);
nyquist(nyq_plotl);
hold on;
nyq_plot2=1/(s*(1+s*TI));
subplot(2,2,2);
nyquist(nyq_plot2);
nyq_plot3=1/(s^2*(1+s*T1));
subplot(2,2,3);
nyquist(nyq_plot3);
nyq_plot4=1/(s^3*(1+s*T1)) ;
subplot(2,2,4);
nyquist(nyq_plot4);
end

output:-

Das könnte Ihnen auch gefallen