draw a convergence graph when using yalmip

3 次查看(过去 30 天)
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.

回答(1 个)

Prathamesh
Prathamesh 2025-6-3
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”

类别

Help CenterFile Exchange 中查找有关 Deep Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by