1
石家庄铁道大学
数0901班最优化方法训练实习试题
学号: 姓名: 考试日期: 考试时间:90分钟 机号:
题号
1
2
3
4
5
6
7
850;210];
Aeq=[3,5];
beq=162;
lb=zeros(2,1);
>> format compact
>> [x,fval,exitflag,output,lambda]=linprog(f,A,b,Aeq, beq, lb)
Optimization terminated successfully.
x =
5
fval =
-
exitflag =
1
output =
iterations: 5
cgiterations: 0
algorithm: 'lipsol'
lambda =
ineqlin: [3x1 double]
eqlin: -
upper: [2x1 double]
lower: [2x1 double]
目标函数在(4,30)处取得最大值168。
9. 求解下面的最优化问题;
输入下列系数矩阵:
H=[-4 -4 4;-4 -5 8;4 8 -5];
f=[2;6;-3];
Aeq=[1 1 1];
beq=[40];
lb=zeros(3,1);
>> format compact
>> [x,fval,exitflag,output,lambda]=quadprog(H,f,[],[],Aeq,beq,lb)
Warning: Large-scale method does not currently solve this problem formulation,
switching to medium-scale method.
> In C:\MATLAB6p1\toolbox\optim\ at line 213
Exiting: The solution is unbounded and at infinity;
the constraints are not restrictive enough.
x =
+017 *
0
fval =
-+034
6
exitflag =
-1
output =
iterations: 3
algorithm: 'medium-scale: active-set'
firstorderopt: []
cgiterations: []
lambda =
lower: [3x1 double]
upper: [3x1 double]
eqlin: 0
ineqlin:
matlab最优化 来自淘豆网m.daumloan.com转载请标明出处.