How can i add parameters intlinprog
3 views (last 30 days)
Show older comments
I have a huge matrix. I can write it but i can not find any example for it.
x(1)*c(1)+x(2)*c(2)+x(3)*c(3)
if x(1) greater than 0(zero) x(3)=1
else x(3)=0
there is simple example what i want to write in my model. I'm thinking to use intlinprog. if you have any other solver i'm open for suggestions
0 Comments
Answers (1)
John D'Errico
on 21 May 2016
Edited: John D'Errico
on 21 May 2016
That makes your problem nonlinear. intlinprog cannot handle a nonlinear problem.
As well, this creates a non-differentiable (actually discontinuous) objective. So most solvers will have problems.
In your example, x(3) is not actually a variable the optimizer can control independently. So I'll argue this does not form a constraint, but a part of the objective function.
Anyway that you do it, you need an optimizer that can handle discontinuities. That eliminates anything that uses a gradient. And since you appear to have MANY variables, some tools that are not dependent on a gradient (like fminsearch) will fail. Such polytope tools are really limited to 6-10 variables at the upper end. Even they will have serious problems with discontinuous objectives.
That leaves the class of stochastic optimizers as your target. So genetic algorithms, particle swarms, simulated annealing, etc. You need something that can handle a large scale problem, but is not fazed by discontinuities.
0 Comments
See Also
Categories
Find more on Linear Programming and Mixed-Integer Linear Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!