blob: 3a61d1b3a230f4ba69ac34047c2f0137e5cd6e54 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
s = %s;
A = [0 1 0;0 0 1;-24 -26 -9];
B = [0;0;1];
C = [1 1 0];
x0 = [1;0;2];
I = eye(3,3);
syms t ;
U = syslin('c', 1/(s+1));
disp(U,"U(s)=");
L = inv(s*I-A)*(x0+B*U);disp(L,"x1,x2 and x3 are :");
Y = C*L;
disp(Y,"Y(s)=");
y = ilaplace(Y,s,t);disp(y,"output y(t)=");
D = det(s*I-A);
printf("Roots are the eigenvalues of the system");
root = roots(D);
disp(root,"eigenvalues");
|