资源预览内容
第1页 / 共1页
亲,该文档总共1页全部预览完了,如果喜欢就下载吧!
资源描述
Use damped Newton method to find the minimum of fx=x12+4x22+9x32-2x1+18x3.Select suitable initial point. Stopping error should not larger than = 0.01.Requirements:(1) Write Matlab codes to finish the algorithm (not use Matlab function directly).(2) Provide Matlab codes, the middle and the final results.Matlab Codes:syms x1 x2 x3 n;x= x1,x2,x3;f=x12+4*x22+9*x32-2*x1+18*x3;g=2*x1-2,8*x2,18*x3+18;h=2,0,0;0,8,0;0,0,18;h0=inv(h);eps=0.01;k=0;tol=1;x0=0,0,0;while tolepsg0=subs(g,x,x0);m=eval(norm(g0);if m0 n=n0; end; end;end; x0=x0+n*d0; tol=m; k=k+1endResult:k=0 g0 =-2 m =18.11080 18 k =1 g0 =0 m=0 fmin =-10 x = 1 0 00 -1
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号