# Project

Part of the grade (30%) in this course is based on a project to be handed in during the course. The project will consist of two parts that partially depend on each other. The first part will be published in the first half of February, and the second part at the end of March.

You may work on the project either alone or in groups of up to three students.
**In case you are looking for project partners, please send me an e-mail before the 3rd of February.**

~~The first project will prospectively be handed out around 8th February, with a deadline on Sunday, 26th February.~~

### Results of the first project

A list with the results of the first project (on a scale from 0-100) can now be found on itslearning. *If your student/candidate number does not appear on this list even though you have handed in a project, please let me know as soon as possible.*

If you want some feedback concerning your project report, feel free to come to my office.

## Second Project

- The
**deadline**for the second project is**Sunday, May 7, at 23:59.** - The second project will count 20% of the final grade of the course.
- If you don't hand in anything for the second project, you may take the exam,
*but the project still counts 20% of the grade.* - You may work on the project either alone or in groups of up to three students. The groups need not necessarily be the same as for the first project.
- The evaluation of the project will be based both on the correctness and extent of your results and on the presentation of these results (see the note concerning advice for the report). The presentation will count for roughly 1/3 of the grade.

### Project description

**If you find errors in the project descriptions or find parts that are unclear to you, please tell me as soon as possible.**

### What to hand in and how

Your work should contain:

- A written report of at most ten pages submitted electronically as a
**PDF file**.- You may write either in English or in Norwegian.
- The report has a strict upper limit of
**ten pages**. You may of course use fewer pages than that. - Preferably use LaTeX, but you may use any other typesetting program you like if this causes issues.
- Do not put your names anywhere on the report. Either use your candidate numbers for this course (if they are already available) or your student numbers (if not).
- Feel free to reuse or reformulate parts of your report for the first project.
- As in the first project, the main task will be the implementation of a method for solving an optimisation problem, and the choice of the method is, again, completely up to you. However, the problems to be solved will be much more complex than in the first project, and so will - probably - be the methods you use. Make sure that you include enough details in your report that it is possible to understand how you have produced your numerical results.

- A
**zip file**containing all your relevant code.- Make sure that the code actually runs and include enough documentation for me to run it as well.
- The quality of the code will not be included in the grade; its correctness will be, though. In particular, your implementation should actually coincide with your description of the algorithm in your report.
- Do not put your names anywhere in the code.

Send both files together by e-mail to Fredrik Hildrum with "TMA4180 - project 2" in the subject heading.

### Help sessions

There will be additional help sessions for the duration of the project:

- On Wednesday, April 26, the exercise session will already start at 14.
- On Friday, April 28, there will be an exercise session in Nullrommet between 14-16.
- In the week from May 02-05, I will have additional office hours: I will be available on Wednesday, 03rd of May, from 11-14, and on Friday, 05th of May, from 10-13.

### FAQ

*What has to be done?*

Each group should discuss the questions in Section 3.1 (problems 1-3) and then*either*3.2.1 (problems 4,5)*or*3.2.2 (problems 6-8).*How do I prove the existence of a solution (problem 1)?*

This may be a bit tricky for this particular problem, as you cannot use the same idea as in the first project, and neither can you immediately use the basic results concerning existence of solutions, which we have discussed in the first lectures. However, it can be a good idea to find out to which extent the function is coercive, and to which extent it is periodic. (What happens to the energy functional, if you add the same number to each of the angles; and why is this a problem for coercivity?)*I am using a log-barrier method for solving one of the inequality constrained problems in Section 3.2, but the results I am getting are weird (NaN, not satisfying the constraints,…). Why?*

If you are using Matlab, you might have encountered problems with the definition of the logarithm: In Matlab, the function log returns (some branch of) the*complex*logarithm and thus some complex number if its argument is negative. Instead, the barrier method assumes \(-\infty\) as value of the logarithm of a negative number. In order to make your implementation work, you will therefore need to add an additional check in the line search for whether all inequality constraints are satisfied.*I am trying to solve Problem 3.2.1 (Angular constraints), but the method seems unable to satisfy the equality constraints. What should I do?*

Problem 3.2.1 is very sensitive to good initial values, and may have problems converging if the initialisation is far from satisfying the equality constraints. Try to find a better initialisation that is close to satisfying all constraints.*When I run a line search method for minimising a quadratic penalty functional/the Augmented Lagrangian/…, I often observe incredibly small step lengths although the gradient is quite different from zero. Why?*

There are two main reasons for this to happen:

- The first possibility is that there is an error in the implementation of the gradient (or, possibly, the implementation of the function to be minimised), because of which the Armijo condition is not satisfied even for very small (or zero) step lengths. The error might be even something as small as a missing factor of 1/2 in the quadratic penalty function.

- The other possibility is that the search direction in the current step is not a descent direction. If you are using Newton's method, this can happen if the Hessian at the current point is indefinite, and you have not implemented any Hessian modification for correcting this. Or, if you are using a Quasi-Newton method, this can happen if the*previous*step length did not satisfy the second Wolfe condition. Note that you usually cannot guarantee the second Wolfe condition to be satisfied, if you use a simple backtracking method for choosing the step lengths.

## First Project

### General information

- The
**deadline**for the first project is**Sunday, February 26, at 23:59.** - The first project will count 10% of the final grade of the course.
- If you don't hand in anything for the first project, you may take the exam,
*but the project still counts 10% of the grade.* - You may work on the project either alone or in groups of up to three students.
- The evaluation of the project will be based both on the correctness and extent of your results and on the presentation of these results (see the note concerning advice for the report). The presentation will count for roughly 1/3 of the grade.

### Project description

### What to hand in and how

Your work should contain:

- A written report of at most five pages submitted electronically as a
**PDF file**.- You may write either in English or in Norwegian.
- The report has a strict upper limit of five pages. You may of course use fewer pages than that.
- Preferably use LaTeX, but you may use any other typesetting program you like if this causes issues.
- Do not put your names anywhere on the report. Either use your candidate numbers for this course (if they are already available) or your student numbers (if not).

- A
**zip file**containing all your relevant code.- Make sure that the code actually runs and include enough documentation for me to run it as well.
- The quality of the code will not be included in the grade; its correctness will be, though. In particular, your implementation should actually coincide with your description of the algorithm in your report.
- Do not put your names anywhere in the code.

Send both files together by e-mail to Fredrik Hildrum with "TMA4180 - project" in the subject heading.

### Help sessions

There will be additional help sessions for the duration of the project work:

- I will have office hours on February 17 and 24, between 10-12 and 13-15, and on February 23 between 15-17 (SBII, 10th floor, room 1040).
- There will be an additional exercise session in Nullrommet on February 20 between 10-12.
- The exercise session on February 22 will start already at 14:15 instead of 15:15.
- We (i.e., Fredrik and Markus) will be available in the exercise session on February 15 somewhat earlier (that is, some time between 14:45 and 15:00).