Numerical methods - lecture 2 Jiří Zelinka Autumn 2017 Jiří Zelinka 1/11 Solving nonlinear equations Equation f(x) = 0, x e / = [a, b], f is continuous real function x e / - solution, root of f. Iterative process: We create sequence (x/c)^0, xk —>► x. (x^)^ - iterative sequence. Bisection method f (a) • f (6) < 0, a0 = a, 60 = ft, let x0 = (a0 + 60)/2. If f (a0) • f (*o) < 0 we choose ai = ao, 6i = x0, else ai = x0, bi = 60, x e [ai, □ Jiří Zelinka Numerical methods - lecture 2 2/11 Generally: we have ak, bkl f(ak) • f(bk) < 0, x e [ak, bk], let *k = (a* + ^/c)/2. If f(ak) - f{xi<) < 0 we choose ak+i = a/c, 6/c+i = xk, else ^/c+i = *k, bk+i = ^/c, so x e [a/c+i, Estimate of the absolute error in k-th step: xk-x < b-a 2k+l Jiří Zelinka □ S1 Numerical methods - lecture 2 3/11 Fixed point iteration • Equation x = g(x) • g continuous on / = [a, b] • Solution x is called the fixed point of the function g Iteration process • Let us choose x0 G / and xi = g(x0). • Generally xk+1 = g(xk). • Function g is called iteration function. 4/11 Geometric meaning The fixed point x is the intersection of the function g and line 5/11 Graphical representation of the iteration process: Jiří Zelinka □ [31 Numerical methods - lecture 2 The convergence is faster if the derivative of g in t\ intersection is close to 0: Jiří Zelinka □ [31 Numerical methods - lecture 2 The existence and uniqueness of the fixed point Theorem: If for the function g continuous on / = [a, b] the following condition holds Vx G / : g(x) e /, then there exists at least one fixed point x e / of the function g. Moreover, if there exits constant L < 1 that for all x e / VxG / : |g-'(x)| < L, then there exit one fixed point x and for any xq G / the iteration process given by formula Xfr+i = g(xk) converges to this fixed point. □ S Jiří Zelinka Numerical methods - lecture 2 8/11 Estimation of the error *k-Ú< L 1 - L x0 - Xi Example x3 + 4x2 - 10 = 0 Classification of the fixed points The fixed point x of the function g is called • attractive if < 1, then the iterative process converges on some neighborhood of x. • repelling if ^(x)! > 1, then the iterative process doesn't converge. Jiří Zelinka □ i3i Numerical methods - lecture 2 9/11 le process doesn't converge if Ig"'^)! > 1 Jiří Zelinka 10/11 Creating of the iteration function f(x) = 0 ->• x = g(x) Generally: g(x) = x - g(x) = x - f_(x) K f_(x) h(x) □ [31 Jiří Zelinka Numerical methods - lecture 2 11/11