### Assignment 2: primal-dual interior-point method (3p)

Results can be found at the bottom of the page. Most of the students got it all right.

Preliminary **deadline**: Monday Feb 13th, 6pm

The students will program a primal-dual interior-point method and write 1-2 page report where you explain shortly how your code works and the solutions to the problem below. Submit both the report and the matlab codes in one zip file. **Can be done in pairs (submit one package).**

The task is to solve a convex problem of the form min f(x) s.t. g(x)<=0 with the interior point method. The algorithm is presented in Section 11.7 in Convex Optimization book https://stanford.edu/~boyd/cvxbook/ . (Note that there are no equality constraints Ax=b and the corresponding multipliers v.)

Solve the cantilever problem (an instance of geometric programming, Section 4.5.4) with N=8 and N=4. The objective is to minimize the volume of the beam depending on the widths w_i and heights h_i. The constraints are on aspect ratios h_i/w_i, maximum stress and deflection y_1.

min \( \sum w_ih_i \)

s.t. \(w_{min} <= w_i <= w_{max}, i=1,...,N\)

\(h_{min} <= h_i <= h_{max}\)

\(S_{min} <= h_i/w_i <= S_{max}\) (aspect ratio)

\(6iF/(w_ih_i^2) <= \sigma_{max}\) (maximum stress)

\(y_1 <= y_{max}\) (vertical deflection of the beam)

\(w_{min}=h_{min}=0.1, w_{max}=100, h_{max}=6, S_{min}=1/5, S_{max}=5, \sigma_{max}=1, y_{max}=10, E=F=1.\) The method requires a feasible starting point \(g(x_0)<=0\). For N=8, you can use \(x_0=(20\ 20...\ 20\ 6\ 6...\ 6).\)

You can use the matlab file given below to generate the functions, gradients and the hessians for the problem: f(x) objective function, df, hf are its gradient and hessian. g(x) is the vector of constraints, dg the jacobian and \(hg(x,u)=\sum u_i\nabla^2 g_i(x).\) The algorithm can be, for example, of the form: function **[x,u]=pdip(x0,u0,f,df,Hf,g,dg,Hg,tol,maxiter)**, where tol=tolerance for optimality and maxiter=maximum number of iterations.

(Note that this is not a convex problem but can be converted into one using the transformation given in 4.5.3 by using variables y=log(x).You don't probably need to do this transformation but you can try.)

Here is the optimal shape with N=8: