How can i use binary variables for if else condition in problem based MILP optimization problem
18 views (last 30 days)
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.