Division by an OptimizationVariable not supported.
5 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I met a problem that in my equation, there is a part where includes a division of two optimization varaibles. For example, if i let
y=optimvar('y',[4,1,4],'Type','integer','LowerBound',0,'UpperBound',1);
then my equation would be like: (1-yi)/sum(yi)
However, matlab says division of two optimization variable is not supported by optimization toolbox, while I don't think i can change the form of my equation. So I
'm wondering if it's possible to proceed.
Thank you!
0 个评论
采纳的回答
Matt J
2019-7-27
编辑:Matt J
2019-7-27
The problem-based solver is largely limited to linear and (in R2019) quadratic programs. If you find yourself computing non-linear/non-quadratic OptimizationExpressions, it will typically mean that you have a more general optimization problem than that and must resort to another solver.
Or, you could try to reformulate your problem as a linear problem, but to know if that is possible, we would have to see the full problem, not just a single expression that occurs in it somewhere.
5 个评论
Matt J
2019-7-30
编辑:Matt J
2019-7-30
Here is a list of Supported Operations on Optimization Expressions and Variables. You will have to go through your operations and see which are not on the list. It appears, for example, that sqrt is not there.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Problem-Based Optimization and Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!