Unconstrained Optimization Solver

Let $x\in\mathbf{R}^n$ be an n-dimensional real vector and let $f:\mathbf{R}^n\rightarrow\mathbf{R}$ be a twice differentiable function. Then, the unconstrained optimization problem is to find the local minimizer $x^\star$ that minimizes the objective function $f(x)$: \[ \min_{x}f(x) \] This type of problems has no restriction on $x$. This application uses Newton's method with trust region method to solve the problems. The gradient vector and the Hessian matrix required by this solver are calculated using Gradient Calculator and Hessian Calculator. Testing with some benchmark problems shows that the solver is quite robust though it can be a time-consuming calculation for some problems.

Input Data

The calculator uses the same input format as Gradient Calculator. It is not necessary to input $x_0$ if the $n$-cube $(0,1)^n$ is a subset of the domain of $f(x)$ as $x_0\in(0,1)^n$ can be generated automatically.

Note that some systems of nonlinear equations can be solved with this calculator. Let us find the solution of \[ \begin{array}{c} f_1(x_1,\ldots,x_n) = 0 \\ f_2(x_1,\ldots,x_n) = 0 \\ \cdots \\ f_n(x_1,\ldots,x_n) = 0 \end{array} \] by solving the unconstrained optimization with the objective function $f = f_1^2 + f_2^2 + \cdots + f_n^2$. If the minimizer $x^\star$ is found such that $f(x^\star)=0$, $x^\star$ is also the solution of the system of nonlinear equations above. For example, see the problem from wiki, we have \[ \begin{array}{rcl} f(x_1,x_2,x_3) &=& \left(3x_1-\cos(x_2x_3)-\frac{3}{2}\right)^2 \\ && + \left(4x_1^2-625x_2^2+2x_2-1\right)^2 \\ && + \left(\exp(-x_1x_2)+20x_3+\frac{1}{3}(10\pi-3)\right)^2 \end{array} \] The solution from the calculator is (0.8332, 0.0549, -0.5214) and $f=0$.

Unconstrained Optimization Calculator