📄 controller.m
字号:
function [u] = Controller(x, pi1, pi2)
% function [u] = Controller(x, pi1, pi2)
%
% Compute the truck-trailer optimal control.
% INPUTS
% x = state estimate
% pi1 = ARE Solution for fuzzy T-S model #1
% pi2 = ARE Solution for fuzzy T-S model #2
% OUTPUTS
% u = control
% Compute the T-S system matrices and the membership function values.
[A1, A2, B1, B2, h1, h2] = FuzzyModel(x);
% Compute the two local optimal controls.
r1 = -inv(eye(1) + B1' * pi1 * B1) * B1' * pi1 * A1 * x;
r2 = -inv(eye(1) + B2' * pi2 * B2) * B2' * pi2 * A2 * x;
% Compute the global control.
u = h1 * r1 + h2 * r2;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -