Description: matlab用于求解规划问题的工具包
推荐把这个工具整合到matlab中去,这个工具是私人的,不过大家都可以免费下载使用。下载后,只要在matlab中添加路径就可以使用这工具箱。
正在吸引我的是,这个工具箱建立了一种新的数据类型,使所有规划问题都整合在一起。
举例如下:
已知非线性整数规划为:
Max z=x1^2+x2^2+3*x3^2+4*x4^2+2*x5^2-8*x1-2*x2-3*x3-x4-2*x5
s.t.
0<=xi<=99(i=1,2,...,5)
x1+x2+x3+x4+x5<=400
x1+2*x2+2*x3+x4+6*x5<=800
2*x1+x2+6*x3<=800
x3+x4+5*x5<=200
在matlab中输入 x=intvar(1,5);
f=[1 1 3 4 2]*(x .^2)-[8 2 3 1 2]*x F=set(0<=x<=99)
F=F+set([1 1 1 1 1]*x <=400)+set([1 2 2 1 6]*x <=800)+set(2*x(1)+x(2)+6*x(3)<=800)
F=F+set(x(3)+x(4)+5*x(5)<=200) solvesdp(F,-f)
double(f) 80199
double(x) 53 99 99 99 0
intvar(m,n):生成整数型变量;
sdpvar(m,n):生产变量;
solvesdp(F,f):求解最优解(最小值),其中F为约束条件(用set连接),f为目标函数
double:显示求解的答案
intvar,sdpvar,生成的变量可以像矩阵一样使用,如例题显示。
File list (Check if you may need any files):
yalmip\@sdpvar\abs.m
......\.......\acos.m
......\.......\acosh.m
......\.......\acot.m
......\.......\and.m
......\.......\any.m
......\.......\asec.m
......\.......\asin.m
......\.......\asinh.m
......\.......\assign.m
......\.......\atan.m
......\.......\beta.m
......\.......\binary.m
......\.......\blkdiag.m
......\.......\bounds.m
......\.......\brutepersp.m
......\.......\cat.m
......\.......\ceil.m
......\.......\circshift.m
......\.......\clean.m
......\.......\clearsdpvar.m
......\.......\clear_poly_dep.m
......\.......\cone.m
......\.......\conj.m
......\.......\Contents.m
......\.......\conv.m
......\.......\convexhull.m
......\.......\cos.m
......\.......\cosh.m
......\.......\cot.m
......\.......\ctranspose.m
......\.......\cut.m
......\.......\deadhub.m
......\.......\degreduce.m
......\.......\degree.m
......\.......\depends.m
......\.......\det.m
......\.......\diag.m
......\.......\diff.m
......\.......\display.m
......\.......\domain.m
......\.......\double.m
......\.......\eig.m
......\.......\eliminateBinary.m
......\.......\end.m
......\.......\eq.m
......\.......\erf.m
......\.......\erfc.m
......\.......\erfcx.m
......\.......\erfinv.m
......\.......\exp.m
......\.......\expanded.m
......\.......\exponents.m
......\.......\extractkyp.m
......\.......\false.m
......\.......\find.m
......\.......\fix.m
......\.......\fliplr.m
......\.......\flipud.m
......\.......\floor.m
......\.......\ge.m
......\.......\generateAB.m
......\.......\geomean.m
......\.......\getbase.m
......\.......\getbasematrix.m
......\.......\getbasematrixwithoutcheck.m
......\.......\getbasevectorwithoutcheck.m
......\.......\gethackflag.m
......\.......\getsosrank.m
......\.......\getvariables.m
......\.......\getvariablesvector.m
......\.......\gt.m
......\.......\hankel.m
......\.......\homogenize.m
......\.......\horzcat.m
......\.......\imag.m
......\.......\imag2real.m
......\.......\integer.m
......\.......\invsathub.m
......\.......\is.m
......\.......\isconvex.m
......\.......\isequal.m
......\.......\ishermitian.m
......\.......\isinteger.m
......\.......\isinterval.m
......\.......\islinear.m
......\.......\ismember.m
......\.......\ismember_internal.m
......\.......\isreal.m
......\.......\issymmetric.m
......\.......\jacobian.m
......\.......\kron.m
......\.......\kyp.m
......\.......\le.m
......\.......\length.m
......\.......\lmior.m
......\.......\lmixor.m
......\.......\loadobj.m
......\.......\log.m
......\.......\log10.m