You are on page 1of 8

Uni\rersity, FacultY"6fJE1'i,~irieering

··."-';M;'i"Elect.rical~and
Electronics Engineering Deparnnent
. .. . .
.'\UlllCIll"ll ;leU1111(iliCS all(i ,.I.'i()bi'llilllllllg .
Fina! Exalni n'2:fl6nJ;JulY'9t!l,~O'0Q~~~};~~;:';''0ii~7'!·1'~J~tiij\~t
~

'j1t(.;sl~·Oil.j [0 the bl3.5i (-:/)-'our J...7;01~1;;-"::g;! (2) 1'/0 qU2srion l~'i!/Z!.; Cii1s"'rFcrl\:l d:iring the CXD.nz

(3)Shoj\' uf!
,
J'OU,'" s/('!):; on:! C(I."/~1·~::":-::onlj)!~t{l!f()f7.:.· ;.-:; ./ clcch17a! J-7!oc':::s !!.~·:.!~!.?SotherH'ise r"?~ntioned.
(12.5 l\'larks for each question)
>XL.
y
Ql- Using Simpson's
•...----_.-~----
~ rule for double.' init"gration, eV31u<lte the following integral
~l11d
CiJll1P~ln.~ )'uur :lilswcr :,', t11l..' :tllalylict! :-:olutiol1 in lC']"!n nfrcbtj\"(· error. ( lJsC'
.~\x=().3, ..'.\F'O.,? )
. ']
(I ~,..'-:/- I I,) ':1.0'1.2
(;f~f 'U': \

PI
-0.2,0.4
0,_,
e'':: cos(2y) dy;dx
/ .

Q2- Solve :~~ == sin(x) + YJ y(O) == 2 '\ analytically then usmg simplified and
im;::\fovecl Euler's methods. Chcck )lour ansvvers bv fincli:12 the relative enol' to the
J. .t •._

analytical solution. U5e h=D. 25 and tabulate your onswef'S osfolloH's :


r ~._ ...~._-;.-:----:---;;-.:.-------'--:----.-.--,~.----~----~;----_ ----:-~----:-~-- ',----.-.--.---~----,- -----
,x ! YiX), SlmplIt!cc! Eul~.r.. "_'::. improved E,;;-:r : Y(I), Analytical. t\!1:;\··.'cr· [., R.:l3tlvc Error' . I
I
I· ."' i; "' S'1'1'P"'~
l .... ~LI!r,~ - •..
J
! ,i
Ij'1'nr-"
J'~U"cd :--J I
!O.O-r i
I !
I 0'1'
.•~)
,
i
[
'
!
f
0J. J,- I I1 .

i0 ~T,\ I
j 1 :C)~) . __L_._ . __ .__ ._. ._. . . J . i !

