Plot Graph using fmincon
이전 댓글 표시
Hi i just can't seem to figure out how to plot a graph using fmincon. I am doing an optimization with my function:
fun =@(x) (R_f(Cm,Cwp,Abt,V,x(4),x(1),x(2),x(3)) * k_1(Cm,x(3),x(4),Cstern,x(1),x(2))) + R_w(Cwp,x(4),Abt,hb,Cm,At,x(1),x(2),x(3)) + R_b(Abt,hb,V,x(1),x(2),x(3)) + R_tr(Cwp,At,V,x(1),x(3)) + R_a(Cm,Cwp,Abt,V,hb,x(4),x(1),x(2),x(3));
lb=[2.5,1.5,150,30000];
ub=[5,3.5,250,50000]; A=[];
bt=[];
Aeq=[];
beq=[];
nonlincon = [];
options = optimoptions(@fmincon,'Algorithm','interior-point',...
'SpecifyObjectiveGradient',true,'SpecifyConstraintGradient',true,'PlotFcn',{@optimplotx,...
@optimplotfval,@optimplotfirstorderopt});
[x,fval] = fmincon(fun,x0,A,bt,Aeq,beq,lb,ub,nonlincon,options);
can i please get some help here.
댓글 수: 6
Walter Roberson
2018년 4월 19일
Please post enough to reproduce -- e.g., R_f and Cm, Cwp, etc.
Yun Yong Lin
2018년 4월 19일
Walter Roberson
2018년 4월 19일
We need your complete code, along with any data files you use.
Yun Yong Lin
2018년 4월 19일
Matt J
2018년 4월 19일
How do we know if we've fixed it? What result do you see now? What should you see?
Walter Roberson
2018년 4월 19일
Undefined function or variable 'x0'. Error in Main (line 60) [x,fval,exitflag] = fmincon(fun,x0,A,bt,Aeq,beq,lb,ub,nonlincon,options);
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Spline Postprocessing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!