关键词 > DTS104TC

DTS104TC Numerical Methods Assignment 1

发布时间:2024-05-23

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

DTS104TC Numerical Methods

School of Artificial Intelligence and Advanced Computing

Assignment 1

June 7, 2024. 5pm (GMT+8)

LEARNING OUTCOMES

This assessment tests your ability to:

A. Apply numerical methods in a number of different contexts.

B. Solve systems of linear and nonlinear algebraic equations to specified precision.

C. Compute eigenvalues and eigenvectors by the power method.

D. Solve boundary value and initial problems to finite precision.

E. Develop quadrature methods for numerical integration.

INSTRUCTIONS

1.       The weighting of this assignment is 80% of the final mark.

2.       The marking criteria sheet is provided as a supplementary document.

3.       Your submission should only be in English.

4.       When you fill out Tables in your Answer Sheet, you can add or delete rows if it is needed.

5.       Where required, Matlab code should be attached as .m files.

a)       State the relevant .m file name in Answer Sheet to each question.

b)      It is allowed to make use of multiple .m files as functions and inputs.

c)       User-defined functions are allowed and all relevant functions of all questions should be

submitted in a single folder. The final answers to each question should be displayed in an executable .m file named after each question.

d)      You should add comments on functions,for loops, while loops and variables used in

your .m files to get full marks.

e)       In some questions, please show your process of derivation before you use your Matlab

codes to get full marks.

6.       Answers to questions should be typed on the Assignment1 Answer Sheet as Word files. The

assignment must be submitted in a Zip file with your Answer Sheet and all .m files (Check all documents needed in the Zip file in your Assignment1 Answer Sheet) via Learning Mall Online to the correct drop box. Only electronic submissions are accepted and no hard copy submissions are permitted.

7.       All  students must download their file and check that it is viewable after submission. Documents may  become  corrupted during the uploading process (e.g. due to slow internet connections). However, students themselves are responsible for submitting a functional and correct file for their assessments.

Question – 1 (15/100)

Consider the following equation: Equation (1)

(a)  Assume the initial interval of x is set as [0,2]. Solving x for the following cases: y=0 for an absolute error of 0.01 using Bisection method using Matlab. Find out how many iterations are required to determine the value of x and fill out Table-1(a) in your Answer Sheet and the final answers should be computed and submitted in Matlab, using a file named AnswerOneA.m . (3 marks)

(b)  Set the initial guess as 1, solve x for the following case: y=15 andy=30 for an absolute error of 0.01 using Newton-Raphson method in Matlab. Fill out Table-1(b) in your Answer Sheet and the final answers should be computed and submitted in Matlab, using a file named AnswerOneB.m . (6 marks)

(c)  Suppose that one root of the function lies in the interval [4, 5]. Using the Bisection method, find out how many iterations are required to determine the value of x to an absolute error of 0.001. Show and discuss your calculation step in your Answer Sheet. If you cannot solve it by using the Bisection method, explain why this is the case and try to use other method to find out how many iterations are required to determine the value of x to an absolute error of 0.001, the final answers should be computed and submitted in Matlab, using a file named AnswerOneC.m . (6 marks)

Submission requirements:

.All relevant Matlab code should be copied & pasted into the Answer Sheet.

.Attach your Matlab code as .m files in your submission.

Question – 2 (22/100)

Consider the system of linear algebraic equations: Equation (2)

(a) Implement the Gauss-Seidel method in Matlab. Set the initial guess as [0; 0; 0; 0; 0; 0] and compute the solutions for Equation (2) for a tolerance of 0.1 . Fill out Table-2(a) in your Answer Sheet and the final answers should be computed and submitted in Matlab, using a file named AnswerTwoA.m . (10 marks)

(b) Implement the LU Decomposition method in Matlab  and compute the  solutions for Equation (2). Fill out Table-2(b) in your Answer Sheet and the final answers should be computed and submitted in Matlab, using a file named AnswerTwoB.m . (8 marks)