--_._---------------_. __ ._----------------------
Q3- Soh'c },I 2x2 - YJ == -lJ. analytically then USi:lg second order Runge- y(O)
Kutta (Heuns' method), compare your answcr with the :fourth. order Kutta's method.
Use h=! ondtabuiate vour onswers os ro!10H's:
"'"(J,~,;c,.:.:.J:~\;,'t;lc;r,:';;;"'".:r~:"''9EJ''''''';j::'''''~e'.:rYo,f,cRS'",I ':>: Eno,
~6~ii,L""":~~:I;;'~r·i!~!j i
. : , ; , \ : I
- . . i .
! ._....L..-.
L i ! .._. I. ..__ .. I ! .~ ~I ."

<:
--'
jOfh'l
rI I £'(l'/\~
/' f~ I--.rl
'-f, {,'T
/":7!·1/.. '.'/
/1,;:' U;,) ';'
U,l.
¢
'~; , ,_17" {-<:>"h1
....
..k..l .L t..t.l.'- ..•.
J.
rT~;'~;;:;':~if-,.T'
\....1 ~~.--..J
,t. •..••• , ••••••.~

Faculty of Engineering
'YH,/J':I~<::txicHl'U1~I,.t]ectronlc~bnglll~erlIlgi)elj,c..u .ilCilL •......................
'

;i~'W~
... ., ..' '£1-: 3()3'Ktl~~~i~~~~~~~f~~~~ge;::~~~~i~ogi4tilHT.ii1g~~~~~~~*c~<;f
Q Answer anv two questions to the best of your knowledge.
IP Carryall calculations to 4 digi ts
_~'\;o 9~~cstion~wi~l-be al2.~~~~re_~
during the exam. Time allowed:Z, hours
QI - Given a mC\trix of the form Ax=b where
2.9S00 1.7600 - 5.050~)] [-300.7336]
/1 co.
f 3.7300
L2.0223
B.l100
";".34~.2
0.-/6uO
O."~()}1..
h::..-: 2254.2222
1206.0751
((I) If vector b is chzmged by (~10%), what is the relative error introduced to the solution vector
of this system.? (5 Marks)

~ (b) Given A~ [~ ~~] ~

(1) What is the value of a that will make ttds ma.trix singular? (1.i\1ark)
(2) '\\That is the value of n that will make the condition number cf t.:.\ismatrix> 100? (2 Marks)
(3) Find the Eigen V'2l1ues of the system in term of a? (2 Marks)
Q2- For tht; Follov0-na d,ata p~vs:
I '~:'.' •. / 0 ,.,y , 0 5 -/ I nu '77 'l n ~"1 '
r:~2_':_"I_~-'---'';~' '(.<;( .
'0 ,.,: '.~
: ' I), l. J1 l~: 1 ")
L If ,j 1"')

J].=:t-J~::'iO;,O_) _.2136? 3.30458


I~ •••• ') t""\

l~~~~;JL.40~~~._.
;dfi~ Construcl (1 l\!cviJJc ~abJe thZlt intcrpolates at x:;:O'.~ usin,g only tl~c:first four points. (3 Mal'ks)
~..05))Fit a 3rd degree polynomial of the forrn y = ao + c<':l,X + az:';~+ C-: .. 3 using Non-linear Least
II ~ Square and use it to estimate f(0.6) <:..1'~·7 ( (~..MarkS1
~ Estimatef(O.6) using 3rJ degree ~ewton-Gregory interpolating l~""·~ynomial '(3 Marks)
,,-v(d) The table is for [(x) = ;\ e'':. vVrGG~ method gave the closest arLS-.':er to the correct answer,
(1 Mark)
~ Q3- The foV9\viI'\gsable is f% /::?X"i -7 r
A ~. 10.0(" , '0:4' 10.9" :-1.5 1.8 '
~~ .__ -rU\.l7J51735
!jT:(-J-rTl)()(jO 2.2.179 I 9 ..4877 . . 25.5337 _
~ __ ~__L_________
.-..-6::\) Find the first tl paramdcrs of th·,:: fitling p,olynomiql of the fom,:

• Pn eX) , ([0 + LI~l ni IT~o(X - -~J "II\J'{\Vt9(~~"


tX.J) Write dmvn Ow divide difference tables to: \\I~

01) EstiIIl:ate e lc l\sing~.l_e_!~_~~~£dur~~ (2 Marks)


'- (2) Estimate c 1,: using the bst four points (2 Marks)
,..(c) Write.J :lli. d~g[-~~ L~\grc1ngL' jl~t\~rJ:~olatlng polync..'imiCll that intc'r':cclatcs the given duta and use it
to estima.te fl1.2) (2 Marks)
\.G1L~\'h icll..~~1~'l~C2~l.g,a~l~
lh~.~c.cs_~c~c;
!J!..l~~~~L_. ._.______ ___ ( 1 Mark;
§oca.f{./c.!:to uffs(Ycu
•. ~~~!.-.uva~L)'1,oCt""L;.~,!,,-'''n;IX;'"~~~''''''''''~~~~2:''''';...';,.~~~~~~~:~~~~::::;:;Q£;JSS:la;;lUiJh'' m~

Dr, Tdri5 EI~Feghi'----------- . ££303, ;'nll 2C~'~ Page 1/1

I~f~~', ./1, ./. J. ~


/\
r '
1'\
Lo:
···U
lL
(
.\2,
[·1
I]
x= \~
.
l\.
'o:.i
,md
[
.0= '1:~~7j
l-()5
7:i 1

,'.' f;1 d vc t lie system lIsil1~ Gall~siClI1 cl i III inntion \Vitho.~i voti12g (5 M~~~)
',' ! Iy l1Silll~ tilC G<lllssi811 :('lill1il1~lti( 11cocfficient~; find the. LU matl·ices. (5 [VIades)
• L i
.... --- I .
(Q2) Give the following!systcm 01 linear equations
! 2 x / - 4x 2 + 5X3 = 59;
:Ix/ - 18 .\?+ 2 .\;'7' 172 .__
;.··i··:'
- . I .
',' ~.
~.\'/'! \d.\) -iO''(.I---2~1 __
,
e) Soh/c thc system ufing.LU decol77p,)sitio17 with the follO\ving two sti?-ges,
L:' /. ~;olve !('I";: (8 rylnrIcs)
Ux-:;:. solvc fO\.\' :
I
/:j .C;!·,i''''· ::;;\[ (r:-:;lCrI11il'1:111l)
l
def(A)=dl f(!)*det(U) (2 I\1arkS).
j

_":r/v;)

\ ~h' 11<1I,[;I1COIleost Sqi"11C filtil1g to [II d a polyl1omial Gf degree 2 to fit the


/ ' I'u) !e)".\, j /1 g lJIJu lZ'ttccl clJ\~l t hell fi!lcl j( I J) (5 Ma rles)

~) , r~;~'=~T~~rlr~tr~3:'~'
-L =·-~2.51 ·1.4
•..c;

3.6 I ';.7 5.8


'--\ ;; I!
./
IMll?
.... ,.~t.,".,.=_-~==
J---=-j=
·0525' I . t:\ ·2\ )25
=i=-------r-- .
-22.8
.T -18.125 I -7.4
I 9.375 32.2 I

..~!, c['clci' poly;lollli,d


i:it :\ :'~:,~: through t:l[; first five points using L2.grangi8.~
polylloll,i,li <1m! tiilC.1.f({.()) ~ "," , (5 Marl<s).
I
---------------_._.-
Good.Luck to all oj'you

~q
/
;,;:;;~~:::;:"~:""!
..:
I I

·1 •. ,. A ~~·~jiin"

... .
htii~;tv e
~~0(qfZll~~t1\r~~F~t~
r·: r::~03 I'h! nle .' c2.l Techni ues & Programming
I Fi112 Exan1inCltion _
i

'!'iIlIe J1lfuwed: 3 HOU;~S (Ansv;cI' nJ.l questions) cac;h question is 10 Marks


. . ~..-----~ ..
... _.- -----
I "'"\ . .
.
CU, Using Newton's metKod/~find t:-:e roolD-l he followln.,g non-!;"-,22r function
L(x) '"-"-~'~' 7in(2x) In ~e into~:2 ( ~,~Jrep/!tu'{.Wthe e:ro~<,:lO-5

02. Usinr, ~~['::t5~~~~f~, the fall, win,


;;ncl.."I'"I\'f1~l11iOIOfcl9CE@~fit
c1.lt0, .
i! - ,

'(.'t
•. 0 .-----~.---~-------~ •• --_.-_- •• - •• _. _

I'l. i:..I.'I·/:".'J[II', !;F.-,o:,' ::: ",'.',' ;1.11/ 'I','l"ilu['IUI": ,I:. ['("'.'7UII::':'.";.,! Jl/~l' ,r;I.",?007 PO.I;' ; II
..•
p ,_ ..,.

,/

'.§d;~~~\ \1
, . '

'AI-Fatell tfniveTsitjl 'i .


l ':nj.~iJ lccring- Elcclrkal & Electronics /Engineering
DCPll rLnleT1 t
E£303 NHi1H!.ric~1 Tcc7m.iqIlCS & P1 ogmnw:.i7:g (.fin;11. yxwmination)

Time 1\ llo,:;ed: 3 He i!rS (Ans,vcr "il q JCStiOllS) <::::.:hqucst~~n is 10 M:nks


----------
, '-:-~. ' ' I

JI.
11
Q 1., a~ Using th~cZOjd;:.~~LdC,
followm table. s -,
i!!)d.:l·l':
.
~u~,:;i'\il~C¥~~':~ of the rJ~cl:on
I
rcrrcsc;;!U; by :hc

/i!.". ,.·j-.1.0 -0Tl -OA! -0.]-'0.2 I-'~l O.S I 1.: I j,4 11 1.7 f-~
f(x ,'. 2.7183 1.11092 1.0Gr>] 11:00: 01 0:9920 10.S325 jO.5S':f3 1-).1(,;2 I 0.061,31 I O,OO'?i.-L 0.0(;03 r

.-
:
., ,- ..- '-~
. I

~~) Repent ,-ising\~i~.I:s~~.~


rulcj':,;.-,-

...•..

7 Q5- F:,tirnntc the error b'2~';/~:" .\'~ j .-..:=].6 \\l.,cn th[~ililf.~~~lc:il.~Qd


:'l;'id is used to soJ\'C
, C\' ~ 'l .~/-, I J
:. ~; . 'T- .d/)'- J. JJIC (fl(/ly(ic(:I.~c7il(J~I;7-r:; y=:)=:~
..f n) I b: h:·O.1 ('11l11J1111L" 11111\\; ;1(.:lll;1Ierrors ,I[ C1\:!l :;tcp \'.'i{~l the ;1I);11Ylic!1~~;~\\1li(JiI.
~. b) U:;clt~l~l{lr_:;;:l'i~;d)[o:'Jcr 4 ;;Hf-~'~ll1p::rc the. r~:;uJts \V~!:,the-'r~'s-C:;iis'~bt::;~'~d'i~'-p::rt
~~))of this
~. ~l1C~ilit"l (\~(rllle,~nLl1ytic2.1 v"lucs, -- . --.. i _- _ .
~~.- ... - ..---.- ,_______ I

~
•... ;
~
I
., II
K: ~G:C'DJIu.ck to allo/.ycu i
;r"
I.,
I
I" .
I
tr.b 9'",2005
If V/'/-1J--"/
-- )
.~~~,L;~.:::c:;
," . . l"a.c;W!y ..qfE~~iineeririg'
'f.li&~~~~"of-(oflb'\:~'~;';'''Y~f' .•. ~ ..• _",- .,',.' .. _ • • ·,,:",,,:~,~••~.r."'~!/~.i--~:..•.• ~·,:... ~.-,~._ :", _ " ,"-:,':, .. ,. ,_

"~iiaElectronics Engineering Depaft:i:Deht


'~~0f;~";~-:~~l"'EIe~ti-icaI .. . ":----,'"/

EE 303 Nurnerical Techniques and Programluing;r


Ivlidterm II, December 14':' ,2009

a) AnsH:er all questions to the bSST o!:,/ollr Jaw·wledge.


h) Show all steps and carryall calculations UD to 4 di..!;jL~__.Ii!!c's othCi"'~'isc 7!7('i!riolicd.
c) No 'question 11,·'i1l be answered during the C'W!il.
d) Time a!lo~,'ed: 21zours
Ql-' "
(Zl)Derive Simpson's 1/3 rule by integTating tIle seco~e l\e\vton-Gregory \
'-../ P?lynomial that fits/trY at x-values of ,Xli x2:x~'~vhich ·are e'vertly ~~p~cec1~\. '
dlstsl1ce h apmi.. (~:\'lark~.) ,
~~(b) \Vritc a C program for computing numerical integration usill,~ tl1c trapczuidal
method. (3 [Vhrk,')
jc) Use 3/z/8 Simpson's rule to e:aluate the follo\ving illtcc-ral:

rl~4,Sjn(2X) fix
... -l..:-c.;.. o.

j - c. Z' 2.:~.?
1

fJ.: 'J, (,! ~ \..i,


(d) \\111at is tlie relativc error of the solution obtained in pc\rt (C) '? c·: ,(2 i\1arl-;,;;

~'1: ->:00.243 I 1.J~23 0291' -T--OA~23 --1' 0:789T1=24S--j'- 23-i(i-:


'j " '_..LJ_"~_~,'I,
~f(v) 0.8153 ,_ ! 0.8918 1.5877
'I
I 2.1087
\
i -4J3583! 12.1478 i 58~0-7-!t'1
._.,-

}'_~)(,- .......ca) USil1g nonlinear 1eClc;t square fitting, find a 3rd degree polynorniaJ and use it .~()
Y,'y Y_,;) estimate f{o.5). j (6lVbl'k"')
,,) (b) T'·.r d d' . 1 d~fe.f,V.l
-r(/~
.Jsmg lon,\,U1" 1\'1(,(; 1 'crenCC,1l1C
f- 1 a Y_TO d c£ree J1ltC1VO
. J',atmg po 1 . 1
)'1101111,L
. •...•... -",-."",._~..~-. ~~-"'-
and use it to estimcttef(O.5). \'.", ',j C "I)" .){(.
('J) (() Mar"")
c(~ ,,C c) Given the true VahlE f(O. 5) =2.5125, calculate the relative enor in both case~,
~ zmd identify which method lS Inore accurate. ~" (3 \1 arb!

) I j
,
!::. .,- s!! r,.,} -j- "') (S-\ ):\ ' i::' f
-. \' '. S- - I" ; - ~.\
: ..' . ~ 'I ~ ..
:~,:~..-:'"~.~!~.h~~_~.~!!!R"2'_"!::..,~lQl2:~~":':-.,-~~-~""':":-"'?_""---=_!:..--=--~.'!~
...---'.' '~_·""--"-'-""'i.· •.....
;j ,J:'/::W.'1, Foil
,. :!(){)')
, ') J\ \)

-J:... _ • 1-.

--------.- --. --~~


---- ---
./1 ,Al-Fateh University
EleiCtHt'£
·";~!;i;~;\?F~;~t¥,"~·,;~tj!5;';;;fi;7i ·~ll,~~~~E~~pj~f,&i~A~~~gi.R~p;cftrm(;Bt.t~~~;{~~'f.;:~j#k
.EE 303 Num~ri8al Tcchniq~e~Clfi.9-_tf5?-r<Y"f1:1'~i5, .' . . . , .' ..
_______________ Q_u_l_z._D_~_:~_::1_b_er_2_4_,_20_0_8_, _"__ . ····;·;H,,·
"Answcr nn'''' two C)l1csti011Sto the best ofyot::' knowledge. Time allowed:2, hOlies
Ql- Givcn (l m<1trix of the form Ax=h where
I :~.:WOO -1.0500 2.0530] . 1-2.2/14°]
A = l4.2656 -1.3997 2.7000, c = -3.064·5
--0.0830 -0.03'10 1.0470 2.0750

(a) Write Zl c/c++ code for dynamic memory 3:1ocation for any matrix A of type float with
columns =m and rOW5=n. (1 Mark)
Cb) \Vrite two MatlCib. commands for finding :he condition number of matrix A. (1 Mark)
~c) Write the formula for the Eigen values of ~.;atrix A(do notfind the values). (2 Marks)
,//'Cd) Using two methods outlined in class, sho· ....that the matrix is ill-conditioned. (6 Marks)

.¥ Q2- For the Following data " 1"

1.2 1.8 2.5 3.6 --I 1 ",' /~ _ ,'1.,x {)


4-:'" .,,','2.847 1.680 0.039 0.0045 i 3
(j.'Y'
~~~r . .
O\..'OtJ~{a) Write <l MZltbb. Comm,mcl for fitting a pc~:.llomi"l of3rd degree ::me! for evaluating the same
N\.~\.(,.' \ polynomial at X= 2.'0. (2 Marks) .
(b) Write a Lagrange interpolation polynomi=.l that interpolates the given data and used it tp _
' estimate Al.5) andf(2.0). .. (4 Marks)

.
v.
6~ ,( Compare'yoiIr

)f.
""",
Q3- Write down the"divid1e difference
---
results 'v',nth 3rd degree Nc;:·Unear Least Square ,·"echod.
,
(4 Marks)

table j'J( eX / using the va\~.2.S.J .-' '('.. \") l 0-\ Q

/J
>J j -'i '-;:;./ ~''-;-. :;Hc'
(..<>-<)1""""' ' ....
/'/'
'
\ I i _.iiJJ ,: \i - 'r'
, -
r I' 0 0\

"c:J' z,:,/ (-;......~>'.'., ';'


.;( •.!. x)
11'\'

,,'
,~~ v •
"
-' .~ : \ Df.C"-".T \... t-;r ~
j
It- 6 \\~,\ L
"':5''''-1J
.
tv 'I
~J
;..
~

(2) Find the fi.rst 3 parameters of the fitting r::c1ynomial of the form:
"····p"cC~):= ao, +'L:f=l ai Di=o(x - Xi)
"....'.."1:.'.-. ;'"
Cb) Estimate el~Z/ using
i-Cubic interpolator with Xo := 0.0
2-Cubic interpolator \ovitl1 Xo := 0.4 ;./"
vVhirh gives Z1 hcttcr estimJtc'?

I / .;' -)
'\~)0-X\ /-~
UJJ (Yl
o ,N . 1) . D f ()Jtn-G·k i oJ
I. 1.-
[ ~+-ed

t iwtcd€ e
L-":J ~d ~0J'

([) C.t.t-h IL- Int t>( r c :lJ;'o}~'

C tti~ e:/J I

0- 261

"
~
f
-_._ \?() -=:. \

'F~--I~
. .....

s·' 6 g "I C\ \

C-' =- ':]. u S /

You might also like