Test 3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Wednesday, 06 May 2020

14:30 – 17:30 (BST)

EXAMINATION FOR THE DEGREES OF B.SC. (DESIGNATED AND


HONOURS), M.SCI. (HONOURS) AND M.SC.

[ PHYS4017 ]

Numerical Methods

Candidates should answer Question 1 (16 marks)


and either Question 2A or Question 2B (24 marks each)

This paper is being taken remotely as an ‘open-book’ examination.


Upload your answer to each question as a separate pdf file.
Approximate marks are indicated in brackets as a guide for candidates.

PHYS4017 Numerical Methods


Fundamental constants Derived units

name symbol value quantity dimensions∗ derived unit


speed of light c 2.998 × 108 m s−1 energy M L2 T −2 J
permeability of free space µ0 4π × 10−7 H m−1 force M LT −2 N
permittivity of free space 0 8.854 × 10−12 F m−1 frequency T −1 Hz
electronic charge e 1.602 × 10−19 C gravitational field strength LT −2 N kg−1
Avogadro’s number N0 6.022 × 1023 mol−1 gravitational potential L2 T −2 J kg−1
electron rest mass me 9.110 × 10−31 kg power M L2 T −3 W
proton rest mass mp 1.673 × 10−27 kg entropy M L2 T −2 J K−1
neutron rest mass mn 1.675 × 10−27 kg heat M L2 T −2 J
Faraday’s constant F 9.649 × 10−4 C mol−1 capacitance M −1 L−2 T 4 I 2 F
Planck’s constant h 6.626 × 10−34 J s charge IT C
fine structure constant α 7.297 × 10−3 current I A
electron charge to mass ratio e/me 1.759 × 1011 C kg−1 electric dipole moment LT I Cm
quantum/charge ratio h/e 4.136 × 10−15 J s C−1 electric displacement L−2 T I C m−2
electron Compton wavelength λe 2.426 × 10−12 m electric polarisation L−2 T I C m−2
proton Compton wavelength λp 1.321 × 10−15 m electric field strength M LT −3 I −1 V m−1
Rydberg constant R 1.097 × 107 m−1 electric (displacement) flux TI C
Bohr radius a0 5.292 × 10−11 m electric potential M L2 T −3 I −1 V
Bohr magneton µB 9.274 × 10−24 J T−1 inductance M L2 T −2 I −2 H
nuclear magneton µN 5.051 × 10−27 J T−1 magnetic dipole moment L2 I A m2
proton magnetic moment µp 1.411 × 10−26 J T−1 magnetic field strength L−1 I A m−1
universal gas constant R 8.314 J K−1 mol−1 magnetic flux M L2 T −2 I −1 Wb
normal volume of ideal gas – 2.241 × 10−2 m3 mol−1 magnetic induction M T −2 I −1 T
Boltzmann constant kB 1.381 × 10−23 J K−1 magnetisation L−1 I A m−1
First radiation constant 2πhc2 c1 3.742 × 10−16 W m2 permeability M LT −2 I −2 H m−1
Second Radiation constant hc/kB c2 1.439 × 10−2 m K permittivity M −1 L−3 T 4 I 2 F m−1
Wien displacement constant b 2.898 × 10−3 m K resistance M L2 T −3 I −2 Ω
Stefan-Boltzmann constant σ 5.670 × 10−8 W m−2 K−4 resistivity M L3 T −3 I −2 Ωm
gravitational constant G 6.673 × 10−11 m3 kg−1 s−2

impedance of free space Z0 3.767 × 102 Ω M = mass, L = length, T = time, I = current
1 (a) The golden section method can be used to find the local extremum of √
a
−1+ 5
unimodal function f (x) on an interval [a, b]. It uses the factor r = 2 ,
where r + r2 = 1, to reduce the size of the interval at each iteration.

Explain how this method can be used to find the maximum of a unimodal
function f (x) on an interval [a, b]. [4]

(b) Consider the function f (x) = 2x3 − 9x2 + 12x on the interval [0, 2]. Apply
two iterations of the golden section method to find a smaller interval where
the maximum of that function lies. [4]

(c) Consider the differential equation dy


