Review of Taylor Series. Read Section 1.2

Similar documents
Lecture 2 Solution of Nonlinear Equations ( Root Finding Problems )

: Numerical Analysis Topic 2: Solution of Nonlinear Equations Lectures 5-11:

Chapter 4: Root Finding

Summary with Examples for Root finding Methods -Bisection -Newton Raphson -Secant

CISE301: Numerical Methods Topic 2: Solution of Nonlinear Equations

Chapter Newton s Method

NUMERICAL DIFFERENTIATION

CHAPTER 4d. ROOTS OF EQUATIONS

Topic 5: Non-Linear Regression

Single Variable Optimization

Curve Fitting with the Least Square Method

Numerical Methods Solution of Nonlinear Equations

Formal solvers of the RT equation

Module 14: THE INTEGRAL Exploring Calculus

Complex Numbers Alpha, Round 1 Test #123

Week3, Chapter 4. Position and Displacement. Motion in Two Dimensions. Instantaneous Velocity. Average Velocity

1 Matrix representations of canonical matrices

polynomial interpolation a x

Math1110 (Spring 2009) Prelim 3 - Solutions

Section 8.3 Polar Form of Complex Numbers

Modeling curves. Graphs: y = ax+b, y = sin(x) Implicit ax + by + c = 0, x 2 +y 2 =r 2 Parametric:

Mechanics Physics 151

ACTM State Calculus Competition Saturday April 30, 2011

Differentiating Gaussian Processes

Modelli Clamfim Equazioni differenziali 7 ottobre 2013

= 1.23 m/s 2 [W] Required: t. Solution:!t = = 17 m/s [W]! m/s [W] (two extra digits carried) = 2.1 m/s [W]

Module 2. Random Processes. Version 2 ECE IIT, Kharagpur

Modelli Clamfim Equazioni differenziali 22 settembre 2016

Chapter 3 Differentiation and Integration

Problem Set 9 Solutions

Chapter 12. Ordinary Differential Equation Boundary Value (BV) Problems

Supplement: Proofs and Technical Details for The Solution Path of the Generalized Lasso

Nice plotting of proteins II

Mathematics Intersection of Lines

8.1 Arc Length. What is the length of a curve? How can we approximate it? We could do it following the pattern we ve used before

arxiv: v1 [math.ho] 18 May 2008

Lecture 10 Support Vector Machines II

Section 3.6 Complex Zeros

Line Drawing and Clipping Week 1, Lecture 2

Lectures - Week 4 Matrix norms, Conditioning, Vector Spaces, Linear Independence, Spanning sets and Basis, Null space and Range of a Matrix

1 GSW Iterative Techniques for y = Ax

Exercises. 18 Algorithms

Transfer Functions. Convenient representation of a linear, dynamic model. A transfer function (TF) relates one input and one output: ( ) system

Newton s Method for One - Dimensional Optimization - Theory

A Hybrid Variational Iteration Method for Blasius Equation

REAL ANALYSIS I HOMEWORK 1

APPENDIX A Some Linear Algebra

Lecture 12: Discrete Laplacian

3.1 Expectation of Functions of Several Random Variables. )' be a k-dimensional discrete or continuous random vector, with joint PMF p (, E X E X1 E X

Lecture 13 APPROXIMATION OF SECOMD ORDER DERIVATIVES

CALCULUS CLASSROOM CAPSULES

= = = (a) Use the MATLAB command rref to solve the system. (b) Let A be the coefficient matrix and B be the right-hand side of the system.

Implicit Integration Henyey Method

EEE 241: Linear Systems

Chapter Twelve. Integration. We now turn our attention to the idea of an integral in dimensions higher than one. Consider a real-valued function f : D

More metrics on cartesian products

A new Approach for Solving Linear Ordinary Differential Equations

36.1 Why is it important to be able to find roots to systems of equations? Up to this point, we have discussed how to find the solution to

Homework Assignment 3 Due in class, Thursday October 15

Lecture Notes on Linear Regression

IV. Performance Optimization

6. Stochastic processes (2)

Bezier curves. Michael S. Floater. August 25, These notes provide an introduction to Bezier curves. i=0

ρ some λ THE INVERSE POWER METHOD (or INVERSE ITERATION) , for , or (more usually) to

6. Stochastic processes (2)

The equation of motion of a dynamical system is given by a set of differential equations. That is (1)

Foundations of Arithmetic

Errors for Linear Systems

2 Finite difference basics

Using T.O.M to Estimate Parameter of distributions that have not Single Exponential Family

Advanced Algebraic Algorithms on Integers and Polynomials

Min Cut, Fast Cut, Polynomial Identities

The optimal delay of the second test is therefore approximately 210 hours earlier than =2.

Ensemble Methods: Boosting

n α j x j = 0 j=1 has a nontrivial solution. Here A is the n k matrix whose jth column is the vector for all t j=0

College of Computer & Information Science Fall 2009 Northeastern University 20 October 2009

OPTIMISATION. Introduction Single Variable Unconstrained Optimisation Multivariable Unconstrained Optimisation Linear Programming

Chapter 5. Solution of System of Linear Equations. Module No. 6. Solution of Inconsistent and Ill Conditioned Systems

10.34 Numerical Methods Applied to Chemical Engineering Fall Homework #3: Systems of Nonlinear Equations and Optimization

CIS526: Machine Learning Lecture 3 (Sept 16, 2003) Linear Regression. Preparation help: Xiaoying Huang. x 1 θ 1 output... θ M x M

STAT 309: MATHEMATICAL COMPUTATIONS I FALL 2018 LECTURE 16

Difference Equations

Bézier curves. Michael S. Floater. September 10, These notes provide an introduction to Bézier curves. i=0

Finding Dense Subgraphs in G(n, 1/2)

Math 702 Midterm Exam Solutions

Week 8: Chapter 9. Linear Momentum. Newton Law and Momentum. Linear Momentum, cont. Conservation of Linear Momentum. Conservation of Momentum, 2

Suppose that there s a measured wndow of data fff k () ; :::; ff k g of a sze w, measured dscretely wth varable dscretzaton step. It s convenent to pl

Consistency & Convergence

Kernel Methods and SVMs Extension

SOLVING NON-LINEAR SYSTEMS BY NEWTON s METHOD USING SPREADSHEET EXCEL Tay Kim Gaik Universiti Tun Hussein Onn Malaysia

THE CURRENT BALANCE Physics 258/259

Introductory Cardinality Theory Alan Kaylor Cline

Numerical Solution of Ordinary Differential Equations

Introduction to Vapor/Liquid Equilibrium, part 2. Raoult s Law:

ANSWERS. Problem 1. and the moment generating function (mgf) by. defined for any real t. Use this to show that E( U) var( U)

8.6 The Complex Number System

THE ARIMOTO-BLAHUT ALGORITHM FOR COMPUTATION OF CHANNEL CAPACITY. William A. Pearlman. References: S. Arimoto - IEEE Trans. Inform. Thy., Jan.

Digital Signal Processing

Root Finding

Gravitational Acceleration: A case of constant acceleration (approx. 2 hr.) (6/7/11)

Transcription:

Revew of Taylor Seres Read Secton 1.2 1

Power Seres A power seres about c s an nfnte seres of the form k = 0 k a ( x c) = a + a ( x c) + a ( x c) + a ( x c) k 2 3 0 1 2 3 + In many cases, c = 0, and the seres takes the smpler form k = 0 a k 2 3 k x = a0 + a1x+ a2x + a3x + Specal power seres of our nterest are Taylor seres. 2

Taylor Seres The Taylor seres of a functon f( x) about the pont c ( k ) f ( c) s the power seres k ( x c). k! k = 0 k = 0 f ( c) f ( c) f( x) f( c) f ( c)( x c) ( x c) ( x c) 2! 3! ( k ) f ( c) ( ) k = x c k! 2 3 + + + + If f( x) equals ts Taylor seres n an nterval I contanng c, f( x) s sad to be analytc n I. 3

x Taylor Seres of e about c= 0 ( k ) f ( c) k f( x) ( x c). k! k = 0 d e = e f c = e = e dx x x ( k) c 0, so ( ) 1. = e x k = 0 k x. k! 4

Some Famlar Taylor Seres 2 3 k x x x x e = 1 + x+ + + = ( x < ) 2! 3! k! k = 0 3 5 7 2k + 1 x x x k x sn x = x + + = ( 1) ( x < ) 3! 5! 7! (2k + 1)! k = 0 2 3 4 k x x x k 1 x ln(1 + x) = x + + = ( 1) ( x < 1) 2 3 4 k k = 0 5

