SJUT/MAT210/Interpolation/Splines 2013-14S2

  • 101 views
Uploaded on

Lecture slides based on Autar Kaw's Numerical Methods text, Chapter 5.05, found at http://nm.mathforcollege.com

Lecture slides based on Autar Kaw's Numerical Methods text, Chapter 5.05, found at http://nm.mathforcollege.com

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
101
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
2
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. St. John's University of Tanzania MAT210 NUMERICAL ANALYSIS 2013/14 Semester II INTERPOLATION Splines Kaw, Chapter 5.05
  • 2. MAT210 2013/14 Sem II 2 of 20 ● Direct, Newton Divided Difference & Lagrangian Interpolation ● Two approaches for finding the same nth order polynomial fit for all points in an data set ● Is splines just another way to do the same ● NO! ● It is Piecewise polynomial interpolation ● Each piece can be linear, quadratic or cubic Introduction
  • 3. MAT210 2013/14 Sem II 3 of 20 How do we avoid this?
  • 4. MAT210 2013/14 Sem II 4 of 20 By observing ● This function has distinct regions ● The interval from x ≈ -1 to -0.5 ● The interval from x ≈ -0.5 to -0.1 ● The interval from x ≈ -0.1 to +0.1 ● The interval from x ≈ 0.1 to 0.5 ● The interval from x ≈ 0.5 to 1 Though there is some symmetry... ● It would be better to fit different functions to different intervals
  • 5. MAT210 2013/14 Sem II 5 of 20 Piecewise Polynomials Rather than interpolating n+1 points with a single polynomial of degree n, put different polynomials on each interval S(x)= { s0 (x) , x∈[x0 ,x1) s1 (x) , x∈[x1, x2) ⋮ sn−1 (x) , x∈[xn−1 , xn]}where the sj are polynomials of (usually) small degree
  • 6. MAT210 2013/14 Sem II 6 of 20 Interpretation ● Piecewise linear = connect the dots ● Piecewise quadratic = parabolas between the dots ● But wait ● Two points uniquely define a line – linear is understandable ● Three points are needed for a parabola – How is the other degree of freedom set?
  • 7. MAT210 2013/14 Sem II 7 of 20 Splines ● In the connect the dots linear case, the curve is not “smooth” ● Add “smoothness” into the requirement ● Draftsmen achieved this smoothness with splines - a flexible strip of metal or wood
  • 8. MAT210 2013/14 Sem II 8 of 20 Splines ● In the connect the dots linear case, the curve is not “smooth” ● Add “smoothness” into the requirement ● Draftsmen achieved this smoothness with splines - a flexible strip of metal or wood ● Mathematicians achieve it by matching derivatives at the end points of the intervals
  • 9. MAT210 2013/14 Sem II 9 of 20 Linear Splines
  • 10. MAT210 2013/14 Sem II 10 of 20 Linear Splines Slope between points
  • 11. MAT210 2013/14 Sem II 11 of 20 v(16) … Again The linear case is unchanged No surprise there
  • 12. MAT210 2013/14 Sem II 12 of 20 Quadratic Splines ● Now things get interesting ● How to find all the coefficients? ● 3n coefficients, n equations, n continuity at end points, whence the other n?
  • 13. MAT210 2013/14 Sem II 13 of 20 2n from continuity Each curve must pass through both endpoints
  • 14. MAT210 2013/14 Sem II 14 of 20 n-1 from smoothness a1 x 2 +b1 x+c1 ⇒2a1 x+b1 a2 x2 +b2 x+c2 ⇒2a2 x+b2 Must match at n-1 interior points 2 a1 xi +b1 =2a2 xi +b2 ∀ i ∈ [1 ,n−1]
  • 15. MAT210 2013/14 Sem II 15 of 20 One more assumption ● This is 3n unknowns and 3n -1 equations ● Need to set one more condition ● Generally set the first spline to be linear ● a1 = 0 ● Now use any technique to solve simultaneous linear equations
  • 16. MAT210 2013/14 Sem II 16 of 20 Revisiting the Rocket
  • 17. MAT210 2013/14 Sem II 17 of 20 The continuous derivatives The draftsman is bending his spline!
  • 18. MAT210 2013/14 Sem II 18 of 20 The Final Matrix
  • 19. MAT210 2013/14 Sem II 19 of 20 The Solution
  • 20. MAT210 2013/14 Sem II 20 of 20 Going Deeper ● The overall curve is smooth and the accuracy can be quite good ● Cubic is better, more common – See that next time ● What about finding the distance traveled? ● From 11 to 14s? ● From 11 to 16s? ● From 0 to 30s?