How can I write objective function with variable plus constant for solving using intlinprog Ex. X1+4
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nurye Hassen
el 16 de Sept. de 2017
Comentada: Nurye Hassen
el 15 de Nov. de 2017
How can I write objective function with variable plus constant for solving using intlinprog Ex. X1+4
Thank you for your time
0 comentarios
Respuesta aceptada
Matt J
el 16 de Sept. de 2017
Editada: Matt J
el 16 de Sept. de 2017
There is no way to include a constant term in the objective function, but it would be meaningless to do so. Adding a constant term does not change the optimal solution, x.
2 comentarios
Matt J
el 7 de Oct. de 2017
Editada: Matt J
el 7 de Oct. de 2017
Again, that would complicate things unnecessarily. Using your example of obj X1+4, note that
min{X1+4} = min{X1}+4
In other words, you could just solve the minimization min{X1} without any constant terms and then add 4 to the final result.
Más respuestas (1)
Aurele Turnes
el 13 de Nov. de 2017
Editada: Aurele Turnes
el 13 de Nov. de 2017
If you have R2017b, the new Problem-based approach lets you specify constant terms in the objective of linear and mixed-integer linear problems. Although Matt is correct that the constant term will not change the final solution value, just the objective value.
Ver también
Categorías
Más información sobre Linear Programming and Mixed-Integer Linear Programming en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!