e x 2 3 4 5 6 x x x x x = 1+ x+ + + + + + 2! 3! 4! 5! 6! e x 2 3 4 5 6 x x x x x 1+ x+ + + + + 2! 3! 4! 5! 6! What's the error n ths approxmaton? 6

Taylor's Theorem If a functon s dfferentable to the ( n + 1)th order n a closed nterval I = [ a, b], then for any c and x n I, n ( k ) f ( c) k f( x) = ( x c) + k! k = 0 E n + 1 where the error term ( n+ 1) f ( μ) En+ 1 = ( x c) ( n + 1)! for some pont between x and c. n+ 1 7

Taylor's Theorem for f ( c+ h) Let h= x c, then x= c+ h, and Taylor's Theorem becomes: n ( k ) f ( c) k f( c+ h) = h + E k! k = 0 where the error term n+ 1 E n+ 1 = ( n+ 1) f ( μ) ( n + 1)! h n+ 1 for some pont between c and c+ h. 8

Root Fndng Read Chapter 3 9

Roots and Zeros Equaton: f( x) = 0 A number r for whch f( r) = 0 s called a root of the equaton f( x) = 0 a zero of the functon f 2 Example: the equaton x 2x 3 = 0 has two roots, 2 1 and 3; the polynomal 2 3 has two x= x= x x zeros, x= 1 and x= 3. 10

Bsecton Method Assume f s contnuous. If f( a) and f( b) have dfferent sgns, then there s a root n [ a, b]. The bsecton method s smlar to the bnary sear ch. 11

Bsecton Method Input: functon f, nterval [ a, b] where f( a) f( b) < 0, ε. Algorthm: 1. Compute the mdpont c= ( a+ b) / 2; 2. f f( c) = 0 then return( c); /* unlkely */ 3. f sgn( f( a)) sgn( f( c)) Recurse on I : = [ a, c] else /* sgn( f( c)) sgn( f( b)) */ Recurse on I : = [ c, b] endf I 4. Repeat untl < ε; then return the mdpont of I. 2 12

Bsecton Method Bsecton( f, a, b, ε, k) /* Precondton: sgn( f( a)) sgn( f( b)) */ /* k = max # of remanng teratons */ 1. c ( a+ b) / 2 2. f f( c) = 0 then return( c); 3. f ( ( b a) /2 < ε or k < 1) then return( c); 4. f sgn( f( a)) sgn( f( c)) then 5. Bsecton( f, a, c, ε, k 1); 6. else /* sgn( f( c)) sgn( f( b)) */ 7. Bsecton( f, c, b, ε, k 1); 8. endf 13

Convergence of Bsecton Method How many teratons are needed? Let [ ab, ] = [ a, b] be the ntal nterval. 0 0 Let [ a, b] be the nterval of the th recursve call. Length of nterval [ a, b]: b a = b 2 #teratons (recursve calls) needed: a 1 b a ( b a) < ε 2 > 2 2 2ε ( b a) > log2 = log 2( b a) log22ε 2ε 14

Convergence of Bsecton Method [ a0, b0] = [ a, b]: the ntal nterval. [ a, b]: the nterval of the th recursve call. Mdponts of these ntervals c0, c1, c2, form a sequence of approxmatons to the root r. Let e = r c. c0 = ( a0 + b0) / 2 e0 ( b a) 2 c1 = ( a1+ b1)/2 e1 ( b a) 2 c = ( a + b)/2 e ( b a) 2 ( c c c ) How fast does the sequence,,, converge to r? 0 1 2 Approxmately 1 bt per teraton. 2 + 1 15

Regula Fals: Improved Bsecton Method Choose c to be the pont where the secant lne between ( a, f( a)) and ( b, f( b)) ntersects the x axs. Regula Fals often converges faster than bsecton. c 16

The equaton of secant lne: y f( b) f( a) f( b) = x b a b bf ( a) af ( b) When y = 0, x=, whch s c. f( a) f( b) c 17

Newton's Method Approxmate f( x) by a straght lne l( x), and use the root of lx ( ) as an approxmaton to the root of f( x). lx ( ) : a lne tangent to the functon at a current guess. 18

