Professional Documents
Culture Documents
ANM Part2 Jan2014
ANM Part2 Jan2014
• If you do part 1 or part 2 only, the allowed time for the exam is 1.5 hours (14:00-15:30).
• If you do both parts, the allowed time for the exam is 3 hours (14:00-17:00).
• On every sheet, clearly state: number of the exercise, your name, your student number.
Part 2 - Question 1
2
f(t) −−>
0
0 2 4 6 8
t −−>
Using Dirichlet’s theorem, the periodic function f (t) sketched above is approximated by a
function
∞
1 X mπt mπt
fˆ(t) = a0 + am cos + bm sin (1)
2 m=1
P P
This is not sufficient by itself, the actual value is asked for. This requires the correct
value for P (period 2P = 4) and the formula for f (t). Alternatively, from the figure we
may read that the integral gives 4, such that a0 = 2.
1
(b) Determine the value of the coefficient b1 .
1 2P
Z
πt
b1 = f (t) sin dt (3)
P 0 P
Insert P = 2 and note that the integral can be restricted to [0, 2] where f (t) = 2:
Z 2 2
1 πt 1 4 πt
b1 = 2 sin dt = − cos (4)
2 0 2 2 π 2 0
2 4
= − (cos(π) − cos(0)) = (5)
π π
Part 2 - Question 2
The pdf of a continuous stochastic variable X is given by:
p(x) = 0 for x ≤ 0
p(x) = ax for 0 < x ≤ 1
(6)
p(x) = a(3 − x)/2 for 1 < x ≤ 3
p(x) = 0 for x > 3
2
(b) What is the probability to find a value of X with 0.5 ≤ X ≤ 1?
Z 1 Z 1 1
2 1 2 1 1 1
P (0.5 ≤ X ≤ 1) = p(x) dx = x dx = x = − = (8)
0.5 0.5 3 3 0.5 3 12 4
Part 2 - Question 3
We are seeking the minimum for the minimum of the function
(c) We are trying to find the minimum through numerical iteration. At iteration k, our
guessed minimum is xk = (1, 1). We proceed to iteration k + 1 by taking a step of
length a = 0.1 in the direction of the steepest descent. Compute xk+1 and show that
φ(xk+1 ) < φ(xk ) and that |γ(xk+1 )| < |γ(xk )|.
3
• Steepest descent direction: p = −γ(xk ) = [4, −10]T .
• Step length 0.1 gives xk+1 = [1.4, 0]T .
• Function values φ(xk ) = 7, φ(xk+1 ) = 3.16, decreasing.
• Gradient at new point γ k+1 = [0.8, −3.6]T .
√ √
• Size of gradient |γ k | = 116, |γ k+1 | = 13.6, decreasing.
Part 2 - Question 4
We wish to compute the heating up of water in a channel, schematized as two-dimensional
flow between two flat plates.
y=H
u(y)
y=0
y=−H
x=0 x=L
(a) You don’t have sufficient information for deciding whether upwind or central differences
are appropriate. Describe which information you need and how you would proceed to
make a choice.
We must know the mesh-Peclet number. For this we need the mesh size ∆x (i.e. L)
and the strength of advection u(y) compared to the strength of diffusion λ/ρcp . We
prefer central differences, but these can be used only if the mesh-Peclet number is low
throughout the domain. Else we must revert to upwind differences.
(b) Formulate the finite difference analogon of equation (16) using upwind differences.
4
Define xm = m · ∆x, m = 0, . . . , 100, and yn = n · ∆y, n = −5, . . . , 5; denote Tm,n ≡
T (xm , yn ) and un ≡ u(yn ).
Tm,n − Tm−1,n
un =
∆x
λ Tm+1,n − 2Tm,n + Tm−1,n Tm,n+1 − 2Tm,n + Tm,n−1
+ (20)
ρcp ∆x2 ∆y 2
un λ un λ λ
− − Tm−1,n + +2 +2 Tm,n
∆x ρcp ∆x2 ∆x ρcp ∆x2 ρcp ∆y 2
λ λ λ
− 2
Tm+1,n − 2
Tm,n−1 − Tm,n+1 = 0 (21)
ρcp ∆x ρcp ∆y ρcp ∆y 2