Chapter 3 Solving Nonlinear Equations

Similar documents
Z b. f(x)dx. Yet in the above two cases we know what f(x) is. Sometimes, engineers want to calculate an area by computing I, but...

Lecture 12: Numerical Quadrature

NUMERICAL INTEGRATION. The inverse process to differentiation in calculus is integration. Mathematically, integration is represented by.

MAT 772: Numerical Analysis. James V. Lambers

Numerical Integration

Review of Calculus, cont d

Lecture 20: Numerical Integration III

Numerical Analysis. 10th ed. R L Burden, J D Faires, and A M Burden

Math& 152 Section Integration by Parts

4.4 Areas, Integrals and Antiderivatives

Numerical Analysis: Trapezoidal and Simpson s Rule

3.4 Numerical integration

Integration Techniques

Calculus I-II Review Sheet

III. Lecture on Numerical Integration. File faclib/dattab/lecture-notes/numerical-inter03.tex /by EC, 3/14/2008 at 15:11, version 9

A REVIEW OF CALCULUS CONCEPTS FOR JDEP 384H. Thomas Shores Department of Mathematics University of Nebraska Spring 2007

Numerical Integration. 1 Introduction. 2 Midpoint Rule, Trapezoid Rule, Simpson Rule. AMSC/CMSC 460/466 T. von Petersdorff 1

Taylor Polynomial Inequalities

Definite integral. Mathematics FRDIS MENDELU. Simona Fišnarová (Mendel University) Definite integral MENDELU 1 / 30

Best Approximation. Chapter The General Case

Orthogonal Polynomials and Least-Squares Approximations to Functions

Integrals - Motivation

P 3 (x) = f(0) + f (0)x + f (0) 2. x 2 + f (0) . In the problem set, you are asked to show, in general, the n th order term is a n = f (n) (0)

CAAM 453 NUMERICAL ANALYSIS I Examination There are four questions, plus a bonus. Do not look at them until you begin the exam.

Definite integral. Mathematics FRDIS MENDELU

Definition of Continuity: The function f(x) is continuous at x = a if f(a) exists and lim

The Regulated and Riemann Integrals

Section 6.1 Definite Integral

Lecture 14: Quadrature

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

Polynomials and Division Theory

Numerical Integration. Newton Cotes Formulas. Quadrature. Newton Cotes Formulas. To approximate the integral b

63. Representation of functions as power series Consider a power series. ( 1) n x 2n for all 1 < x < 1

Review of basic calculus

( ) as a fraction. Determine location of the highest

Main topics for the First Midterm

AB Calculus Review Sheet

( ) where f ( x ) is a. AB Calculus Exam Review Sheet. A. Precalculus Type problems. Find the zeros of f ( x).

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus

Discrete Least-squares Approximations

Chapter 1. Basic Concepts

Suppose we want to find the area under the parabola and above the x axis, between the lines x = 2 and x = -2.

Partial Derivatives. Limits. For a single variable function f (x), the limit lim

Exam 2, Mathematics 4701, Section ETY6 6:05 pm 7:40 pm, March 31, 2016, IH-1105 Instructor: Attila Máté 1

APPROXIMATE INTEGRATION

Numerical Integration

JDEP 384H: Numerical Methods in Business

Calculus II: Integrations and Series

Topics Covered AP Calculus AB

Section 4.8. D v(t j 1 ) t. (4.8.1) j=1

Sections 5.2: The Definite Integral

Chapter 7 Notes, Stewart 8e. 7.1 Integration by Parts Trigonometric Integrals Evaluating sin m x cos n (x) dx...

Chapters 4 & 5 Integrals & Applications

Lecture 6: Singular Integrals, Open Quadrature rules, and Gauss Quadrature

Ordinary Differential Equations- Boundary Value Problem

Improper Integrals, and Differential Equations

NUMERICAL INTEGRATION

Introduction to Numerical Analysis

1 nonlinear.mcd Find solution root to nonlinear algebraic equation f(x)=0. Instructor: Nam Sun Wang

( ) where f ( x ) is a. AB/BC Calculus Exam Review Sheet. A. Precalculus Type problems. Find the zeros of f ( x).

Math 1B, lecture 4: Error bounds for numerical methods

different methods (left endpoint, right endpoint, midpoint, trapezoid, Simpson s).

New Expansion and Infinite Series

B.Sc. in Mathematics (Ordinary)

CHAPTER 4a. ROOTS OF EQUATIONS

CMDA 4604: Intermediate Topics in Mathematical Modeling Lecture 19: Interpolation and Quadrature

Recitation 3: More Applications of the Derivative

The Wave Equation I. MA 436 Kurt Bryan

Overview of Calculus

Chapter Direct Method of Interpolation More Examples Civil Engineering

COSC 3361 Numerical Analysis I Numerical Integration and Differentiation (III) - Gauss Quadrature and Adaptive Quadrature

DOING PHYSICS WITH MATLAB MATHEMATICAL ROUTINES

INTRODUCTION TO INTEGRATION

Anti-derivatives/Indefinite Integrals of Basic Functions

Final Exam - Review MATH Spring 2017

Big idea in Calculus: approximation

Math 116 Calculus II

Math 190 Chapter 5 Lecture Notes. Professor Miguel Ornelas

Orthogonal Polynomials

0.1 Chapters 1: Limits and continuity

We will see what is meant by standard form very shortly

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies

MORE FUNCTION GRAPHING; OPTIMIZATION. (Last edited October 28, 2013 at 11:09pm.)

Numerical integration

AQA Further Pure 1. Complex Numbers. Section 1: Introduction to Complex Numbers. The number system

1 Error Analysis of Simple Rules for Numerical Integration

Mathematics for economists

Module 6: LINEAR TRANSFORMATIONS

The Riemann Integral

38 Riemann sums and existence of the definite integral.

Chapter 1: Fundamentals

SOLUTIONS FOR ADMISSIONS TEST IN MATHEMATICS, COMPUTER SCIENCE AND JOINT SCHOOLS WEDNESDAY 5 NOVEMBER 2014

Physics 116C Solution of inhomogeneous ordinary differential equations using Green s functions

1 The Riemann Integral

The Fundamental Theorem of Calculus

y = f(x) This means that there must be a point, c, where the Figure 1

CBE 291b - Computation And Optimization For Engineers

The final exam will take place on Friday May 11th from 8am 11am in Evans room 60.

Objectives. Materials

Best Approximation in the 2-norm

Transcription:

Chpter 3 Solving Nonliner Equtions 3.1 Introduction The nonliner function of unknown vrible x is in the form of where n could be non-integer. Root is the numericl vlue of x tht stisfies f ( x) 0. Grphiclly, the root is the point where the function f(x) crosses or touches the x-xis. 2 A simple nonliner eqution is qudrtic eqution f ( x) x bx c 0, the roots of it cn be found nlyticlly by qudrtic formul s b b 2 4c x 2 In mny situtions, however, it is very difficult or impossible to find the nlyticl roots of the non-liner eqution. In this cse, numericl methods nd desired ccurcy of solution re often required. These numericl methods cn be divided two types: 1). Brcketing Method: serch for root inside n intervl (x l, x r ). Grphicl method Flse position (lso clled regul flsi or liner interpoltion) method Bisection method 2). Open Method: serch for root strting from n initil given guess point x 0. Newton s method Secnt method Fixed -point itertion 3.2 Brcketing Method Intermedite vlue theorem: Brcketing method: An initil intervl tht includes the solution is identified. Then, by using numericl scheme, the size of the intervl is successively reduced until the distnce between the endpoints is less thn the desired ccurcy of the solution. It includes two steps: 1). Subdividing lrge intervl (, b) into n smller subintervls s (, 1 ), ( 1, 2 ),, ( n-1, b) 24

