1 of 36

Mata Kuliah : Metode Numerik�Minggu ke 11

2 of 36

Mahasiswa dapat melakukan komputasi untuk menentukan koefisien fungsi polynomial dengan Lagrange Interpolating

Tujuan perkuliahan

3 of 36

Lagrange’s Method

4 of 36

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

5 of 36

Linear Interpolation

6 of 36

Linear Interpolation (contd)

7 of 36

Quadratic Interpolation

http://numericalmethods.eng.usf.edu

8 of 36

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

9 of 36

Quadratic Interpolation (contd)

10 of 36

Quadratic Interpolation (contd)

The absolute relative approximate error obtained between the results from the first and second order polynomial is

 

11 of 36

Cubic Interpolation

12 of 36

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

13 of 36

Cubic Interpolation (contd)

14 of 36

Cubic Interpolation (contd)

The absolute relative approximate error obtained between the results from the first and second order polynomial is

 

15 of 36

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%

16 of 36

Why Splines ?

17 of 36

Why Splines ?

Figure : Higher order polynomial interpolation is a bad idea

18 of 36

Linear Interpolation

http://numericalmethods.eng.usf.edu

19 of 36

Linear Interpolation (contd)

20 of 36

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

21 of 36

Linear Interpolation

22 of 36

Quadratic Interpolation

23 of 36

Quadratic Interpolation (contd)

24 of 36

Quadratic Splines (contd)

25 of 36

Quadratic Splines (contd)

26 of 36

Quadratic Splines (contd)

27 of 36

Quadratic Spline Example

The upward velocity of a rocket is given as a function of time. Using quadratic splines

  1. Find the velocity at t=16 seconds
  2. Find the acceleration at t=16 seconds
  3. Find the distance covered between t=11 and t=16 seconds

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

28 of 36

Solution

Let us set up the equations

29 of 36

Each Spline Goes Through Two Consecutive Data Points

30 of 36

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

31 of 36

Derivatives are Continuous at Interior Data Points

32 of 36

Derivatives are continuous at Interior Data Points

At t=10

At t=15

At t=20

At t=22.5

33 of 36

Last Equation

34 of 36

Final Set of Equations

35 of 36

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

36 of 36

THANK YOU

FOR YOUR ATTENTION