Solving a nonlinear programming using MATLAB?

5 ビュー (過去 30 日間)
C Zeng
C Zeng 2014 年 8 月 15 日
編集済み: Matt J 2014 年 8 月 15 日
Hello, experts, just wondering if MATLAB can solve a non-linear programming efficiently. The decision variable is a vector of N, call it a, a is discrete. Has a linear constraint. The objective is p'a+c'max(a-1,0) is nonlinear form.
Can anybody show an example of code? Thanks.

採用された回答

Johan Löfberg
Johan Löfberg 2014 年 8 月 15 日
fmincon is not applicable since you have integrality constraints.
The model can easily be converted to a mixed-integer linear problem (if c is non-negative using a standard epigraph reformulation of the max operator, otherwise using a big-M model of it), for which there are many solvers available for MATLAB
The MATLAB toolbox YALMIP makes the modelling easy. Install a MILP solver for good performance (otherwise it uses its own naive implementation)
N = 10;
c = rand(N,1);
p = randn(N,1);
a = intvar(N,1);
solvesdp([-5 <= a <= 5],p'*a+c'*max(a-1,0))
double(a)
Note though, I think you can solve this problem analytically.
  3 件のコメント
Johan Löfberg
Johan Löfberg 2014 年 8 月 15 日
yes, just google.
Matt J
Matt J 2014 年 8 月 15 日
編集済み: Matt J 2014 年 8 月 15 日
MATLAB's Optimization Toolbox can solve mixed integer linear programs as of R2014. See intlinprog.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear Programming and Mixed-Integer Linear Programming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by