Warning: No rules fired for Output 1. Defuzzified output value set to its mean range value 0.5.

11 views (last 30 days)
I have this problem:
Warning: No rules fired for Output 1.
Defuzzified output value set to its mean range value 0.5.
That is a huge problem for my study. How I can solve this?
This is part of my code:
% Crear objeto FIS vacío
fis = mamfis;
fis.AndMethod = 'prod';
fis.OrMethod = 'max';
fis.ImplicationMethod = 'min';
fis.AggregationMethod = 'max';
% Agregar variable de entrada 'Desplazamiento'
fis = addInput(fis, [-1 1], 'Name', 'Desplazamiento');
fis = addMF(fis, 'Desplazamiento', 'gaussmf', [ddesvest1 dmedia1], 'Name', 'mf1');
fis = addMF(fis, 'Desplazamiento', 'gaussmf', [ddesvest2 dmedia2], 'Name', 'mf2');
fis = addMF(fis, 'Desplazamiento', 'gaussmf', [ddesvest3 dmedia3], 'Name', 'mf3');
fis = addMF(fis, 'Desplazamiento', 'gaussmf', [ddesvest4 dmedia4], 'Name', 'mf4');
fis = addMF(fis, 'Desplazamiento', 'gaussmf', [ddesvest5 dmedia5], 'Name', 'mf5');
fis = addMF(fis, 'Desplazamiento', 'gaussmf', [ddesvest6 dmedia6], 'Name', 'mf6');
fis = addMF(fis, 'Desplazamiento', 'gaussmf', [ddesvest7 dmedia7], 'Name', 'mf7');
% Agregar variable de entrada 'Velocidad'
fis = addInput(fis, [-1 1], 'Name', 'Velocidad');
fis = addMF(fis, 'Velocidad', 'gaussmf', [vdesvest1 vmedia1], 'Name', 'mf1');
fis = addMF(fis, 'Velocidad', 'gaussmf', [vdesvest2 vmedia2], 'Name', 'mf2');
fis = addMF(fis, 'Velocidad', 'gaussmf', [vdesvest3 vmedia3], 'Name', 'mf3');
fis = addMF(fis, 'Velocidad', 'gaussmf', [vdesvest4 vmedia4], 'Name', 'mf4');
fis = addMF(fis, 'Velocidad', 'gaussmf', [vdesvest5 vmedia5], 'Name', 'mf5');
fis = addMF(fis, 'Velocidad', 'gaussmf', [vdesvest6 vmedia6], 'Name', 'mf6');
fis = addMF(fis, 'Velocidad', 'gaussmf', [vdesvest7 vmedia7], 'Name', 'mf7');
% Agregar variable de salida 'Voltaje'
fis = addOutput(fis, [0 1], 'Name', 'Voltaje');
fis = addMF(fis, 'Voltaje', 'gaussmf', [vodesvest1 vomedia1], 'Name', 'mf1');
fis = addMF(fis, 'Voltaje', 'gaussmf', [vodesvest2 vomedia2], 'Name', 'mf2');
fis = addMF(fis, 'Voltaje', 'gaussmf', [vodesvest3 vomedia3], 'Name', 'mf3');
fis = addMF(fis, 'Voltaje', 'gaussmf', [vodesvest4 vomedia4], 'Name', 'mf4');
fis.DefuzzificationMethod = 'mom';
% Agregar las reglas difusas
rules = [1 1 4 1 1;
1 2 4 1 1;
1 3 4 1 1;
1 4 3 1 1;
1 5 1 1 1;
1 6 1 1 1;
1 7 1 1 1;
2 1 4 1 1;
2 2 4 1 1;
2 3 4 1 1;
2 4 2 1 1;
2 5 1 1 1;
2 6 1 1 1;
2 7 2 1 1;
3 1 4 1 1;
3 2 4 1 1;
3 3 4 1 1;
3 4 1 1 1;
3 5 1 1 1;
3 6 2 1 1;
3 7 3 1 1;
4 1 4 1 1;
4 2 3 1 1;
4 3 2 1 1;
4 4 1 1 1;
4 5 2 1 1;
4 6 3 1 1;
4 7 4 1 1;
5 1 3 1 1;
5 2 2 1 1;
5 3 1 1 1;
5 4 1 1 1;
5 5 4 1 1;
5 6 4 1 1;
5 7 4 1 1;
6 1 2 1 1;
6 2 1 1 1;
6 3 1 1 1;
6 4 2 1 1;
6 5 4 1 1;
6 6 4 1 1;
6 7 4 1 1;
7 1 1 1 1;
7 2 1 1 1;
7 3 1 1 1;
7 4 3 1 1;
7 5 4 1 1;
7 6 4 1 1;
7 7 4 1 1];
% Agregar todas las reglas al FIS
fis = addrule(fis, rules);

Answers (2)

Sam Chak
Sam Chak on 20 Apr 2023
I can only explain why the "Warning" appears. Once you understand, try fixing the underlying root cause. Here are two examples.
Case #1: The degree of membership at the boundaries is zero.
In the first figure, Input #1 is 0 and Input #2 is 1, but none of the rules is triggered due to the design of the output membership functions (specifically outMF1 and outMF9), resulting the internal algorithm automatically set the defuzzified output value to its mean range value that is 0.5.
Figure 1
Case #2: The input membership functions do not fully cover the universe of discourse.
In the second figure, the first input (Weft_stretch = 85) occurs in the region outside the coverage of the two membership functions. Thus, no rules can possibly be fired for any of the 5 outputs. Thus, all outputs return their mean range values.
Figure 2
  1 Comment
Sam Chak
Sam Chak on 22 Apr 2023
If you have access to the FIS design, it would be more effective to directly reshape the Membership Functions so that they cover the entire the universe of discourse.
Can you provide more info on the initial design of MFs?

Sign in to comment.


Verónica Valencia Valencia
Thank you @Sam Chak. Should I change the rules then? Or is there any way to make the warning throw me 0 instead of 0.5?

Community Treasure Hunt

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

Start Hunting!