Cardiff School of Computer Science and Informatics: Coursework Assessment Pro-Forma
Cardiff School of Computer Science and Informatics: Coursework Assessment Pro-Forma
This coursework is worth 35% of the total marks available for this module. If coursework is
submitted late (and where there are no extenuating circumstances):
1. If the assessment is submitted no later than 24 hours after the deadline, the mark for the
assessment will be capped at the minimum pass mark;
2. If the assessment is submitted more than 24 hours after the deadline, a mark of 0 will be
given for the assessment.
Your submission must include the official Coursework Submission Cover sheet, which can be
found here:
https://docs.cs.cf.ac.uk/downloads/coursework/Coversheet.pdf
Submission Instructions
Description Type Name
Cover sheet Compulsory One pdf file [Student number].pdf
Report Compulsory One pdf file Report [Student number].pdf
Source code Compulsory One or more Matlab files Code [Student number].zip
packaged as a single zip file
Any code submitted will be run on a system equivalent to those available in the School laboratory
and must be submitted as stipulated in the instructions above.
Any deviation from the submission instructions above (including the number and types of files
submitted) will result in a mark of zero for the assessment.
Staff reserve the right to invite students to a meeting to discuss coursework sub-
missions
Assignment
Modify the code Newton.m which is provided on Learning Central and has been covered in class
during the sessions on solving one variable non-linear equations.
1
2. Your code needs to be able to handle functions that are not just polynomials (as demon-
strated in some of the examples below).
3. Use the code for Newton.m and Bisection.m that are provided on Learning Central as
the base versions for your solutions.
4. Set the maximum allowed number of iterations to 100.
5. Set the error tolerance to 1 × 10−5 .
f (pn−1 )
qn−1 = pn = pn−1 −
f 0 (pn−1 )
which we will denote the result of by qn−1 . Write a modified version of Newton.m to implement
Ostrowski’s method called Ostrowski.m, which improves the convergence rate of Newton’s
method by replacing the update with the following update equation:
Note:
1. Set the range of x to [−10, 10].
2. Sample the curve at 1000 points.
Task 3 (20% weight): Write a modified version of Newton.m called NewtonMulti.m to extract
multiple roots using the method of deflation. Deflation operates by solving for the first root r1
of f1 (x) = f (x) and then modifying the function to become f2 (x) = f1 (x)/(x−r1 ). This process
is repeated to extract the set of roots ri from fi (x) = fi−1 (x)/(x − ri−1 ). After extracting ri
from fi (x) this solution should be refined by updating the initialisation to p0 = ri and rerunning
Newton’s method on the modified function. (Note that at each iteration the function becomes
progressively more complicated.) Plot the function and the positions of the roots as shown in
x5 x4 x3 2
the example shown below where f (x) = 1024 + 3256 − 564 − 1516x + x + 12.
2
Note:
1. Plot output in the range of x in [−10, 10].
2. Look for a maximum of 10 roots. If less than 10 roots can be found then (automatically)
stop the root finding process.
Task 5 (10% weight): Combine your methods developed in Tasks 1 and 4 to produce a more
effective root finding algorithm that 1/ does not require careful specification of the bound-
ing range for the root, and 2/ is efficient. Your program RootFindingImproved.m first runs
BisectionInitialise.m followed by 5 iterations of Bisection.m, to produce a solution that
is refined by Ostrowski.m. This program just needs to find a single root.
3
Note:
1. Set the range of x to [−1, 1].
2. Set the sampling rate of a and b such that the image dimensions are 400 × 400.
3. If the root finding method does not converge then set the colour to mid gray.
4. When checking for duplication of roots use a high tolerance threshold of 1 × 10−3 to avoid
proliferation of roots.
5. The colours do not need to be consistent across different root finding methods.
Please note: You are allowed to use the Geometric Processing toolbox introduced in the module
and third-party libraries, as long as you clearly reference the sources in your report.
You must supply a report on your submission which provides a short written description (1–2
pages of text plus diagrams, screenshots etc.) conveying all the appropriate information to
demonstrate its operation.
4
Criteria for assessment
Credit will be awarded against the following criteria.
and the amount of credit will be awarded according to the following indicators:
1. 1st: the submission fully addresses the stated requirement for the Part,
as well as meeting the excellence indicators below.
2. 2.1: the submission fully addresses the stated requirement for the Part,
but has weaknesses in terms of the weakness indicators below.
3. 2.2: the submission partially addresses the stated requirement for the Part.
4. 3rd: the submission minimally addresses the stated requirement for the Part.
5. Fail: the submission does not adequately address the stated requirement for the Part.