Thanks for powerful pso toolbox. I have an error after running the code with nonlinear constraint. The error message is:
" Problem is infeasible due to nonlinear constraints"
I have checked that my nonlinear constraints is passed with my initial population that I supplied. What could be the possible place that I can take a look to fix this problem.
Thanks for pointing that out, Aman.
b should really be a column vector [2;1] so that it will fit the equation
[1 0 ; 0 1]*[x1; x2] ≤ [2; 1]
however it looks like GA is robust enough to check for and correct that error.
I will add a small piece of input-checking code in the next release so that PSO will yield the same behavior as GA.
Sam,If PSO toolbox syntax same as GA toolbox so then I have found one a little bugs(but not with GA If using same syanx )for example: If I compare n run both GA n PSO syntax for two variable objective function.... pso(@(x)(x(1)^2+x(2)^2+x(1)),2,[1 0;0 1],[2 1]) showing "hozcat " and "psocheckinitialpopulation" error
...BUT ga(@(x)(x(1)^2+x(2)^2+x(1)),2,[1 0;0 1],[2 1]) result come out