What problem does it solve?
Writing MATLAB optimization code is error-prone: choosing the wrong solver, misconfiguring options, misinterpreting exitflags, or missing hidden problem structure leads to failed convergence and wrong answers. This Skill guides the full optimization lifecycle so problems are classified correctly, solvers are selected and tuned properly, and results are validated.
Core Features & Use Cases
- Problem Classification & Formulation: Identify the problem class (LP, QP, MILP, NLP, least-squares, nonsmooth) and formulate it with
optimproblem, optimvar, and fcn2optimexpr, or fall back to solver-based APIs when appropriate.
- Solver Selection & Tuning: Choose the narrowest applicable solver (
linprog, quadprog, intlinprog, fmincon, lsqnonlin, ga, surrogateopt), verify options with optimoptions, and apply per-solver tuning guidance.
- Result Validation & Debugging: Interpret exitflags, check constraint violations with
issatisfied/infeasibility, verify gradients with checkGradients, and follow a systematic checklist for failed or poor solutions.
- Use Case: A user fitting parameters to a simulation model gets guidance to wrap the
ode45-based objective with fcn2optimexpr as a black-box, select surrogateopt for expensive evaluations, and validate convergence with exitflag and constraint checks.
Quick Start
Ask the agent to formulate and solve your optimization problem in MATLAB, for example: minimize a nonlinear objective subject to constraints using the problem-based approach and validate the result.