draw a convergence graph when using yalmip

4 visualizzazioni (ultimi 30 giorni)
照旭
照旭 il 25 Ott 2023
Risposto: Prathamesh il 3 Giu 2025
How to draw a convergence graph when using yalmip to solve optimization problems? And check the number of iterations and the results of each iteration.

Risposte (1)

Prathamesh
Prathamesh il 3 Giu 2025
Hi @照旭,
I understand that you want to draw a convergence graph using yalmip to solve optimization problem and want to check the number of iterations as well as result of each iteration.
Below are steps to check the number of iterations:
  • Enable Verbode output after installing YALMIP in your system.
  • Use a solver that supports iteration info. Solver like “IPOPT” provide detail iteration logs. YALMIP itself does not track iterations.
  • Capture solver output using “optimize”
sol=optimize(constraints,objective,options);
And then check the solver status using “sol.info” and problem code using “sol.problem”.
  • Extract Iteration data
diaryon
optimize(constraints,objective,options);
diaryoff
  • Manually track object value and update the model or parameters using “optimize.
  • Plot the convergence graph using MATLAB “plot” function.
Please refer below documentation links for IPOPT” and “optimize”

Categorie

Scopri di più su Deep Learning Toolbox in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by