Sei sulla pagina 1di 8

Prepared by Mrs.

Sania Shahid Nizamani



1


CASE STUDY PROBLEMS FOR LINEAR, QUADRATIC AND
CUBIC SPLINE INTERPOLATION
QUESTION # 01: Suppose you use a zener diode for a voltage regulator circuit (to filter out the
small sinusoidal ripple voltage and to refine the constant power signal). You need to use the
voltage-current characteristic ( ) v i i = in order to compute the steady-state voltage drop
across the electric network. However, this function is not amenable to representation with a
simple analytical expression. Instead, measurements are available only for following data
points.
97 . 602 78 . 362 35 . 517 04 . 227 0
5 . 22 15 20 10 0
i
v

Use Linear Spline Interpolation to connect the data values and to reproduce a simple analytical
representation of the voltage-current characteristic? Estimate the value of ( ) 16 i
Solution: The given v values are not in ascending order, therefore; rewriting the given table yields
97 . 602 35 . 517 78 . 362 04 . 227 0
5 . 22 20 15 10 0
i
v

We have 5 data points and hence 4 intervals.
: ] , [
1 0 0
v v I = For the first interval;
( ) ( ) ( ) v v v v
v v
i i
i v s 704 . 22 0
0 10
0 04 . 227
0
0
0 1
0 1
0 0
=


+ =

+ =
: ] , [
2 1 1
v v I = For the second interval;
( ) ( ) ( ) 44 . 44 148 . 27 10
10 15
04 . 227 78 . 362
04 . 227
1
1 2
1 2
1 1
=

+ =

+ = v v v v
v v
i i
i v s

: ] , [
3 2 2
v v I = For the third interval;
( ) ( ) ( ) 93 . 100 914 . 30 15
15 20
78 . 362 35 . 517
78 . 362
2
2 3
2 3
2 2
=

+ =

+ = v v v v
v v
i i
i v s

: ] , [
4 3 3
v v I = For the fourth interval;
Prepared by Mrs. Sania Shahid Nizamani

2


( ) ( ) ( ) 61 . 167 248 . 34 20
20 5 . 22
35 . 517 97 . 602
35 . 517
3
3 4
3 4
3 3
=

+ =

+ = v v v v
v v
i i
i v s

Hence, the linear spline (piece-wise polynomial) becomes
( ) ( )





= =
5 . 22 20 ; 61 . 167 248 . 34
20 15 ; 93 . 100 914 . 30
15 10 ; 44 . 44 148 . 27
10 0 ; 704 . 22
x v
x v
x v
x v
v i v s
i
; where = 3 , 2 , 1 , 0 i
The above piece-wise function is an analytical representation of the characteristic. voltage-current
Since 16 = v lies in the third interval, therefore
( ) ( ) ( ) = = 694 . 393 93 . 100 16 914 . 30 16
2
i v s

QUESTION # 02: Dynamic viscosity of water ( )
3 3
10 N.s/m

is related to temperature ( ) C T
in the following manner:
307 . 1 519 . 1 787 . 1
10 5 0

T

Plot the data and use quadratic spline interpolation to predict at = C T 5 . 7
Solution: Let T and be denoted by x and y respectively for the sake of convenience.
We have following terms given in the data:
0 5 10 15 20 25
0
100
200
300
400
500
600
700
voltage
c
u
r
r
e
n
t
Voltage versus Current


s1(v)
s2(v)
s3(v)
s4(v)
data points
Prepared by Mrs. Sania Shahid Nizamani

3


= = = = = = = = = 5 , 307 . 1 , 519 . 1 , 787 . 1 , 10 , 5 , 0
3 2 1 3 2 1 3 2 1
h h h f f f x x x
Let the quadratic spline to be fitted be denoted by
( )
( ) ( )
( ) ( )

+ +
+ +
=
10 5 ;
5 0 ;
2
2 2 2 2 2
2
1 1 1 1 1
x x x c x x b a
x x x c x x b a
x S
There are total ; therefore, we need which would be obtained in the following 6 unknowns 6 equations
manner:

= +
=
= +
=
2 3
2
2 2 2 2
2 2
1 2
2
1 1 1 1
1 1
f f h c h b
f a
f f h c h b
f a
Continuity Condition
} = + 0 2
2 1 1 1
b h c b Continuous slope
} = 0
1
c Zero curvature
Substituting all the given values, we get
212 . 0 25 5
519 . 1
268 . 0 25 5
787 . 1
2 2
2
1 1
1
= +
=
= +
=
c b
a
c b
a

0 10
2 1 1
= + b c b
0
1
= c
Setting up all the above equation in a matrix form, we get
Prepared by Mrs. Sania Shahid Nizamani

4


