Uploaded by piceratops314

Numerical methods final

advertisement
ChEn 42O1
Spring 2005
Numerical methods in ChEn applications
Final Examination
This is a closed-book examination; two 8f" x 11" sheets of paper with hand-written notes on
both sides are allowed. Read all questions carefully; answer them concisely and neatly. Show all
work on these pages. Point va,iues in the left-hand margins a.re based on 100 points tota,i for the
exam.
Please print your name and section number as indicated below and on the last
page; sign f other pages.
Name:
Section:
5 pts
1. Please state the soivability of each of the systems listed below and justify your answer. You
need not describe how to solve the svstem nor actuallv solve it.
( "| )o -3l l l : : l : | , ; ]
5olJl;ar
:)
o
r ul _ o io i
lz
\ : , -? , \
cl'e-feY""t;*"trtt'
Check
f
-'7 +o
= 6r I
eYisls
l;;l:l,ll
-L
(-o,;O,f
l=
t
O ,
1--L--O ,ch(L=
t,
,
-t '^ , f l . , u ^
tn,"'1 m'ttittt/ '<ttuie5
l
i
Q
y
.
a
{
i
a.{:<
"4tkn4
v e c l o , r 6 e n f a i n g/'''. \
or^4 is utai1u<-
=)
2r -2y : I
-0.52 + 0.5u: -0.25
U.1'
t$hs
t-..r- Ll => Klt
| ; ^t" 1
1 vton^Ilol
<o('ttraa Ao<s d
<v;tf
f3!e
6ealaias l'ul<.|+s
--O
buf
,
h1o'^ , alzl fi
.n ,b .l -rl . F1uJ,ns
bolfo-.
)y
v J Q - m,, l+';p
;{
.nln,.s
is
-=)
3al4ian exisls brl
on|;)'enl;cal
(5"t"e-
l; c'e 1
no|
1
"J .^,i ,*?v e_-_ (, a h o
,l $l;5)
15 pts 2. The following questionsrefer to the Gauss-Seideliterative method for solving the linear
alsebraicoroblem Az = b.
(a) What is a sufrcient condition for the Gauss-Seidel method to converge? (Please be
mathematicallyexplicit.)
ff s"&;c;.nt| , bol
fo
It^e- ,Ae'liJ
.
)"wi
I
h',.4+
)
ho+^ece-s@(Y, (ondif;au" (.,'
{aat S i5 ol in6o^a((7
cot\s'er'VL is
I
h q w'c lY
l
,
I
tL'4 T
.
t
I 1 t , rI 1 1
g--
(,.
)
(b) Doesviolation of this criterion meanthat the Gauss-Seidel
methodwill not work? Briefly
explain.
(envct'6xca
'
raJi|;e4 . r's 2'{ necessarY
I
No , ft,;t
'/;ola-l<4'
yy-a{ ac.uY "-uin;6 '{-;s
I
(c) Is convergenceguaranteed for the following form of 4? Why or why not?
f "t ,
" | -a, -z1
=
-0.5
L 0.25
l
(d) Is convergenceguaranteed for the following form of{
f ro -r 5
ls
t
.
z+&n t ^qnT
Ai < Xo^"lly
t
Why or why not?
o I
34 L2 -2J I
1
L
a, _: ll o
I 5 o . a sI 3
3 I
f o.r o.s -t
fu".
ii
A
n+
I
di<i, clo^;..qnl,'
ron,u2 Jirl<les
t^
6orJ i{,>rn
(q\
-
(e) Is convergenceguara,nteedfor the following form of 4? Why or why not?
.:lI ;' :;'j, ! | ';:^^:^"i,
f
-10
I o
2
o
o
o I
o
o
2
-Lo)
t
ie.>,tinanlr.
(f) Please write out the formulas needed to solve 4q: ! for the following case using the
Gauss-Seidelmethod. You need not actually attempt to solve.
-2 rl
f
+
. , 4 : 1 0 . 2 5- 0 . 5 0 l
l
2 -rJ
t
L 0
'l
|
-6 : | -'0 |
L l
, ,V'"\, lt<.^
-ith
JI<t4;,-7
..:.^:f,o(Xu"'-, .-,
,,v).a-fc
:
o';;it,,:!*;:"','
^riIi:?r":";;^'
I^;,'iu!
Yit't*''
-*
- t'l i
tit*.'
o'J
bi ji,,
?
=t
{'
qii
(or
l t"',9 1 a , l i c o ( "r
xl
(vtt)
/(+r)
x;
.{rc*''t
(45?-)
r - (
-zY-{*\ t xr'"' )
-1
rp+r)
l
,
( 0.25
+o . x | l )
-, 6r+t)
:
- D.5
^
- t - ( o x,("*t)+ l l z
Cr+t; t
)
- l
1 * zx{"')
L
P;to'd"t ^<-l+ol
slve A' Cx) = O , ;+c"'{<
v
To
15pts 3. solotionofnonlinearequations.
:
va'^t
V
cv+t) -dq
*
f&(")
(a) Set up Picard's iterative method to solve for roots of the following equations. You need
not attempt to actually solve the equations.
l
tB - e-' :0
.?
y(r+r)
=
y&\
-a(r)
u (X(-t)--(_
s(a)-t-0
y(") rV.:xcv)\-Xr=)
- n ( t z + )=
)
0
l1r.
I nl+3n1n2+Ll
R ( n \= |
3r?-x,
l=0
L " 3 j " o " l' -'
y/r<+r)
:)
=
lGt
y rckf) ,-r
t
BCF(F))
+|
r3xfF)xio
y,cr)rcy(r))z
-l-t*)
=
*
*.ro,)
&.*r 1c1")t
= "5-1 t1Xrt")3- cosx'(K)
XrG'')
(b) Set up Newton'smethodto solvefor roots of the followingequation. You neednot
attemptto actuaJlysolvethe equation.
f (r) = *5 - aa+ 4r - 12
.112+t)
vrr<) -
rsn) =
V
yCr)
Y '
=)
4 ( x G ) r/ 0t t (' x'r r )
u
y{raf - X,v)'{ rLJ{o
@
(c) Outline the application of the Newton*Raphsonmethod to solvethe generalnonlinea,r
vector equation li(d : 0.
4Iu(s5 t L'-'
Cl^ oolz in;h'qI
-t
lY t':
U,1)"12 i+e'r't+;"e
(xG')
J
d
CKrr) --
_1't
* ,
(r+r)
u^l;l tg(>(k"t)l <t,
Ll'141'<-
o ^ 4 l 5 r ' . ' ' ) 1 1 €z
(d) Show the form of the Jacobian matrix you would need to apply the Newton-Raphson
method to the foliowine eouation.
R(q):
I q-',l+t I
I rl-"1-xsI
I rrz"a-sinor I
f
w i 'u
. -
Tl
-
'u6rj
4-
- 3y-t
Zt'r
- Zfz
x l - (-oSf',
-t
t ./ x r Y j?
-lZ
10 pts 4. The Net PresentValue (NPV) of a financia,lproject is definedas,
N
NPV(r) = t
.
"i
?i0+r)i
where the yearly periods of the project are denoted by i, N representsthe total lifetime of
the project, Ci is the cash flow to the companyin year i, and r is the rate of return for the
project.
The Discounted Cash Flow R^a,teof Return (DCFRR) is defined as the rate of return r* at
which the Net Present Value is exactly zero. Consider that i, N, and all Ci are knovrn. Your
task is to find the DCFRR for theseconditions.
(a) Set up an approachto solvethis problem.
i. List the mathemati.calunknown(s)..
aFev<-
it
*\<
x'.
onKhow4 ) Y
ii. Write out the equation(s) to be solved.
\
r--
/
|
O = tr -'./(r+r{,)'
iii. What type of mathematicalproblem is this?
Nonhne^ndncbv<ic
(b) Set up the best method to solvethis problem. Pleasefully explain your reasoningand
show all neededformulas.
U*-
N.a\wfs
w',zlho4
+..
gol'te-
r Q\
u 44k
-,f Cv+\ o '
t- h,,*-
i n i I tal
nt/
ets
e
C-l
w h u n l { 6 " r r " r ; lz t
L I . L
.-------:-1,
( t t - v1 '
rfAan
f-<-.n//
utt
T
+|
rY =Y(rrt)
140n'br
5 pts
5. PleasefilI in the 10 empty bla.nksin the following tables. Each is worth 1/2 point. Use the
following nomenclature:
n
p
k
ft.
Matrix dimension
Half-bandwidth of matrix (fu1lbandwidth : 2p + 1)
Iterations neededfor iterative solution
Time step sizefor integration method
(a) Linear algebraicequationsolution methods.
GaussianElimination (LU decomposition
Full Matrix
Storage (Words)
Elimination (operations, to leading order
Back Substitution (operations, to leading order
Gauss-Seidelmethod
n"
nt,/a
n(2p+ 1
n z/ z
_ znp
F\rll Matrix
k-mz
(b) ODE integration methods.
Global error,
Stability limit q,
to leadingorder
0<.\h<q
Explicit methods
Euler
1
Fourth-order Runee-Kutta
h' l
Implicit methods
Backwa.rd Euler
Tlapezoid
2 nPz
Band Matrix
n(2p+ 1l
Storage (Words
Solution after k iterations (operations,to leading order
Method
Band Matrix
(without pivoting)
z
x z. t 6i)
l^
<zO
hz
oo
- 2knp
15 pts 6. Consider the following second-orderdifferentia,l equation:
d'a,^du,,
7 F+ g f r * 2 Y : s
(a) Cast this equation in the form of two first-order difierential equations, in terms of 3r1: y
^ d y z : 4at '
(b) For the system of equations that you found in (a) determine the steady state and char'
acterizeits stability (and type).
rF.+< =)
Jtz^s,y
#=O
= ) Y , ,= o , ' l z , = o
JhA;lily
/'*7ern&eon
I
-L
3-^
|
L- z -JLyC
e'ina^vq0te-5
--o
>c-3-\) + 2 = o
Xz {- 3\
l"
L,o.t
tlfY,iJ=
f - o -s
u'
'l
IA-x!-l--o
( , h z "%
z '-Ay) +
-x
+
v 7
( x + z ) (X + r )
- Q
=O
+
t r , =- -Zl
f' =
sk^Al
is
sll
4
7l"ble- v\od( '
r:!
(c) Make a rough sketdr of the steady state and somerepresentativetrajectories in the phase
olane.
q{-tr*rr-sh+e
5alt^,|s
f rt.\ e#rags 'rl+
N<tn*
t
o*v"M
)-s'
(d) Show how you would solve these equations using the explicit Euler method. Pleasedo
nto attempt to artually solve.
€;r^^
{/;)
r h/
,
= y:
v...
I
u
f
frrr
-1
i*a^"ks
^v'J'
i^Aey
5l?rl
sl-ep
lt4.n.
o(
::r
. " ' L ' z v <h ' r r
r
,gAvwk.r.
ti'".-e' 5te'
-f:
t,.
t,
L
*i
) ;.,=* i
[_".:r]
=
'lt' ; + hYz)\
)tri*'
:
: - h ( z y n , i* 3 y r , t )
t ' fz r i r r
(e) What is the maximum step size that you would use for integrating the equations in the
vicinityof thesteady
stateusingtheExplicitEulermethod?
o a h l \ ; l ' " x< 2
y r a b l o - l, \, ; [ , - . " = /
w\zv z \r"ffrftrfifr
) fu'lh'"
>
=)
ht-l*
15 pts 7. Considerthe following boundary value problem:
"**
ar'
((\'
\o,r /
akcs/2:s
with the following boundary conditions,
d",
:AT- 1 . = o =
c(n: t) :
-r1c-l)l':0,
1'
D, k, and P are constants.We wish to solvethis equation.usingthe finite differencemethod
(over a mesh of n equally spacednodes and with consistent centered-differenceformulas) a.nd
the Newton-Raphsonmethod.
(a) Show the form of the residual equations for this problem. Clea,rly show how these are
C,'r-t
Cd Ci
Ctobtained.
{',n,lc. d1;lftn^ca^'lhA
hpvty
'
AY?Yi1,-r'
)
+-
-2c:
R ; ( e)
Fon i --2, '-1^-,1
a odeS)
(;^+eni"
t-c;-t
,.L
Ci+, -ci-' \
l
)
2zrx
/
t
\
7lz
rkci
i -- 1'\ )
fo.
l..'vlto"1'd<-,
f " . ; - - l l
Co
I
I
R,c, )
t ^ . nt ' , l e -
(te(4
26n '.f
(
r
,
P
C 7 - C o
x=c-r =/ )
J<z-
X1
{o
?-6x
f
D lL
Q* c- '
5''bst;t'4<
F;*tly
CL-Zct
-)
L)
-- ' )'Pav(cc-t) *cz
Co
t
^.YZ
Rlce)= , f ,.;4.t-:2P"Yl:!t)
A'\
l
10
L
+ (rC'"-')) *h'(.f''
i
(b) Show the specific form of the Jacobian matrix for this problem.
J;; 'O
l
vlt
D(-z* Zl-l * zf(rn-t\ + ZkeJz
-
Ax.Z
2D
u12
D
->l<'
.i_
-
--
f
t,'-l
1
. .
lJl
Y. ..
vt)ltl
dnln
Gllat":"1 en[t;es ,
&
4rc4d
=
=
-2D
p
axz
Ci+1-Ct-1
2 axz
?
v^
0 ^ n t L
? ^ri
g 1 * , - C i t-zF
L
11
15 pts 8. You desire to solve the following, nonlinea,rboundary value problem,
*AT' * ' *AT: o
with the following boundary conditions,
d(o) :
d(1) :
6'
1,
via the methodof weightedresiduals.To do this, we will constructan approximate
solution
using a simple polynomial expansion that
'automatica.lly
0(r) x 0(r) : " + i
satiSfiesthe boundary conditions,
or(ri+l- r).
d=1
Pleasecomputean approximatesolution to this BVP using n : 1 and collocationat n:
Pleaseexplain your approach and show all formulas.
h=l +
Ll2.
6 t * ) - - x + - < ,( x z - x )
4dX >
r'
colloc^I;o^ nJ x= l/z'
u't^7
(<s;av1l zV'nl;"n ,
W<I7AJJ
u
'sc"-'">
& + a l d \ a n =D
1
f
4)< J
)xx(
) ,"bst;4"4c{'*'
ab't€
'
--o
\
(z ^" ' -l x + 1 , ( * ' - { [ t * 2 " { , x 2 " 1 ,+
"('l' / r\,
' ' l l Y * / ' -r{J
t
z
f + t #' 1d ' - 5 ^ r J ,
Lz
t
l
z
o
r
r
\
Z
17
- O
+'
-l
*1 ^ r
z
4,=-+(L)
12
':./;
=
I
-
z ^-
7
-t
(extra spacefor problem 8.)
5"r
5 pts
z
-
J
(*'-n)
9. Indicate the beslmethod (from the list below) to solvethe following equations. Each is worth
| /2 point.
, . ..-"4"*Ga:assia'n-di,minaiion
B. Gatss-Seidel rnethod
C. Picard's method
D. Newton-Raphson method
E. Para,metric continuation (with Newton-Rephson method)
F. Runge-Kutta method
G. Implicit Euler method
H. Finite Difierencemethod
I. Method of Lines
J. Linear Least Squaresregression
(')
a
4:s
D is a very la,rge,diagonally-dominant matrix; q is constant.
& ) J
aa
Find the valuesof o and B that best fit this relationshipto a set of data points (za,g.1).
(c)
o
du
E:I\ut)
w : a at, t : b. lt is expected that components of tu exhibit widely disparate times
scalesin their behavior.
(d) H
d,2u d,u
-;=
* -; +u'u"
dz'
dz
d,2u d,u
-.;-= dz.
--f
d,z
d,u
1.1-;
d,z
= U
=
du
-o,n :
u :
o :
d,u
iafr :
(e)
C
g
0, atz=0
L, atz:L
0, atz:0
- u , a t 'z : 1
pk):0
f is a complicated nonlinear function whosederivatives axenot easily found and can be
discontinuous.
(f)
F
&u
d,u
-:-= t --+u'r"
, -.dzz -dz
d,'1J d;u
d,u
-;-; - -:- *o-;
'nz.
0,2
tlz
= U
=
d,u
ia:x =
u =
u :
d,u
-o,r :
14
g
0' atz:0
I, atz:O
0, atz:O
0 ' a tz = O
(e)
T
0a = d'u
+a'
;;
oz'
at
6a :
0, atz:O
dz
a
-
1
u =
^ + - - 1
0, att:0
A
(h)
:
:
0.3or* 8cz* Ats :
rt*2rz-1xs
-2nt-4rz-1rs
0
1
-3
D
(i)
n1I2x2-1as :
-2r1- 4x2- \ns :
0.32r+ 8aal4r1t:s
:
0
I
-3
E
(i)
iD(r;p) : g
for0(p<2.
(Dis a nonlinearfunction.
Name:
Section:
Please do not write below this line,
L.
7.
15
2.
/10
o.
/15
8.
3.
/15
lr
9.
Total
/100
IO
lr5
/5
Download