home › Forums › # Technical Support › Matlab and jfuzzylight difference › Reply To: Matlab and jfuzzylight difference
Hi,
thank you for emailing me the example.
The problem you are experiencing is because I did something “funny” when implementing Takagi-Sugeno controllers. To solve your problem you *need* to delete the implication and aggregation methods as follows:
ImpMethod=''
AggMethod=''
You can find the details on what I did here:
http://fuzzylite.com/cpp/#Weighted_Defuzzifiers
In Matlab, I do not know why the examples of TakagiSugeno have implication and aggregation operators (i.e., ImpMethod
and AggMethod
). Matlab does nothing with these operators, that is, you can change them in Matlab and obtain the same results. In FuzzyLite, for (funny) design purposes, I decided to use these operators for what is detailed at http://fuzzylite.com/cpp/#Weighted_Defuzzifiers (or in the documentation http://fuzzylite.github.io/fuzzylite/d7/dde/classfl_1_1_weighted_average.html). For the sake of simplicity, I may remove this “feature” in the next version.
The corrected example is:
[System]
Name='temperature'
Type='sugeno'
Version=2.0
NumInputs=2
NumOutputs=1
NumRules=7
AndMethod='min'
OrMethod='max'
ImpMethod=''
AggMethod=''
DefuzzMethod='wtaver'
[Input1]
Name='ambient'
Range=[-50 50]
NumMFs=3
MF1='cold':'trapmf',[-86 -54 15 23]
MF2='office':'trimf',[15 23 31]
MF3='hot':'trapmf',[23 31 54 86]
[Input2]
Name='diff'
Range=[-10 10]
NumMFs=4
MF1='big':'trapmf',[1 1.5 10 16]
MF2='verysmall':'trimf',[-0.5 0 0.5]
MF3='small':'trimf',[-0.5 0.5 1.5]
MF4='negative':'trapmf',[-10 -10 -0.5 0]
[Output1]
Name='probability'
Range=[0 1]
NumMFs=3
MF1='low':'constant',[0]
MF2='medium':'constant',[0.5]
MF3='high':'constant',[1]
[Rules]
0 1, 1 (1) : 1
0 4, 3 (1) : 1
3 2, 2 (1) : 1
3 3, 2 (1) : 1
-3 2, 3 (1) : 1
2 3, 2 (1) : 1
1 3, 3 (1) : 1