How can i use binary variables for if else condition in problem based MILP optimization problem
11 次查看(过去 30 天)
显示 更早的评论
Hi,
I have sent query before about inlcuding conditional statement in objective function, i understand that it is not possible.(https://www.mathworks.com/matlabcentral/answers/1436322-battery-storage-optimisation-problem_charge-and-discharge-conditional-constraint-nested-function_jn)
i have two costs to include in objective function depending on the sign of power (whether positive or not),
i have checked the example https://www.mathworks.com/help/optim/ug/optimal-dispatch-problem-based.html,, but i am confused how i can use yhe binary variable to indicate the two dfferent cost to use in objective function.
Please advice
1 个评论
Alan Weiss
2021-10-4
See my answer to the same question in https://www.mathworks.com/matlabcentral/answers/693740-linear-programming-with-conditional-constraints
Alan Weiss
MATLAB mathematical toolbox documentation
回答(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!