#5 - Taylor Series: Expansions, Approximations And Error

2y ago
30 Views
2 Downloads
218.13 KB
17 Pages
Last View : 7d ago
Last Download : 3m ago
Upload by : Milo Davies
Transcription

#5Taylor Series: Expansions, Approximations and ErrorL. OlsonSeptember 15, 2015Department of Computer ScienceUniversity of Illinois at Urbana-Champaign1

motivation All we can ever do is add and multiply with our Floating Point Unit(FPU) We can’t directly evaluate e x , cos(x), x What can we do? Use Taylor Series approximation2

taylor series definitionThe Taylor series expansion of f (x) at the point x c is given byf (x) f (c) f 0 (c)(x c) (k )Xf (c)k 0k!f 00 (c)f (n) (c)(x c)2 · · · (x c)n . . .2!n!(x c)k3

an exampleThe Taylor series expansion of f (x) about the point x c is given byf (x) f (c) f 0 (c)(x c) (k )Xf (c)k 0k!f (n) (c)f 00 (c)(x c)2 · · · (x c)n . . .2!n!(x c)kExample (e x )We know e 0 1, so expand about c 0 to getf (x) e x 1 1 · (x 0) 1 x 1· (x 0)2 . . .2x2 x3 .2!3!4

taylor approximation So22 23 .2!3! But we can’t evaluate an infinite series, so we truncate.e2 1 2 Taylor Series Polynomial ApproximationThe Taylor Polynomial of degree n for the function f (x) about the pointc isnXf (k ) (c)pn (x) (x c)kk!k 0Example (e x )In the case of the exponentiale x pn (x) 1 x x2xn ··· 2!n!5

taylor approximationEvaluate e 2 : Using 0th order Taylor series: e x 1 does not give a good fit. Using 1st order Taylor series: e x 1 x gives a better fit. Using 2nd order Taylor series: e x 1 x x 2 /2 gives a a reallygood fit.123456import numpy as npx 2.0pn 0.0for k in range (15):pn (x**k) / math. factorial (k)err np.exp (2.0) - pn6

taylor approximation is localApproximate e x using c 1:7

taylor approximation is localApproximate e x using c 0:8

taylor approximation is localApproximate e x using c 1:9

taylor approximation recapInfinite Taylor Series Expansion (exact)f (x) f (c) f 0 (c)(x c) f 00 (c)f (n) (c)(x c)2 · · · (x c)n . . .2!n!Finite Taylor Series Expansion (exact)f (x) f (c) f 0 (c)(x c) f 00 (c)f (n) (ξ)(x c)2 · · · (x c)n2!n!but we don’t know ξ.Finite Taylor Series Approximationf (x) f (c) f 0 (c)(x c) f 00 (c)f (n) (x)(x c)2 · · · (x c)n2!n!10

taylor approximation error How accurate is the Taylor series polynomial approximation? The n terms of the approximation are simply the first n terms ofthe exact expansion:ex x21 x {z 2!}p2 approximation to e x x3 . 3! {z }(1)truncation error So the function f (x) can be written as the Taylor Seriesapproximation plus an error (truncation) term:f (x) fn (x) En (x)whereEn (x) f (n 1) (ξ)(x c)n 1(n 1)!11

big-o (omicron)Recall Big-O ”O” notationLet g(n) be a function of n. Then defineO(g(n)) {f (n) c, n0 0 : 0 6 f (n) 6 cg(n), n n0 }That is, f (n) O(g(n)) if there is a constant c such that0 6 f (n) 6 cg(n) is satisfied.12

truncation errorUsing the Big ”O” notation,f (n 1) (ξ)(x c)n 1(n 1)! (x c)n 1 O(n 1)!En (x) since we assume the (n 1)th derivative is bounded on the interval[a, b].Often, we let h x c and we havef (x) pn (x) O(h n 1 )13

truncation errorThe Taylor series expansion of sin (x) issin (x) x x3 x5 x7 x9 .3!5!7!9!If x 1, then the remaining terms are small.If we neglect these termsx3 x5x7 x9sin (x) x .3! {z 5!} 7! {z9!}approximation to sintruncation error14

