20
Quadratic Spline Interpolation Part 1 of 2 http://numericalmethods.eng.usf.edu

Quadratic Spline Interpolation Part 1 of 2

Embed Size (px)

Citation preview

Page 1: Quadratic Spline Interpolation Part 1 of 2

Quadratic Spline InterpolationPart 1 of 2

http://numericalmethods.eng.usf.edu

Page 2: Quadratic Spline Interpolation Part 1 of 2

Quadratic Spline ExampleThe upward velocity of a rocket is given as a function of time. Using quadratic splinesa) Find the velocity at t=16 secondsb) Find the acceleration at t=16 secondsc) Find the distance covered between t=11 and t=16 seconds

t v(t)

s m/s

0 0

10227.0

4

15362.7

8

20517.3

5

22.5602.9

7

30901.6

7

Page 3: Quadratic Spline Interpolation Part 1 of 2

Data and Plott v(t)

s m/s

0 0

10227.0

4

15362.7

8

20517.3

5

22.5602.9

7

30901.6

7

Page 4: Quadratic Spline Interpolation Part 1 of 2

Solution

,)( 112

1 ctbtatv 100 t

,222

2 ctbta 1510 t

,332

3 ctbta 2015 t,44

24 ctbta 5.2220 t

,552

5 ctbta 305.22 t

Let us set up the equations

Page 5: Quadratic Spline Interpolation Part 1 of 2

Each Spline Goes Through Two Consecutive Data

Points,)( 11

21 ctbtatv 100 t

0)0()0( 112

1 cba

04.227)10()10( 112

1 cba

Page 6: Quadratic Spline Interpolation Part 1 of 2

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

Points04.227)10()10( 22

22 cba

78.362)15()15( 222

2 cba

78.362)15()15( 332

3 cba

35.517)20()20( 332

3 cba

67.901)30()30( 552

5 cba

35.517)20()20( 442

4 cba

97.602)5.22()5.22( 442

4 cba

97.602)5.22()5.22( 552

5 cba

Page 7: Quadratic Spline Interpolation Part 1 of 2

Derivatives are Continuous at Interior Data Points

,)( 112

1 ctbtatv 100 t

,222

2 ctbta 1510 t

10

222

210

112

1

tt

ctbtadt

dctbta

dt

d

10221011 22

ttbtabta

2211 102102 baba

02020 2211 baba

Page 8: Quadratic Spline Interpolation Part 1 of 2

Derivatives are continuous at Interior Data Points

0)10(2)10(2 2211 baba

0)15(2)15(2 3322 baba

0)20(2)20(2 4433 baba

0)5.22(2)5.22(2 5544 baba

At t=10

At t=15

At t=20

At t=22.5

Page 9: Quadratic Spline Interpolation Part 1 of 2

Last Equation

01 a

Page 10: Quadratic Spline Interpolation Part 1 of 2

Final Set of Equations

0

0

0

0

0

67.901

97.602

97.602

35.517

35.517

78.362

78.362

04.227

04.227

0

000000000000001

01450145000000000

00001400140000000

00000001300130000

00000000001200120

130900000000000000

15.2225.506000000000000

00015.2225.506000000000

000120400000000000

000000120400000000

000000115225000000

000000000115225000

000000000110100000

000000000000110100

000000000000100

5

5

5

4

4

4

3

3

3

2

2

2

1

1

1

c

b

a

c

b

a

c

b

a

c

b

a

c

b

a

Page 11: Quadratic Spline Interpolation Part 1 of 2

Coefficients of Spline

iaibic

i ai bi ci1 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

Page 12: Quadratic Spline Interpolation Part 1 of 2

END

http://numericalmethods.eng.usf.edu

Page 13: Quadratic Spline Interpolation Part 1 of 2

Quadratic Spline InterpolationPart 2 of 2

http://numericalmethods.eng.usf.edu

Page 14: Quadratic Spline Interpolation Part 1 of 2

Final Solution,704.22)( ttv 100 t

,88.88928.48888.0 2 tt 1510 t,61.14166.351356.0 2 tt 2015 t,55.554956.336048.1 2 tt 5.2220 t,13.15286.2820889.0 2 tt 305.22 t

Page 15: Quadratic Spline Interpolation Part 1 of 2

Velocity at a Particular Pointa) Velocity at t=16

,704.22)( ttv 100 t,88.88928.48888.0 2 tt 1510 t,61.14166.351356.0 2 tt 2015 t,55.554956.336048.1 2 tt 5.2220 t,13.15286.2820889.0 2 tt 305.22 t

m/s24.394

61.1411666.35161356.016 2

v

Page 16: Quadratic Spline Interpolation Part 1 of 2

,704.22)( ttv 100 t,88.88928.48888.0 2 tt 1510 t,61.14166.351356.0 2 tt 2015 t,55.554956.336048.1 2 tt 5.2220 t,13.15286.2820889.0 2 tt 305.22 t

Acceleration from Velocity Profile

16)()16(

ttv

dt

da

b) Acceleration at t=16

Page 17: Quadratic Spline Interpolation Part 1 of 2

Acceleration from Velocity Profile

The quadratic spline valid at t=16 is given by

)61.14166.351356.0()( 2 ttdt

dta

,66.352712.0 t 2015 t

66.35)16(2712.0)16( a 2m/s321.31

,

,61.14166.351356.0 2 tttv 2015 t

Page 18: Quadratic Spline Interpolation Part 1 of 2

Distance from Velocity Profile

c) Find the distance covered by the rocket from t=11s to t=16s.

,704.22)( ttv 100 t,88.88928.48888.0 2 tt 1510 t,61.14166.351356.0 2 tt 2015 t,55.554956.336048.1 2 tt 5.2220 t,13.15286.2820889.0 2 tt 305.22 t

16

11

)(1116 dttvSS

Page 19: Quadratic Spline Interpolation Part 1 of 2

Distance from Velocity Profile

,88.88928.48888.0 2 tttv 1510 t,61.14166.351356.0 2 tt 2015 t

16

11

15

11

16

15

)()()(1116 dttvdttvdttvSS

16

15

2

15

11

2

)61.14166.351356.0(

)88.88928.48888.0(

dttt

dttt

m9.1595

Page 20: Quadratic Spline Interpolation Part 1 of 2

END

http://numericalmethods.eng.usf.edu