Task 1: Theory

Point a)-c): This were solved satisfactory by most of the groups. However, a printout of the plot in point b) were missing in several of the reports.

Point d): Most groups noticed quite correctly that the iterates stayed near the fixed point for all iterations of scheme 1 and 3, but not of scheme 2. Some commented correctly that the fixed point was stable for \(g_1\) and \(g_3\) but unstable for \( g_2 \). Only a very few actually verified this, by use of Theorem 1.5, Theorem 1.6 and Definition 1.3, which was exptected.
One minor comment about rounding errors: Rounding errors is not present for irrational numbers, there are also rational numbers which can not be represented exact in the computer, e.g. 1/3

Point e): This point has been been given most weight in the grading of the theory part, you should verify that the conditions of Theorem 1.3 is satisfied. Both the condition \( g([a,b]) \in [a,b] \) and the contraction condition (Definition 1.2) should be verified. Most of you did this for \( g_1 \). The first condition is not true for \( g_3 \), but extended the interval for instance to \( [1,\sqrt{5}] \) and proved that \( g_3 \) is a contraction on this interval. Some of you have a critical comment that this is strictly speaking not allowed, since the original \( f \) is only defined on \( [1,2] \). This is a good observation, but it is possible to overcome the objection by making the natural extension of the interval, since this obviously is what will happen when the iteration scheme is implemented.

There were one serious mistake done by a very few: The Lipschitz constant \( L \) \[ |g(y)-g(z)|\leq L |y-z| \] has been proved by finding the maximum difference of \( g(y) \) and \( g(z) \) and the corresponding \(y\) and \(z \) values (there are variations on this). But the inequality should be true for all values of \(y\) and \(z\) in the relevant interval, and as long as \( g \) is continuous, it is best done by the mean value theorem, so \( L=\max|g'(x)| \) over the interval.

Point f). Up to some miscalculations, the max number of iterations were correctly calculated in most of the reports. So was the actual number of iterations required. It would be good to see more comments on the discrepancy of the maximum and actual number of iterations.

Task 2 and 3: Programming

Newton: The majority of groups got the basic Newton procedure satisfactory implented, but very few newton functions were completely without errors. The majority of problems with the newton program can be traced back to not reading the task description carefully enough, and not checking thoroughly that the program actually works as intended.

Common examples were:

  • Using some other stopping criterion, rather than the maximum norm of f, or not implementing this norm correctly.
  • Not counting the number of iterations correctly and/or stopping the iteration process at the right time and/or reporting correctly on whether convergence has been acchieved.
  • Not printing a warning.
  • Not checking that the help text for the function can be reached when you type "help newton".

Some groups also had more serious issues, sometimes using symbolic differentiation to find the Jacobian, multiplying by inverses or even pseudoinverses in the Newton step, or writing a separate newton procedure for each problem.

Test and flow problem: These were implemented correctly for the majority of groups. Some derived incorrect flow equations. However a surprising number of groups derived the correct set of flow equations, but implemented them incorrectly due to one of the following:

  • Simple typographical errors: E.g. replacing * with ^, or writing down the gauge pressure incorrectly.
  • Round off errors: Rounding the constant factor in the pressure equations introduces an unneccesary error source in the computed answer, and limits the possible accuracy.

This again demonstrates the importance of proofreading and testing your code thoroughly. Unlike an exam, you have ample time to do this.

A significant number of groups did not hand in the simple script that runs newton on the flow problem, even though the project specifically asked for this.

Several groups computed the output from the problem functions by generating and evaluating symbolic, anonymous or inline functions. Computing the output from the input in a function, by generating and evaluating practically the same function inside it, is both unneccesarily complicated and bad practice. In the case of symbolic functions, it can also be very inefficient.

General: Be careful to make your code well organized and readable. The MATLAB editor has a vertical line, indicating how long a line of code should be. Split the command over several lines if it is significantly longer than this. Use vector and matrix operations and built in functions to make commands shorter and more readable, e.g. don't multiply a vector with a constant by manually multiplying the elements of the vector with this constant. Using vector and matrix operations also generally makes the code much more versatile. Finally, the comments and help text included should also be well organized and readable

Task 3: Report part

Not all included the derivation of the equations in the report, neither wrote down the iteratied solution. And almost no-one commented on the obtained result (Is it reasonable? Why?)

2013-10-02, eirikhoe