急!matlab 如何完成非线性约束优化

学习 时间:2026-04-03 14:29:13 阅读:7452
急!matlab 如何完成非线性约束优化小弟想用matlab求下面的最小值:目标函数:f=0.5*[1.067*10^7-1169*x(1)+8.82*x(1)^2-0.003*x(1)^3+4.53*10^-7*x(1)^4]+8.89/[-9506-0.0083*x(1)^2/x(2)^2-0.00023(-3641.48+x(1))*(395.84+x(1))*x(2)];约束条件:x(1)+x(2)

最佳回答

隐形的龙猫

高兴的服饰

2026-04-03 14:29:13

编写M文件fun。mfunction f=fun(x)f=0。5*(1。067*10^7-1169*x(1)+8。82*x(1)^2-0。003*x(1)^3+4。53*10^7-x(1)^4)+8。89/(-9506-0。0083*x(1)^2/x(2)^2-0。00023*(-3641。48+x(1))*(395。84+x(1))*x(2));命令窗口输入>> [x,fval]=fmincon('fun',rand(2,1),[],[],[],[],[1200;3。9],[2500;5。571])Warning:Large-scale (trust region) method does not currently solve this type of problem,switching to medium-scale (line search)。> In fmincon at 260Optimization terminated:first-order optimality measure lessthan options。TolFun and maximum constraint violation is lessthan options。TolCon。Active inequalities (to within options。TolCon = 1e-006):lower upper ineqlin ineqnonlin1 x =1。0e+003 *2。50000。0039fval =-1。9531e+013你的目标函数我做了改动,你看看一致不

最新回答共有2条回答

  • 美满的煎饼
    回复
    2026-04-03 14:29:13

    编写M文件fun。mfunction f=fun(x)f=0。5*(1。067*10^7-1169*x(1)+8。82*x(1)^2-0。003*x(1)^3+4。53*10^7-x(1)^4)+8。89/(-9506-0。0083*x(1)^2/x(2)^2-0。00023*(-3641。48+x(1))*(395。84+x(1))*x(2));命令窗口输入>> [x,fval]=fmincon('fun',rand(2,1),[],[],[],[],[1200;3。9],[2500;5。571])Warning:Large-scale (trust region) method does not currently solve this type of problem,switching to medium-scale (line search)。> In fmincon at 260Optimization terminated:first-order optimality measure lessthan options。TolFun and maximum constraint violation is lessthan options。TolCon。Active inequalities (to within options。TolCon = 1e-006):lower upper ineqlin ineqnonlin1 x =1。0e+003 *2。50000。0039fval =-1。9531e+013你的目标函数我做了改动,你看看一致不

上一篇 No( )em( )er括号里填什么字母

下一篇 昨天晚上梦到白天没有太阳,只有月亮,而且还在下雨.觉得很奇怪,请问预示着什么啊?