Condition between variable fmincon

I have an optimization problem of 2 variables a and b of lenght N both.
I want to add the following constraint with matrices:
if a=0 then b=0
Can you help me to do this?

4 Comments

I'm sorry, but I do not understand your question. Is your problem an integer problem? If not, then this constraint is quite discontinuous, and probably not suitable for Optimization Toolbox™. I also do not understand the constraint. Do you mean a(i) = 0 implies b(i) = 0, or do you mean that the constraint holds only if all elements in a are zero?
Alan Weiss
MATLAB mathematical toolbox documentation
Thank you Alan for your answer. My problem is not integer. I mean that if a(i)=0 then b(i)=0 for i between 1 and N where N=size(a)=size(b) And a and b are vectors of two optimization variables.
I agree with Alan. If your variables are continuous, it is peculiar to impose such a discontinuous constraint. What is the rationale behind it?
When no ressources are allocated (i.e. a(i)=0) then the offloading should not happen.
In the litterature, I found b<a which is not very accurate.

Answers (0)

This question is closed.

Products

Release

R2018b

Asked:

on 31 Oct 2019

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!