Download Mathematical Methods 3 Closed book test: 12–11–2015 Time 9.05

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Positional notation wikipedia , lookup

Dirac delta function wikipedia , lookup

Function (mathematics) wikipedia , lookup

Continuous function wikipedia , lookup

History of the function concept wikipedia , lookup

Non-standard calculus wikipedia , lookup

Function of several real variables wikipedia , lookup

Approximations of π wikipedia , lookup

Elementary mathematics wikipedia , lookup

Transcript
Mathematical Methods 3
Time 9.05–9.50
Closed book test: 12–11–2015
Attempt all five questions
Calculators will be needed
(1) Give the formal definitions of a function, and a continuous function of one
variable. Give an example of a continuous function that is not differentiable.
[3 marks]
(2) Construct a Newton iteration to compute the fifth root of a given number.
Starting from x0 = 1.5, run your iteration to calculate 51/5 to an accuracy of
three decimal digits. (Two iterations will be needed.)
[Hint: you can compute the square root of β by finding a zero of the function
f (x) = x2 − β.]
[4 marks]
(3) Find the maximum value of the function f (x, y) = x + y − 1 subject to
the following constraints; 0 ≤ x ≤ 2, 0 ≤ y ≤ 2, 2x + y ≤ 4, x + 2y ≤ 6.
Are any of the conditions redundant? (Would the question be unchanged if a
condition were to be removed?)
[3 marks]
(4)
Consider the initial value problem: find y(t) such that
y 0 = t2 − y 2 ,
y(0) = 1.
Estimate y(1) = 0.750015 . . . (a) by taking two steps of the modified Euler (me)
method, and (b) by taking one step of the Runge–Kutta (rk4) method. (Work
to an accuracy of four decimal places.)
[6 marks]
(5) Explain, as concisely as you can, how you would construct a centered
difference approximation to the reference boundary value problem: given the
function f (x), find u(x) such that
−u00 (x) = f (x),
x ∈ (0, 1);
u(0) = 0, u(1) = 0.
[4 marks]
Solutions
Solution (1)
A function maps one or more inputs (real numbers) to a
unique output number. A one-dimensional function is continuous when
lim f (x − ) = f (x) = lim f (x + )
→0
→0
for all possible values of x.
The simplest example of a continuous function that is not differentiable in the
function f (x) = |x| (there are other possibilities).
Solution (2)
Given the function f (x) = x5 − β and a starting value x0 ,
Newton’s method computes an accurate estimate of the fifth root using the
following algorithm:
dk = −f (xk )/f 0 (xk );
k
0
1
2
3
xk
1.5000
1.3975
1.3802
1.3797
xk+1 = xk + dk ,
f (xk )
-2.5938
-0.3310
-0.0081
-0.0000
f 0 (xk )
25.3125
19.0729
18.1430
18.1195
k = 1, 2, . . .
dk
-0.1025
-0.0174
-0.0004
-0.0000
The answer (to three decimal digits) is 1.380.
Solution (3) The vertices of the feasible region are the points (0, 0), (2, 0),
(0, 2) and (1, 2) (where the line y = 2 intersects y = 4 − 2x). Evaluating f at
these points the maximum value is at the point x = 1, y = 2 when f = 2.
The constraint x + 2y ≤ 6 is redundant.
Solution (4) (a) Running the modified Euler (me) process the approximate
solution yj is tabulated below. Note that f (y, t) = t2 − y 2 , tm = tj + h2 and
ym = yj + h2 f (yj , tj ).
h
tj
yj
f (yj , tj )
tm
ym
0.5 0 1.0000 −1.0000 0.2500 0.7500
0.5 0.5 0.7500 −0.3125 0.7500 0.6719
0.5 1.0 0.8055
f (ym , tm )
−0.5000
0.1111
Running the Runge–Kutta (rk4) process gives ...
h=1
first temporary point
second temporary point
third temporary point
new point
t = 0.0 y0 = 1.0000 K1 = −1.000
t = 0.5 ym = 0.5000 K2 = 0.0000
t = 0.5 ym = 1.0000 K3 = −0.7500
t = 1.0 y∗ = 0.2500 K4 = 0.9375
t = 1.0 y1 = 0.7396
Solution (5) A centered difference approximation defined on a subdivision of size h is the vector of values obtained by solving the system of linear
equations
A

2 −1
 −1
2


..

.

 0
0
0
0
−1
..
.
−1
..
.
2
−1
u
 

0
u1
0 
u2 
 

 
 = h2
 

  .. 
. 
−1 
un−1
2
where uj ≈ u(xj ), fj = f (xj ) and h = 1/n.
b
f1
 f2


 .
 ..

fn−1





