home › Forums › # Technical Support › Matlab and jfuzzylight difference
Tagged: matlab
- This topic has 4 replies, 2 voices, and was last updated 7 years, 1 month ago by
Unknown.
-
AuthorPosts
-
April 5, 2016 at 05:03 #2115
Unknown
MemberI found that for some fuzzy systems Matlab (2015b2) and jfuzzylight 5.0 produce different results (using the same FIS file,of course). Is this a known issue? I can send the FIS and test data if necessary.
April 5, 2016 at 06:49 #2117Juan Rada-Vilela (admin)
KeymasterHi,
thank you very much for your post.
Please, could you post or email me the files presenting such differences?
Thanks!
April 6, 2016 at 23:31 #2119Juan Rada-Vilela (admin)
KeymasterHi,
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
andAggMethod
). 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
April 6, 2016 at 23:45 #2120Juan Rada-Vilela (admin)
KeymasterHere is an issue in github better describing what I commented earlier:
April 7, 2016 at 03:07 #2121Unknown
MemberThank you very much!
This fix really works. Minor note: Matlab does use
impMethod
andaggMethod
, it just replaces the empty strings with defaults:impMethod: 'prod' aggMethod: 'sum'
Its easy to see if you compare the FIS file’s content and the working space variable (structure).
It leads to the inconvenience: Matlab fuzzy editor (from Fuzzy Logic toolbox) changes the file on save, and it is necessary to edit it before jfuzzylight have read it.
Regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.