1 / 80

Interpolation: Concept and Application in Numerical Analysis

Interpolation is a method used in numerical analysis to estimate values between known points. It is useful for creating functions that approximate experimental or measurement data. This article explores the concept of interpolation and its application in various fields.

rstradley
Download Presentation

Interpolation: Concept and Application in Numerical Analysis

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Παρεμβολή (Interpolation) ΑΡΙΘΜΗΤΙΚΗ ΑΝΑΛΥΣΗ

  2. Η έννοια της παρεμβολής • Στην πράξη, πολλές φορές έχουμε ένα πίνακα τιμών (π.χ. πειραματικά αποτελέσματα ή αποτελέσματα μετρήσεων), στη συνέχεια ένα γράφημα του πίνακα τιμών, που έχουμε δημιουργήσει με πολύ κόπο και τελικά έναν τύπο μιας συνάρτησης , που ΠΙΘΑΝΟΝ να περιγράφει το φαινόμενο που έδωσε τα πειραματικά αποτελέσματα ή τα αποτελέσματα των μετρήσεων. • Η εύρεση μιας τέτοιας συνάρτησης είναι εξαιρετικά χρήσιμη αφού θα μας επιτρέπει να προσδιορίζουμε (εύκολα ή δύσκολα) – ΝΑ ΠΑΡΕΜΒΑΛΛΟΥΜΕ – και άλλα σημεία, ανάμεσα ή και πέρα από τα ήδη υπάρχοντα. Η διαδικασία εύρεσης μιας τέτοιας συνάρτησης λέγεται παρεμβολή. • Το πρόβλημα της δημιουργίας ενός μαθηματικού τύπου από έναν πίνακα τιμών, έχει άπειρες λύσεις, δηλ. υπάρχουν άπειροι τύποι συναρτήσεων που μπορούν να παράγουν τον πίνακα τιμών. Επομένως η επιλογή του κατάλληλου μαθηματικού τύπου (της συνάρτησης) απαιτεί ιδιαίτερη προσοχή. • Η καταλληλότερη προσέγγιση αυτών των συναρτήσεων είναι μέσω πολυωνύμων, επειδή έχουν πολύ καλές ιδιότητες στην παραγώγιση και ολοκλήρωση.

  3. Ένα από τα βασικότερα θέματα της αριθμητικής ανάλυσης είναι και το πρόβλημα της προσέγγισης μιας συνάρτησης f(x)από μία άλλη, περισσότερο «εύχρηστη» συνάρτηση g(x), η οποία θα είναι αρκετά κοντά, κατά κάποια έννοια, στην f(x)σε ένα κλειστό διάστημα [a,b]. • Στην περίπτωση αυτή ενδιαφερόμαστε για την εύρεση όσο το δυνατόν μικρότερων φραγμάτων ε της μεγαλύτερης δυνατής απόκλισης της f(x)από την g(x), που την προσεγγίζει στο διάστημα [a,b], δηλαδή: • Τόσο η αριθμητική ολοκλήρωση, όσο και η αριθμητική παρεμβολή, αποτελούν ειδικές περιπτώσεις αυτού του βασικού προβλήματος.

  4. Η πλέον συνηθισμένη κλάση συναρτήσεων g(x)που χρησιμοποιούνται ως συναρτήσεις παρεμβολής είναι τα πολυώνυμα, τα οποία είναι συνεχείς συναρτήσεις που ολοκληρώνονται και παραγωγίζονται εύκολα. • Στην πολυωνυμική παρεμβολή βασίζεται η επίλυση πολλών προβλημάτων αριθμητικής παραγώγισης, αριθμητικής ολοκλήρωσης και αριθμητικής επίλυσης διαφορικών εξισώσεων.

  5. Interpolation • Interpolation is important concept in numerical analysis. Quite often functions may not be available explicitly but only the values of the function at a set of points. • The method of estimating between two known points (values) is called interpolation. • While estimating outside of known values is called extrapolation. • The values for f(xi) may be the results from a physical measurement (conductivity at different points around a central point) • It may also be from some long numerical calculation which can’t be put into a simple equation.

  6. Interpolation • Interpolation produces a function that matches the given data exactly. The function then can be utilized to approximate the data values at intermediate points. • Interpolation may also be used to produce a smooth graph of a function for which values are known only at discrete points, either from measurements or calculations.

  7. Given data points  Obtain a function, P(x) P(x) goes through the data points  Use P(x), to estimate values at intermediate points

  8. Application of interpolation • A spring is an elastic object used to store mechanical energy. In case of mechanical spring there is a spring load and deflection graph. The deflection is in millimeters and the load is measured in newton. The deflection is plotted on the x-axis and the corresponding load in newton on y-axis. Often we have to find the values between the two sets of values (load vs. deflection). Hence interpolation is the technique used to find the unknown values. Thegraphisusuallyplottedinexcel.

  9. The figure above shows the spring deflection at values of 7.5 and 14.33mm and the corresponding load. One is the graph for minimum load values shown in blue (157.31 and 79.05). The other graph shown in red is for the maximum force values (178.69 and 90.95). Now we want to find the load values at deflection of 10mm using the following interpolation formula:

  10. Interpolationformula In the graph you have got the values of x1, x3, y1 and y3. Now you want to interpolate the value of y2 at any given value of x2 so you can use the simple interpolation formula given below

  11. Interpolation • Interpolation is carried out using approximating functions such as: • Polynomials • Trigonometric functions • Exponential functions • Fourier methods

  12. What is a good approximation? Clearly a good approximation should be, such that the error between the true function and the approximation function should be very small. • Other than this approximating functions should have the following properties: • The function should be easy to determine • It should be easy to differentiate • It should be easy to evaluate • It should be easy to integrate • There are numerous theorems on the sorts of functions, which can be well approximated by which interpolating functions. • Generally these functions are of little use. • The following theorem is useful practically and theoretically for polynomial interpolation.

  13. Weierstrass Approximation Theorem • If f(x) is a continuous real-valued function on [a, b] then for any  > 0 , then there exists a polynomial Pn on [a, b] such that |ƒ(x) – Pn(x)| <  for all x [a, b]. • This tells us that, any continuous function on a closed and bounded interval can be uniformly approximated on that interval by polynomial to any degree of accuracy. • However there is no guarantee that we will know f(x)to an accuracy for the theorem to hold. • Consequently, any continuous function can be approximated to any accuracy by a polynomial of high enough degree.

  14. Polynomial Approximation • Polynomials satisfy a uniqueness theorem: A polynomial of degree n passing exactly through n + 1 points is unique. • The polynomial through a specific set of points may take different forms, but all forms are equivalent. Any form can be manipulated into another form by simple algebraic rearrangement.

  15. Polynomial Approximation • The Taylor series is a polynomial of infinite order. Thus ƒ(x) = ƒ(x0) + ƒ'(x0)(x - x0) + 1/2! ƒ''(x0) (x - x0)2+.. • However it is impossible computationally to evaluate an infinite number of terms.

  16. Polynomial Approximation • Taylor polynomial of degree n is therefore usually defined as ƒ(x) = Pn(x) + Rn + 1(x) where the Taylor polynomial Pn(x) and the remainder term Rn + 1(x) are given by Pn(x) = ƒ(x0) + ƒ'(x0)(x - x0) + … + 1/n! ƒn(x0) (x - x0)n Rn + 1(x) = 1/(n+1)! ƒn+1( ξ ) (x - x0)n+1 where x0≤ξ<x.

  17. Polynomial Approximation • The Taylor polynomial is a truncated Taylor series, with an explicit remainder, or error term. • The Taylor polynomial cannot be used as an approximating function for discrete data, because the derivatives required in the coefficients cannot be determined. • It does have great significance, however, for polynomial approximation because it has an explicit error term.

  18. Polynomial Approximation • When a polynomial of degree n, Pn(x), is fitted exactly to a set of n + 1 discrete data points, (x0, f0), (x1, f1), …, (xn, fn), the polynomial has no error at the data points themselves. However, at the locations between the data points, there is an error, which is defined by E(x) = ƒ(x) - Pn(x) • This error term has the form E(x) = 1/(n+1)! (x - x0) (x – x1) … (x – xn) ƒn+1( ξ ) x0≤ξ≤x.

  19. Interpolating Polynomials

  20. Interpolating Polynomials True function Approx 1 Approx 2 • Suppose we are given some values, the principle is that we fit a polynomial curve to the data. • The reason for this is that polynomials are well-behaved functions, requiring simple arithmetic calculations. • Approximating polynomial (interpolating polynomial) should pass through all the known points. • Where it does not pass through the points it should be close to the function.

  21. Interpolating Polynomials We will be looking at two interpolating methods: • Lagrange Interpolation • Divided Difference

  22. Lagrange Interpolation

  23. Lagrange Polynomials • A straightforward approach is the use of Lagrange polynomials. • The Lagrange Polynomial may be used where the data set is unevenly spaced. • The Lagrangian polynomial passes through each of the points used in its construction.

  24. ΠαρεμβολήLagrange ΒΙΒΛΙΟΓΡΑΦΙΑ: ΠΑΝΕΠΙΣΤΗΜΙΟ ΙΩΑΝΝΙΝΩΝ, ΕΠΙΣΤΗΜΟΝΙΚΟΙ ΥΠΟΛΟΓΙΣΜΟΙ, Μιχάλης Τζούμας

  25. Το πολυώνυμο του Lagrange

  26. Η ορίζουσα αυτή είναι διαφορετική από το μηδέν, επομένως το σύστημα (2.2) έχει μοναδική λύση και το πολυώνυμο Pn(x)είναι μοναδικό.

  27. Lagrange Polynomials • The formula used to interpolate between data pairs (x0,f(x0)), (x1,f(x1)),…, (xn,f(xn)) is given by, • Where the polynomial Pj(x) is given by,

  28. Lagrange Polynomials • In general,

  29. Lagrange Polynomials • Consider the table of interpolating points we wish to fit.

  30. Lagrange Polynomials • The interpolation polynomial is,

  31. Advantages / Disadvantages • The Lagrange formula is popular because it is well known and is easy to code. • Also, the data are not required to be specified with x in ascending or descending order. • Although the computation of Pn(x) is simple, the method is still not particularly efficient for large values of n. • When n is large and the data for x is ordered, some improvement in efficiency can be obtained by considering only the data pairs in the vicinity of the x value for which Pn(x) is sought. • The price of this improved efficiency is the possibility of a poorer approximation to Pn(x).

  32. Diagram showing Interpolation (incrementally from one to 5 points)

  33. Μέθοδος Διηρημένων Διαφορών Newton

  34. Μέθοδος Διηρημένων Διαφορών Newton • Υπάρχουν περιπτώσεις κατά τις οποίες είναι δυνατόν να προστίθενται νέα σημεία στα ήδη υπάρχοντα που έχουν προσεγγιστεί με κάποια αριθμητική μέθοδο. • Στην περίπτωση της παρεμβολής Lagrange (πολυωνυμική παρεμβολή) η συνάρτηση (πολυώνυμο παρεμβολής) που προκύπτει δεν μπορεί να χρησιμοποιηθεί για κάθε νέα τιμή που προστίθεται και πρέπει να υπολογιστεί εκ νέου (επιπτώσεις : δαπάνη υπολογιστικού χρόνου και αύξηση του κόστους υπολογισμών). • Η μέθοδος διηρημένων διαφορών Newton επιλύει αυτό το πρόβλημα χρησιμοποιώντας μία ήδη υπολογισμένη συνάρτηση παρεμβολής και διορθώνοντάς την, λαμβάνοντας υπόψη κάθε νέο σημείο που μπορεί να προστεθεί.

  35. Στην περίπτωση της μεθόδου Newton το πολυώνυμο παρεμβολής έχει τη μορφή: • Αν λάβουμε τα aiέτσι ώστεPn(x) = ƒ(x)σεn+1γνωστά σημεία, δηλαδή : Pn(xi) = ƒ(xi), i= 0,1,…,n, τότε τοPn(x) είναι ένα πολυώνυμο παρεμβολής.

  36. Newton’s Divided differences • A divided difference is defined as the difference in the function values at two points, divided by the difference in the values of the corresponding independent variable. • Thus, the first divided difference at point is defined as The second difference is given as: In general,

  37. The divided difference of a function, is denoted as with respect to It is called as zeroth divided difference and is simply the value of the function, at Divided differences and the coefficients

  38. The divided difference of a function, with respect to and called as the first divided difference, is denoted

  39. The divided difference of a function, , and with respect to called as the second divided difference, is denoted as

  40. The third divided difference with respect to , , and

  41. The coefficients of Newton’s interpolating polynomial are: and so on.

  42. Example Find Newton’s interpolating polynomial to approximate a function whose 5 data points are given below.

More Related