代做Numerical Methods 2023/4: Individual Project代做回归

- 首页 >> Matlab编程

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-ing other questions.

Individual project A 1 CONTINUED. . .One disadvantage of Gaussian quadrature rules is that they cannot be refined as easily as Newton–Cotes rules, because the nodes move if the number of subintervals is increased. However, there is a way to perform. a refinement which can be used with any Gaussian rule. This problem is concerned with an extension to the two-point Gaussian rule, which we call the K5 rule. This has five nodes: t2 = −1/√ 3, t4 = 1/ √ 3 and the others chosen optimally, to minimise error. With function values at all five points we can calculate two estimates: one from the two-point Gaussian rule (which has nodes at t = ±1/√ 3 ) and one from the K5 rule.

(a) Write down a system of equations for the weights and the node locations t1, t3 and t5. Use symmetry to reduce the number of unknowns.

(b) The node locations t1, t3 and t5 are roots of K3(t), which is a cubic polynomial such that

Here, P2(t) is the Legendre polynomial of degree two. Find K3(t) and its roots.

This is a lot easier than it first appears — think about the symmetry in the nodes and what this means for the form. of K3.

Note: this works because we can write an arbitrary polynomial of degree seven in the form.

Q7(t) = P2(t)K3(t)A2(t) + B4(t).

The method used to locate the Gauss nodes in the lecture notes will now work for the K5 rule (you are not asked to write out this argument).

(c) (i) Use the result of part (b) and the system of equations from (a) to find the exact values of the weights for the GK5 rule. You should find that w3 = 28/45.

(ii) Calculate the exact value of the first nonzero coefficient Sp in the error formula, and the leading-order error in the K5 rule for a single subinterval of width ∆x.

(iii) Determine the leading-order error for the two-point Gaussian rule on a single subinterval.

(iv) Is it possible to accurately predict the relationship between the errors in the two rules? Justify your answer.

(d) (i) Write a Maple procedure that takes as its arguments a function f, real numbers a and b, and N, the number of subintervals. It should return two approximations to

as its results; the first calculated using the two-point Gaussian rule and the second using the K5 rule.

(ii) Test your procedure with N = 20 and N = 40 using the integral

Obtain numerical values for the absolute errors in the estimates from the two-point Gaussian rule and the K5 rule. Determine the effect that doubling N has on the K5 rule, and check that this is in agreement with your analysis in part (c). Repeat these calculations for one other integral chosen arbitrarily. Don’t use a polynomial, but make sure there is no possibility of division by zero, etc.





站长地图