hw4 Soln
hw4 Soln
Problem 1
Consider the following kinetic sequence:
k1 k
A−
↽−
−⇀ 2
− B −→ C (1)
k−1
(a) Write the set of coupled differential equations which describe the concentrations of A, B, and C for this
sequence assuming these are elementary reactions. Write the set of equations into a matrix-vector form.
(b) Put the system into dimensionless form using the following variables:
k−1 k1
x = A/A0 ; y = B/A0 ; z = C/A0 ; τ = k2 t; λ= ; ϵ= (2)
k1 k2
and solve explicitly for x(τ ), y(τ ), and z(τ ) assuming all rate constants are positive. Note that the initial
conditions are A(t = 0) = A0 and y(0) = z(0) = 0. Hint: Once you solve for the eigenvalues of the resulting
matrix system, you may leave your solution in terms of those eigenvalues r1 , r2 , r3 . You may find that
defining the parameter ν = ϵλ + ϵ + 1 is convenient.
(c) Plot y(τ ) for x(τ = 0) = 1, ϵ = 0.1, with λ being set to λ = 0.1, 1, 10. Your plot should have three
curves. Note that λ → 0 is the case with A → B being irreversible, identical to the case we worked out in
class. Comment on the effect of this reaction being reversible.
Solution
dA
= −k1 + k−1 B (3)
dt
dB
= k1 − k−1 B − k2 B (4)
dt
dC
= k2 B (5)
dt
or, in matrix-vector form, dA
dt −k1 k−1 0 A
dB = k1 −k−1 − k2 0 B (6)
dt
dC 0 k2 0 C
dt
1
Our next step is to find the eigenvalues of the above matrix. Since λ is already taken, we’ll denote the
eigenvalues as w. We find the eigenvalues by finding the roots of
−ϵ − w ϵλ 0
ϵ −(1 + ϵλ) − w 0 =0 (11)
0 1 −w
(−ϵ − w)(−(1 + ϵλ) − w)w − ϵλ(−wϵ) = 0 (12)
2
w(−(w + ϵ)(w + ϵλ + 1) + ϵ λ) = 0 (13)
2
w(w + (ϵ + ϵλ + 1)w + ϵ) = 0 (14)
2
w(w + νw + ϵ) = 0 (15)
0 β11
−ϵ ϵλ 0 0
ϵ −(1 + ϵλ) 0 β21 = 0 ⇒ β (1) = 0 (17)
0 1 0 β31 0 1
√
−ν+ ν 2 −4ϵ
For the second eigenvalue, w2 = 2 ,
ϵλ
2
−ϵ − w2 ϵλ 0 β1 0 ϵ+w2
ϵ −(1 + ϵλ) − w2 0 β22 = 0 ⇒ β (2) = 1 (18)
0 1 −w2 β32 0 1/w2
√
−ν− ν 2 −4ϵ
And for the final eigenvalue, w3 = 2 ,
ϵλ
3
−ϵ − w3 ϵλ 0 β1 0 ϵ+w3
ϵ −(1 + ϵλ) − w3 0 β23 = 0 ⇒ β (3) = 1 (19)
0 1 −w3 β33 0 1/w3
Now we solve for the unknown constants A, B, C using the initial conditions:
ϵλ ϵλ
1 0 ϵ+w2 ϵ+w3
0 = A 0 + B 1 + C 1 (21)
1 1 1/w2 1/w3
(ϵ + w2 )(ϵ + w3 )
A=− (22)
w2 w3 ϵλ
(ϵ + w2 )(ϵ + w3 )
B= (23)
ϵλ(w3 − w2 )
(ϵ + w2 )(ϵ + w3 )
C= (24)
ϵλ(w2 − w3 )
2
So then the final solution is given as
ϵλ ϵλ
x 0 ϵ+w
(ϵ + w2 )(ϵ + w3 ) (ϵ + w2 )(ϵ + w3 ) w2 τ 2 (ϵ + w2 )(ϵ + w3 ) w3 τ ϵ+w3
x = y = − 0 + e 1 + e 1
w2 w3 ϵλ ϵλ(w3 − w2 ) ϵλ(w2 − w3 )
z 1 1/w2 1/w3
(25)
The final task is to plot the solution y(τ ) with the given parameters and λ varying from 0.1 to 10.0. The
plot is given below in Figure 1. Favoring the reversal of B back to A (i.e., λ > 1) results in a significant
reduction in both the peak concentration of B and the timescale in which B is converted irreversible to C.
0.08 = 0.1
= 1.0
y( ) / dimensionless
0.06 = 10.0
0.04
0.02
0.00
0 5 10 15 20
/ dimensionless
Figure 1: Solution to the ODE, y(τ ), as a function of λ for ϵ = 0.1 and x(τ = 0) = 1.
3
Problem 2
(a) In class, we developed the framework for a generalized Fourier series expansion of functions. Using your
own words, explain how and why any function can be written as a sum of e.g. sin functions.
Solution
Answers will vary, but should contain some element of:
• Functions can be thought of as being a vector belonging to a particular vector space, e.g. L2 (0, 1).
• A set of n vectors that are linearly independent form a basis for a vector space of dimension n.
• The vector space of functions, L2 (a, b) is of infinite dimension, meaning we need an infinite sum of
linearly independent vectors.
• One such example is the set of vectors u(i) = sin(iπx) for i = 1, 2, 3, ...
• Then any function f (x) ∈ L2 (a, b) can be written as a linear combination of these vectors:
∞
X
f (x) = An sin(nπx) (26)
n=1
Solution
The biggest hurdle with this problem is determining the coefficients An . We can do this by solving the
inner product:
(f (x), sin(nπx)
An = (27)
(sin(nπx), sin(nπx))
We’ll start with the numerator first.
Z 1
(f (x), sin(nπx)) = x sin(nπx)dx (28)
−1
1
sin(nπx) − πnx cos(nπx)
= (29)
π 2 n2 −1
−2 cos(nπ)
= (30)
nπ
Noting that cos(nπ) = (−1)n for n = 1, 2, ... we have the numerator,
2
(f (x), sin(nπx)) = (−1)n+1 (31)
nπ
Next we have the normalization, i.e. the denominator,
Z 1
sin(2nπ)
(sin(nπx), sin(nπx)) = sin2 (nπx)dx = 1 − =1 (32)
−1 2nπ
4
Giving us our coefficients,
2
An = (−1)n+1 (33)
nπ
Finally, we just need to write a simple program to plot the results for increasing n. When I plot this in
Python, I get the following:
1.0
0.5
0.0
y
0.5
n=1 n = 100
1.0 n = 10 n = 1000
1.00 0.75 0.50 0.25 0.00 0.25 0.50 0.75 1.00
x
Figure 2: Results of a Fourier sine series approximating y = x for increasing n.
5
For reference, the code needed to produce the above plot is given here:
import matplotlib.pyplot as plt
import numpy as np
def get_series(n,x):
series = np.zeros(1000) # initialize as all zeros
for i in range(n):
j = i+1 # python starts at 0, and we want to start at 1
an = 2.0/(j*np.pi)*(-1)**(j+1)
normalization = 1
series += an*np.sin(j*np.pi*x)/normalization
return series
edge = 0.1
x = np.linspace(-1-edge,1+edge,1000) # just fill a vector from -1 to 1,
# plus a little on the edges
fig = plt.figure(figsize=(5*1.618,5))
plt.plot(x,x,’k-’) # plot y=x
ns = [1,10,100,1000]
for n in ns:
series_approx = get_series(n=n,x=x)
plt.plot(x,series_approx,’--’,label=’$n=%i$’%n)
plt.xlabel(’x’)
plt.ylabel(’y’)
plt.legend(ncol=2)
plt.tight_layout()
plt.show()
(c) Comment on the results of part (b). What is happening near the edges?
Solution
The approximation is increasingly excellent near the interior of the region, but consistently shows some
error near the edge. This phenomenon is known as the ‘Gibbs phenomenon’ – you can read more about it
on Wikipedia.
Problem 3
The dimensionless Schrödinger equation is of the form
where ψ is the wave function and E is the energy state (an eigenvalue). For a particle in a spherical shell
box over 1 ≤ r ≤ 1 + β, let
∞
r < 1 so ψ = 0 at r = 1
U (x) = ∞ r ≥ 1 + β so ψ = 0 at r = 1 + β (35)
0 otherwise
6
Then ψ = ψ(r) and we can define a kinetic energy operator (assuming symmetry in ϕ and θ):
1 d 2 d
− 2 r ψ = Eψ . (36)
r dr dr
Find the normalized ψn (r) and the first five eigenvalues for β = 0.5. Note: write the expression for the
normalization constant, but do not attempt to evaluate the integral.
Solution
We’ve been tasked to solve the eigenvalue problem
1 d d
− 2 r2 ψ = Eψ . (37)
r dr dr
subject to boundary conditions given by the wavefunction ψ vanishing at the edges of the spherical shell box
r = 1, 1 + β,
From our discussion in class of the particle in a spherical box, we know that the eigenfunctions of this
operator are the spherical Bessel functions. Note that the version of the spherical Bessel’s function equation
in the course reader is
x2 y ′′ + 2xy ′ + (λ2 x2 − ν 2 )y = 0 (39)
and the general solutions are the νth order spherical Bessel functions of the first and second kinds, i.e.
To more clearly see the connection, we can rewrite our eigenvalue problem into a similar form by multiplying
both sides by r2 and expanding to yield
sin(x) cos(x)
j0 (x) = , y0 (x) = (43)
x x
Therefore, our eigenfunctions have the form
√ ! √ !
sin( Er) cos( Er)
ψ(r) = A √ +B √ (44)
Er Er
Now, we use the boundary conditions to determine the eigenvalues. We begin with ψ(1) = 0 and solve for
one of the coefficients:
√ ! √ !
sin( E) cos( E)
ψ(1) = 0 = A √ +B √ (45)
E E
√ √
0 = A sin( E) + B cos( E) (46)
√
sin( E) √
B = −A √ = −A tan( E) (47)
cos( E)
7
Now we apply the second boundary condition:
√ ! √ !
sin( E(1 + β)) cos( E(1 + β))
ψ(1 + β) = 0 = A √ +B √ (48)
E(1 + β) E(1 + β)
√ √
0 = A sin( E(1 + β)) + B cos( E(1 + β)) (49)
In order to have non trivial solutions (i.e. A and B not both equal to zero), the determinant And we arrive
at the condition for the eigenvalues. The eigenvalues are energy levels En such that the following condition
holds:
p p
tan( En ) = tan( En (1 + β)) (51)
The normalized eigenfunctions are then given as
√ √
sin( En r) p cos( En r)
ψn (r) = An √ − tan( En ) √ (52)
En r En r
Z 1+β √ √ 2 !−1/2
2 sin( En r) p cos( En r)
An = r √ − tan( En ) √ dr (54)
1 En r En r
which is true when En = (2nπ)2 for n = 1, 2, ..., so these are our first five values for En .
Problem 4
Write an exam level question that covers chapter 2 content, with a solution.
Solution
Answers will vary