Fuzzy logic - help required urgently - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Fuzzy logic - help required urgently

Vedu8Vedu8 Posts: 1Member
Hi .. I am new to the fuzzy logic systems. I studied it a little and developed one programme in Matlab .
It seems fine to me but it doesnt work correctly for some inputs.
It gives a warning "Total area is zero in defuzzCentroid() for output 1"
"Average of the range of this output variable is used as the output value"

I am confused whether some problem in Logic or something else.Logic seems fine to me.
Can you please see whats the problem in logic or implementation.

I have 3 inputs and 1 output.

function [FaultIndex] = indexcal(NormRMS,dstatVal,Difference)

d = newfis('Fault1');

d=addvar(d,'input','NormRms', [0 20]);
d=addmf(d,'input',1,'Good','trapmf', [-0.491 -0.0131 1 1.203]);
d=addmf(d,'input',1,'Bad','trimf', [1.0 1.4 1.8]);
d=addmf(d,'input',1,'Worse','trapmf', [1.6 2 6 6.4]);
d=addmf(d,'input',1,'Worst','smf', [6.2 7.2]);

d=addvar(d,'input','dstat', [0 1]);
d=addmf(d,'input',2,'Good','trapmf', [-0.491 -0.0131 0.05 0.15]);
d=addmf(d,'input',2,'Bad','trimf',[0.12 0.21 0.3]);
d=addmf(d,'input',2,'Worse','smf', [0.28 0.32]);

d=addvar(d,'input','Difference', [0 50]);
d=addmf(d,'input',3,'Good','trapmf', [-0.491 -0.0131 1 1.203]);
d=addmf(d,'input',3,'Bad','trimf', [1.0 5.5 10.0]);
d=addmf(d,'input',3,'Worse','trapmf', [9 12 18 21]);
d=addmf(d,'input',3,'Worst','smf', [20 22]);

d=addvar(d,'output','Index', [0 1]);
d=addmf(d,'output',1,'Normal','zmf', [0.2 0.4]);
d=addmf(d,'output',1,'Warning','trimf', [0.3 0.5 0.7]);
d=addmf(d,'output',1,'Alarm','trapmf', [0.6 0.65 0.7 0.75]);
d=addmf(d,'output',1,'SevereAlarm','smf', [0.7 0.8]);

RuleList3=[1 1 1 1 1 1 ; 2 2 2 2 1 1; 3 3 3 4 1 1;...
2 3 3 3 1 1; 3 2 3 3 1 1; 3 3 2 3 1 1;4 0 0 4 1 1; 0 0 4 3 1 1];


d=addrule(d, RuleList3);
[FaultIndex] = evalfis([NormRMS dstatVal Difference],d);

My inputs are : 1.0192 0.04 1.4305

So it gives result as 0.5 i.e. average of the range [ 0 1] though according to the inputs and membership
functions , output should be much less.

Please reply asap.:-)

Thanks:-)

Comments

  • PredictorPredictor Posts: 17Member
    It sounds as though, in the cases you mention, the entire output domain has a fuzzy truth of 0.0. Typically, as the various fuzzy rules fire, they each attach one more fuzzy output set to be combined through fuzzy composition. Yours, I am guessing, have all gone to zero.

    One easy possibility to check is whether your entire [italic]input[/italic] is covered- if it's not, no rules will fire and the output domain will have nothing in it. For the specific cases which generate this error, I suggest checking whether any fuzzy rules fire at all (or should).

    Good luck!


    -Will Dwinnell
    [link=http://matlabdatamining.blogspot.com/]Data Mining in MATLAB[/link]
Sign In or Register to comment.