Can someone help with nonlinear optimization with constraints? (i've tried tutorials with no luck)
이전 댓글 표시
Hi, I've been working on a hw assignment for a while trying to self teach optimization and its proving difficult. I have to minimize the function x1^3-6x1^2+11x1+x3 with the following constraints:
x1^2+x2^2-x3^2<=0 4-x1^2-x2^2-x3^2<=0 x3-5<=0 -x1<=0 -x2<=0 -x3<=0 the starting feasible point is .1,.1,3 So far, by looking at the tutorials I've come up with this coding, but I'm getting an error message about the function definition, saying "x and fval may not be used". Also, the code runs and in the command window k>> appears. Any help would be appreciated.
function f=mae342hw5p2(x) f=x1.^3-6.*x1.^2+11.*x1+x3; function [c,ceq]=confun(x) c=[ x1^2+x2^2-x3^2; 4-x1^2-x2^2-x3^2; x3-5;-x1;-x2;-x3]; ceq = []; x0=[.1 .1 3]; options=optimset('Algorithm','active-set'); [x,fval]=... fmincon(@mae342hw5p2,x0,[],[],[],[],[],[],@confun,options);
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!