draw a convergence graph when using yalmip
Show older comments
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.
Answers (1)
Prathamesh
on 3 Jun 2025
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
diary on
optimize(constraints, objective, options);
diary off
- 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”
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!