November 12, 2022, 4:19pm
I have the following function to be called from another function. But it gives error, it seems cvx doesnt read such function. It is called as a part of objective in my problem.
if z>= ep
If the function is not called with argument
z being a CVX variable or expression, this function has nothing to do with CVX, even if called in the middle of a CVX program.
If the function is called with argument
z being a CVX variable or expression, it would violates CVX’s rules and generate an error message by being used as the condition in an
To implement what you want, you may have to use Big M logic modeling.using binary variables.
https://or.stackexchange.com/search?q=logic+constraints and https://yalmip.github.io/tutorial/logicprogramming .
November 13, 2022, 4:49am
Thanks for your reply Mark, I know it can be reformulated using new variables, but the goal was not to that as it increase number of variables in model. This is kind of smoothing function used in CVaR optimization and when the number of scenarios are larrge so reformulating is a drawback.
My goal is for someone to give me a billion dollars tomorrow. When I don’t have a lot of money, it is a drawback.
You can’t always get what you want.