Error running optimization tool for GAFuzzy

please help me out with the error below.
Optimization running.
Error running optimization.
Illegal parameters in fisGeneralizedBellMf() --> a = 0

 채택된 답변

Walter Roberson
Walter Roberson 2018년 9월 22일

0 개 추천

Your fis includes a Generalized Bell Membership Function rule, https://www.mathworks.com/help/fuzzy/gbellmf.html
Those are of the form
1/(1 + abs((x-c)/a)^(2*b))
That is not valid if a is 0, because it gives a division by 0.
I suspect you are trying to do fuzzy processing to optimize a FIS. You need to put a positive lower bound on the first value.

댓글 수: 7

sattybol40
sattybol40 2018년 9월 23일
편집: Walter Roberson 2018년 9월 23일
i tried to implement your suggestion, but i failed.
this is my lower bound
[0 1 -Inf -Inf 0 1 -Inf -Inf 0 1 -Inf -Inf 0 1 -Inf -Inf 0 1 -Inf -Inf 0 1 -Inf -Inf 0 1 -Inf -Inf 0 1 -Inf -Inf 0 1 -Inf -Inf 0 1 -Inf -Inf 0 1 -Inf -Inf 0 1 -Inf -Inf 0 1 -Inf -Inf 0 1 -Inf -Inf 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1]
That does not tell me much, as I do not know which of those entries is the one that is going to go on to be the parameter passed as the first entry to the generalized bell membership.
It would have to be one of entries #
2 6 10 14 18 22 26 30 34 38 42 46 50 54 59 60 61 64 65 66 69 70 71 74 75 76 79 80 81 84 85 86 89 90 91 94 95 96 99 100 101 104 105 106 109 110 111 114 115 116 119 120 121 124 125 126 129 130 131
for that lower bound to be effective in preventing the problem.
sattybol40
sattybol40 2018년 9월 23일
what should be the corresponding upper bound value if i choose any of the above specified lower bound values
Those are indices, not lower bounds. For any entry in your lb vector that corresponds to an element that is going to become an "a" value of a generalized bell transfer function, the lower bound should be positive.
If your a is small (near zero) for 1/(1 + abs((x-c)/a)^(2*b)) then (x-c) would tend to be large (potentially significantly greater than 1) except when x == c exactly. A number significantly greater than one, raised to 2*b, is potentially going to end up huge if b > 1/2 so that 2*b > 1. That would lead to 1+large number on the denominator, and 1 over that would lead to a small value. If 2*b < 1 but positive, then raising to 2*b would tend to pull the value back towards 1 but still potentially much greater than 1, so 1/(1 + abs((x-c)/a)^(2*b)) could still end up fairly small
If your a is greater than max of abs(x-c) then (x-c)/a would be in the range of +/- 1. Raise that to 2*b with 2*b > 1 and you would tend to pull towards 0; if 2*b < 1 then you would tend to pull towards +/- 1. Add that to the 1 and you would tend to a value between 1 and 2, and 1 over that would be relatively moderate, 1/2 to 1.
If you continue to raise a relative the maximum x-c range, then you tend to emphasize the 1/2 or 1 possibilities more strongly.
If you know the maximum x-c value then you could tune the parameters such that what you get is effectively two cases, 1 overall where x == c exactly, and mostly a different value such as 1/2 otherwise.
sattybol40
sattybol40 2018년 9월 23일
Thanks for your response, it would take some time for me to understand and implement your suggestion.
What shape are you expecting? Are you trying to create an impulse-like function that is quite different at c then at other locations that are not near c ?
You can compute an effective limitation on a . If a is large enough, abs((x-c)/a) will be near zero, and if b > 1/2 then abs((x-c)/a)^(2*b) is going to be less than eps(1) so 1 + abs((x-c)/a)^(2*b) would become the same as 1, so the entire expression would just compute 1, with the calculation becoming useless. You might as well put an upper bound on a to prevent it from exceeding that value.
The analysis is a bit different if b can be small: the smaller b is, the more the calculation tend to single out x == c as special and output 1 at x == c and output 1/2 otherwise.
sattybol40
sattybol40 2018년 9월 24일
Thank You sir, Finally i am able to solve the problem with your help.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Fuzzy Logic Toolbox에 대해 자세히 알아보기

질문:

2018년 9월 22일

댓글:

2018년 9월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by