Newton's Method The slope of the tangent lne s the dervatve f ( x0). So: y = f ( x0)( x x0) + f( x0) f( x ) 0 When y = 0, x= x0. f ( x0) Ths gves us a sequence: x f( x0) = x f ( x ) 1 0 0 x f( x1) = x f ( x ) 2 1 1 x = x 3 2 f( x2) f( x ) x+ 1 = x f ( x ) f ( x ) 2 19

Newton's Method: Example What s f ( x) : 3 2 Fnd a zero for f( x) = x + 2x 11x 12 So f x = x + x 2 ( ) 3 4 11 3 2 f( x) x + 2x 11x 12 + 1 = = 2 f ( x) 3x + 4x 11 x x x Start wth x 0 = 30 Does ths method always converge? 20

Newton's Method: Bad Functons 21

Newton's Method: Convergence Doesn't always converge. Assume: f, f, f are contnuous n a neghborhood of r (the root) and f ( r) 0. The sequence ( x0, x1, x2, ) converges f x0 s close enough to r. Converges quadratcally : r x c r x + 1 2 or e + 1 ce 2 where c s a postve constant. 22

Quadratc Convergence The error terms satsfy: e 1 Example: Suppose c= 1, and e0 2. 1 e0 2 2 e1 2 4 e2 2 8 e3 2 16 e4 2 The number of correct dgts doubles wth each teraton. Fve or sx teratons are often suffcent to yeld full machne precson. + 1 ce 2 23

Newton's Method: Remarks We must be able to evaluate f ( x), whch s not always the case. Does not guarantee convergence. But t s very fast, f the startng pont s close enough to the root. 24

Secant Method As n Newton's method, approxmate the functon wth a lne, but ths tme a secant lne. Two startng ponts: x and x. 0 1 25

Secant Method Let the ntersecton pont be ( x f( x1) f( x0) 0 f( x1) = x x x x 1 0 2 1 2,0). Equate the slopes: Rearrange: x = x f ( x ) 2 1 1 x x 1 0 f( x ) f( x ) 1 0 Do the same thng for x usng x and x. 3 1 2 In general: x = x f( x ) + 1 x 1 f( x ) f ( x ) x 1 26

Secant Method vs Newton's Method Secant method s smlar to Newton's method except that f ( x ) s approxmated by f ( x ) f( x) f( x 1) x x So how does t compare to Newton's method? How many functon evaluatons are needed per teraton? Wll t converge? How about speed of convergence? e 1 ce α +, α 1.62, the golden rato. Not qute as fast as Newton's method but stll superlnear and much faster than bsecton. But f you consder number of evaluatons t could be faster than Newton's. 1 27

Root Fndng Comparson Bsecton Method Always converges, but does so slowly, Needs two startng values on opposte sdes of the root. Newton's Method May not converge, but converges quckly near the root. Needs two functon evaluatons per teraton. Needs to be able to evaluate f. Secant Method May not converge, but converges quckly near the root. Needs one functon evaluaton per teraton. Doesn't need f. 28

Hybrd Methods Most popular Combne Bsecton wth Newton's or Secant. Apply Bsecton for a few steps and then swtch to Newton or Secant. 29

Root Fndng wth Matlab Matlab has a functon gven functon. fzer o that returns a root of a 30

Defne a Functon The followng Matlab scrpt defnes a functon f( x) = x x + sn( x) + 7. 5 3 Store the scrpt n a fle named f.m functon y = f(x) % defne a functon named "f" y = x^5 - x^3 + sn(x) + 7; 31

Plot the Functon lnspace(a,b) defnes a 100 equally-spaced ponts nterval [a,b]. lnspace(a,b) draw the dagram. Try plot(x,y,'r*'), plot(x,y,'g+'). Use help plot to get more nformaton. x = lnspace(-p, p); % an array of 100 equally-spaced ponts n [-p,p] for = 1:100 y() = f(x()) end plot(x,y) 32

Fnd the Root fzero('fname', [a b]) tres to fnd a zero of the functon fname n the nterval [a,b]. fzero('fname', a) tres to fnd a zero of the functon fname near a. x = lnspace(-p,p); for = 1:100 y() = f(x()); end; root = fzero('f',[-2 2]); plot(x,y, root, 0, 'ro'); root, f_val_at_root = f(root) 33