You are on page 1of 1

Partial Differential Equations: Exercise Set 7

1. Use pdepe to solve the heat equation ut = uxx on x > 0 and t > 0 with
boundary condition u(0, t) = sin t and initial condition u(x, 0) = 0,
and find the value of u(1, 1). (Hint: apply the boundary condition
ux (b, t) = 0, and choose an appropriately large value of b.)

2. In exercise set 2 problem 5 you derived the model for the temperature
u(r, t) in a cylinder with a thin layer of insulation on its surface:

ut = kr−1 (rur )r , ur (0, t) = 0, ur (R, t) + α(u(R, t) − T ) = 0

Solve the problem using pdepe with parameter values R = 1, α = 1,


T = 1, k = 1, and initial condition u(r, 0) = 0. Plot the temperature
at the centre u(0, t) for 0 ≤ t ≤ 4.

3. How much should you pay today for the right to buy a stock at a given
price K at a given time in the future? The Black-Scholes equation for
the fair price y(x, t) of such a “European call option” is

yt = 12 σ 2 yxx + (r − 21 σ 2 )yx − ry

where x = ln(S) (the logarithm of the stock price), t is the time re-
maining until the option can be exercised, r is the interest rate, and
σ is the volatility of the stock price. At maturity the option’s value
is y(x, 0) = max(S − K, 0), because you won’t exercise the option if
K > S. Also, y ≈ 0 for S  K and y ≈ S − Ke−rt for S  K.
Use pdepe to compute the option value y(x, t) when S = 100, t = 1,
σ = 0.2, r = 0.1, and K = 100. Compare the numerical solution with
the exact solution

y(x, t) = ex N(d1 ) − Ke−rt N(d2 ),

where
ln(S/K) + (r + 21 σ 2 )t √
d1 = √ , d2 = d1 − σ t,
σ t
and N is the standard normal cumulative distribution function
1 1 √
N(d) = + erf(d/ 2).
2 2

Answers
1. u(1, 1) ≈ 0.26 3. y(ln(100), 1) = 13.27

You might also like