YALMIP Solvers

Solvers


One of the core ideas in YALMIP is to rely on external solvers for the low-level numerical solution of optimization problem. YALMIP concentrates on efficient modeling and high-level algorithms.

Linear programming can be solved by quadratic programming which can be solved by second-order cone programming which can be solved by semidefinite programming. Hence, in theory, you only need a semidefinite programming solver if you only solve linear problems. In practice though, dedicated solvers are recommended.

A recommended installation if you mainly intend to solve SDPs and LPs and QPs is MOSEK, SEDUMI or SDPT3.

If you solve non-trivial linear and quadratic programs (and nonconvex problems via BMIBNB, a dedicated LP/QP solver is recommended. Most examples in this Wiki have been generated using MOSEK, GUROBI and CPLEX.

If you are in academia, MOSEK is convenient since it gives you a very competetive MILP, MIQP, MISOCP and SDP solver in one package.

If you intend to solve large problems or other problem classes, you are advised to download several solvers to find one that works best for your problem.

And finally, there are no free lunches and you get what you pay for (unless you’re in academia!).

Available solvers by problem class

A simple categorization is as follows (the definitions of free and commercial depends slightly on the solver, please see the specific comments in the solver description)

Linear programming (free)

CDD, CLP, GLPK, LPSOLVE, QSOPT, SCIP

Mixed Integer Linear programming (free)

CBC, GLPK, LPSOLVE, SCIP

Linear programming (commercial)

CPLEX (free for academia), GUROBI (free for academia), LINPROG, MOSEK (free for academia), XPRESS (free for academia)

Mixed Integer Linear programming (commercial)

CPLEX (free for academia), GUROBI (free for academia), INTLINPROG, MOSEK (free for academia), XPRESS (free for academia)

Quadratic programming (free)

BPMPD, CLP, OOQP, QPC, QPOASES, QUADPROGBB (nonconvex QP)

Quadratic programming (commercial)

CPLEX (free for academia), GUROBI (free for academia), MOSEK (free for academia), NAG, QUADPROG, XPRESS (free for academia)

Mixed Integer Quadratic programming (commercial)

CPLEX (free for academia), GUROBI (free for academia), MOSEK (free for academia), XPRESS (free for academia)

Second-order cone programming (free)

ECOS, SDPT3, SEDUMI

Second-order cone programming (commercial)

CPLEX (free for academia), GUROBI (free for academia), MOSEK (free for academia)

Mixed Integer Second-order cone programming (commercial)

CPLEX (free for academia), GUROBI (free for academia), MOSEK (free for academia)

Semidefinite programming (free)

CSDP, DSDP, LOGDETPPA, PENLAB, SDPA, SDPLR, SDPT3, SDPNAL, SEDUMI

Semidefinite programming (commercial)

LMILAB, MOSEK (free for academia), PENBMI, PENSDP (free for academia)

General nonlinear programming and other solvers

BARON, FILTERSD, FMINCON, GPPOSY, IPOPT, KNITRO, LMIRANK, MPT, NOMAD, PENLAB, SNOPT, SPARSEPOP

Internal solvers

By exploiting the optimization infrastructure in YALMIP, it is fairly easy to develop algorithms based on the external solvers. This has motivated development of mixed integer conic solvers (BNB, CUTSDP), indefinite quadratic programming (BMIBNB, KKTQP ), simple quasi-convex problems ([bisection]), sum-of-squares modules ([solvesos]) and a global solver for pretty much any nonlinear problem (BMIBNB), just to mention some of the most important modules in YALMIP.

### YALMIP 安装教程 #### 准备工作 在开始安装前,需确认 MATLAB 已经成功安装并可以正常运行。如果尚未安装 MATLAB,请先完成其安装过程。 #### 下载 YALMIP 访问官方 GitHub 页面或其他可信资源下载最新版的 YALMIP 文件[^3]。通常情况下,可以从以下链接获取: - **GitHub 地址**: https://github.com/yalmip/YALMIP/releases 下载完成后,将压缩包解压到本地目录。 --- #### 将 YALMIP 添加至 MATLAB 路径 1. 打开 MATLAB 并进入命令窗口。 2. 使用 `cd` 命令切换到解压后的 YALMIP 主目录。例如,假设解压路径为 `C:\YALMIP-master`,则执行以下命令: ```matlab cd('C:\YALMIP-master'); ``` 3. 运行初始化脚本以加载 YALMIP 功能: ```matlab yalmip('init') ``` 此操作会自动将 YALMIP 的核心函数添加到当前 MATLAB 会话中的路径列表中[^4]。 为了使每次启动 MATLAB 都能自动加载 YALMIP,可将其路径永久保存: ```matlab savepath; ``` --- #### 测试 YALMIP 是否安装成功 创建一个新的 `.m` 文件或直接在命令窗口中输入以下代码来测试基本功能是否可用: ```matlab sdpvar x; % 创建符号变量 F = [-1 <= x <= 1]; % 设置约束条件 optimize(F,-x); % 解决最小化问题 value(x) % 输出最优解 ``` 如果程序能够顺利运行并返回结果,则说明 YALMIP 成功安装[^5]。 --- #### 配置求解器(如 Gurobi 或 CPLEX) 若计划使用第三方求解器(例如 Gurobi 或 CPLEX),需要额外配置: 1. 确认已正确安装所需的求解器软件及其许可证; 2. 在 MATLAB 中设置环境变量指向求解器库的位置; 3. 利用 YALMIP 提供的功能检测支持的求解器列表: ```matlab solvers() ``` 通过上述步骤验证特定求解器是否被识别和支持[^1]。 --- #### 注意事项 尽管 MATLAB 是一种强大的数值计算平台,但在处理大规模复杂优化模型时可能不如专用建模语言 LINGO 效率高。因此对于涉及众多决策变量与严格限制条件的应用场景,应综合考虑不同工具的特点加以选择[^2]。 ---
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值