How to determine the number and range of Fuzzy Membership Functions

7 vues (au cours des 30 derniers jours)
azarm
azarm le 22 Sep 2011
Modifié(e) : Sam Chak le 15 Avr 2025
Hi everyone,
I implemented a FIS using GUI of matlab. Some unclear questions are: 1. How can you assign the number of MF in a fuzzy system? What is the difference between {Low, Medium, High} and {Low, Normal, Medium, High}?. Do more MFs mean more details?
2. How can I fix the proper range for each MF?
Tnx
Azi

Réponses (1)

Sam Chak
Sam Chak le 15 Avr 2025
Modifié(e) : Sam Chak le 15 Avr 2025
In function approximation, it is true that the more uniformly spaced the distribution-type MFs are, the more details can be captured, resulting in smoother curves. This principle is supported by various theorems, including linear interpolation theory, the Stone–Weierstrass theorem, and radial basis function interpolation theory.
The range (base or width) for each uniformly spaced distribution-type MF is consistent and is determined by the chosen approximation accuracy. Higher accuracy results in a smaller range and more densely spaced MFs. The demo for approximating the McDonald's logo is presented below, using 27 Gaussian MFs.
However, in fuzzy control design, the number of fuzzy rules tends to "explode" with the number of MFs. In fuzzy PD controllers, there are two input variables (e and ), and if each has 5 MFs, namely {Very Low, Low, Medium, High, Very High}, then fuzzy rules are required. If a 3rd input variable () is added, also with 5 MFs, the number of rules increases to .
%% The McDonald's Logo
x = linspace(-6.5, 6.5, 261)';
y = 6*abs(x) - x.^2 + 3.25;
%% ANFIS
% set up initial FIS
genOpt = genfisOptions('GridPartition');
genOpt.NumMembershipFunctions = 27; % design choice: can try 13
genOpt.InputMembershipFunctionType = 'gaussmf'; % design choice: 'trimf', 'gbellmf'
genOpt.OutputMembershipFunctionType = 'constant'; % design choice: "linear" (default)
iniFIS = genfis(x, y, genOpt);
% specify ANFIS options for tuning fuzzy systems
opt = anfisOptions('InitialFIS', iniFIS);
opt.DisplayANFISInformation = 0;
opt.DisplayErrorValues = 0;
opt.DisplayStepSize = 0;
opt.DisplayFinalResults = 0;
% tune Sugeno FIS using training data
outFIS = anfis([x y], opt);
%% Plot results
figure
plotmf(outFIS, 'input', 1, 1301),
grid on, ylim([-0.5, 1.5])
xlabel('Input, x')
title('27 Input Gaussian MFs')
delete(findobj(gca, 'Type', 'text'));
figure
x1 = linspace(-6.5, 6.5, 27*3)';
y1 = 6*abs(x1) - x1.^2 + 3.25;
plot(x1, y1, 'o'), hold on
plot(x, evalfis(outFIS, x), 'linewidth', 1.5), hold off
grid on, ylim([-1 13])
legend('Training Data', 'ANFIS Output', 'location', 'south')
axis equal
xlabel('x'), ylabel('y')
title('McDonald''s Logo')

Catégories

En savoir plus sur Fuzzy Logic Toolbox dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by