Plotting fmincon with varying constraint
Afficher commentaires plus anciens
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 Réponse acceptée
Plus de réponses (1)
John D'Errico
le 30 Déc 2022
Modifié(e) : John D'Errico
le 30 Déc 2022
0 votes
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 commentaire
Kenneth
le 30 Déc 2022
Catégories
En savoir plus sur Function Creation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!