dt = 4y. The initial value is y(0) = 1.
Use a single step of the midpoint method to estimate the value of y at t = 0.2. [4]

(d) The Butcher tableau for the RK4 method is:

i ci ai,1 ai,2 ai,3 bi


1 0 1/6

2 1/2 1/2 1/3

3 1/2 0 1/2 1/3

4 1 0 0 1 1/6

Imagine you are integrating a quantity u with respect to time. u has the
value un at timepoint n. Its derivative at time tn can be computed as f (tn , un ).
With the help of the Butcher tableau, write out the equations used by the RK4
method to determine the value un+1 (i.e. at time tn + h). [4]

PHYS4017 Numerical Methods 3/6 Paper continued over. . .


2A (a) Explain in detail how the trapezium rule works to perform numerical
integration of a continuous function on an interval [a, b]. [4]
Z 1 −1
(b) Calculate by hand 1 + x2 dx by the trapezium rule, using six
0
points. You must write out all the steps in your answer.

Hence, calculate the relative error. (The exact result is π/4 .) [4]

(c) How many points should you take to calculate the same integral with the
trapezium rule to a precision of 10−5 ? [6]

(d) What other numerical integration method would you choose to compute
this integral? You should carefully justify your answer by explaining why your
chosen method would be better than the trapezium rule and considering all
relevant aspects of numerical methods discussed in class. [5]

(e) Calculate the integral from part (b) by hand, using the method you have
introduced in part (d). How do your two results compare? [5]

PHYS4017 Numerical Methods 4/6 Paper continued over. . .


2B (a) By considering the Taylor expansion of a function f (x) about the point x,
show that the one-sided difference method
f (x + h) − f (x)
f 0 (x) =
h
can determine the derivative f 0 (x) accurate up to a residual error of order h. [2]

(b) Define the truncation error, and write down its value for the one-sided
difference method. [2]

(c) Explain what is meant by the fractional accuracy of a computer vari-


able. What part of the one-sided difference equation is most sensitive to the
fractional accuracy of the variables used in the computation, and why? [3]

(d) Show that for an input variable fractional accuracy of 10−16 , the one-sided
difference method can be used to estimate the derivative of a function with a
fractional accuracy of approximately 10−8 .
p
You may assume the characteristic scale of the function, xc = |f (x)/f 00 (x)|,
is approximately equal to 1. [4]
2
du
(e) A diffusion equation of the form dt = D ddxu2 can be solved using a forward-
time-centred-space (FTCS) scheme:

un+1
j − unj unj+1 − 2unj + unj−1
=D .
∆t ∆x2

The stability criterion for this equation is:


2D∆t
≤ 1.
∆x2
With reference to this stability criterion, explain why a simple FTCS scheme
would be inefficient in the case where D varies significantly as a function of
position. [3]

(f) Another strategy for solving this initial-value problem is to use an implicit
method. State how the FTCS equation given in part (e) can be modified
slightly to create an implicit counterpart to the FTCS scheme. Explain why
it is necessary to solve a matrix equation as part of this implicit scheme. [2]

PHYS4017 Numerical Methods 5/6 Q 2B continued over. . .


Q 2B continued

(g) Show that the associated matrix equation can be written in the form:
 .  
.. ..
 
. .. .
    
   n+1   n 
 . . . 0 −α 1 + 2α −α 0 0 0 ...    uj−1   uj−1
   
 
   n+1   n 
 ... 0 0
 −α 1 + 2α −α 0 0 ...    uj
 = u
  j


    
 ... 0 0 0 −α 1 + 2α −α 0 . . .   un+1   un 
   j+1   j+1 
    
.. .. ..
. . .

[4]

(h) The basic Gaussian elimination algorithm can successfully solve some ma-
trix equations, but not others. Discuss whether the zeros that appear in this
matrix equation would pose a problem for the basic Gaussian elimination al-
gorithm. [2]

(i) If you were to implement the Gaussian elimination algorithm for this spe-
cial case of a N × N tri-diagonal matrix, how many row-elimination operations
would be required? [2]

End of Paper

PHYS4017 Numerical Methods 6/6 END

You might also like