Plotting fmincon with varying constraint
Mostrar comentarios más antiguos
Hi all. I've got a function which I'm trying to minimize subject to a nonlinear constraint. I've been able to get this to work, but now I want to vary the constraint and plot the minimum as a function of this new parameter. I.e., I want to plot
subject to the constraint
The parameter a should take values in
. I can provide the files I'm working with upon request, but so far I've just been working with fmincon as provided in the documentation. Any advice is appreciated, thanks in advance!
subject to the constraint Respuesta aceptada
Más respuestas (1)
John D'Errico
el 30 de Dic. de 2022
Editada: John D'Errico
el 30 de Dic. de 2022
0 votos
You already know how to use fmincon. And surely you understand how to use a for loop.
- Set up a loop, varying a over the indicated domain.
- Call fmincon with the current value of a in the constraint, saving the results into a vector.
- After the loop has terminated, plot the results as a function of a.
Don't just provide the files, then asking us to write the complete code to solve your problem. Surely you can do exactly what I just explained in that basic algorithm. If then you have a problem, show what you tried. Explain where you are confused.
1 comentario
Kenneth
el 30 de Dic. de 2022
Categorías
Más información sobre Choose a Solver 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!