Plot Graph using fmincon
Afficher commentaires plus anciens
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 commentaires
Walter Roberson
le 19 Avr 2018
Please post enough to reproduce -- e.g., R_f and Cm, Cwp, etc.
Yun Yong Lin
le 19 Avr 2018
Walter Roberson
le 19 Avr 2018
We need your complete code, along with any data files you use.
Yun Yong Lin
le 19 Avr 2018
Matt J
le 19 Avr 2018
How do we know if we've fixed it? What result do you see now? What should you see?
Walter Roberson
le 19 Avr 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);
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Spline Postprocessing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!