资源描述:
《数学建模非线性最小二乘问题》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、1.非线性最小二乘问题用最小二乘法计算:sets:quantity/l・・15/:x,y;endsetsmin=@sum(quantity:(a+b*@EXP(c*x)-y)A2);@free(a);@free(b);@free(c);data:x=2,5,7,10,14,19,26,31,34,38,45,52,53,60,65;y=54,50,45,37,35,25,20,16,18,13,8,11,8,4,6;enddata运算结果为:Localoptimalsolutionfound.Objectivevalue:44.78049Extendedsolves
2、teps:5Totalsolveiterartions:68VariableValueReducedCostA2.4301770.000000B57.332090.000000C-0.4460383E-010.000000由此得到a的值为2.430177,b的值为57.33209,c的值为-0.04460383o线性回归方程为y=2.430177+57.33209*@EXP(-0.04460383*x)用最小一乘法计算:程序如下:sets:quantity/l.・15/:x,y;endsetsmin=@sum(quantity:@ABS(a+b*@EXP(c*x)-
3、y));@free(a);@free(b);@free(c);data:x=2,5,7,10,14,19,26,31,34,38,45,5乙53,60,65;y=54,50/45,37,35,25,20,16,18,13,8,11,8,4,6;enddata运算结果为:Linearizationcomponentsadded:Constraints:60Variables:60Integers:15Localoptimalsolutionfound.Objectivevalue:20.80640Extendedsolversteps:Totalsolveritera
4、tions:643VariableValueReducedCostA3.3982670.000000B57.114610.000000c-0.4752126e-010.000000由上可得a的值为3.398267,b的值为57.11461,c的值为-0.04752126。线性冋归方程:Y=3.398267+57.11461*@EXP(-0.04752126*x)用最大偏差最小的方法计算:程序如下:sets:quantity/l・・15/:x,y;endsetsmin=@MAX(quantity:@ABS(a+b*@EXP(c*x)-y));@free(a);@fre
5、e(b);@free(c);data:x=2,5,7,10,14,19,26,31,34,3&45,5乙53,60,65;y=54,50/45,37,35,25,20,16,18,13,8,11,8,4,6;enddata运行结果为:Linearizationcomponentsadded:Constraints:91Variables:76Integers:Localoptimalsolutionfound.Objectivevalue:Extendedsolversteps:Totalsolveriterations:303、059550264843Variab
6、leValueReducedCostA3.7011640.000000B54.546220.000000C-0.4645980e-010.000000由上可得,a的值为3.701164,b的值为54.54622,c的值为-0.0464598□线性回归方程:y=3.701164+54.54622*@EXP(-0.0464598*x)2.1)这个问题可以这么假设,用来生产汽油的A原油为xl桶,用来生产汽油的B原油为yl桶,用來生产民用燃料的A原油为X2桶,用來生产民用燃料的B原油为y2桶,那么就可以生产xl+yl桶汽油,x2+y2桶民用燃料。由题意可以知道,每桶汽油需要
7、广告费2元,每桶民用燃料需要广告费1元。生产出来之后可以卖出的总额为250(xl+yl)+200(x2+y2),那么要求的目标就知道了总利润为250*(xl+yl)+200*(x2+y2)-2*(xl+yl)-(x2+y2);加上应有的约束,满足质量指数关系,编写出相应的林公程序如下:max=250*(xl+yl)+200*(x2+y2)-2*(xl+yl)-(x2+y2);(10*xl+5*yl)/(xl+yl)>=8;(10*x2+5*y2)/(x2+y2)>=6;(10*x2+5*y2)/(x2+y2)<=8;xl+yl<=5000;x2+y2<=1000