2). Exmine signs t both ends of ech subintervl. There re two possibilities of the two signs: ) f(x l ) nd f(x u ) sme signs, i.e. f(x l )f(x u ) >0 then No roots or Even number of roots b) f(x l ) nd f(x u ) different signs, i.e. f(x l )f(x u ) <0, ccording to intermedite vlue theorem then One roots or Odd number of roots Exceptions: f(x) id discontinuous function. The lgorithm (not MATLAB code) of brcketing method is: Given: f(x), xmin, xmx, n dx = (xmx-xmin)/n % Size of brcket intervl xl = xmin % Initilize left side of test brcket i = 0 % Initilize counter while i < n i = i + 1 xr = xl + dx if f (x) nd f (xb)<0 %f(xl) nd f(xr) hve different sign sve [ x, xb ] for further root finding else xl = xr % serch next intervl end 3.2.1 Grphicl Method Grphicl method: Sketch the grph of f (x), then serch for the points tht intersects x- xis, these points re the roots of f ( x) 0. 667.38 0.147x Exmple 3.1 Estimte the root of f ( x) (1 e ) 40 0 by grphicl x method. 25

From the plot, we observe tht it crosses x xis between (12, 16), nd estimte the root roughly s x 15. However, f (15) = -0.4133, thus, grphicl method is not precise. 3.2.2 Bisection Method Bisection method: is brcketing method for finding numericl solution of eqution f(x)=0 when it is known tht within given intervl [, b], f(x) is continuous nd the eqution hs solution. The lgorithm is implemented in the following steps: 1). Choose serch intervl [, b] which hs sign-chnge for f(x) (i.e. f()f(b)<0); 2). Clculte the midpoint of the intervl x m = (+ b ) / 2, use it s n estimte of the numericl solution; 3). Select subintervl from [, x m ] or [x m, b], use the one tht hs sign-chnge for f(x) (i.e. contins solution) s new serch intervl [, b], then repet steps 2)-3) until the error stisfies your expecttion. The lgorithm of bisection method is: initilize: =..., b =... for k = 1, 2,... xm = + (b-)/2 if sign(f (xm)) = sign(f ()) = xm else b = xm end 26

if converged, stop end 667.38 0.147 x Exmple 3.2 Estimte the root of f ( x) (1 e ) 40 0 by bisection x method between the intervl (12, 16) until estimted reltive error less thn 0.5%. Itertion b xm 1 12 16 14 5.279 2 14 16 15 6.667 1.487 3 14 15 14.5 3.448 1.896 4 14.5 15 14.75 1.695 0.204 5 14.75 15 14.875 0.840 0.641 6 14.75 14.875 14.8125 0.422 0.219 Note: The method converges slowly to find n idel solution. It my fil when the function f(x) is tngent to nd does not cross x-xis. t 3.2.3 Flse Position (Regul Flsi or Liner Interpoltion) Method Flse position method: is nother brcketing method for finding numericl solution of eqution f(x)=0 when it is known tht within given intervl [, b], f(x) is continuous nd the eqution hs solution. The endpoints t the intervl (, b) re connected by stright line, the point where the line crosses the x-xis is thought s the estimte of the numericl solution. 27

Line cn be expressed s: y= sx +t Then Δy=sΔx i.e. let y=0 so x=x c = (3.1) The lgorithm is implemented in the following steps: 1). Choose serch intervl [, b] which hs sign-chnge for f(x) (i.e. f()f(b)<0); 2). Find the cross point xc by eqution 3.1, use it s n estimte of the numericl solution; 3). Select subintervl from [, x c ] or [x c, b], use the one tht hs sign-chnge for f(x) (i.e. contins solution) s new serch intervl [, b], then repet 2)-3) until the error stisfies your expecttion. Note: 3.3 Open Method 3.3.1 Newton s Method Newton s method: lso clled Newton-Rphson method, is open method for finding numericl solution of eqution f(x)=0 when it is known tht f(x) is continuous nd differentible nd the eqution hs solution ner given point. Figure below shows procedure: 28

Newton s method cn be derived by using Tylor series round x i : f(x)= Assume x i+1 is the root, then f(x i+1 )=f(x i )+f (x i )( x i+1 - x i )=0 thus x i+1 = (3.2) The lgorithm is implemented in the following steps: 1). Choose point x i s n initil guess of the numericl solution; 2). Find the next guess x i+1 by eqution (3.2), use it s n estimte of the numericl solution; 3). Clculte the estimted reltive error, check whether the error stisfies your expecttion or not. If not, use x i+1 s new initil guess x i, then repet 2); otherwise, x i+1 is the solution. Stop itertion by checking 1) or 2) tolernce f ( xi ). Note: Newton s method converges fst when there is solution. The expression of derivtive (slope) of function f(x) should be found nd used to clculte the next guess of solution, sometimes it is difficult to determine the expression, then slope should be found numericlly. Newton s method my fil under the following conditions: Cse 1: Inflection point in vicinity of root Cse 2: Oscillte round locl mximum or minimum Cse 3: Jump wy for severl roots 29

