Clear Filters
Clear Filters

binary non-linear-optimization with a variable in the denominator

4 views (last 30 days)
Dear all , I am trying to do a non-linear optimization in MATLAB
The point is that my variable " x" could take the value of zero or one - binary optimization-
however, -i will try to simplify the problem - , my objective function (in a loop) is as follows :
y = y+(d/(x((2*j))*B;
i have the following questions if it is possible to be answered. 1) 2) can a possible value of a zero or inf. be in the denominator of the objective function ?
3) can the denominator and the numerator contains zero or inf ? so we may get zero / inf
4) what should be done otherwise?
Thank you in advance

Answers (1)

John D'Errico
John D'Errico on 28 May 2016
Never divide by zero. The result is meaningless. Well, maybe +/- inf, sometimes NaN, but all equally useless.
Optimizations of infinite objective functions tend to be poorly posed.
What should be done? Spend some time in rethinking your problem, as what you have so far cannot be solved. Given that we don't know the source of this problem, anything about it including how you have chosen to solve it but for a one line code fragment, how can we possibly help more?

Categories

Find more on Get Started with Optimization Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!