How to use fmincon with non-linear constraints that are dependent on the objective function output?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Torsten
2018년 3월 8일
By writing a function "noncons" and calling the objective function from within "noncons" to get "T_max_sim_lst".
Best wishes
Torsten.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!