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


MATH10001 Mathematical Workshop


MATLAB Coursework

1. Write a single script M-file to

(a) (3 marks) plot the equations below on the same axes for x between 0 and 2. Your code should generate a title and label the axes.

(b) (2 marks) use fzero to find the two solutions of = 2 sin(x) for x between 0 and 2


2. (6 marks) Write a script M-file to implement the Newton-Raphson method with x0 = 2 to find a solution of the equation below. Your solution should be correct to 5 decimal places and your code must not do more iterations than necessary to achieve this. Your code must output the result of each iteration until the required solution is reached.


3. (6 marks) Write a script M-file to implement the trapezium rule to find the area between the curve y = − 2 sin(x) and the x axis between x = 0 and x = 0.8. Write your code so that it produces estimates using h = 0.1, h = 0.01, h = 0.001 and h = 0.0001 in an efficient way.


4.      (a) (3 marks) Write a script M-file to implement the central difference method to find the gradient of the curve y = − 2 sin(x) at the point where x = 0.5 using h = 0.1.

(b) (2 marks) Differentiate y = − 2 sin(x) (by hand) and use your answer find to 4 decimal places the actual gradient when x = 0.5. This part should be carefully typeset in LATEX in your final report.


Project Report

This project is worth 25% of the marks for MATH10001. The project report should be word-processed using LATEX and include the M-files and their outputs. There are 3 marks available for accurate LATEX. To gain all the marks, your M-files must contain comments to explain their structure and the report must be clearly presented. To gain all the marks, your code should be as efficient as possible.

        The project and report must be all your own work. Anyone suspected of sharing M-files or copying another student’s work will be dealt with by the Academic Malpractice Panel.


Presenting your answers

Upload a single pdf document via Blackboard and four M-files. The pdf should be generated using LATEX and have the following form;

1. The name of the M-file for this question followed by the graph and the two solutions it outputs.

2. Show how you derived your Newton-Raphson iteration formula for this question. The name of the M-file for this question followed by the output

3. The name of the M-file for this question followed by the output for each h value.

4. (a) The name of the M-file for this question followed by the output

    (b) Show what you got when you differentiated the function and the actual gradient to 4 decimal places.