(c) Discuss the complexity of LU decomposition method and Gaussian elimination method; Discuss the advantages of LU decomposition method over Gaussian elimination method. (4 marks)

Submission requirements:

.    All relevant Matlab code should be copied & pasted into the Answer Sheet.

.    Include Matlab code as .m files as part of your submission.

Question – 3 (10/100)

Consider the the Matrix A below: Equation (3)

(a) Apply the power method to find the highest eigenvalue for the inverse of Matrix A in Matlab.  Set the initial Eigenvector as [1; 1; 1] and the stopping criterion as 1% (Estimated Eigenvector need to be normalized). Fill out Table-3(a) in your Answer Sheet and the final answers should be computed and submitted in Matlab, using a file named AnswerThree.m . (8 marks)

(b) Take the reciprocal of the final eigenvalue estimates in question(a) and compare with the smallest eigenvalue calculated using eig() function for the Matrix A in Matlab. Fill out Table-3(b) in your Answer Sheet. (2 marks)

Submission requirements:

.    All relevant Matlab code should be copied & pasted in the section below.

.    Attach your Matlab code as .m files in your submission.

Question – 4 (15/100)

Consider the equation below: Equation(4)

(a)  Implement 4th-Order Runge-Kutta Methods to calculate the integral of function g in the interval between 0 and 1. The initial condition of G(x =0)=3 is known. Compare the results obtained with a different step size and report your findings. Fill out Table-4 in your Answer Sheet and show your process of derivation, final answers should be computed and submitted in Matlab, using a file named AnswerFour.m . (10 marks)

(b) Please briefly describe the advantages of the Runge-Kutta method as compared to the Euler's method, as well as its disadvantages. In reference to one selected disadvantage, provide a possible way to address this disadvantage. (5 marks)

Submission requirements:

.    All relevant Matlab codes should be copied and pasted on the Answer Sheet.

.    Attach Matlab code as .m files in submission

Question – 5 (20/100)

Evaluate the rational integral expression (5) below.

(a)  Set  a=0  and  b=1,  in  Matlab,  calculate  the  approximate  solution  of  Expression  (5)  using  Gaussian Quadrature method with n=3. Fill out Table-5(a) in your Answer Sheet and the final answers should be computed and submitted in Matlab, using a file named AnswerFiveA.m . (4 marks)

(b)  Consider that the actual integral in the situation of Q5(a) is 0.138487095484. Use Matlab to test how many segments are required by the Trapezoidal method to obtain a better accuracy than Gaussian Quadrature with n  =  5? Fill out Table-5(b) in your Answer Sheet and the final answers should be computed and submitted in Matlab, using a file named AnswerFiveB.m . (4 marks)

(c)  Use Gaussian Quadrature method with n=5 to evaluate Expression (5) for a=0 and b=+∞ in Matlab. Write down your answer in your Answer Sheet. Fill out Table-5(c) in your Answer Sheet and the final answers should be computed and submitted in Matlab, using a file named AnswerFiveC.m . (10 marks)

(d) Explain why Gaussian Quadrature method is superior to Trapezoidal method; In what situation can the Trapezoidal method obtain a precise results? Present answer in your Answer Sheet. (2 marks)

Submission Requirements:

.    All relevant Matlab codes should be copied and pasted on the Answer Sheet.

.    Attach Matlab code as .m files in submission

Question – 6 (18/100)

Consider the equation below: Equation(6)

(a)  Implement Finite Difference method with h=0.01 to  solve the first-order differential equation (6). The initial condition of y(x =0)=0 is known. Fill out Table-6 in your Answer Sheet, final answers should be computed and submitted in Matlab, using a file named AnswerSixA.m . (10 marks)

(b) Use MATLAB to plot the graph of the function   y    within the range  of 0 to 10, then paste this graph generated by Matlab into the answer sheet, final answers should be computed and submitted in Matlab, using a file named AnswerSixB.m . (8 marks)

Submission Requirements:

.    All relevant Matlab codes should be copied and pasted on the Answer Sheet.

.    Attach Matlab code as .m files in submission