问题描述
我试图优化我的FIS与GA的帮助下,用MATLAB优化工具箱。在code是这样的:
i am trying to optimize my FIS with the help of a GA, with matlab optimization toolbox. The code looks like this:
function errorr=fun3_2(x)
Name='eleni';
Type='mamdani';
NumInputs='8';
NumOutputs='1';
% NumRules='80';
AndMethod='min';
OrMethod='max';
ImpMethod='min';
AggMethod='max';
DefuzzMethod='centroid';
a=newfis('eleni');
%INPUTS_______________input 1____________
a.input(1).name='ARIAS';
a.input(1).range=[0 1];
a.input(1).mf(1).name='1';
a.input(1).mf(1).type='trimf';
a.input(1).mf(1).params=[x(1) x(2) x(3)];
a.input(1).mf(2).name='2';
a.input(1).mf(2).type='trimf';
a.input(1).mf(2).params=[x(4) x(5) x(6)];
a.input(1).mf(3).name='3';
a.input(1).mf(3).type='trimf';
a.input(1).mf(3).params=[x(7) x(8) x(9)];
..........等等,对共8个输入和输出的10各1个的MF。
.......and so on, for totally 8 inputs and 1 output of 10 MFs each.
我正确地插入线性不等式,从而
I insert linear inequalities correctly, so as
0<x(1)<x(2)<x(3)<1
0<x(4)<x(5)<x(6)<1
...等。
..etc..
但在10以下的迭代过程停止并出现以下错误信息appers:
but after 10 or less iterations the process stops and the following error message appers:
错误的运行优化。非法参数条件:B> C
Error running optimization.Illegal parameter condition: b > c
是我应该做的,以保持它运行的任何想法?
Any ideas of what i should do to keep it running?
推荐答案
在表A和B的线性不等式,是(假设只有2 MFS,然后概括它)
the tables A and B for the linear inequalities, are (assuming only 2 mfs, and then generalize it)
A=[-1 0 0 0 0 0;
1 -1 0 0 0 0;
0 1 -1 0 0 0;
0 0 1 0 0 0;
0 0 0 -1 0 0;
0 0 0 1 -1 0;
0 0 0 0 1 -1;
0 0 0 0 0 1]
B=[0;0;0;1;0;0;0;1]
矩阵B是问题所在,因为ΑΧ&其中; =Β,所以以这种方式它表明,说不定X1 = x2..etc。 的平等,必须消除的!假设有参数之间的微小差异,解决了这个问题,因此表B必须被定义为,与GA运行:
matrix B is the problem, because ΑΧ<=Β, so in that way it suggests that maybe x1=x2..etc. The equality must be eliminated! Assuming there is a slight difference between the parameters, solves the problem, thus table B must be defined as follows, and the ga runs:
B=[-0.01;-0.01;-0.01;0.99;-0.01;-0.01;-0.01;0.99]
这篇关于优化的FIS隶属函数,通过遗传算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!