[Fuzzy Logic] How to advise the membership functions and plot the graph

8 ビュー (過去 30 日間)
Junghwan
Junghwan 2023 年 2 月 7 日
コメント済み: Junghwan 2023 年 2 月 16 日
Dear all,
I'm struggling to reslove the issue how to advise the membership functions and plot the graph in fuzzy logic inference system.
Please help me and it will be highly appreciated if you could give me a hand.
I made the FIS with 4 inputs and 1 output and 81 rules as following;
[System]
Name='Fuzzy'
Type='mamdani'
Version=2.0
NumInputs=4
NumOutputs=1
NumRules=81
AndMethod='min'
OrMethod='max'
ImpMethod='min'
AggMethod='max'
DefuzzMethod='centroid'
[Input1]
Name='General'
Range=[0 10]
NumMFs=3
MF1='low':'gaussmf',[1.5 0]
MF2='medium':'gaussmf',[1.5 5]
MF3='high':'gaussmf',[1.5 10]
figure(1)
subplot(2,1,1)
plotMF1(fis, 'Input1', 1), grid on, title('Input 1: Amount of Dirt')
subplot(2,1,2)
plotMF2(fis, 'input', 2), grid on, title('Input 2: Amount of Grease')
[Input2]
Name='Fuel_receiving_and_refueling_area'
Range=[0 10]
NumMFs=3
MF1='low':'gaussmf',[1.5 0]
MF2='medium':'gaussmf',[1.5 5]
MF3='high':'gaussmf',[1.5 10]
[Input3]
Name='Reactor_area'
Range=[0 10]
NumMFs=3
MF1='low':'gaussmf',[1.5 0]
MF2='medium':'gaussmf',[1.5 5]
MF3='high':'gaussmf',[1.5 10]
[Input4]
Name='Spent_fuel_pool_area'
Range=[0 10]
NumMFs=3
MF1='low':'gaussmf',[1.5 0]
MF2='medium':'gaussmf',[1.5 5]
MF3='high':'gaussmf',[1.5 10]
[Output1]
Name='Safeguardability'
Range=[0 10]
NumMFs=5
MF1='Very_low':'trimf',[-2.5 0 2.5]
MF2='Low':'trimf',[0 2.5 5]
MF3='Medium':'trimf',[2.5 5 7.5]
MF4='High':'trimf',[5 7.5 10]
MF5='Very_high':'trimf',[7.5 10 12.5]
[Rules]
1 1 1 1, 1 (1) : 2
1 1 1 2, 2 (1) : 2
1 1 1 3, 2 (1) : 2
1 1 2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 3 1, 3 (1) : 2
3 1 3 2, 3 (1) : 2
3 1 3 3, 4 (1) : 2
3 2 1 1, 3 (1) : 2
3 2 1 2, 3 (1) : 2
3 2 1 3, 3 (1) : 2
3 2 2 1, 3 (1) : 2
3 2 2 2, 3 (1) : 2
3 2 2 3, 4 (1) : 2
3 2 3 1, 3 (1) : 2
3 2 3 2, 4 (1) : 2
3 2 3 3, 4 (1) : 2
3 3 1 1, 3 (1) : 2
3 3 1 2, 3 (1) : 2
3 3 1 3, 4 (1) : 2
3 3 2 1, 3 (1) : 2
3 3 2 2, 4 (1) : 2
3 3 2 3, 4 (1) : 2
3 3 3 1, 4 (1) : 2
3 3 3 2, 4 (1) : 2
3 3 3 3, 5 (1) : 2
Q1. Is it necessary to have 81(=3*3*3*3) rules?
Q2. How I will be able to plot the membership graphs such as an example as following?
FYI, I will integrate this FIS into App designer with slider which give the numeric inputs as following;
I'd like to display the defuzzification graph on the UIaxes when I push the "Process" button like the follolwing example;

採用された回答

Raghvi
Raghvi 2023 年 2 月 14 日
Hey Junghwan,
I understand that you are trying to identify the number of rules required for the fuzzy system. Additionally, you would also like to plot the membership function graphs to implement them using app designer.
From my understanding you do not need all permutations of rules to create a fuzzy system. Although, it is a good practice to add as many rules as possible to achieve accuracy in your system. Refer to the following documentation to understand more about If-Then Rules:
To plot the membership function, refer to the following:
>> fis = readfis('<filename>')
>> plotmf(fis,'input',1)
You can go through plotmf function documentation to understand more about the function and use it as per your need:
To display the plot in app designer, refer to the following documentation:
  1 件のコメント
Junghwan
Junghwan 2023 年 2 月 16 日
Thanks for valuable and prompt feedback! I will try to follow your feedback:)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFuzzy Inference System Modeling についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by