Optimization Questions on set constraint
조회 수: 5 (최근 30일)
이전 댓글 표시
Halo
I have got a question when setting the constraint of optimization I want to optimize the p(1,p(2)and p(3) There are 4 constraint i need to set
1)p(1)+p(2)+p(3)=1
2)p(1)*e(1)+p(2)*e(2)+p(3)*e(3)<=eav
3)0<=p(i), where i=1,2,3
4)p(i)<=1, where i=1,2,3
I want these set in a condition file However matlab just tell me
Warning: The default trust-region-reflective algorithm does not solve problems with the constraints you
have specified. FMINCON will use the active-set algorithm instead. For information on applicable
algorithms, see Choosing the Algorithm in the documentation.
> In fmincon at 504
In optst22 at 32
Warning: Your current settings will run a different algorithm (interior-point) in a future release.
> In fmincon at 509
In optst22 at 32
PS it seems that it failure PLZ help me
댓글 수: 0
답변 (3개)
Ho Chun
2014년 12월 8일
편집: Matt J
2014년 12월 8일
댓글 수: 2
Matt J
2014년 12월 8일
편집: Matt J
2014년 12월 8일
Only bound constraints can be satisfied exactly, but only with the interior-point or sqp algorithm, and only if you use the lb,ub arguments to express them, as Alan indicated.
The rest of the constraints can be violated slightly and you must accept this. Although, you can use the TolCon input option to demand a lower non-zero violation. The price will be more iterations and longer compute time for fmincon, however.
Torsten
2014년 12월 8일
If t=1, result=p(1)+p(2)+p(3) and your call to fmincon is correct, I don't see anything wrong.
By the way: The constraints p(i)<=1 are superfluous because you claim p(i)>=0 and p(1)+p(2)+p(3)=1.
Best wishes
Torsten.
Alan Weiss
2014년 12월 8일
You should not be using nonlinear constraints. Instead, use bounds and linear constraints as follows:
lb = zeros(3,1)
ub = ones(3,1)
Aeq = [1,1,1]; beq = 1;
A = [e(1),e(2),e(3)]; b = eav;
options = optimoptions(@fmincon,'Algorithm','interior-point');
[x,fval,eflag,outpt] = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,[],options)
Alan Weiss
MATLAB mathematical toolbox documentation
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Surrogate Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!