How to use the Height Defuzzification method in Fuzzy Logic Toolbox
4 ビュー (過去 30 日間)
古いコメントを表示
In simulink environment using fuzzy logic controller the attempt was made to compensate harmonics. In that fuzzy tool box the height method which is used for defuzzification is not available. How to use that method in fuzzy tool box. Kindly post your views.
0 件のコメント
回答 (1 件)
Sam Chak
2025 年 4 月 16 日
The height defuzzification method is indeed available in the Fuzzy Logic Toolbox and is associated with the Smallest, Middle, and Largest of Maximum, denoted as SOM, MOM, and LOM, respectively. If the height of the aggregated output membership function (amf) is at the peak point, then all three MOM, SOM, and LOM have the same value. However, if the amf has a plateau at its maximum value, the MOM, SOM, and LOM will have different values as shown in the figure below.
Since the min–max operator often results in plateaus in the aggregated output membership function, it is common to choose the Middle of Maximum (MOM) as the height defuzzification method.
x = 0:0.01:20;
%% output membership functions
mf1 = trimf( x, [ 0 5 10]);
mf2 = trapmf(x, [ 5 7 14 16]);
mf3 = trapmf(x, [12 13 18 20]);
%% rule firing strength
fs1 = 0.7; % firing strength of mf1 (change to 1.0 to see the difference)
fs2 = 0.5; % firing strength of mf2
fs3 = 0.3; % firing strength of mf3
%% aggregated output membership function
% amf = max(fs2*mf2, max(fs1*mf1, fs3*mf3));
amf = max(min(fs2, mf2), max(min(fs1, mf1), min(fs3, mf3)));
%% plot membership functions
figure('Tag','defuzz')
hold on
plot(x, [mf1; mf2; mf3])
plot(x, amf, 'LineWidth', 3)
hold off
grid on
%% Labels
xlabel('Output variable')
ylabel('Degree of membership')
h_gca = gca;
h_gca.YTick = 0:0.2:1;
ylim([-1.2 1.2])
text(4.5, 1.1, 'mf1')
text(10., 1.1, 'mf2')
text(15., 1.1, 'mf3')
title('Five Defuzzification methods')
%% Defuzzification methods
xCentroid = defuzz(x, amf, 'centroid');
xBisector = defuzz(x, amf, 'bisector');
xLOM = defuzz(x, amf, 'lom');
xMOM = defuzz(x, amf, 'mom');
xSOM = defuzz(x, amf, 'som');
hCentroid = line([xCentroid xCentroid], [-0.1 1.0], 'Color', '#7F7F7F', 'LineStyle', '--');
tCentroid = text(xCentroid, -0.15, 'Centroid', 'FontWeight', 'bold');
hBisector = line([xBisector xBisector], [-0.3 1.0], 'Color', '#7F7F7F', 'LineStyle', '--');
tBisector = text(xBisector-1.5, -0.35, 'Bisector', 'FontWeight', 'bold');
hLOM = line([xLOM xLOM], [-0.5 1.0], 'Color', '#7F7F7F', 'LineStyle','--');
tLOM = text(xLOM-1, -0.55,' LOM', 'FontWeight', 'bold');
hMOM = line([xMOM xMOM], [-0.7 1.0], 'Color', '#7F7F7F', 'LineStyle','--');
tMOM = text(xMOM-1, -0.75,' MOM', 'FontWeight', 'bold');
hSOM = line([xSOM xSOM], [-0.9 1.0], 'Color', '#7F7F7F', 'LineStyle','--');
tSOM = text(xSOM-1, -0.95,' SOM', 'FontWeight', 'bold');
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Fuzzy Logic Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
