## 5 Hull Form Optimization Process  
### SQP Algorithm  
The mathematical formulation of the optimization problem is expressed as  
\[\text{Minimize}\left[f_{1}(\overline{x}),\;f_{2}(\overline{x}),\cdots,f_{K}( \overline{x})\right] \tag{9}\]  
subject to the equality and inequality constraints  
\[h_{j}(\overline{x})=0,\;\;\;\;\;j=1,\;\cdots,\;p \tag{10}\]  
\[g_{j}(\overline{x})<0,\;\;\;\;\;j=1,\;\cdots,\;q \tag{11}\]  
where \(f_{i}(\overline{x})\) is the objective function, \(K\) is the number of objective functions, \(p\) is the number of equality constraints, \(q\) is the number of inequality constraints, and \(\overline{x}=(x_{1},\;x_{2},\cdots,\;x_{N}\;)\subseteq S\) is a solution or design variable. The search space \(S\) is defined as an N-dimensional rectangle in \(R^{N}\) (domain of variables defined by their lower and upper bounds)  
\[x_{i}^{min}\leq x_{i}\leq x_{i}^{max},\;\;\;\;i=1,\;\cdots,\;N \tag{12}\]  
The constraints define the feasible area, which means that if the design variables vector \(\overline{x}\) is in agreement with both constraints \(h_{j}(\overline{x})\) and \(g_{j}(\overline{x})\), it belongs in the feasible area. In this study, the sequential quadratic programming (SQP) method was used to obtain the numerical solution of constrained nonlinear optimization problem. \(\
abla f(\overline{x})\) is the gradient of \(f(\overline{x})\) and it can be expressed as follows:  
\[\
abla f(\overline{x})=\left(\frac{\partial f}{\partial x_{1}},\;\frac{ \partial f}{\partial x_{2}},\cdots,\frac{\partial f}{\partial x_{N}}\;\right) \tag{13}\]  
When the gradient cannot be evaluated directly with respect to the design variable \(x_{i}\), the gradient of objective function \(f\) can be evaluated by finite differencing as follows:  
\[\frac{\partial f}{\partial x_{1}}=\frac{f(x_{i}+\epsilon_{i})-f(x_{i}- \epsilon_{i})}{2\epsilon_{i}},i=1,\cdots,N \tag{14}\]  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Running Attitudes** & \(C_{P}\times 10^{3}\) & \(C_{FM}\times 10^{3}\) & \(C_{TM}\times 10^{3}\) & **\begin{tabular}{c} **Sinkage** \\ **(\(\Delta z\)/LBP)** \\ \end{tabular} & **\
\begin{tabular}{c} **Trim** \\ **(\({}^{\circ}\))** \\ \end{tabular} & **
\begin{tabular}{c} **Computational** \\ **Time (h)** \\ \end{tabular} \\ \hline Free & 0.7280 & 2.8360 & 3.5640 & \(-\)0.0020 & \(-\)0.174 & 5 \\ Fixed with static & 0.7352 & 2.8350 & 3.5702 & \(-\)0.0021 & \(-\)0.173 & 2 \\ sinkage \& trim & & & & \\ \hline \hline \end{tabular}
\end{table}
Table 5: CFD validation with respect to running attitude conditions for the optimal hull.  
in which \(\epsilon_{i}\) is the step size of design variable \(x_{i}\).  
This method, based on the iterative formulation and solution of quadratic programming subproblems, obtains subproblems using a quadratic approximation of the Lagrangian and by linearizing the constraints. The following quadratic programming problem is solved to obtain the search direction vector \(d\):  
\[\text{Minimize}\ \
abla f(\overline{x})^{T}d+\frac{1}{2}d^{T}Hd \tag{15}\]  
subject to  
\[h_{j}(\overline{x})+\
abla h_{j}(\overline{x})^{T}d=0,\ \ \ \ j=1,\ \cdots,\ p \tag{16}\]  
\[g_{j}(\overline{x})+\
abla g_{j}(\overline{x})^{T}d<0.\ \ j=1,\ \cdots,\ q \tag{17}\]  
\(H\) is an approximation to the Hessian matrix of the Lagrange function.  
When the design variables \(x_{i}^{k}\) at \(k\)-th iteration step are determined, the design variables \(x_{i}^{k+1}\) at \(k+1\)-th iteration step are evaluated as follows:  
\[x_{i}^{k+1}=x_{i}^{k}+\alpha^{k}d_{i}^{k}.\ i=1,\cdots,N \tag{18}\]  
Here, \(\alpha^{k}\) represents the step length at \(k\)-th iteration step. During the iterations for optimization, the principal particulars such as \(LBP\), \(B\), \(T\) were kept unchanged, and the inequality constraints were set in terms of maximum increment in design variables. As pointed out earlier, the displacement of ship was allowed to vary within 0.015%.