How to use fmincon with non-linear constraints that are dependent on the objective function output?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I would like to assign non-linear constrains to my minimization problem. My issue is that my non-linear constrain function is dependent on an output of my objective function.
To run the objective function I can call;
[W,T_m,T_max_sim_lst] = sim_calc(d,frac,q_conv,set,epsillon,sigma,T_inf,area);
where "frac,q_conv,set,epsillon,sigma,T_inf,area" are constant inputs. I want to use "d" as my design variable so I setup the problem such that:
lb = 0.001; ub = 10; T_max = [1000, 600, 500];
options = optimoptions('fmincon','Display','iter');
[d_opt,W_opt] = fmincon(@(d) sim_calc(d,frac,q_conv,set,epsillon,sigma,T_inf,area),... d_0,[],[],[],[],lb,ub,@(c,ceq) noncons(T_max_sim_lst,T_max),options);
My nonlinear constraint function (noncons) is dependent on T_max_sim_lst which is an output of the objective function TPS_calc. So my question is how do I need to setup fmincon such that the variable output T_max_sim_lst is passed on correctly to the non-linear constrains inputs?
Thank you for your help, Thib
0 Commenti
Risposte (1)
Torsten
il 8 Mar 2018
By writing a function "noncons" and calling the objective function from within "noncons" to get "T_max_sim_lst".
Best wishes
Torsten.
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!