home Forums # Technical Support Matlab and jfuzzylight difference

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2115
    Unknown
    Member

    I 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.

    #2117

    Hi,

    thank you very much for your post.

    Please, could you post or email me the files presenting such differences?

    Thanks!

    #2119

    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
    
    #2120

    Here is an issue in github better describing what I commented earlier:

    https://github.com/fuzzylite/fuzzylite/issues/68

    #2121
    Unknown
    Member

    Thank you very much!

    This fix really works. Minor note: Matlab does use impMethodand aggMethod, 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

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.