📄 fuzzymodel.m
字号:
function [A1, A2, B1, B2, h1, h2] = FuzzyModel(x)
% function [A1, A2, B1, B2, h1, h2] = FuzzyModel(x)
%
% Compute the T-S model system matrices and the membership function values,
% based on the current state.
% INPUTS:
% x = current state
% OUTPUTS:
% A1 = transition matrix for the first T-S model
% A2 = transition matrix for the second T-S model
% B1 = input matrix for the first T-S model
% B2 = input matrix for the second T-S model
% h1 = degree of membership in first fuzzy set
% h2 = degree of membership in second fuzzy set
ell = 2.8; % truck length
L = 5.5; % trailer length
v = -1; % speed
tprime = .5; % sample time
% Compute the system matrices.
A1 = [1 - v * tprime / L 0 0; v * tprime / L 1 0; (v * tprime)^2 / 2 / L v * tprime 1];
A2 = A1;
A2(3,1) = A2(3,1) / pi / 100;
A2(3,2) = A2(3,2) / pi / 100;
B1 = [v * tprime / ell; 0; 0];
B2 = B1;
% Compute the firing strengths of the two rules.
z = x(2) + v * tprime / 2 / L * x(1);
h1 = (1-1/(1+exp(-3*(z-pi/2))))*(1/(1+exp(-3*(z+pi/2))));
h2 = 1 - h1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -