The best way to write a large number of constraints for an optimization problem
4 次查看(过去 30 天)
显示 更早的评论
Hi All,
I have an optimization problem which have a larger number of variables, probably 10000 optimization variables and a large number of constraints. The optimization problem is mixed integer convex problem. What is the best way to define the large number of constraints?. Can I use loops like the ones used in CVX to define constraints?. I have matlab 2013a.
Thank you
0 个评论
采纳的回答
Matt J
2019-11-6
编辑:Matt J
2019-11-6
If they are linear constraints, they will be expressed using matrix-vector multiplication
A*x<=b
Aeq*x<=beq
so any vectorized method for building the A, Aeq, b, beq, matrices would be appropriate. Similarly, nonlinear constraints in Matlab are expressed using user-defined constraint functions of the following form
function [cineq,ceq]=nonlcon(x)
....
end
where cineq and ceq are vectors of inequality and equality constraint violations, respectively. When the number of variables or constraints is large, you would use vectorized Matlab commands to generate cineq and ceq from x.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Nonlinear Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!