(
(
(
(
(
(
(

=
(
(
(
(
(
(
(

(
(
(
(
(
(
(

0
0
212 . 0
519 . 1
268 . 0
787 . 1
0 0 0 1 0 0
0 1 0 10 1 0
25 5 0 0 0 0
0 0 1 0 0 0
0 0 0 25 5 0
0 0 0 0 0 1
2
2
2
1
1
1
c
b
a
c
b
a

Since , ,
2 1
a a and
1
c are reducing the order of the above system to already known
(
(
(

=
(
(
(

(
(
(

0
212 . 0
268 . 0
0 1 1
25 5 0
0 0 5
2
2
1
c
b
b

The above is solved using MATLAB. Thus, all the values are given below:
787 . 1
1
= a , 0536 . 0
1
= b , 0
1
= c , 519 . 1
2
= a , 0536 . 0
2
= b and 0022 . 0
2
= c .
Hence, the quadratic spline is given by:
( )
( )
( ) ( )

+

=
10 5 ; 5 0022 . 0 5 0536 . 0 519 . 1
5 0 ; 0536 . 0 787 . 1
2
x x x
x x
x S
Prediction of at 5 . 7 = T is:
( ) ( ) ( ) + = 39875 . 0 5 5 . 7 0022 . 0 5 5 . 7 0536 . 0 519 . 1 5 . 7
2

Graph of data and quadratic spline is given below:
Prepared by Mrs. Sania Shahid Nizamani

5



QUESTION # 03: The current in wire is measured with great precision as a function of time:
58 19 2 4
6 5 2 0
i
t

Estimate i at 4 = t using cubic spline interpolation?
Solution: Let the symbols used instead of t and i be x and y respectively.
Divided Difference Table
58 6
39 19 5
7 2 2
3 4 0
] , [


f y x

In symbols;
= = = = = = = 1 , 3 , 2 , 6 , 5 , 2 , 0
3 2 1 4 3 2 1
h h h x x x x
( ) ( ) ( ) ( ) = = = = 58 , 19 , 2 , 4
4 3 2 1
x f x f x f x f
Divided differences are:
= = = 39 , 7 , 3
3 2 1
f f f

0 2 4 6 8 10
1.3
1.4
1.5
1.6
1.7
1.8
Temperature
V
i
s
c
o
s
i
t
y
Temperature versus Viscosity


data points
spline 1
spline 2
1.519-0.0536(T-5)+0.0022(T-5)
2
1.787-0.0536(T)
Prepared by Mrs. Sania Shahid Nizamani

6


First Step: We find all cs in the following manner:
( )
( )
( )
( )
(
(
(
(



=
(
(
(
(

(
(
(
(

+
+
0
3
3
0
1 0 0 0
2 0
0 2
0 0 0 1
2 3
1 2
4
3
2
1
3 3 2 2
2 2 1 1
f f
f f
c
c
c
c
h h h h
h h h h

Substituting all the values, we get
(
(
(
(

=
(
(
(
(

(
(
(
(

0
96
30
0
1 0 0 0
1 8 3 0
0 3 10 2
0 0 0 1
4
3
2
1
c
c
c
c

Since 0
4 1
= = c c (natural spline), the above matrix reduces to
(

=
(

96
30
8 3
3 10
3
2
c
c

Solving it yields the following values:
6761 . 0
2
= c and 2535 . 12
3
= c .
Second Step: The values of as are given below:
= = = = = = 19 , 2 , 4
3 3 2 2 1 1
f a f a f a
Third Step: The values of bs are found in the manner given below:
( ) = + =
+
3 , 2 , 1 ; 2
3
1
i c c
h
f b
i i
i
i i

For : 1 = i
( ) ( ) 549296 . 2 6761 . 0 0
3
2
3 2
3
2 1
1
1 1
= = + = c c
h
f b
For : 2 = i
Prepared by Mrs. Sania Shahid Nizamani

7


( ) ( ) 9013 . 3 2535 . 12 3522 . 1
3
3
7 2
3
3 2
2
2 2
= + = + = c c
h
f b
For : 3 = i
( ) ( ) 831 . 30 0 507 . 24
3
1
39 2
3
4 3
3
3 3
= + = + = c c
h
f b
Fourth Step: The values of all ds are found in the following manner:
=

=
+
3 , 2 , 1 ;
3
1
i
h
c c
d
i
i i
i

For : 1 = i
1127 . 0
6
0 6761 . 0
3
1
1 2
1
=

=

=
h
c c
d
For : 2 = i
4366 . 1
9
6761 . 0 2535 . 12
3
2
2 3
2
=
+
=

=
h
c c
d
For : 3 = i
0845 . 4
3
2535 . 12 0
3
3
3 4
3
=

=
h
c c
d
Hence, piece-wise cubic polynomials (splines) are summarized below:

All the values have been calculated above. Substitution of these values yields the required cubic splines:
Prepared by Mrs. Sania Shahid Nizamani

8



We will use second spline to predict i at : 4 = t
( ) ( ) ( ) ( ) ( )
3 2
2
2 4 4366 . 1 2 4 676056 . 0 2 4 901408 . 3 2 4 + = = i t s
Thus, ( ) 0142 . 1 4 i
Using , graph of data points and above cubic splines is shown below: MATLAB



THE END

0 1 2 3 4 5 6
-10
0
10
20
30
40
50
60
Time (t)
C
u
r
r
e
n
t


(
i
)
Current versus Time
t
3
-5t
2
+3t+4

Potrebbero piacerti anche