Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

80 Work Book on Numerical Methods

,
III - Problems on Cubic Spline
I. Obtain the cubic spline approximation for the following data:

Gfxi 1-~I! I 2~ I
with Mo = M 2 = 0, Hence interpolate at x = 0.5 and x = l.5
2. Obtain the cubic spline approximation for the function Y = J( x ) from the following data:

I 1Cxi I:: I ~ I! 13~ I


with Mo = M3 = 0
SDIuJ:'r ~ :
FO'J-f ,t{,fJ}, w. :
N,r., ~ 4fLl:t -1 Mr, , • [L[f (xr-,J -.Rf(xr) ·I ! (x r;i >J I - ,, ;, . 3. •
fl O = 1'-{11, ~ 0 .
~) equai/Jj Jfa ud-'
n(x) ~ rl- f(~'i -X,) J(xr-xf·- h-z- J]Hr- 1 ·f -j;-(:xr-:>c ){(xr-!) -t

r
Z1r {(z- Xp_,) tx.-z.,_,f_ !,,"JI Hu t- ( x-%,_,)f r~,)

stu)I_ fCwj a.K(' e9uailg spaad .


o ~>- , ~ :2.
~ >. /T == ,)
a~ vw Mo ~ k :2.. ::: o .
put f .,.. 1

~o -1 4N 1 --1 Ma
"' /;. [f {'Xo)-Jf(x, ! ~ f (xo.!]
OiA,fY,+ D
t li,~ [ (- 1J - ~ (3 l uq]
Interpolation and Approximation 81

puf x,::::t fi-1 Fr{x) :


1
fr(,x.1:: _L r(x ,- x) 1Cx,-xJ2-_ {r):2.jJ No + ~1 (x.,-xJf(4)
t(r) 11

+ fcr [{-x - r: o) J/i - Zo)'- _ {tJLJ] H, + t(?l- '1-o)f(x.,)


1

~ {'Xt - X) f (Xo) .f /Jx ~'l,o){{ X- Xo) :_ (rfj] fv<, ../- iJ-(,x -~ f (x,)
}
0
)

-::- ( f- x_) {-r) + bI [ ('a:- 'trJ ) 1lX- o) (I ) J] (~r:,) (x - D) (S)


2_ 2- vf-

;s:: - 11-x+ -f;[ x(x-2-t )_]ii.+3~


==- A<t -t +-j, [~~- '£_]3E' 11
1-

c ;j__(x"'-x) + ,4 X - ( = f [,,x~-11x+SX- - .2J


~ = .-}[t1-x~- 3z-2]
, '. F, [x) :::- ~ fux.'3_ Bx-.2J _, o ~~~I
1w X ::=c2- in Fr ( x ) :

'Fi. (x) :- _I r~ - x)
6 C
l ( 2 -x, ) 2
- {i )
2
f'J7 f..< , + J_t ~-x) (a) + j_
6
[rz -,) J (x - I )~ ,iYJ ~2.. + -~ (~ ---I ) (£>q)

- £ [&--ex..> l {2-- x/ 1-_ 11] {3 3) + C2-aJ(a1 + (x_.-\)(2Gt)


: t [c_2-...•~J l -4 t 't2-- 4l: - l 1] 33 + b - 3~ + 21 J q . X -

= ~ [8+ :2_~2.- 8-_:t - -2 - ,:{ X - ~~] t- 1/; X - ,23

=- ~ f-x + bx.'- - -t6J


3 II :I: +2b x-23.., ;i,,,,
~2

= 1i__f bb
I Ix-,,+ + x"-- / 21 x. {,l, + '5 2 'X. - ,HJ ],~ I
82 Work Book on Numerical Me th0 ds

To f1L-1.J ~)~ f (o, 5 ) <r, f (t .F:5)


rJ f fo f5 ) flV, f1tf F, (x )

·c-> F, (o 15 ) ::: --i [11 ro.r5) 3- 3 co, rs) -7]


= 2
1
[ II ( o. 12 i;s) - 3 {CJ .JS) -2 J
: = -; [-~11~
=- -I . Ob 2.f>
~r ~G - 1=r111,j
0

•11 )4 (\,~) lret t\tt f2(x)

""' fr [t, <o ) " ~ f-11 'if.BP +-6 b {t, '5) 2


- {,9 (1 , 6) -r-10]

=-;_ r-\\(3°3 15) +tl (:2 ~2 6)- t°l {tL6 ) +2-0]


C ½[2+, ~-T5]
-::: I 5 , '7 31-E

.4 "-< l -1- f.ti_ -::: b [ (- I) - ~ (1 ) t 3J


iA N 1 +f'.h. ~ 6 r- I - ..2 t-.3]

,4M, +N~ e-0 -~@ :> N2. '=--'1N,

pu& F :s:o. 2 lt1 Nt


M1 + 4 f'.fa ➔ fl{5 ~ (, [f (x,) ,,_lf (~2.) + f (x,JJ
H, t ,lfM2. !:: t [1 - ~(~J-t3SS]
N, +ti N2 ~.·1, [ ~oJ
Interpolation and Approximation 83

H,+JtN2. cc l'l3D ~@ 4H I t M.2. = 0,


i u.\> G) W\ @ N :i.. ➔ -4 (- r 2.) = o
@) .:::) ~, -t A t--Jt M 1) :::. t<g D [J}2- == 4-1)
Hl _ fb N l :::. t9 0 ,
- 15 N t ::: t80
,~ ~ -!3J
pu1- r = , ?f1 F P( -x )
Fr(~) " --}; [(x, 1
_ ..,_) J(-.: ,-x f_ / ~ J ('( 0 + I (x, - x) £fol + -f f(;t. - :> u)
i(x - <;(_oY2"- I j J N1 t- \ (~ - ~ 0
){{-x.. .J
~ {o-~) (-1 )-+ t [lx._!1 )l(~-+1/-· 13J ~1.2..)
2__
+{ x --1-1 ) { ,)

::: X + j [~+I ) ( <X--z.-1- t+ 2 X -1) J {:t 2:J + X +I


~ .2.-X -i-l -6- ..:.., o) . R ~4-I} ( X 2.-t 2-z)] "" _29(,+ I - ~ rx 3
+2 r-t~ 2
+52 ~ ]

~ 2.X + \ - & ~ ?> ~ 6 'f' - 4X ,

Fr ( ?l-) = - If)(_'1-z 3- /'..,,,, 2 -


b<-- ") n-
.-,:c..,<... +- I - J # - ( :::! Z ~ 0 ►

Plll:- l =- .2.. r11, Pr (x )

F.J.J'A:) : t [{~.1.- ~) J{ ~ 1---z) :- j J 1 N t +- (X.1. -':{, ){ C-z.i) + i [lx- x ,)


t (x - -x., f2.- r 1] N 2 ..t - I (-x-x.,) f (~)

= f [ (t-x) l (r- x) ..._ I j] (-12-) + ( 1- x 1 Cr l + l ~rx - o) z(x-cl'- 1J}ir


+ (x-o) (3)
-= 1[c 1-x_) 0JG-1 2.) + (l- t -!:8 [ z 3- ~ ]
l (t-+ 'X 2
- 2 'X - 'A_) +3~

-==- -~ [(,-x, [x':2.._Dl.x]] + 8 [il.3 -~l +.2x +1


== -~ [~2._2.x.-2- 3 + 2.c] + %'t--s-~'J'.:..\-2~ +'
~ - 6 'X_ .2..+ Ax + ~ x 3 + ex:3 - 6 x__ + ,
F~ {~) : : -- lo x_?>
-
c. ~ 2-- .::i.~ +I , o ~ ~ ~ I.
84 Work Book on Numerical Methods

Pw: -l - 3 rri Fr (x )

f J (x) ~ -t [('it3-',;) j{Z3 - z)"_ I J] ifL i- ('X3-?J f {z, J -1-('K-x.,)f{~:{)


s- f [(2- z) 1{2.-z)"'--13] (;j il) + (J.-x) @) (z - I )(B'S) f-

:cc.) t .4tx,2-.lpi - l]jA8 6 - 3X +sisr:- 35


[0.--x.l .i-

.e_ i [ti-~) i Z - tl z+sJJ .+ g2.x - 2'L


2

-:: :. 3 [ 2.?:'2._ Bz + G- z?i+ 4~2-_ 3-xj +~2-x .- 21

:::.. 8- r-xs +-Gx2 - / IX +t].-+32.:t~r:2.f

-:= - 8-'x.3 + /..l&'X.-2._ 8%X t ,4g + '?)'2X~£r


== -8~3-tA8X-Q. -fi.6x +l°l
j<11

F3 {x.) = - 8 ?c.3 + ft &x,'2.__ 5'6 x + I,qI J


• 1 :f. 'X. ~ /)_,
Interpolation and Approximation 85

IV_ Problems on Newton's Backward or Forward Difference Interpolation


Formula
1. Using Newton 's forward difference interpolation formula, find the cubic polynomial which takes the
following values:

2. From the data given below, find the number of students whose weight is between 60 and 70
Weight in lbs 0-40 40-60 60-80 80-100 100-120
No.of.students 250 120 100 70 50

3. The population of a town is as follows:


Year (x ) 1941 1951 1961 1971 1981 1991
Population in lakhs f (x ) 20 24 29 36 46 51
Est:j.mate the population increase during the period 1946 to 1976.

1 ., fo~& cle-ffe.nuue hct:eJ1potcr±fr,-u ~·


-
k.€X9- tC<Q $ pax.l ft1Jj fA .,;au,ze be/r,ov.t(
~1 t) I 2-
I
3
,o
OJ I/ 2-' n .•,[n,,e-f r
i~ tx_) I ')___

Netotot-t t ~ ro~ Jr ffvt e,uce_ l-o-h re '


~ fl~) Af(sx:-) L12-f t~) ?l~f(~)

1 I
q
tn
fe1i1.1Jand dlffm eaC12 fon U{ wa :
f ['X-B) - + ~ fff [xo} + c~ --~o) {-<X.,.-Xt)
I} k ~£_t
f- [1X_-';(.tJ) L?C - ~I) [:i,-'X..2) ,t:12-f {VJ),,
3/ /13 + ... '
,
~ (, , .,_ rx - o , c, , +- ( t:. .- o , c: (_ - ,) c-.,_ ) -\-
u xl ..l. l (1 ) 1. 31
'
::: ' + ?( + ~ ~ l( C-1.-) + X C-x?-- .'.2. 'X. - X -+ .2.) ,.. ( 12)

I
86 Work Book on Numerical Methods

= t t Z - ·x,2-- + ~ .f-- 2-:x} - 6 x.2..+ 4 -x_


;;; 2~3- :f?<.2...,__ 0K + r

J). {)J ~ .&t .ih~ 0-1-to 60 -80 - 8/J~ tOV /OD ..- /20 ·
..k0-60

/.20 teo -:po 5V


NO. 1 Jlv.,clmh .260

f md 'lvD • of !3 mdw-t1 Whr2~ weJ,<f-t u bet/1Jeeu ~ to ;io .

Sol:
-- Wel¥t-- NDrtrf ~ {-9 A.fl(~) LIY{rx.) A'f~ t A{c1J
l'X..J fC~
.A O ,2 60
J?,.,O
60 3 =/D -2.. D
ID1) - ID
go kfO -3 o d1J
::;. o to
(00 PAD -.1 0
15 0
/10 , ~~D

Bg c.u t 11 11Qmr(J'U, 1 J foo/(,CXJwtd r~pota.fiau


. ftx) : :. / (41,o) + r~-Xol AHL, + ( ,c,-Xo){x,-?Ci ) J/(1<-,,t (: - )(
l _t k R, ! k 2- ·f- ~)
3t·
/ £(:to')
+ ('t-~ ~)(?<-~XI) (x_rxz._) (X- -~ I A~ I(~) ' -Jtj I

A! k~ I

<(o farid ffM. trallf bttw~ 6 0 to ::f o ~ :fD tMLU: 'Mll f.


". ~ = 1D, k :=. ~o {c;/J-ffeJtea u) ,
_~J!D. ,_ [-:fD-A,o} (r,oJ + {::ro - /.fo ){-rO °ioJ (-&o}
f f,-o ) - - t r. ;;,o ~ ,' [iDJ2-
/g-_/'l_1tn) c=ro...--Ga ) ( :fD -!~) C~tol _ t- (:fD-A.ol (~o -ho) ('fD -- 8'~ ~~10Cl)
t ~ ()oJ s +! -~ (2.C)
. \¾t-'
Interpolation and Approximation 87

:;. t 'JO + f 80 + C-<o • ~) -+ 0 · G.2. 5. + O• t.\-6) 8 ::,: s .

_.::::-,.4R,3•~q
~ /; ~I; ' -f o
;-g louoo:> ~ ft,;Jt-r .
of ~ H:uiw.,f-s wkoge
U9 Q,t~t-
-!l,w [11,0 •
u 3'-;f{) •
1 2:. J--u clet~JJ' lO Cw~ e weir& f rd foelo~ I; 0
7fu Vl,D r

n, 0 of J tu&nt t-s wko ge fA!)~f t& bd-WelM


~' . Tfu C

Y..! A~A -- 8-:fo ~ 54


00 ~ -=ro

1c:; 4 I tt::t ~ l (1b I 14.'.f f fiB r I °t"'t I


J. ~ [-x..) '
~

,.. _:l.q 36 4G of
f'Opuia/tl)t{ f (<1-) .. .20 .2~
}vt (,t,/cv'I., -
r trt l)tS}~ e &, [Jj1 l 1f1.J L~ pextc& (4 It f, to lCf =76 .
fivrl tCw. populait()l,t ~ ,.i
Fo?aOcv-r d ba l/4 wOJtcl .
J) t 1faeut.i. &bte ~
po pyltJ.,tt rrt/1. ~v( raktM
f tx..J

19 1-1 \ ½!?__
1951
(°/ b I

f~i I

/"f 8 I

B~ ~wfm<, ' j

/td ~ f (XP)
88 Work Book. on Numericnl Mcrhods

f(A Ab\ =- Y v -1 (19A l, -l'YHtltAJ_ ➔ (1'1J4L - 19/..11)(A~L - 19f:>J) Ct )


I ) )(. ID, A2 1. X. ( lb )L

-\ (l'\l{L - l°'Al ) (1'lA L,- /'H51){1 4Jd"- l-=t &t) >' JiL -t- ,o;
31 10 3
-I ( t9~b) - l'\/.\1) (l°l~b-19531) (l'lHb-lCfb1) (/"(/.\;t,-19::fl)t!!_,4 C,...-t't'!l).>l ~
- - {to)5
"5 !

8~ ~ '& ha..d::wcmrl lvtfe7ltolo.1-tfYU. fo91vtllJJa_

f {x,) -== ! t-x.rJ + c~ x '2:._L v f ex"') + c;t -4) c?L- X1-1-,) y1(?Cv..)
I) x n. 2 1 x kl!.
-1 ~x ~ <)(,VI--, ) CX-- X-n.,..~ ~ '7 'f- (X l'\)
i! kg
-+ (-x:.- xn.)C-x.-Xvt-1) Cx..~ x.1,1,- 2...) (,c.- x.n-1) ~ 9 ~1 (-x_v\l
- --- -1 I r
- -- h11
·4 (x.~~n ) ( x._..- }tri,- 1) (X--Xtt-~) CX-- ~ -3) {a:.- ~n-It-) '!_ tJfc~)
~! ,~
ix :::: \C\::fb k == \u
t (IC\~ h) ~ 6\ + ( l~ ={C. -l'\C{t) ( ~) + (1'\1 b- A'1!) (\'\:t{i - \°\21) (-FS)
I ,' to :2.. I - [ioJ2
.-t (t'\ "::f h - l°'.."t \~ '1=f f.- IC\~ I ) ( \q ":+ b - \q ~ I) (-'8'
31 x..C.10) 3 -
'

t ( rq:f t, -IC\41)
A ! X L\t)) lt ---- ~----------
+ (r'\::rtt ~ t'\"'- 1) C1'\~b-\ G\8 t) t\l\:'.\t.~\c::i·:t-1) ll°'-1- b --- l'\ l>,)

Ct~-- \'\ %~) o ~~b --- l°t'!\) Cr'r1f- b- ~bl


(-ct)

) [t1.:f l -tc:r JS1) ~


- - - - ~: )
5' f xt1n) 5
Interpolation and Approximation 89

"" '5t _";:f.'3 ~ lo'8::f'3 '"" 0,'3 - Oo 2..t0°t . .... O~to54

::: .40 . 808q-

--- Al
/V

You might also like