Plot Graph using fmincon
Show older comments
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 Comments
Walter Roberson
on 19 Apr 2018
Please post enough to reproduce -- e.g., R_f and Cm, Cwp, etc.
Yun Yong Lin
on 19 Apr 2018
Walter Roberson
on 19 Apr 2018
We need your complete code, along with any data files you use.
Yun Yong Lin
on 19 Apr 2018
Matt J
on 19 Apr 2018
How do we know if we've fixed it? What result do you see now? What should you see?
Walter Roberson
on 19 Apr 2018
Undefined function or variable 'x0'. Error in Main (line 60) [x,fval,exitflag] = fmincon(fun,x0,A,bt,Aeq,beq,lb,ub,nonlincon,options);
Accepted Answer
More Answers (0)
Categories
Find more on Spline Postprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!