AERO40003 Computing and Numerical Methods 1 Coursework Project 2019-2020
Dr. Maria Ribera Vicent & Dr. Elnaz Naghibi
Due Date: 20 March 2020
PART 2 – NUMERICAL METHODS [50%]
Question 1 [10%]
Plot the function in the interval and find its two roots in the mentioned interval using MATLAB functions.
Using the derivative of the function and appropriate initial guesses from the plot of the function, verify which root can be found by fixed-point method. Use the fixed-point method to approximate this root and use the secant method to find the other root (for which the fixed-point method does not work). Show the convergence to each root using appropriate plots and provide the codes for both methods. Consider the tolerance value to be equal to 1e-6.
Answer:
You can use this space to explain the answers and include equations as needed using either Latex code or the live script equation editor from the tab “insert”.
% Use this box for coding.
% Outputs and graphs will be displayed on the right panel.
% To avoid submitting multiple files, please include functions at the bottom of your scripts. Question 2 [20%]
Part a: [10 %]
Calculate Legendre polynomial of degree 5 using equation 16 in Handout_4 and MATLAB symbolic toolbox. Compare your resulting polynomial with “legendreP” function in MATLAB. Plot this function in the interval and calculate its roots . Calculate weighting coefficients using the definition in equation 21. Using and , calculate the integral of and show that it will be the same as its analytical value.
Answer:
Part b: [10 %]
Use Simpson integration scheme to calculate the below integral for . Compare the results with the analytical value and calculate the error in each case. Provide the code for the integration scheme and error calculation.
Answer:
Question 3 [20%]
Part a: [10%]
Use Chebyshev distribution to sample 5 values of function in the interval . Write a code to calculate the Lagrange interpolating polynomial passing though these points. Increase the number of points to 15 and rebuild the polynomial. Provide graphs to compare the original function and the interpolating polynomial and report the Euclidean norm of error in each case.
Answer:
Part b: [10%]
Use the 5 equally spaced sample points for the function in part a and find the cubic splines passing through these points. Calculate the Euclidean norm of the error in this case and provide a graph to compare the original function and the cubic splines.
Answer: