Quadratic Interpolation Given (x),(),and (x2,),fit a quadratic interpolant through the data. f(x)=bo+b(x-x0)+b2(x-x0)(x-x) bo f(xo) 化以 6=f)-f) 在2y2 X1-X0 "在o%】 f(x2)-f(x)f(x)-f(xo) b2=- X2-X1 X1-x0 X2-x0 华南师范大学数学科学学院谢删玲
Quadratic Interpolation Given ( , ), 0 0 x y ( , ), 1 1 x y and ( , ), 2 2 x y fit a quadratic interpolant through the data. ( ) ( ) ( )( ) 2 0 1 0 2 0 1 f x = b + b x − x + b x − x x − x ( ) 0 0 b = f x 1 0 1 0 1 ( ) ( ) x x f x f x b − − = 2 0 1 0 1 0 2 1 2 1 2 ( ) ( ) ( ) ( ) x x x x f x f x x x f x f x b − − − − − − = 华南师范大学数学科学学院 谢骊玲
Example The path of a rapid laser is given by these specifications. If the laser is traversing from x=2 to x=4.25 to x=5.25 using a quadratic path,find the value of y at x=4 using the Newton's Divided difference polynomial method. x (m) y(m) Path of a robot 2 7.2 8 7 4.25 7.1 5 5.25 6 3 7.81 5 9.2 3.5 0 15 10.6 5 华南师范大学数学科学学院谢细玲
Example ◼ The path of a rapid laser is given by these specifications. ◼ If the laser is traversing from x = 2 to x = 4.25 to x=5.25 using a quadratic path, find the value of y at x = 4 using the Newton’s Divided difference polynomial method. Path of a robot 0 1 2 3 4 5 6 7 8 0 5 10 15 X Y x (m) y (m) 2 7.2 4.25 7.1 5.25 6 7.81 5 9.2 3.5 10.6 5 华南师范大学数学科学学院 谢骊玲
Quadratic Interpolation(cont. 7.56258 (x)=b+b,(x-x)+b2(x-x。x-x) x0=2.00,y(x)=7.2 x1=4.25,(x)=7.1 x2=5.25,x2)=6.0 b。=y(xo) =7.2 6=)-)=7.1-72 X1-X0 4.25-2.00 5.25 =-0.04444 y(x2)-y(x)_(x)-y(xo) 6.0-7.17.1-7.2 X2-X X1-x0 -525-425425-2.00 X2-X0 5.25-2.00 =-1.1+0.04444 3.25 =-0.32479 华南师范大学数学科学学院谢删玲
Quadratic Interpolation (cont.) 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 7.56258 6 y s f(range) f(x desired) 2 x 5.25 s range x desired ( ) ( ) ( )( ) 0 1 0 2 0 1 y x = b + b x − x + b x − x x − x 2.00, x0 = y(x0 ) = 7.2 4.25, x1 = y(x1 ) = 7.1 5.25, x2 = y(x2 ) = 6.0 华南师范大学数学科学学院 谢骊玲 ( ) 0 0 b = y x = 7.2 1 0 1 0 1 ( ) ( ) x x y x y x b − − = 4.25 2.00 7.1 7.2 − − = = −0.04444 2 0 1 0 1 0 2 1 2 1 2 ( ) ( ) ( ) ( ) x x x x y x y x x x y x y x b − − − − − − = 5.25 2.00 4.25 2.00 7.1 7.2 5.25 4.25 6.0 7.1 − − − − − − = 3.25 −1.1+ 0.04444 = = −0.32479
y(x)=bo+b(x-xo)+b2(x-xoXx-x1) =7.2-0.04444(x-2.00)-0.32479(x-2.00(x-4.25) 2.00≤x≤5.25 At x=4, y4.00)=7.2-0.04444(4.00-2.00)-0.324794.00-2.00)4.00-4.25) =7.2735(in), The absolute relative approximate error obtained between the 7.56258 results from the first and second order polynomial is 7.2735-7.1111 7.2735 =2.2327% XX 3.5 ng,xd山 华南师范大学数学科学学院谢珊玲
( ) ( ) ( )( ) 0 1 0 2 0 1 y x = b + b x − x + b x − x x − x = 7.2 − 0.04444(x − 2.00) − 0.32479(x − 2.00)(x − 4.25), 2.00 x 5.25 At x = 4, y(4.00) = 7.2 − 0.04444(4.00 − 2.00) − 0.32479(4.00 − 2.00)(4.00 − 4.25) = 7.2735 (in). The absolute relative approximate error a obtained between the results from the first and second order polynomial is 100 7.2735 7.2735 7.1111 − a = = 2.2327% 华南师范大学数学科学学院 谢骊玲 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 7.56258 6 y s f(range) f(x desired) 2 x 5.25 s range x desired
3.3 Lagrange Approximation A polynomial Px)of degree at most N that passes through the N+1 points (xoo),()...,(N,yN)on [a,b]and has the form B,()=∑LvAx) k-0 where Lx)is the Lagrange coefficient polynomial based on these nodes: L4()=任-小-x-g-x) ΠIx-x) ≠k (-xo)...(1)+)Xx) Πc-x) 华南师范大学数学科学学院谢删玲
3.3 Lagrange Approximation ◼ A polynomial PN (x) of degree at most N that passes through the N+1 points (x0 ,y0 ), (x1 ,y1 ),…,(xN , yN ) on [a, b] and has the form where LN,k(x) is the Lagrange coefficient polynomial based on these nodes: 华南师范大学数学科学学院 谢骊玲 , 0 ( ) ( ) N N k N k k P x y L x = = 0 0 1 1 , 0 1 1 0 ( ) ( ) ( )( ) ( ) ( ) . ( ) ( )( ) ( ) ( ) N j j k k N j k N k N k k k k k k N j k j j k x x x x x x x x x x L x x x x x x x x x x x = − + − + = − − − − − = = − − − − −