KMU255Programming_6thClass_PolynInterpolation

# KMU255Programming_6thClass_PolynInterpolation - Polynomials...

This preview shows pages 1–12. Sign up to view the full content.

Polynomials and Interpolation Selis Önel, PhD

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
SelisÖnel© 2 Effort quotes Success is a ladder you cannot climb with your hands in your pockets. ~American Proverb Be not afraid of going slowly; be afraid only of standing still. ~Chinese Proverb When I was young, I observed that nine out of ten things I did were failures. So I did ten times more work. ~George Bernard Shaw, Irish playwright, 1856-1950 Opportunity is missed by most people because it is dressed in overalls and looks like work. ~Thomas Edison, American inventor and businessman, 1847-1931 All the so-called "secrets of success" will not work unless you do. ~Author Unknown
SelisÖnel© 3 When do we need data/function interpolation? Need to obtain estimates of function values at other points Need to use the closed form representation of the function as the basis for other numerical techniques

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
SelisÖnel© 4 Goals Fit a polynomial to values of a function at discrete points to estimate the functional values between the data points Derive numerical integration schemes by integrating interpolation polynomials – Power series – Lagrange interpolation forms Differentiation and integration of interpolation polynomials Interpolation polynomials using nonequispaced points Chebyshev nodes ( roots of the Chebyshev polynomial of the 1st kind )
SelisÖnel© 5 Polynomials Power series form: y=c 1 x n +c 2 x n-1 +…+c n x+c n+1 n : order of polynomial c i : coefficients Cluster form: y=((…((c 1 x+c 2 )x+c 3 )x…+c n )x+c n+1 ) Factorized form: y=c 1 (x-r 1 )(x-r 2 )…(x-r n ) r i = roots of polynomial

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
SelisÖnel© 6 Ex: Polynomials Power series form: y=x 4 +2x 3 -7x 2 -8x+12 Cluster form: y=((((x+2)x-7)x-8)x+12) Factorized form: y= (x-1)(x-2)(x+2)(x+3)
SelisÖnel© 7 Polynomials A polynomial of order n has n roots: – Multiple roots – Complex roots – Real roots If all c i are real, all the complex roots are found in complex conjugate pairs

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
SelisÖnel© 8 Polynomials in MATLAB® % y=4x 4 +2x 3 -7x 2 +x+7=0 % p = [4 2 -7 1 7] % roots : Finds the roots of a polynomial >> p = [4 2 -7 1 7] p = 4 2 -7 1 7 >> x=roots(p) x = 0.93158276438947 + 0.60071610876714i 0.93158276438947 - 0.60071610876714i -1.18158276438947 + 0.16770340687492i -1.18158276438947 - 0.16770340687492i
SelisÖnel© 9 Polynomials in MATLAB® % y=4x 4 +2x 3 -7x 2 +x+7 % poly : Determines the coefficients of the original polynomial knowing the roots. % The polynomial is normalized to make the leading coefficient 1 >> r=[ 0.93158276438947 + 0.60071610876714i 0.93158276438947 - 0.60071610876714i -1.18158276438947 + 0.16770340687492i -1.18158276438947 - 0.16770340687492i]; >> p=poly(r); p’ ans = 1.00000000000000 0.50000000000000 -1.75000000000000 0.25000000000000 1.74999999999999 4 2 -7 1 7 (4)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
SelisÖnel© 10 Accuracy of Conversions Conversions may not be accurate due to rounding errors in computations Coefficients → Roots Roots → Coefficients Multiple roots: Less accurate conversion “Computing a highly multiple root is one of the most difficult problems for numerical methods” 1 Ex: y=(x-5) 5 (This equation can be expanded symbolically using simple(y) or >> expand (y) y =x^5-25*x^4+250*x^3-1250*x^2+3125*x-3125 >> p= sym2poly (y) p = 1 -25 250 -1250 3125 -3125 >> roots(p) ans = 5.00482653710827 + 0.00350935026218i 5.00482653710827 - 0.00350935026218i 4.99815389493583 + 0.00567044756022i 4.99815389493583 - 0.00567044756022i 4.99403913591176
SelisÖnel© 11 Accuracy of Conversions Use the round and real functions to get integer results in taking the roots of polynomials: >>round(real(5.0048+0.0035i)) ans = 5 >> p = [1 -25 250 -1250 3125 -3125] >> r=round(real(roots(p))); r' ans = 5 5 5 5 5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 71

KMU255Programming_6thClass_PolynInterpolation - Polynomials...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online