Mata Kuliah : Metode Numerik�Minggu ke 11
Mahasiswa dapat melakukan komputasi untuk menentukan koefisien fungsi polynomial dengan Lagrange Interpolating
Tujuan perkuliahan
Lagrange’s Method
Example
The upward velocity of a rocket is given as a function of time in Table 1. Find the velocity at t=16 seconds using the Lagrangian method for linear interpolation.
Table Velocity as a
function of time
Figure. Velocity vs. time data
for the rocket example
(s) | (m/s) |
0 | 0 |
10 | 227.04 |
15 | 362.78 |
20 | 517.35 |
22.5 | 602.97 |
30 | 901.67 |
Linear Interpolation
Linear Interpolation (contd)
Quadratic Interpolation
http://numericalmethods.eng.usf.edu
Example
http://numericalmethods.eng.usf.edu
The upward velocity of a rocket is given as a function of time in Table 1. Find the velocity at t=16 seconds using the Lagrangian method for quadratic interpolation.
Table Velocity as a
function of time
Figure. Velocity vs. time data
for the rocket example
(s) | (m/s) |
0 | 0 |
10 | 227.04 |
15 | 362.78 |
20 | 517.35 |
22.5 | 602.97 |
30 | 901.67 |
Quadratic Interpolation (contd)
Quadratic Interpolation (contd)
The absolute relative approximate error obtained between the results from the first and second order polynomial is
Cubic Interpolation
Example
http://numericalmethods.eng.usf.edu
The upward velocity of a rocket is given as a function of time in Table 1. Find the velocity at t=16 seconds using the Lagrangian method for cubic interpolation.
Table Velocity as a
function of time
Figure. Velocity vs. time data
for the rocket example
(s) | (m/s) |
0 | 0 |
10 | 227.04 |
15 | 362.78 |
20 | 517.35 |
22.5 | 602.97 |
30 | 901.67 |
Cubic Interpolation (contd)
Cubic Interpolation (contd)
The absolute relative approximate error obtained between the results from the first and second order polynomial is
Comparison Table
Order of Polynomial | 1 | 2 | 3 |
v(t=16) m/s | 393.69 | 392.19 | 392.06 |
Absolute Relative Approximate Error | -------- | 0.38410% | 0.033269% |
Why Splines ?
Why Splines ?
Figure : Higher order polynomial interpolation is a bad idea
Linear Interpolation
http://numericalmethods.eng.usf.edu
Linear Interpolation (contd)
Example
The upward velocity of a rocket is given as a function of time in Table 1. Find the velocity at t=16 seconds using linear splines.
Table Velocity as a
function of time
Figure. Velocity vs. time data
for the rocket example
(s) | (m/s) |
0 | 0 |
10 | 227.04 |
15 | 362.78 |
20 | 517.35 |
22.5 | 602.97 |
30 | 901.67 |
Linear Interpolation
Quadratic Interpolation
Quadratic Interpolation (contd)
Quadratic Splines (contd)
Quadratic Splines (contd)
Quadratic Splines (contd)
Quadratic Spline Example
The upward velocity of a rocket is given as a function of time. Using quadratic splines
Table Velocity as a
function of time
Figure. Velocity vs. time data
for the rocket example
(s) | (m/s) |
0 | 0 |
10 | 227.04 |
15 | 362.78 |
20 | 517.35 |
22.5 | 602.97 |
30 | 901.67 |
Solution
Let us set up the equations
Each Spline Goes Through Two Consecutive Data Points
t | v(t) |
s | m/s |
0 | 0 |
10 | 227.04 |
15 | 362.78 |
20 | 517.35 |
22.5 | 602.97 |
30 | 901.67 |
Each Spline Goes Through Two Consecutive Data Points
Derivatives are Continuous at Interior Data Points
Derivatives are continuous at Interior Data Points
At t=10
At t=15
At t=20
At t=22.5
Last Equation
Final Set of Equations
Coefficients of Spline
i | ai | bi | ci |
1 | 0 | 22.704 | 0 |
2 | 0.8888 | 4.928 | 88.88 |
3 | −0.1356 | 35.66 | −141.61 |
4 | 1.6048 | −33.956 | 554.55 |
5 | 0.20889 | 28.86 | −152.13 |
THANK YOU
FOR YOUR ATTENTION