5311 Spr 2011
Take home midterm solution
Problem #3, parts (b)-(e)
Write a function to evaluate the Rayleigh quotient
Qu
In[5]:=
:
Integrate x D u, x ^ 2, x, 0, 1
Integrate x u ^ 2, x, 0, 1
Compute Q for the functions x p
When p
0, Q
1
Q xp
0
0 because th
Math 5311 Spring 2011
Take-home midterm solutions
Problem #1, part (b)
Discretize in space with the Fourier sine basis
M ,n ,x
Sin n Pi x ;
x
Piecewise
fx
1, x
1 2,
5 4, x
12
;
1;
Form the mass matrix
M3
Table
Integrate 3, i, x 3, j, x , x, 0, 1
i, 1, 3
Math 5311 Spring 2011
Take-home midterm solutions
Problem #1, part (b)
Discretize in space with Lagrange finite elements
xNode M , n
n
M
1;
M ,n ,x
Piecewise
x xNode M, n 1
xNode M, n 1
x
x
Piecewise
fx
1, x
xNode M, n
xNode M, n
1 2,
xNode M, n 1
1
xNod
Math 5311 Spr 2011 - Midterm take-home exam solutions
Problem #1
Part (a)
N
Assume an approximate solution u ( x, t) = n=1 an (t) n ( x ) . The spatial basis functions n ( x ) are chosen so
that they obey the Dirichlet BCs. The residual is
N
R=
an (t) n (
Math 5311 Midterm review
1. Inhomogeneous BCs
(a) Shifting data
2. Greens functions
(a) Denitions and basic properties:
i. given a BVP you want to solve, nd a BVP that denes the Greens function.
ii. Given a Greens function, how do you solve the original B
Math 5311 Spr 2011 - Midterm exam solutions
1. Solving the BVP
d
du
(x)
= f1 (x)
dx
dx
u (0) = 0
u (1) = 0
by Greens functions.
(a) To obtain the Greens function G ( x, x ) you would need to solve the BVP
dG ( x, x )
d
(x)
= ( x x )
dx
dx
G (0, x ) = 0
Math 5311 Spr 2011 - Homework #1 Solutions
Problem 1
Part (a)
dv W =
d
=
dt
d
W (u + tv)|t=0
dt
1
e(u+vt) d x
1
1
t =0
e(u+vt) v d x
=
1
t =0
1
e(u ) v d x
=
1
Part (b)
d
dv W =
dt
1
u +v t
2
+ (u + vt)2
1
t =0
1
=
v u + vu dx
1
Problem 2
Part (a)
1
u v +