моделирование / лаба3 модел
.docxclc, clear, close all;
T1 = 5;
T2 = 1;
k = 5;
uy = 3;
tp = 0.05;
phik = 34.3;
A = [-T1, 0; 1 -T2];
B = [k; 0];
%Check uprovlaumost`
if det([B, A*B]) ~= 0
disp('System upravluaima');
else
disp('System uncontrolable');
end
syms x
ak = -3/tp
bk = tan(phik * pi / 180)*ak
S1 = ak + 1i*bk;
S2 = ak - 1i*bk;
phis1 = -180 - angle(S1)*180/pi;
phis2 = 180 - angle(S2)*180/pi;
fprintf('Ugol 1-go polisa = %d \n', round(phis1));
fprintf('Ugol 2-go polisa = %d \n', round(phis2));
syms S
Dzamk = expand((S - S1).*(S - S2));
Drazom = expand((S + T1)*(S + T2));
alpha = coeffs(Dzamk);
d = coeffs(Drazom);
I = [alpha(1) - d(1), alpha(2) - d(2)]';
AA = [0, 1; -d(1), -d(2)];
BB = [0;1];
CT = double(-I'*[BB,AA*BB]*inv([B,A*B]))