Cse 4: Disster from zero slope Exmple 3.4 Write MATLAB function file tht pplies Newton s Method to find the root for x - x 1/3-2 = 0 with true reltive error less thn 0.005%. 3.3.2 Secnt Method Secnt method: It is good for function whose derivtive expression is difficult to evlute. It is open method for finding numericl solution of eqution f(x)=0, it uses two points in the neighborhood of the solution to determine new estimte for the solution. 30

In Newton s method, we know x i+1 =, when it is hrd to find the expression of f (x), Newton s method doesn t work. However, we cn rewrite x i+1 = Thus, secnt method needs two initil dt points, nd is n pproximted form of Newton s method. Exmple 3.5 Use secnt method to estimte root of e -x - x = 0. Initil estimte x -1 = 0 nd x 0 = 1.0. 1st itertion: x -1 = 0, f (x -1 ) = x 0 = 1, f (x 0 ) = x 1 = 2nd itertion: 3rd itertion: 3.3.3 Fixed-point Itertion Method Fixed-point itertion method: It is nother open method for finding numericl solution of eqution f(x)=0, the steps includes: 31

1). Rewrite originl eqution f(x) = 0 into nother form x = g(x); 2). Select initil vlue x 0, nd let x i = x 0; 3). Updte new x i+1 s function of old x i using itertion function x=g(x), i.e. x i+1 = g (x i ) 4). Check whether it reches convergence, i.e. xi 1 xi 100% expected error x i 1 If yes, x i+1 is the root; otherwise, let x i = x i+1, nd repet steps 3)-4). Note: 1). Sometimes, it is hrd to derive x=g(x) from f(x)=0. Under this sitution, you cn rewrite f(x)=0 s f(x)+x x=0, then x=f(x)+x is your g(x). 2).For some problem, it my not converge. When the derivtive of g(x) in the neighborhood of the fixed point hs n bsolute vlue tht is smller thn 1, i.e. g(x) <1, the fixed-point itertion method converges. Exmple 3.3 cont. Find root of f (x) = x - e -x = 0 by fixed-point itertion method strting from x 0 =0 until 1%. 32

i x i (%) 0 0 1 1 100 2 0.3679 171.8 3 0.6922 46.9 4 0.5005 38.3 5 0.6062 17.4 6 0.5454 11.2 7 0.5796 5.90 8 0.5601 3.48 9 0.5711 1.93 10 0.5649 1.11 Approximted solutions 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 Approximted solution True solution 0 0 2 4 6 8 10 12 Number of itertions 3.4 Roots of Polynomil A polynomil of order n is where s = constnt coefficients, f(x)=0 is specil kind of nonliner eqution. Roots of polynomils: (1) nth-order eqution hs n rel or complex roots (2) If n is odd, t lest one root is rel. (3) Complex roots exist with conjugte pirs (r + mi nd r - mi) 3.5 MATLAB built-in Function for Solving Nonliner Equtions There re two built-in functions: 1). fzero(`function, x 0 ) It solves n eqution (in the form of f(x)=0) with one vrible. `function is the expression of the function f(x), x 0 is vlue of x ner to where the function crosses the xis. Thus, the user needs to know pproximtely where the solution is. 2). roots(p) It only finds the roots of n-order polynomil 33

2 n f ( x) 0 1x 2 x n x 0 Where the row vector P consists of the coefficients of the polynomil nd P=[ n n-1 0 ]. Exmple 3.6 Find the roots of function. f ( x) 10 8x 5x 3 9x 4 0 using MATLAB roots Exmple 3.7 Find the root of Exmple 3.5 using MATLAB fzero function, use x 0 =0.5. 34