How to maximise the objective function with constraints and plot the solution
Mostrar comentarios más antiguos
I want to maximise the objective function with respect to x
function=a*ln(1+x)+b(c-x)
subjected to constraints : x,min<=x<=x,max
given parameters are a,b,c.(Randamly I choose some values but it shows error as 'Index exceeds the number of array elements. Index must not exceed 1",how to correct this?)
Also plot the x verses function graph.
Respuesta aceptada
Más respuestas (1)
William Rose
el 27 de Feb. de 2022
0 votos
The routine fmincon() is good for this. The name is short for function minimization with constraints. Minimize the negative of your function in order to maximize.
2 comentarios
Ancy S G
el 17 de Mzo. de 2022
William Rose
el 17 de Mzo. de 2022
@Ancy S G, you're welcome.
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



