资源预览内容
第1页 / 共4页
第2页 / 共4页
第3页 / 共4页
第4页 / 共4页
亲,该文档总共4页全部预览完了,如果喜欢就下载吧!
资源描述
.第18章 二次规划18.1 基本数学原理如果某非线性规划的目标函数为自变量的二次函数,约束条件全是线性函数,就称这样规划为二次规划。其数学模型为:式中,,,和Aeq 为矩阵f, beq, lb, ub, 和x 为向量。18.2 有关函数介绍(1) 利用quadprog函数求解二次规划问题,其调用格式为:l x=quadprog(H,f,A,b)返回向量x, 使函数1/2*x*H*x+f*x 最小化,其约束条件为A*x=b。l x=quadprog(H,f,A,b,Aeq,beq)仍然求解上面的问题,但添加了等式约束条件Aeq*x=beq。l x=quadprog(H,f,A,b,lb,ub,)定义设计变量的下届Ib和上界ub,使得lb=x H=1 -1;-1 2; f=-2;-6; A=1 1;-1 2;2 1; b=2;2;3; lb=zeros(2,1);然后调用二次规划函数quadratic: format compact x,fval,exitflag,output,lambda=quadprog(H,f,A,b,lb)得问题的解:Warning: Large-scale method does not currently solve this problem formulation,switching to medium-scale method. In C:MATLAB6p5toolboxoptimquadprog.m at line 213Optimization terminated successfully.x = 0.6667 1.3333fval = -8.2222exitflag = 1output = iterations: 3 algorithm: medium-scale: active-set firstorderopt: cgiterations: lambda = lower: 2x1 double upper: 2x1 double eqlin: 0x1 double ineqlin: 3x1 double如有侵权请联系告知删除,感谢你们的配合!精品
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号