matlab优化问题 求教各位大神
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/19 19:11:55
matlab优化问题 求教各位大神
语句:f=@(x)(x(1)+6*x(2))*1800/x(1)^2/x(3)-340e6;lb=[0.010.01 0.001];ub=[0.03 0.05 0.004];options=optimset('Algorithm','active-set');[x fval]=fmincon(f,[0.015 0.015 0.002],[],[],[],[],lb,ub,[],options)
结果:Optimization terminated:first-order optimality measure less
than options.TolFun and maximum constraint violation is less
than options.TolCon.
Active inequalities (to within options.TolCon = 1e-006):
lower upper ineqlin ineqnonlin
2 1
3
x =
0.0300 0.0100 0.0040
fval =
-295000000
实际结果:
t=0.03,l=0.01,b=0.004,
再问: 亲 麻烦 你看 看 好像除了点问题 t=0.03,l=0.01,b=0.004, 原条件里t不是在0.001到0.004之间么 这个求出来是一组值还是范围啊 大神 万分感谢
再答: f=@(x)(x(1)+6*x(2))*1800/x(1)^2/x(3)-340e6;lb=[0.0010.01 0.01];ub=[0.004 0.03 0.05];options=optimset('Algorithm','active-set');[x fval]=fmincon(f,[0.002 0.015 0.02],[],[],[],[],lb,ub,[],options) 结果:Optimization terminated: first-order optimality measure less than options.TolFun and maximum constraint violation is less than options.TolCon. Active inequalities (to within options.TolCon = 1e-006): lower upper ineqlin ineqnonlin 2 1 3 x = 0.0040 0.0100 0.0500 fval = -196000000 实际结果: t=0.004,l=0.01,b=0.05,
结果:Optimization terminated:first-order optimality measure less
than options.TolFun and maximum constraint violation is less
than options.TolCon.
Active inequalities (to within options.TolCon = 1e-006):
lower upper ineqlin ineqnonlin
2 1
3
x =
0.0300 0.0100 0.0040
fval =
-295000000
实际结果:
t=0.03,l=0.01,b=0.004,
再问: 亲 麻烦 你看 看 好像除了点问题 t=0.03,l=0.01,b=0.004, 原条件里t不是在0.001到0.004之间么 这个求出来是一组值还是范围啊 大神 万分感谢
再答: f=@(x)(x(1)+6*x(2))*1800/x(1)^2/x(3)-340e6;lb=[0.0010.01 0.01];ub=[0.004 0.03 0.05];options=optimset('Algorithm','active-set');[x fval]=fmincon(f,[0.002 0.015 0.02],[],[],[],[],lb,ub,[],options) 结果:Optimization terminated: first-order optimality measure less than options.TolFun and maximum constraint violation is less than options.TolCon. Active inequalities (to within options.TolCon = 1e-006): lower upper ineqlin ineqnonlin 2 1 3 x = 0.0040 0.0100 0.0500 fval = -196000000 实际结果: t=0.004,l=0.01,b=0.05,