This preview shows pages 1–6. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 162 Chapter 8: Nonlinear Equations Nonlinear Equations Definition A value for parameter x that satisfies the equation f(x) = is called a root or a (zero) of f(x) . Exact Solutions For some functions, we can calculate roots exactly; e.g., Polynomials up to degree 4 Simple transcendental functions, such as sin x = 0 which has an infinite number of roots: x = k ( k = 0, 1, 2, . . . ) Numerical Methods Used to estimate roots for nonlinear functions f(x). Bisection Method False Position Method Newtons Method Secant Method All are iterative techniques applied to continuous functions. We will consider only methods for finding real roots, but methods discussed can be generalized for complex roots. 163 Bisection Method A binary search procedure applied to an x interval known to contain root of f(x) . Example: Polynomial f(x) = x 5 + x + 1 has exactly five roots, at least one real root. Step 1: Determine an x interval containing a real root. We can do this by simple analysis of f(x) : compute (or estimate) f(x) for convenient values of x , such as 0, 1. estimate position of local extrema with first derivative of f(x) . make rough sketch of f(x) . Step 2: Bisect interval repeatedly until root is determined to desired accuracy. x 11 f(x) 3.0 1.01.0 Have root in this interval. 164 If f(xlow) and f(xmid) have opposite signs ( f(xlow) . f(xmid ) < 0, root is in left half of interval. If f(xlow) and f(xmid) have same signs ( f(xlow) . f(xmid ) > 0), root is in right half of interval. Continue subdividing until interval width has been reduced to a size where = selected x tolerance. d(x) = x 5 + x + 1 f(xmid) = 0.46875 xup = 0 xlow = 1 xlow + sup 2 xmid = 0.50.510.8 0.6 0.4 0.2 1 165 Using a y tolerance can result in poor estimate of root. Examples: Oscillating function 10 20 30 40 50 60 40 20 false root Asymptotically converging function false root 5 4 3 2 112 1 1 2 3 4 5 166 Pseudocode Algorithm: Bisection Method Input xLower, xUpper, xTol yLower = f(xLower) (* invokes fcn definition *) xMid = (xLower + xUpper)/2.0 yMid = f(xMid) iters = 0 (* count number of iterations *) While ( (xUpper  xLower)/2.0 < xTol ) iters = iters + 1 if( yLower * yMid > 0.0) Then xLower = xMid Else xUpper = xMid Endofif xMid = (xLower + xUpper)/2.0 yMid = f(xMid) Endofwhile Return xMid, yMid, iters (* xMid = approx to root *) (Do not need to recalculate yLower in loop, since it can never change sign.) For a given x tolerance (epsilon), we can calculate the number of iterations directly. The number of divisions of the original interval is the smallest value of n that satisfies: Thus In our previous example x lower = 1, x upper = 0 Choosing...
View
Full
Document
This note was uploaded on 05/01/2011 for the course CHBE 2120 taught by Professor Gallivan during the Spring '07 term at Georgia Institute of Technology.
 Spring '07
 Gallivan

Click to edit the document details