XX = [X_0 X];
В
% Обчислення норми вектора стану
normaXX = Norm (XX (:, N))
В
% Обчислення значення змінної R
R = abs (X_N - F ^ N * X_0) - FG * u ';
R = R ';
z = sum (R);
В
% Похибка наближення до точного рішення
pogresh = 0.3;
В
if (normaXX
N_opt = N;
break;
else
if (z> h)
if a == 1
alfa = ceil (alfa/2);
end
N = N + alfa;
a = 0;
b = 1;
else
if b == 1
alfa = ceil (alfa/2);
end
N = N - alfa;
a = 1;
b = 0;
end
end
t_perevoda = N * h;
end
N_opt
h
t_perevoda
%%%%%%%%%%%%%%%%%%%% ОФОРМЛЕННЯ ОТРИМАНИХ РЕЗУЛЬТАТІВ%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%% У Графічному вигляді%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%
В
% Побудова графіка x1 (t);
figure (1)
t = (0: 1: length (X1) -1) * h;
plot (t, X1, 'b', 'LineWidth', 2);
hl = legend ('x_1 (t)');
set (hl, 'FontName', 'Courier');
xlabel ('t, cek'); ylabel ('x_1 (t)');
grid on
В
% Побудова графіка x2 (t);
figure (2)
t = (0: 1: length (X2) -1) * h;
plot (t, X2, 'b', 'LineWidth', 2);
hl = legend ('x_2 (t)');
set (hl, 'FontName', 'Courier');
xlabel ('t, cek'); ylabel ('x_2 (t)');
grid on
В
% Побудова графіка x2 = x2 (x1);
figure (3)
plot (X1, X2, 'm', 'LineWidth', 2);
hl = legend ('x_2 = x_2 (x_1)');
set (hl, 'FontName', 'Courier');
xlabel ('x_1 (t)'); ylabel ('x_2 (x_1 (t))');
grid on
В
% Побудова графіка u (t)
figure (4)
t = (0: 1: length (u) -1) * h;
plot (t, u, 'r', 'LineWidth', 2);
hl = legend ('u (t)');
set (hl, 'FontName', 'Courier');
xlabel ('t, cek'); ylabel ('u (t)');
grid on
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%
Optimal_L_problem_moments.m
clc
close all
clear all
format long
В
% -------------------------------------------------- ----------------------%
b_0 = 5;
b_1 = 9;
% Укорочена система даного об'єкта
a_5 = 0.1153;
a_4 = 1.78;
a_3 = 3.92;
a_2 = 14.42;
a_1 = 8.583;
a_0 = 0;
% ---------------------------------------------- --------------------------%
% Приведення системи
b0 ...