Математическая модель в пространстве состояний линейного стационарного объекта управления

w = 0 : 0.01 : 100;

fi_w = (atan(w/0.5556)-atan(w/0)-atan(w/13.5832)-atan((w-2.7677)/0.5850) .

-atan((w+2.7677)/0.5850) - atan(w/(0.6848)))*180/pi;

plot(w,fi_w, 'k', 'LineWidth', 2);

grid on

xlabel('w')

ylabel('fi(w)')

title('Function FCHX(w)')

%-------------------------------------------------------------------------%

%----------------------Построение АФЧХ--

----------------------------------%

figure('Name', '[0,100]');

w = 0 : 0.01 : 100;

A_w = sqrt((b0^2 + b1^2.*w.^2)./((-a1*w.^2+a3*w.^4).^2+(a0*w-a2*w.^3+a4*w.^5).^2));

fi_w = (atan(w/0.5556)-atan(w/0)-atan(w/13.5832)-atan((w-2.7677)/0.5850) .

-atan((w+2.7677)/0.5850) - atan(w/(0.6848)));

polar(fi_w,A_w, 'k');

grid on

xlabel('Re(W(jw))')

ylabel('Im(W(jw))')

title('Function AFCHX(fi_w,A_w)')

%-------------------------------------------------------------------------%

%----------------------Построение ЛАЧХ------------------------------------%

figure('Name', '[0,100]');

w = -100 : 0.01 : 100;

LA_w = 20*log(sqrt((b0^2 + b1^2.*w.^2)./((-a1*w.^2+a3*w.^4).^2+(a0*w-a2*w.^3+a4*w.^5).^2)));

plot(w,LA_w,'k', 'LineWidth', 2);

grid on

xlabel('w')

ylabel('L(w)')

title('Function L(w)')

%-------------------------------------------------------------------------%

%----------------------Построение ФАЧХ------------------------------------%

%-------------------------------------------------------------------------%

%----------------------Построение h(t)------------------------------------%

figure('Name', '[0,50]');

t = 0 : 0.01 : 50;

h_t = 0.0024 * exp(-13.5832.*t) - 0.2175 * exp(-0.6848.*t) .

+ 0.1452 * exp(-0.5850.*t).* cos(2.7677.*t) .

- 0.2217 * exp(-0.5850.*t).* sin(2.7677.*t) .

+ 0.5825 .* t + 0.0699;

plot(t,h_t, 'k', 'LineWidth', 2);

grid on

xlabel('t')

ylabel('h(t)')

title('Function h(t)')

%-------------------------------------------------------------------------%

%----------------------Построение k(t)------------------------------------%

figure('Name', '[0,50]');

t = 0 : 0.01 : 50;

k_t = - 0.0329 * exp(-13.5832.*t) + 0.1489 * exp(-0.6848.*t) .

- 0.6986 * exp(-0.5850.*t).* cos(2.7677.*t) .

- 0.2721 * exp(-0.5850.*t).* sin(2.7677.*t) .

+ 0.5826;

plot(t,k_t, 'k', 'LineWidth', 2);

grid on

xlabel('t')

ylabel('k(t)')

title('Function k(t)')

%-------------------------------------------------------------------------%

x1=tf([b1 b0],[a4 a3 a2 a1 a0 0]);

ltiview(x1)

ProstranstvoSostoyanii.m

clc

clear all

%format rational

b1 = 9;

b0 = 5;

a5 = 0.1153;

a4 = 1.78;

a3 = 3.92;

a2 = 14.42;

a1 = 8.583;

a0 = 0;

%1. Матрица Фробениуса

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

A=[0 1 0 0 0;

0 0 1 0 0;

0 0 0 1 0;

0 0 0 0 1;

0 -a1/a5 -a2/a5 -a3/a5 -a4/a5]

B=[0; 0; 0; 0; 1/a5]

C=[b0 b1 0 0 0]

%Проверка

syms s

W_s = collect(simplify(C*(s.*eye(5)-A)^(-1)*B),s)

pretty(W_s)

%2. Параллельная декомпозиция

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

b1 = b1/a5;

b0 = b0/a5;

s1 = 0;

s2 = -6615/487;

s3 = -1022/1747 + 4016/1451*i;

s4 = -1022/1747 - 4016/1451*i;

s5 = -415/606;

alfa = real(s3);

beta = imag(s3);

syms s A B C D E

W_s_etal = collect(((b1*s+b0)/((s-s1)*(s-s2)*((s+alfa)^2+beta^2)*(s-s5))),s)

%pretty(W_s_etal)

Slag_1 = simplify(collect(A*(s-s2)*((s+alfa)^2+beta^2)*(s-s5),s));

Slag_2 = simplify(collect(B*(s-s1)*((s+alfa)^2+beta^2)*(s-s5),s));

