Plot Graph using fmincon
Mostra commenti meno recenti
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 Commenti
Walter Roberson
il 19 Apr 2018
Please post enough to reproduce -- e.g., R_f and Cm, Cwp, etc.
Yun Yong Lin
il 19 Apr 2018
Walter Roberson
il 19 Apr 2018
We need your complete code, along with any data files you use.
Yun Yong Lin
il 19 Apr 2018
Matt J
il 19 Apr 2018
How do we know if we've fixed it? What result do you see now? What should you see?
Walter Roberson
il 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);
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Spline Postprocessing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!