物理代写-PHYS3X34
时间:2022-05-31
PHYS3X34 Example Exam Questions 1 Page 1 of 3
1. (a) Briefly explain:
(i) What is meant by an explicit numerical scheme.
(ii) The difference between the stability and accuracy of a numerical method.
(iii) The benefits of evaluating a numerical method on a test case with a known
analytic solution.
(b) Consider the following equation that describes the non-dimensional voltage, v, in
an electrical circuit of diodes, capacitors, and resistors:
...
v = σv¨ + v˙2 − v , (1)
where σ > 0 is a real-valued parameter, and dots indicate derivatives with respect
to time (e.g., v¨ denotes d2v/dt2).
(i) By defining w = v˙ and z = w˙, and identifying x = (v, w, z), determine the
right-hand-side function, f(x), that could be coded to solve this equation using
a Runge-Kutta scheme.
(ii) Recall that the RK4 scheme involves computing a term f (2) = f [x(t)+ 1
2
f (1), t+
1
2
τ ], where f (1) = f [x(t), t]. Explain in words what f (2) computes, including a
simple sketch in your answer.
(iii) The student solves Eq. (1) for v(t) with σ = 2.017 using RK4, repeating the
results for time steps, τ = 0.01, τ = 0.1, and τ = 0.5 and up to a maxi-
mum non-dimensional time, tmax = 120. Their results are shown in Fig. 1.
Inspecting the plot, explain what time-steps, τ , might be appropriate for accu-
rately solving this problem on a timescale tmax = 120. Other than reducing
the time-step, what other options does the student have for reducing truncation
error?
0 20 40 60 80 100 120
Time
-2
0
2
4
6
8
10
v
= 0.5
= 0.1
= 0.01
Figure 1: Numerical solution of Eq. (1) for τ = 0.5 (red), τ = 0.1 (blue), and τ = 0.01 (black,
dashed). Note the overlap of the blue and black dashed lines.
(15 marks)
PHYS3X34 Example Exam Questions 1 Page 2 of 3
2. This question considers solution of the linear wave equation:
∂2u
∂t2
= c2
∂2u
∂x2
, where c > 0 is constant. (2)
(a) Consider solution of Eq. (2) with a scheme using a forward difference approxima-
tion to the second time derivative and a centered difference approximation to the
second spatial derivative. This method is called Forward Time, Centered Space
(FTCS).
(i) Show that a forward difference approximation to the second derivative of a
function f(t) at t is:
d2f
dt2
=
f(t+ 2τ)− 2f(t+ τ) + f(t)
τ 2
+O(τ). (3)
Using Eq. (3), show that a FTCS scheme for the wave equation is
un+2j = 2u
n+1
j − unj + g2
(
unj+1 − 2unj + unj−1
)
, where g = cτ/h. (4)
(ii) Apply von Neumann analysis to Eq. (4) and show that the amplification factor
is
ξ = 1± 2ig ∣∣sin (1
2
kh
)∣∣ . (5)
Hence determine the stability (or otherwise) of this scheme, making sure you
explain your reasoning clearly.
(b) Consider the solution of Eq. (2) with a scheme using a centered difference approx-
imation to the second time derivative and a centered difference approximation to
the second spatial derivative. The method is called Centered Time, Centered Space
(CTCS).
(i) Show that a CTCS scheme for Eq. (2) is
un+1j = 2u
n
j − un−1j + g2
(
unj+1 − 2unj + unj−1
)
, where g = cτ/h. (6)
(ii) Apply von Neumann analysis to Eq. (6) to determine the stability (or otherwise)
of this scheme, making sure you clearly explain your logic.
(Note: you will need to consider when the amplification factor ξ is real and
when it is complex.)
(15 marks)
PHYS3X34 Example Exam Questions 1 Page 3 of 3
3. This question considers solution of the linear advection equation:
∂a
∂t
= −c∂a
∂x
(c > 0 is a constant). (7)
Eq. (7) is assumed to be non-dimensional, and we consider solution in the region 0 ≤
x ≤ 1.
(a) Show that a discretisation of Eq. (7) using a forward difference approximation to
the time derivative and a backward difference approximation to the space derivative
may be written:
an+1j = a
n
j − g
(
anj − anj−1
)
, (8)
where g = cτ/h. This method is called Forward Time, Backward Space (FTBS).
(b) Determine a matrix formulation of the FTBS scheme for advection, Eq. (8), of the
form
an+1 = Man, (9)
where an = (an1 , a
n
2 , . . . , a
n
L)
T is a vector of dependent variable values at time step
n. Assume periodic Dirichlet boundary conditions such that
anL+1 = a
n
1 and a
n
0 = a
n
L (for all tn). (10)
Clearly show the form of the matrix M, and briefly explain how the boundary con-
ditions appear in the matrix.
(c) Apply von Neumann stability analysis to Eq. (8).
(i) Show that the amplification factor is
ξ = 1− g (1− cos kh)− ig sin kh. (11)
(ii) Based on Eq. (11), determine the stability of the FTBS scheme. Make sure
you explain your logic. Is the scheme stable if we allow backwards advection
(c < 0)?
(15 marks)
THERE ARE NOMORE QUESTIONS.


essay、essay代写