"Could not find a feasible initial point" error in GA.

1 回表示 (過去 30 日間)
shirin mhd
shirin mhd 2022 年 5 月 18 日
編集済み: Torsten 2022 年 5 月 18 日
Hi everyone
I try to optimize a problem that is visible below:
a1=3.51e9; a2=750.9;
a3=1.93e8; a4=8.10e8;
a5=min(a3,a2); a6=a4-a1;
a7=a1-a5; a8=min(a1,a7);
answer=ga(@(x) 1e-8*((x(1)+x(2)+x(3)+x(4)+x(5))^2)-100*(x(1)+x(2)+x(3)+x(4)+x(5)),5,...
[-1 0 0 0 0;0 -1 0 0 0;0 0 -1 0 0;0 0 0 -1 0;0 0 0 0 -1;1 0 0 0 0;0 1 0 0 0;...
0 0 1 0 0;0 0 0 1 0;0 0 0 0 1;-1 -1 -1 -1 -1;1 1 1 1 1],[0 0 0 0 0 1e6 1e7 3e7 5e7 7e7 a6 a8])
but I get this result:
Could not find a feasible initial point.
answer =
[]
what is this error for?
what should I do to solve this issue?
I really appreciate any help.
  3 件のコメント
Matt J
Matt J 2022 年 5 月 18 日
編集済み: Matt J 2022 年 5 月 18 日
Avoid using linear constraints to express simple bounds:
A=[-1 -1 -1 -1 -1;
1 1 1 1 1];
b=[a6;a8];
lb=zeros(5,1);
ub=[1e6 1e7 3e7 5e7 7e7];
fun=@(x) 1e-8*((x(1)+x(2)+x(3)+x(4)+x(5))^2)-100*(x(1)+x(2)+x(3)+x(4)+x(5));
answer=ga(fun,5,A,b,[],[],lb,ub)
Also consider using quadprog instead. It is better tailored to this type of problem than ga().
shirin mhd
shirin mhd 2022 年 5 月 18 日
dear Torsten
sorry I edited the problem.
dear Matt J
I did changes that you mentioned above but I still get the same error

サインインしてコメントする。

回答 (1 件)

Torsten
Torsten 2022 年 5 月 18 日
編集済み: Torsten 2022 年 5 月 18 日
The sum of the upper bounds you prescribe for your variables x(1),...,x(5) is smaller than -a6.
But you want to have x(1) + x(2) + x(3) + x(4) + x(5) >= -a6.
Thus it follows from your inequality constraints that the problem has no feasible point.

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by