Professional Documents
Culture Documents
Methods For Solving Nonlinear Equations: Yingwei Wang
Methods For Solving Nonlinear Equations: Yingwei Wang
Yingwei Wang
Department of Mathematics, Purdue University, West Lafayette, IN
wywshtj@gmail.com
1 Newton’s method
1.1 Single equation
Find the positive minimum point of the function f (x) = x−2 tan x by computing the zeros of
f ′ using Newton’s method.
f ′ (xk )
xk+1 = xk − . (1.3)
f ′′ (xk )
The stopping criteria for the iteration (1.3) is that the iterates change by at most tol, i.e.
if δ(xk ) = |f ′ (xk )/f ′′ (xk )| < tol then the iteration should be stopped.
Setting the initial guess as x0 = 1 and the tolerance as tol = 1e − 16, we can get Table 1.
The final result of computation is x = 0.9477471335169905.
I
Yingwei Wang Computer Project #1
x + e−x + y 3 = 0
(1.4)
x2 + 2xy − y 2 + tan x = 0.
3y 2
1 − e−x
J= .
2x + 2y + 1 + (tan x)2 2x − 2y
The stopping criteria for the iteration (1.5) is that the iterates change by at most tol in
the sense of 2-norm, i.e. if δ(Xk ) = kJ −1 F (Xk )k2 < tol then the iteration should be stopped.
Setting the initial guess as X0 = [3, −1.5] and the tolerance as tol = 1e − 14, we can get
Table 2. The final result of computation is x = 3.13244796038883, y = −1.46992840120343.
2 Secant method
Use the secant method to solve the problem in Section 1.1.
The algorithm is:
xk − xk−1
xk+1 = xk − ′ . (2.1)
f (xk ) − f ′ (xk−1 )
The stopping criteria for the iteration (2.1) is that the residue is less than tol, i.e. if
f ′ (xk ) < tol then the iteration should be stopped.
Setting the initial guess as x0 = 2, x1 = 1 and the tolerance as tol = 1e − 16, we can get
Table 1. The final result of computation is x = 0.9477471335169905.
II
Yingwei Wang Computer Project #1
Table 2: Result v.s. iteration step (X0 = [3, −1.5], tol = 1e − 14)
Step xk yk δ(Xk−1 )
1 3.09405751233401 -1.46506099746738 1.0034e-001
2 3.11962295212265 -1.46803802432041 2.5738e-002
3 3.12813825392599 -1.46929314301517 8.6073e-003
4 3.13099681903632 -1.46971436328342 2.8894e-003
5 3.13195900191164 -1.46985626625034 9.7259e-004
6 3.13228316839025 -1.46990408805527 3.2767e-004
7 3.13239241670524 -1.46992020617795 1.1043e-004
8 3.13242923870766 -1.46992563894675 3.7221e-005
9 3.13244164995924 -1.46992747013991 1.2546e-005
10 3.13244583335535 -1.46992808737295 4.2287e-006
11 3.13244724343669 -1.46992829542159 1.4253e-006
12 3.13244771872806 -1.46992836554788 4.8044e-007
13 3.13244787893300 -1.46992838918512 1.6194e-007
14 3.13244793293277 -1.46992839715246 5.4584e-008
15 3.13244795113431 -1.46992839983798 1.8399e-008
16 3.13244795726944 -1.46992840074318 6.2016e-009
17 3.13244795933739 -1.46992840104830 2.0903e-009
18 3.13244796003443 -1.46992840115114 7.0458e-010
19 3.13244796026938 -1.46992840118580 2.3749e-010
20 3.13244796034857 -1.46992840119749 8.0050e-011
21 3.13244796037526 -1.46992840120143 2.6982e-011
22 3.13244796038426 -1.46992840120275 9.0949e-012
23 3.13244796038729 -1.46992840120320 3.0658e-012
24 3.13244796038832 -1.46992840120335 1.0330e-012
25 3.13244796038866 -1.46992840120340 3.4821e-013
26 3.13244796038878 -1.46992840120342 1.1696e-013
27 3.13244796038882 -1.46992840120343 3.9410e-014
28 3.13244796038883 -1.46992840120343 1.3462e-014
29 3.13244796038883 -1.46992840120343 4.3104e-015
III
Yingwei Wang Computer Project #1
where the p(z) and p′ (z) are computed by the Horner’s algorithm:
βk−1 = αk + zβk ,
(3.3)
αk−1 = ak−1 + zαk ,
IV