-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStability Analysis of a Continuos Time LTI System.m
91 lines (76 loc) · 1.49 KB
/
Stability Analysis of a Continuos Time LTI System.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
%Stability Analysis of a continuous Time LTI System using Laplace Transform
clear all
clc
syms t a b m u s
x=input('Enter the input of the system:');
h=input('Enter the impulse response of the system:');
X=laplace(x);
H=laplace(h);
Y=X*H;
y=simplify(ilaplace(Y));
disp('The Laplace Transform of input function is X:');
disp(X);
disp('The Laplace Transform of impulse response is H:');
disp(H);
disp('The Laplace Transform of output function is Y:');
disp(Y);
disp('The output of the system is y:');
disp(y);
G=(Y/X);
disp('The Transfer function of the system is G(s):');
disp(G);
[n,d]=numden(G);
disp('The denominator of the Transfer function is d:');
disp(d);
p=solve(d);
n=length(p);
disp('The poles of the system is P:');
for i=1:n
disp(p(i));
i=i+1;
end
m=0;
u=0;
s=0;
for j=1:n
if(real(p(j))>0)
u=u+1;
end
j=j+1;
end
if(u>0)
disp('The system is unstable');
end
for k=1:n
if(real(p(k))==0)
m=m+1;
end
k=k+1;
end
if(u==0)
if(m>0)
disp('The system is marginally stable');
end
end
if(u==0)
if(m==0)
for f=1:n
if(real(p(f))<0)
s=s+1;
end
f=f+1;
end
end
end
if(u==0)
if(m==0)
if(s>0)
disp('The system is stable');
end
end
end
for o=1:n
plot(real(p(o)),[-10,10]);
hold on
o=o+1;
end