联系我们: 手动添加方式: 微信>添加朋友>企业微信联系人>13262280223 或者 QQ: 1483266981
Numerical Methods 2023/4: Individual
Project
This work will count for 50% of your final mark for Numerical Methods.
The mark breakdown is as follows.
Analysis 60
Working (and efficient) Maple code 30
Coding style 5
Overall presentation 5
Total 100
Store all files on One Drive or the M drive to protect against loss.
Save your Maple work regularly. Executing incorrect codes may cause Maple to become
trapped in an infinite loop. If this happens, you can try pressing the interrupt button ( ),
but you may be forced to close the application and reload your work.
Submit your work as a single pdf file. See the project guidance notes for instructions on
merging and rearranging pdf files.
Invalid submissions (e.g. files in formats other than pdf) will be deleted. Groups that make
invalid submissions will be given another chance to submit, but this will be treated as late,
and subject to standard university penalties (5% deduction for each day, and a mark of zero
after five days).
You must answer the question assigned to you. No marks will be awarded for answer_xfffe_ing other questions.
Individual project H 1 CONTINUED. . .
This question is concerned with quadrature rules of the form
1
√
π
Z
∞
∞
f(x)e x
2
dx ≈
n
q
X=1
wqf(xq),
for nodes xq and weights wq. The nodes are positioned to achieve maximum accuracy. In your
answer you may use the fact that
1
√
π
Z
∞
∞
x
p
e
x
2
dx = κp, where κp =
1 if p = 0,
0 if p ∈ N is odd,
(p 1)!
2
p 1
(p/2 1)! if p ∈ N is even.
(a) (i) What is the sum of the weights for quadrature rules of this type Explain your answer.
(ii) Assuming that the Maclaurin series
f(x) =
∞X
p=0
f
(p)
(0)
p!
x
p
converges for all x, show that the absolute error in the quadrature rule is given by
E =
∞X
p=1
f
(p)
(0)
p!
Sp where Sp = κp
n
q
X=1
wqx
p
q
.
(iii) Use your error formula to obtain a system of equations for the nodes and weights in
the case n = 3. Use symmetry to simplify the system and then solve it.
(iv) Write down the system of equations for the case n = 5. Use symmetry to reduce the
number of unknowns, but do not attempt to solve the system.
(b) It can be shown that the nodes for the n point rule are the roots of hn(x), a polynomial of
degree n with the property that
Z
∞
∞
hn(x)x
r
e
x
2
dx = 0, r = 0, 1, . . . , n 1.
This defines hn(x) up to a multiplicative constant, which can be fixed by requiring that
1
√
π
Z
∞
∞
x
nhn(x)e x
2
dx = n!
Note that this is similar to the case of Gaussian quadrature; to prove that the roots are the
correct node locations, simply write
Q2n 1(x) = hn(x)An 1(x) + Bn 1(x),
and follow the argument from the lecture notes (you are not asked to include this proof).
(i) Determine h3(x). This is easier than it looks; use everything you know about h3.
(ii) Use integration by parts to determine the range of nonnegative integers r for which
Z
∞
∞
h
0n+1(x)x
r
e
x
2
dx = 0,
and hence show that h
0n+1(x) = knhn(x), for some constant kn.
Individual project H 2 CONTINUED. . .
(iii) Given that kn = 2(n + 1) (proof: exercise for fun), determine h5(x) from h3(x).
(iv) Show that, for the case n = 5,
x
2
1 =
5
√
10
2
, x2
2 =
5 + √
10
2
, w1 =
7 + 2√
10
60
, w2 =
7 2
√
10
60
and w3 =
8
15
.
(c) (i) Write a Maple procedure that takes as its argument a function f and returns two
estimates of the integral
J = 1
√
π
Z
∞
∞
f(x)e x
2
dx
as its results. The first estimate should be computed using the three point rule from
part (a) and the second using the five point rule from part (b).
(ii) Apply your procedure to the case
f(x) = x
2 + 2
6 + x
2 + sin x
,
and compute the absolute errors in the two estimates.
(iii) Compute the above integral with Simpson’s rule, setting the integration limits to
±
q ln(0.5 × 10 10). Determine (by experimentation) the minimum number of subin tervals needed to produce a better result than the five point rule from part (b).
Individual project H 3 END


发表评论