1 / 5

习题评述

习题评述. 在计算 Seidel 的迭代法的收敛性时. f(3)= -0.9107. f (3)= 0.2440. 关于牛顿迭代法的程序. function z=newton(f,x0,y0,e) x = sym('x'); y=sym('y') Jx=det([diff(f,y,1),f]); Jy=det([f,diff(f,x,1)]); J=det([diff(f,x,1),diff(f,y,1)]); x=x0; y=y0; n=1 x1=x0+ eval (Jx)/ eval (J); y1=y0+ eval (Jy)/ eval (J);

sarila
Download Presentation

习题评述

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 习题评述 • 在计算Seidel 的迭代法的收敛性时

  2. f(3)= -0.9107

  3. f (3)= 0.2440

  4. 关于牛顿迭代法的程序 function z=newton(f,x0,y0,e) x = sym('x'); y=sym('y') Jx=det([diff(f,y,1),f]); Jy=det([f,diff(f,x,1)]); J=det([diff(f,x,1),diff(f,y,1)]); x=x0; y=y0; n=1 x1=x0+eval(Jx)/eval(J); y1=y0+eval(Jy)/eval(J); while abs(x1-x0)>e & abs(y1-y0)>e & n<1000 x0=x1; y0=y1; x=x1; y=y1; n=n+1; x1=x0+eval(Jx)/eval(J); y1=y0+eval(Jy)/eval(J); end x=x1; y=y1; eval(f), z=[x1,y1,n];

  5. function f=myfun1 syms x; syms y f=[x^2+y^2-1;x^3-y]; newton(myfun1,0.8,0.6,1e-6) ans = 1.0e-011 * 0.1267 0.2556 ans = 0.8260 0.5636 3.0000

More Related