Slag_3 = simplify(collect(C*(s-s1)*((s+alfa)^2+beta^2)*(s-s2),s));

Slag_4 = simplify(collect((D*s+E)*(s-s1)*(s-s2)*(s-s5),s));

Chislit_W_s =collect(Slag_1 + Slag_2 + Slag_3 + Slag_4,s);

%Решение системы линейных уравнений

MS =double( [1 1 1 1 0;

6753029497/515578134 -513659/1058682 10560977/850789 4210795/295122 1;

77456808434995506239663107/126764366837761533378822144 1874500571398143988939141/260296441145300889894912 -3300780600401725219142291/418364246989311991349248 915075/98374 4210795/295122;

26189071674868424275768861465/253528733675523066757644288 2853037197681682345182805/520592882290601779789824 45476725452203201718998205/418364246989311991349248 0 915075/98374;

6290947020888109571128085025/84509577891841022252548096 0 0 0 0])

PCH = [0; 0; 0; b1; b0];

Koeff = MS^(-1)*PCH

%Проверка

MS*[Koeff(1);Koeff(2);Koeff(3);Koeff(4);Koeff(5)];

Slag_1 = simplify(collect(Koeff(1)*(s-s2)*((s+alfa)^2+beta^2)*(s-s5),s));

Slag_2 = simplify(collect(Koeff(2)*(s-s1)*((s+alfa)^2+beta^2)*(s-s5),s));

Slag_3 = simplify(collect(Koeff(3)*(s-s1)*((s+alfa)^2+beta^2)*(s-s2),s));

Slag_4 = simplify(collect((Koeff(4)*s+Koeff(5))*(s-s1)*(s-s2)*(s-s5),s));

Chislit_W_s =collect((Slag_1 + Slag_2 + Slag_3 + Slag_4),s);

Znamena_W_s = collect((s-s1)*(s-s2)*((s+alfa)^2+beta^2)*(s-s5),s);

W_s = collect(simplify(Koeff(1)/(s-s1)+Koeff(2)/(s-s2)+(Koeff(4)*s+Koeff(5))/((s+alfa)^2+beta^2)+Koeff(3)/(s-s5)),s)

pretty(W_s)

%Расчет матриц состояния

A = [s1 0 0 0 0;

0 s2 0 0 0 ;

0 0 0 1 0;

0 0 -(alfa^2+beta^2) -2*alfa 0;

0 0 0 0 s5]

B = [Koeff(1); Koeff(2); 0; 1; Koeff(3)]

C = [1 1 Koeff(5) Koeff(4) 1]

%Проверка

W_s = collect(simplify(C*(s.*eye(5)-A)^(-1)*B),s)

pretty(W_s)

%ВСЕ ПОДСЧИТАНО ВЕРНО!!!

SimplexMetod2.m

function SimplexMetod2

clc

clear all

close all

format short

%%%%%%%%%%%%%%%%%%%%%%%ВВОДИМЫЕ ДАННЫЕ%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Матрицы системы

A = [0 2;

-3 0];

B = [0; 2];

% Координаты начальной и конечной точки

X_0 = [14; 0];

X_N = [0; 0];

% Ограничение на управление

u_m = -3;

u_p = 5;

eps = 1e-10;% погрешность сравнения с нулем

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

N = 195;% число шагов

%h = t1/N;% шаг дискретизации

h = 0.0162;

alfa = 1;

a = 0;

b = 0;

%t1 = 796/245;% время перехода в конечное состояние

n = size(A);

n = n(1);% порядок системы

% Нахождение матричного экспоненциала

syms s t

MatrEx = ilaplace((s*eye(n)-A)^(-1));

MatrEx_B = MatrEx*B;

% Вычисление матриц F и G

F = subs(MatrEx, t, h);

G = double(int(MatrEx_B, t, 0, h));

%%%%%%%%%%ФОРМИРОВАНИЕ ЗАДАЧИ БЫСТРОДЕЙСТВИЯ КАК ЗАДАЧИ%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%ЛИНЕЙНОГО ПРОГРАММИРОВАНИЯ%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

for index = 1 : 1e+10

% Вычисление правой части

PravChast = X_N - F^N * X_0;

% Вычисление произведения F на G

FG = zeros(n, N);% формирование матрицы для хранения данных

for j = 1 : n

for i = 0 : N - 1

fg = F^(N-i-1) * G;

if PravChast(j) < 0

fg = -fg;

end

FG(j, i+1) = fg(j);

Страница:  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15 
 16  17  18  19  20  21  22 


Другие рефераты на тему «Экономико-математическое моделирование»:

Поиск рефератов

Последние рефераты раздела

Copyright © 2010-2024 - www.refsru.com - рефераты, курсовые и дипломные работы