Let f(x)=sinx-e^-x .we saw in exercise5 of the previous section that there is a root x*屬於[0,π/2] of the equation f(x)=0
a.Use the starting point x0=0.5 .Use a caclulator or computer to compute
two steps in the Newton iteration scheme tor the equation f(x)=0
b.Write a code that uses Newtons metod, starting with x0=0.5
to approximate the value of x* to witin 10^-12 . How many iterations
are needed? Compare with the number of iterations needed when
using functional iteration.
c.Explan what happens if the starting value x0>1.8 .
exercise5 f'(x*)不等於0,if = 0,Nowton method still converges,
but much more slowly. Assume that f 屬於C^2 with f''(x*)不
等於0,
lim n->無窮| Xn+1 - X*| /|Xn-X* =1/2
2007-12-09 16:49:46 · 1 個解答 · 發問者 小伊 3 in 科學 ➔ 數學
1. f(x)=sinx-e^(-x)=0有無限個根,0.59, 3.09, 6.28, 9.42, 12.57, ...
在[0,π/2]內的根只有一個
2. f'(x)=cosx+e^(-x)
牛頓法公式: x(n+1)=x(n)-f[x(n)]/f'[x(n)]
即x(n+1)=x(n)-[sin x(n)-exp(-x(n))]/[cos x(n)+exp(-x(n))]
a. (Newton's method for 2 steps)By Excel
x(0)=0.5=>x(1)=0.585643816966, x(2)=0.588529412626
b.
(Newton's method) 4次即達10^(-12)精確度
x(0)=0.500000000000 ,x(1)=0.585643816966
x(2)=0.588529412626 ,x(3)=0.588532743977
x(4)=0.588532743982 ,x(5)=0.588532743982
(functional iteration 1) x(n+1)=-ln(sin x(n) ) x(0)=0.5無法收歛
x(0)=0.500000000000 ,x(1)=0.735166686385
x(2)=0.399417234309 ,x(3)=0.944480574394
x(4)=0.210483313136 ,x(5)=1.565743707453
x(6)=0.000012764535 ,x(7)=11.268839902821
(functional iteration 2) x(n+1)=arcsin(e^(-x(n)))
至第65次迭代,才精確至10^(-12)
x(0)=0.500000000000 ,x(1)=0.651689669501
x(2)=0.548214760928 ,x(3)=0.616252065538
x(4)=0.570394814134 ,x(5)=0.600799568670
.....
x(64)=0.588532743981 ,x(65)=0.588532743982
c. (Newton's method x0=1.9) By Excel
x(0)=1.900000000000 ,x(1)=6.486271714980
x(2)=6.282220173901 ,x(3)=6.285049266011
x(4)=6.285049273383 ,x(5)=6.285049273383
第4次牛頓法即收歛至另一根(第3個根)
2007-12-10 15:15:04 · answer #1 · answered by mathmanliu 7 · 0⤊ 0⤋