Sie sind auf Seite 1von 2

DREXEL UNIVERSITY

Department of Mechanical Engineering & Mechanics


Applied Engineering Analytical & Numerical Methods I
MEM 501/591 - Fall 2010
HOMEWORK #7: Due Thursday, November 18



1. [40 points]
i) Verify the divergence theorem using the vector field F

= 4x t -2y
2
+z
2
k

, if the enclosed surface is


the cylinder x
2
+y
2
= 4 between z = u and z = S.
ii)Verify Stoke's theorem when the vector field is F

= x
2
t +2x +z
2
k

and the closed curve is the plane


with vertices (u,u,S), (1,u,S), (1,1,S) and (u,1,S).
(Hint: Compute separately the left hand side and right hind side of the theorems to validate them).



2. [40 points]
For the function = c
x
(cos (nx)) and points |x
]
|
]=0
n
={u,1,2]
i) Write the Newton form of the polynomial p
2
e J
2
that interpolates at points |x
]
|
]=0
n
.
ii) Write the Lagrange form of the polynomial p
2
e J
2
that interpolates at points |x
]
|
]=0
n
.



3. [20 points]
Consider the function = sin (4ux) and points |x
]
|
]=0
n
in the interval |u,1]. Write a subroutine in
MATLAB that:
i) Computes the n basis monomials m(x) and plots them.
ii) Yields an approximation to the given function by computing the c
]
coefficients such that
p
n
(x) = y = c
]
n
]=0
m(x).
Use this code to show the results of interpolation for n = 1u.
(Hint: Write a subroutine that constructs the Vandermode matrix given an input vector and modify the
following code to get results)









f unct i on [ mj , cj ] =hw7pr obl em3( N) ;

f i gur e( 1) , cl f
xx = l i nspace( 0, 1, 300) ' ; %f i ne gr i d f or pl ot t i ng
x = l i nspace( 0, 1, N+1) ' ; %gr i d poi nt s, x( j +1) = j / N = x_j
yexact =f ( xx) ; %f unct i on t o be i nt er pol at ed
yappr ox=f ( x) ; %f ( xj )

%const r uct n=N+1 monomi al s mj

f or . . .
.
subpl ot ( 2, 1, 1)
pl ot ( xx, ? , ' k- ' , ' l i newi dt h' , 2) , hol d on
pl ot ( x, zer os( si ze( x) ) , ' k. ' , ' mar ker si ze' , 20)
axi s( [ 0 1 - 0. 1 1. 2] )
set ( gca, ' f ont si ze' , 16)
xl abel ( ' x' ) , yl abel ( ' mj ( x) ' ) , t i t l e( ' Monomi al basi s' )
k=k+1;
end

%Fi nd t he coef f i ci ent s cj i n t he pol ynomi al by sol vi ng t he appr opr i at e l i near syst em
.
.
%Comput e y as def i ned i n t he pr obl emst at ement .

subpl ot ( 2, 1, 2)
pl ot ( xx, yexact , ' b- ' ) , hol d on
pl ot ( x, yappr ox, ' k. ' , ' mar ker si ze' , 20) , hol d on
pl ot ( xx, y, ' xr ' )
set ( gca, ' f ont si ze' , 13)
xl abel ( ' x' ) , yl abel ( ' f ( x_j ) =p( x_j ) ' ) , t i t l e( [ ' I nt er pol at i on usi ng Monomi al s wi t h N=' num2st r ( N) ] )

Das könnte Ihnen auch gefallen