another example: f (x) Evaluation of f (x) 11 x11 xusing Taylor Series Expansion:f (x) f (c) f 0 (c)(x c) f 00 (c)f (n) (ξ)(x c)2 · · · (x c)n2!n! Thus with c 01 1 x x2 x3 . . .1 x Second order approximation:1 1 x x21 x15

taylor errors How many terms do I need to make sure my error is less than2 10 8 for x 1/2? X12n 1 x x ··· x xk1 xk n 1 so the error at x 1/2 isex 1/2 kX1(1/2)n 1 21 1/2k n 1 2 · (1/2)n 1 2 10 8 then we needn 1 8 26.6log10 (1/2)orn 2616

some remarks can approximate infinite series; in particular analytic functions(those that have a power series representation). a local approximation (i.e. convergence can be slow far awayfrom evaluation point c). Maclaurin is the special case when c 0. useful for numerical approximation, differentiation, andintegration17

taylor approximation Evaluate e2: Using 0th order Taylor series: ex ˇ1 does not give a good fit. Using 1st order Taylor series: ex ˇ1 x gives a better fit. Using 2nd order Taylor series: ex ˇ1 x x2 2 gives a a really good fit. 1 importnumpy as np 2 x 2.0 3 pn 0.0 4 forkinrange(15): 5 pn (x**k) / math.factorial(k) 6 err np.exp .

Related Documents:

Taylor series As the degree of the Taylor polynomial rises, it approaches the correct function. This image shows and Taylor approximations, polynomials of degree 1, 3, 5, 7, 9, 11 and 13. The exponential function (in blue), and the sum of the first n 1 terms of its Taylor series at 0 (in red).

taylor, james & dixie chicks wide open spaces [live tv version] taylor, james & simon, carly mockingbird taylor, james & souther, j.d. her town too taylor, johnnie disco lady taylor, johnnie who's makin' love taylor, koko wang dang doodle taylor, r. dean indiana wants me tea, ming &

We begin with the Taylor series approximation of functions which serves as a starting point for these methods. 3.1 Taylor series approximation We begin by recalling the Taylor series for univariate real-valued functions from Calculus 101: if f : R !R is infinitely differentiable at x2R then the Taylor series

Nonlinear continuous/discrete state space model State and parameter estimation Filter approximations based on Taylor expansions Filter Approximations based on Numerical Integration Discussion Application: the Lorenz model Implementation References Nonlinear continuous/discrete state space model dYn(t) f(Yn(t),xn(t),ψ)dt g(Yn(t),xn(t),ψ)dWn .

Geometrie Series 765 Definite Integrals 765 Matrices 766 Partial-Fraction Expansions 737 738 763 767 B.l Partial-Fraction Expansions of Continuous-Time Representations 767 B.2 Partial-Fraction Expansions of Discrete-Time Representation 770 APPEN

Taylor’s Theorem In informal terms, Taylor’s Theorem posits that a function with ! 1 derivatives (the first ! derivatives being continuous on some interval) can be written as an infinite series – this infinite series being the Taylor Series. A more formal definition of Taylor

Pick's disease TAU Point mutations, deletions Amyotrophic lateral sclerosis sod1 Point mutations Huntington's disease hd Polyglutamine expansions Spinocerebellar ataxia Type 1 SCA1 Polyglutamine expansions Type 2 SCA2 Polyglutamine expansions Machado-Joseph disease SCA3 Polyglutamine ex

Description Logic Knowledge Base Exchange Elena Botoeva supervisor: Diego Calvanese PhD Final Examination April 10, 2014 Bolzano Elena Botoeva(FUB)Description Logic Knowledge Base Exchange1/33. Outline 1 Introduction 2 Summary of Work 3 Results 4 Technical Development Universal Solutions Universal UCQ-solutions UCQ-representations Elena Botoeva(FUB)Description Logic Knowledge Base Exchange2/33 .