How to constrain the optimized variable using fmincon ?
3 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone,
I am currently using fmincon function to solve an optimization problem.
Basically I am trying to minimize the integral (sum(abs)) of a variable u. The thing is that I want these u to always be >0, and I am not sure if what I do is correct or how to set correctly the constraint function "noncol" to create this condition.
Here it is what I am doing now: I compute the variable u in my costfun (then its integral), I put these u in global and put another global u in the noncol function to use it. I just set c=-u (as the c<0 and I want u>0). Is it correct ?
Matlab doesn't return any error and run correctly I am just not sure if it is the right way to do it.
Thanks in advance
6 件のコメント
Torsten
2017 年 3 月 8 日
No. As you can see from your notation c(u(v(x))): In the end, everything depends on x.
Best wishes
Torsten.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with Optimization Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!