Description

te Furter Matematics network V 07 REVISION SHEET NUMERICAL METHODS (MEI) APPROXIMATING FUNCTIONS Te main ideas are: Constructing and interpreting difference tables Before te eam you

All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.

Related Documents

Share

Transcript

te Furter Matematics network V 07 REVISION SHEET NUMERICAL METHODS (MEI) APPROXIMATING FUNCTIONS Te main ideas are: Constructing and interpreting difference tables Before te eam you sould know: How to construct and interpret a difference table, and te notation used Te formula for te Newton Interpolating polynomial (also known as Newton Forward Difference Metod) Using a difference table to calculate Newton s interpolating polynomial Lagrange s Polynomials/Metod (Finite) Difference Tables. Suppose tat you are given a collection of data points for some function, for eample: f() Note: we must ave equally spaced -values to use any of te metods in tis capter wic relate to looking at difference tables. Column of First 0 f( ) = f0 + Δ f0 + ( 0)( ) Δ f 0 +! ( 0)( )( )! f... Δ 0 + Lagrange s Polynomials wic fit points witout equally spaced -values. For eample A ( b)( c) B ( c)( a) f( ) = + ( a b)( a c) ( b c)( b a) C ( a)( b) + ( c a)( c b) goes troug (a,a), (b, B) and (c, C) Column of Second Differences Column of Tird Differences Column of Fourt Differences Differences i f i Δf i Δ f i Δ f i Δ 4 f i Δ 5 f i Column of Fift Differences Tis entry is calculated as =. Tis entry is calculated as =.8 As a rule of tumb, if te variation in a column is less tan about 0% of te average value for tat column. we would say tat it is nearly constant Te tird differences column is nearly constant so in Newton s Interpolation formula and Newton s Interpolating polynomial use terms up to and including Δ f 0 for a good approimation, unless you require an eact fit. te Furter Matematics network V 07 Newton s Interpolating Polynomial (a.k.a Newton s Forward Difference Metod) Eample Te cubic f( ) = + passes troug te points (, ), (0, ), (, 0) and (, 5). Sow tat Newton s Interpolating Polynomial for tese four points is te original cubic polynomial. Te four points, (, ), (0, ), (, 0) and (, 5) give te i and te f i values 0 i f i Δf i Δ f i Δ f i f 0 Δf 0 Δ f 0 Δ f 0 So, substituting in te formula and wit =, gives 0 ( 0)( ) ( 0)( )( ) f( ) = f0 + Δ f0 + Δ f 0 + Δ f 0!! ( ( ))( 0) ( ( ))( 0)( ) = + [( ( )) ( ) ] = + ( ) ( + ) ( ) = + = + Langrange s Tecnique Eample For a certain function f, f() = 4.5, f() = 4.9, f(4) = 5.8 and f(7) = 8.4. Use Lagrange s Metod to estimate f(5) by fitting a cubic to te grap of f at te points given. Note tat because te -value we ave are not evenly spaced, we ave no coice but to use Lagrange s metod ere. Te curve passing troug (a,a), (b, B), (c, C) and (d, D) is A( b)( c)( d) B( a)( c)( d) C( a)( b)( d) D( a)( b)( c) y = ( a b)( a c)( a d) ( b a)( b c)( b d) ( c a)( c b)( c d) ( d a)( d b)( d c) Using tis wit te points (, 4.5), (, 4.9), (4, 5.8), (7, 8.4) gives 4.5( )( 4)( 7) 4.9( )( 4)( 7) 5.8( )( )( 7) 8.4( )( )( 4) y = ( )( 4)( 7) ( )( 4)( 7) (4 )(4 )(4 7) (7 )(7 )(7 4) Now you must let = 6 to get an approimation to f(6), notice tat ere tere is no need to simplify te interpolating polynomial itself! 4.5(6 )(6 4)(6 7) 4.9(6 )(6 4)(6 7) 5.8(6 )(6 )(6 7) 8.4(6 )(6 )(6 4) f(6) ( )( 4)( 7) ( )( 4)( 7) (4 )(4 )(4 7) (7 )(7 )(7 4) = = 7.8 (to d.p.) te Furter Matematics network V 07 REVISION SHEET NUMERICAL METHODS (MEI) ERRORS AND APPROXIMATION Te main ideas are: Significant Figures and Decimal Places Measures of error Propagation of Errors Before te eam you sould know: Te formula for measures of error. Tese are error, relative error, absolute error and absolute relative error. Te rules for propagation of relative errors addition, multiplication and division. Tat care must be taken wen subtracting approimations to nearly equal quantities, many significant figures can be lost in accuracy. Measures of Error Wen a given value is approimated by X : te errorε is given byε = X. te relative error is defined by, error relative error = eact value ε =. te absolute error is defined as te modulus of te error. In oter words, absolute error = ε = X. te absolute relative error is defined as error ε X absolute relative error = = =. eact value Subtraction of Nearly Equal Quantities Note: usage of tese terms on eam papers as not been completely consistent to date, e.g. an approimation of 0.6 to 0.6 may be described as aving an error of 0.0 instead of an error of 0.0. Eample Te values X =.45 and Y = 0.5 are approimations to values and y wic are bot correct to 6 significant figures. Give y correct to as many significant figures as is possible wit tis information. Since X =.45 is correct to 6 significant figures.455 .455. Similarly, since Y =.5 is correct to 6 significant figures Terefore y y or.0 y .0 So y must be.0 to significant figures, but it cannot be given to 4 significant figures from te information available. te Furter Matematics network V 07 Propagation of relative error upon multiplying or dividing approimations Eample Suppose tat X =. is used as an approimation to =.478 and Y = 0.0 is used an approimation to y = 0.097, i) ii) iii) Wat is te relative error in eac of tese approimations? Wat is te relative error wen XY is used an approimation of y? X Wat is te relative error wen Y is used as an approimation of y? Find any relationsips between te values you ave calculated? i) X..478 r = = = (to 5 d.p.).478. Y y r = = = (to 5 d.p.) y ii) Te relative error wen XY is used to approimate y is: XY y (. 0.0) ( ) r = = y = = (to 5 d.p.) a. A possible relationsip is tat r + r = is approimately equal to tis value. iii) X Te relative error wen Y is used to approimate y is X..478 Y y r = = = = (to 5 d.p.) a. 4 y b. A possible relationsip is tat r r = = (to 5 d.p.) approimately equal to tis value. In fact tese observations old in general: is If X is an approimation of wit relative error r and Y is an approimation of y wit relative error r ten: te relative error in XY as an approimation of y is approimately r + r X te relative error in Y as an approimation of y is approimately r r. te Furter Matematics network V 07 REVISION SHEET NUMERICAL METHODS (MEI) NUMERICAL DIFFERENTIATION Te main ideas are: Using te forward and central difference formulae Knowing about te order of convergence for eac metod and being able to etrapolate from approimations you ave calculated An appreciation of ow te gradient of a function influences te error in f() wen tere is an error in. Using te forward and central difference formulae. Before te eam you sould know: Know te formulae for te forward and central difference approimations to te derivative (or gradient) of a function. Te forward difference approimation to te derivative of a function f at a value is given by f( + ) f( ) f( ) were is small. Te central difference approimation to te derivative of a function f at a value is given by f( + ) f( ) f( ) were is small. If X is used as an approimation to and te error is (so tat X = ) ten te error wen f(x) is used as an approimation to f() is approimately f( ) You sould know tat te central difference metod is a second metod and te forward difference metod is a first order metod (and wat tis means!). Eample For te function f() = sin, calculate te forward difference approimations to = 0.,0.05,0.05,0.05. Te forward difference approimation to f( ) is given by f() wit In eac case below =. Wit = 0., tis gives f( + ) f( ) f( ). f ( 0.) f (). sin. sin + = f () =.6956 (to 4 d.p.) 0. Wit = 0.05, f ( ) f () =.05 sin.05 sin f () =.890 (to 4 d.p.) 0.05 Tese approimations appear to be approacing a value sligtly less tan. te Furter Matematics network V 07 Eample Values of a function, f, for various values of are given in te following table....4 f() 0 Find an approimation to f (.) using forward difference approimations = 0.. : Te central difference approimation wit = 0. is, f (.) f (.) f (.) = = Remembering te formulae Probably te easiest way to remember te formula for forward difference approimation to te derivative and central difference approimation to te derivative is to commit te following diagrams to memory. y-ais Forward Difference Approimation y-ais Central Difference Approimation f(+) f() + f(+)-f() -a gradient of cord cange in y coord = cange in coord f( + )-f( ) = f(+) f() f(-) - f(+)-f(-) + -a gradient of cord cange in y-coordinate = cange in -coordinate f( + ) f( ) = How te gradient of a function influences te error in f() wen tere is an error in. Eample Calculate te error incurred if te approimations X = 6.0 and X = 5.9 are used in te function obtain approimations to f(5.9). Relate tese to te derivative of f. f( ) = to Te eact value of f(5.9) is approimation of f(5.9) is 5.9 = Using X = 6.0 gives f(x) = 6. Te error in tis f (6) f (5.9) = = Te relationsip wit te derivative of f is tat f( X ) f( ) f ( ) were = X. In fact f ( ) = = ( ) Using X = 5.9 gives f(x) = Te error in tis approimation of f(5.9) is f (5.9) f (5.9) = = f ( ) = = Tis time = and ( ) te Furter Matematics network V 07 REVISION SHEET NUMERICAL METHODS (MEI) NUMERICAL INTEGRATION Te main ideas are: Using te midpoint rule, trapezium rule and Simpson s rule to approimate integrals. Knowing ow accurate eac of tese metods is so tat you are able to estimate error. Te Midpoint Rule y a m m m m 4 m 5 m 6 m 7 m 8 b Before te eam you sould know: You sould be familiar wit all te standard notation used in Numerical Integration. You sould know te formulae for M n, te midpoint rule wit n strips, T n te trapezium rule wit n strips and S n, Simpson s rule. You sould know te following formulae, and use tem to your advantage in te eam. T n = ( Tn + Mn ) Sn = ( Tn + Mn) You sould know tat te midpoint and trapezium rule are second order metods. Tis means tat alving te strip widt gives you a rougly four times more accurate approimation. You sould know tat Simpson s rule is a fourt order metod. Tis means tat alving te strip widt gives you a siteen times better approimation. You sould be able to display some knowledge of ow tese facts can allow you to estimate te error in a given approimation by looking at te difference between tat and a previous approimation, see te last section on tis seet for more details. Remember tat eac time you apply tese rules, canges and te values of f, f, cange according to te particular strip widt you are using. Te composite form of te mid-point rule, using n strips, eac of widt gives b f( ) (f( ) f( )... f( )) d m + m + + mn = M n, a were m, m,..., mn are te values of at te midpoints of te strips. Te Trapezium Law y te Furter Matematics network V 07 Te composite form of te trapezium law using n strips, eac b 0 n n. a of widt gives f ( d ) [ f + (f + f + f f ) + f ] Note te notation ere, f 0 is te value of te function at te left and end of te first strip, f is te value of te function at te left and end of te second strip (or te rigt and end of te first strip) and so on. Finally, f n is te value of te function at te rigt and end of te n t strip. a b Simpson s Rule In general, over any interval (a, b) divided into an even number, n, of strips, of widt, te composite Simpson s rule gives, b f ( d ) Sn = f0 + 4(f+ f + f f n ) + (f + f f n ) + fn a [ ] Simpson s rule approimates te function by a series of quadratics, one for eac pair of neigbouring strips. Note tat te above approimation can be calculated as Sn = ( Tn + Mn ) How accurate are my estimates? In te table below and to te rigt. we ave a series of trapezium rule estimates to sin d. Immediately to te rigt is te grap of tis function How accurate can we give an estimate to tis integral based on tese results? Te first ting to say is tat T 8 and T 6 agree to two decimal places, tey bot round to To tree decimal places tey disagree, T 8 rounds to wereas T 6 rounds to As te trapezium rule is a second order metod we can safely say tat to two decimal places sin( d= ) We cannot safely say wat te estimate is to tree decimal places. Estimates get about four times better (four times closer to te true value) upon eac alving of te strip widt. Tis means tat te ratio of differences will be about 0.5 as is sown in te table on te rigt. We may wis to etrapolate to obtain furter estimates of T6 T8 T6 T8 T6 T8 T = T6 +, T64 = T6 + + etc etc. 4 4 In fact you may wis to look at te number T T 6 T8 T 6 T8 T6 T8 T wic can be found by summing an appropriate geometric progression. y Trapezium Differences Ratio of Estimates T i+ -T i Differences T = T = T 4 = T 8 = T 6 = T 8 T 4 T 6 True Value te Furter Matematics network V 07 REVISION SHEET NUMERICAL METHODS (MEI) RATE OF CONVERGENCE IN NUMERICAL PROCESSES Te main ideas are: Using te forward and central difference formulae. Knowing about te order of convergence for eac metod and being able to etrapolate from approimations you ave calculated An appreciation of ow te gradient of a function influences te error in f() wen tere is an error in. Detecting First Order Convergence by looking at Ratio of Differences Eample Sow, by considering ratios of differences, tat te following sequence as first order convergence. Before te eamination you sould know: A converging sequence is said to ave first order convergence if, for some fied positive number k, absolute error in absolute error in k, k,.. absolute error in 0 absolute error in A converging sequence is said to ave second order convergence if, for some fied positive number k, absolute error in absolute error in k, k,... 0 ( absolute error in ) ( absolute error in ) For metods depending on, like tose found in Numerical Integration and Differentiation, a metod is said to be an n t order metod if te absolute error in an approimation is proportional to n. Te forward difference approimation is a first order metod. Te central difference approimation, trapezium rule and midpoint rule are second order metods. Simpson s Rule is a fourt order metod Te ratios of differences are given in te table below. You can calculate te ratios of differences very quickly using a spreadseet program. n n n+- n ( n+- n)/( n+- n+) Ratios of differences Te ratio of differences column, being nearly constant, provides evidence of first order convergence. Detecting Second Order Convergence Second or iger order convergence is muc faster tan first order and so you can get a very good approimation to te limit wit only a few iterations. Since suc an approimation is very close to te actual value of te limit you can use it to estimate closely te absolute error in eac term. You sould know te following facts: Metod te Furter Matematics network V 07 Effect of alving or doubling n Ratio of differences between suc estimates Forward Difference Approimation Te estimate gets twice as close Central Difference Approimation Te estimate gets four times as close 4 Midpoint Rule Te estimate gets four times as close 4 Trapezium Rule Te estimate gets four times as close 4 Simpson s Rule Te estimate gets siteen times as close 6 Eample Below are Trapezium rule estimates to some integral. By considering te ratio between differences in successive estimates, give te value of te integral to te number of decimal places you feel is justified. T T 4 T T 8 T 4 T Te ratio of differences is = 0.58 (to 4 d.p.). 0.9 Te etrapolated value of T 6 is Tis is very close to te value of 4 predicted by te teory = Notice ow we need to subtract ere because clearly T 6 is epected to be less tan T 8. Te etrapolated value of T is = Tis sequence of values converges to = = = 4 = (to 6 d.p.) Comparing tese values, it looks as toug te estimate of.75 is correct to d.p. te Furter Matematics network V 07 REVISION SHEET NUMERICAL METHODS (MEI) THE SOLUTION OF EQUATIONS Te main ideas are: Using te bisection metod, te metod of false position (also known as linear interpolation), fied point iteration, te Newton Rapson Metod, and te secant metod to approimate te solution of an equation. Knowing ow accurate eac of tese metods is so tat you are able to estimate error. Te Bisection Metod Tis is probably te easiest of all te metods to apply. Te key points are: Before te eam you sould know: And be totally familiar wit using te five metods of approimating solutions to equations used in tis capter. Tese are, te bisection metod, te metod of false position, fied point iteration, te Newton Rapson Metod, and te secant metod. For every one of te metods above, you sould know ow to judge wen you ave te approimation to te required degree of accuracy and ten ceck tat tis is indeed te case. You sould know te order of convergence of te Newton-Rapson metod. It as second order convergence you sould know wat tis means. You sould know te requirements on te function g to find a fied point using fied point iteration. You must begin wit two points tat straddle te solution of f() = 0. Tese are usually called a and b Te reason tat tey are cosen is tat te sign of f(a ) is te opposite of te sign of f(b ). Tis means tat we epect te function to cross te -ais somewere between tem. a+ b Te sign of f is calculated. Depending on tis we know tat te cange of sign as to occur a+ b a+ b eiter between a and or between and b. Te appropriate pair become our a and b and te wole process is repeated. Note tat at every stage in tis process you can say tat te solution satisfies an b n. Tis means tat if an and b n are close enoug you can give te solution to any degree of accuracy. Te Metod of False Position (also known as Linear Interpolation) f( ) Given two values, a and b tat straddle a root of f() = 0 an approimation to te root is given by af( b) bf( a) c = f( b) f( a) Tis is te point were te straigt line between ( a,f( a)) and (, b f()) b crosses te -ais. Tis metod can be iterated by testing te sign of f(c) to find weter te root is between a and c or between c and b. f(b) f(a) a c α b Fied Point Iteration One of te main skills you need to acquire for fied point iteration is to get from an equation like f() = 0 to an equation of te form = g(). Here are some eamples = 0 =, te Furter Matematics network V sin = 0 = + 4sin y = If te fied point iteration metod produces values,,,... were n+ = g( n),converging to te fied point of g, ten we epect error in n+ g( ) error in n However we need a little more tan tis if we are to approimate te solution of f() = 0. We need te gradient of te g() to be between and around te fied point. y Gradient of red line negative but - around te fied point results in a converging series of values, illustrated by te inward moving cobweb in tis diagram. y y = g() Gradient of red line negative and - around te fied point results in a non-converging series of values, illustrated by te outward moving cobweb in tis diagram. Newton Rapson-Metod To generate a sequence of values converging to a root of f() = 0, near to = 0, use te following iterative f( r ) formulae: = r + r. Tis metod as second order f( r ) convergence. Below te Newton Rapson metod is being used to approimate a solution of + - = 0. So we ave r + r r+ = r + in tis case. Using a starting value of r = gives = 0 = = = = 0.6 = Ten = , 4 = , 5 = , 5 = Notice ow quickly te sequence converges. You can get your calculator to perform tese calculations very quickly using te ANS feature. Tis also applies to Fied Point Iteration so make sure you know ow to do tis. Secant Metod If = 0 and = are approimations to a root of f() = 0, a better approimation to te root will usually be given by 0f( ) f( 0) =. Tis can be f( ) f( 0) repeated wit and replacing 0 and to obtain a value and so on.. Tese calculations can take quite a wile on a pocket calculator! Te main difference between te secant metod and te metod of false position are tat in te secant metod 0 and need not straddle te solution wereas in te metod of false position te first two values, a and b, sould straddle te root. Wen 0 and do straddle te root te point generated, is eactly te same as c in te metod of false position.

We Need Your Support

Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks