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

 Accepted Answer

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 Comments

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.
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.
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.
Thank You sir, Finally i am able to solve the problem with your help.

Sign in to comment.

More Answers (0)

Categories

Find more on Fuzzy Logic Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!