收藏 分销(赏)

数学实验六.doc

上传人:天**** 文档编号:4354589 上传时间:2024-09-12 格式:DOC 页数:9 大小:34.50KB
下载 相关 举报
数学实验六.doc_第1页
第1页 / 共9页
数学实验六.doc_第2页
第2页 / 共9页
数学实验六.doc_第3页
第3页 / 共9页
数学实验六.doc_第4页
第4页 / 共9页
数学实验六.doc_第5页
第5页 / 共9页
点击查看更多>>
资源描述

1、实验六1415100076 陈田实验项目名称:优化实验时间:2016-27、201-6实验地点:理学楼52实验目得:1、掌握Matla优化工具箱得基本用法,利用优化工具包解线性规划与非线性规划得问题;对不同算法作初步分析、比较;2、练习实际问题得非线性最小二乘拟合.3、初步了解实际问题得线性规划与非线性规划得模型建立。实验内容:1、 教材25页习题2;funcion f=exm702fun(x)f=ex(x(1))(4*x()、+2x(2)、2x(1)*(2)2(2)+1);enM文件:formthotx1,;-ase1:bfgs-pt=optimse(larges,off,mfnevals,

2、10);1,v1,exit1,out1fminunc(xm002fun,x,t1)pausecase2:df-fopt=pimse(ot1,hsspdate,dp);x,2,exi2,ot2=miunc(am070fn,x,fopt)paus-se:step-fopt=optimset(opt1,hesupte,stepdsc);x,v3,e3,out3=fminnc(exam0702fn,x,fopt)pause+rlt folutions +outins=1;x2;x3;funalues=v1;v2;v;iteration=ot1、funCou;ut2、funcCunt;out3、funC

3、on;soutions,unvales,iterato运行结果: 6ans=-case1:bgs-ocl mnufund、Optiizationlteecause he sie of the gradint slessthanthe defautvalof te optmalytolre、stoppn itra deaisx1 5、0000e-0 1、000e+00v= 3、6609e15exit1 1out1 = teratis: 8funcCount: 6stepize: 6、31e-07lssteleg: firstoderpt: 、2284e7agorthm: qasinewtonme

4、ssage: al mnimum oud、ans =case2:dfp-mnimum od、Optiization ld baue the siz o he gradet isls thahedefu alue of teopialitoleranc、stoping rtera details= 5、0000e-01 1、000e+0v2 = 1、247e14xi = 1ou2 = itain: 8funou: 1stesz: 、7463e-06lsteength: 1frrderopt:5、8963e07algoithm: quasewtnese: Lcal miimu fun、an =-s

5、3:seepLocal inimum possile、fminucstoppedecae esie f tecurent ste i less thanthe dfa vaue ofthetep iz oeranc、tppng citeriadetisx= 5、0000e011、0000e+00v3 = 9、030e12xit3 = 2out= eratons: 49fucout: 06stepsz: 1、1892-06lsstelengt: 1、003e-01fstreropt: 8、4759e0lrih: asnetonmessge: Local minm psible、an =+rsul

6、t oslutons +ans= 5、0000e-01 -1、000+0 3、6609e-1 6、6000e+01 5、00e1 -1、000e+00 、2447e1 5、100e01 5、000e-01 -1、000e+ 9、530e12 3、0600e+022、 教材05页习题,要求:实现非线性最小二乘拟合即可,对“用GN与LM两种方法求解、对y作一扰动后观察迭代收敛变慢得情况”不做;fnction y=F(x,t,c)y=(1)+x()ex(4)*t)+(3)ex(x(5)*t);nM文件:0=、5 1、5 1 、0 、2;zos(1,33);fi=1:33t()=10(i1);nc=、

7、4、908 、2 、936 、25 、908 、881、50、81 、784 、751 、718、65 、658 、8 、03 、580 、58 、538 、522、506 、490 、478 、47 、457 、8 、438 、43 、424 、20、41 、41 、406;c2ra(1,3)/1、;-cae1:LM-opt=ptimset(LareScle,of,Mafuevls,000);1,nom1,res1=lsqoli(F,0,,ot1,c)-cas2:GM-op2=optimset(opt1,lrithm,vebergMaruadt);x12,norm1,re=lsnlin(F,

8、x,opt2,t,)cse3:M2-opt3otiset(ot1,Disp,iter);21,nor1,rs2=lsqnonlin(F,x0,opt,t,c2)-cas4:2o4=opimt(opt2,Di,itr);x22,orm22,es2=lsqnln(F,x0,,t4,t,c2)运行结果: c6ans -case1:L-x11= 3、7541e01 1、358e0 -1、647e00 1、286e2 、2123e02norm= 5、649e-05as =-ca:M-12 = 3、741e01 1、98e0 1、464e+0 1、2868e0 2、212e-02norm12 = 5、69

9、e-05ans =-cae:LM2x2 = 、8167e01 3、62-01 5、8127e+01 1、004e01 3、65106norm2 = 、3721e-01an =-cse:M2-x2 -3、906e+0 6、092e+01 -2、1883+01 1、2573e-0 、e04orm2 = 3、073e-03、 教材23页习题;M文件:c1 -2 1;A1=-1 12;11 -1;12 0;0 1 1;A20 1 1;b1=2 4 4;2=1;v00 0;x,f,eitflag,outpu,lag=irog(c,A1,b,A,b2,v1)lag、iqln运行结果:c81Otimizat

10、io teminat、x 7、996e-01 1、6000+05、99e0= 3、00+tfag 1oututierti: 6algorhm: inerr-pinlgaycgitertions: 0messae: iizatinriated、cstriolaton:2、64e14fstordert: 2、479e13la = ineqlin: 4xdbeelin: 1、00e+00uper: x1doublelwer:3x doublg、nqlinans 1、0000e+00 、569e4 、75513 1、863e-14由运行结果可知所求最大值为3、000e00,起作用约束为第一个约束4、

11、教材2页习题。M文件:1=-20 -0;A=1 ; 4;b2 70;v1=;x,xitl1,utpt1,la1=linprg(c1,A,b,,,v1)y1=ag、ineqin运行结果: c85Otimztio termnated、x1 = 1、000+01 、00e+0f1=-、5000+02xitfl1 = 1outut1 =eraions: 5lritm: iterior-poilgagiteatons: 0mssae: Optmiaion ernted、onstrvlatn: 0firstderopt: 、431e1ag =ineqlin: x1 doubleeqli: x1 doubleupper: x doublelwer: 2x1 doubly = 1、167e+ 、66e+0由运行结果可知以甲乙分别2、30元出售时安排甲乙分别生产0、5件可使收入最大,当A、B增加1公斤时收入分别增加1、667、1、66,考虑成本后由11、7-=5、67,1、6672-1、66670可知每进1公斤买原料可增加利润5、7元,买B原料则会减少利润1、7元,故应全部买进A原料。

展开阅读全文
相似文档                                   自信AI助手自信AI助手
猜你喜欢                                   自信AI导航自信AI导航
搜索标签

当前位置:首页 > 教育专区 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服