5.8.1. Non-linear Programming Modeling

A general non-linear programming (NLP) problem can be mathematically represented as follows:

\[\begin{split}\begin{matrix} \min & & f(x) \\ \mbox{s.t.} & & c_i(x) \leq u_i, & \quad i = 1, 2, \cdots, m \\ & & l^c \leq x \leq u^c & \end{matrix}\end{split}\]
Where
  • \(x \in \mathbb{R}^{n}\) is the decision variable,

  • \(l^c \in \mathbb{R}^{n}\) and \(u^c \in \mathbb{R}^{n}\) are the lower and upper bounds of \(x\), respectively,

  • \(f: \mathbb{R}^{n} \to \mathbb{R}\) is the objective function,

  • \(c_i: \mathbb{R}^{n} \to \mathbb{R}\) are functions on the left-hand side of the \(i\) constraint,

  • \(u_i \in \mathbb{R}\) are the upper bounds for the \(i\) constraint.

Note

In non-linear programming problems, the objective function \(f\) and constraint \(c_i\) are generally assumed to be continuously differentiable functions. Nevertheless, some problems involving functions with discontinuous derivatives can also be successfully solved by MindOpt .

MindOpt APL and MindOpt currently support the modeling and solving of non-linear problems composed of the following arithmetic operators or mathematical functions.

5.8.1.1. Supported Mathematical Operators

Mathematical Symbol

Description

Representation in MAPL

\(+\) or \(-\)

Addition/Subtraction Operator or Positive/Negative Sign

+ or -

\(*\) or \(/\)

Multiplication/Division Operator

* or /

\(x^a\)

Power Operator (\(a\) is a constant)

^ or **

\(\sum\)

Summation Operator

sum

5.8.1.2. Supported Non-linear Mathematical Functions

Mathematical Symbol

Description

Representation in MAPL

\(\sin(x)\)

Sine function

sin

\(\cos(x)\)

Cosine function

cos

\(\tan(x)\)

Tangent function

tan

\(\arcsin(x)\)

Inverse Sine function

asin

\(\arccos(x)\)

Inverse Cosine function

acos

\(\arctan(x)\)

Inverse Tangent function

atan

\(\sinh(x)\)

Hyperbolic Sine function

sinh

\(\cosh(x)\)

Hyperbolic Cosine function

cosh

\(\tanh(x)\)

Hyperbolic Tangent function

tanh

\(\text{arcsinh}(x)\)

Inverse Hyperbolic Sine function

asinh

\(\text{arccosh}(x)\)

Inverse Hyperbolic Cosine function

acosh

\(\text{arctanh}(x)\)

Inverse Hyperbolic Tangent function

atanh

\(\exp(x)\)

Exponential function

exp

\(\ln(x)\)

Natural Logarithm function

log or ln

\(\lg(x)\)

Logarithm Base 10 function

log10

\(\log_2(x)\)

Logarithm Base 2 function

log2

\(\sqrt x\)

Square Root function

sqrt

\(|x|\)

Absolute Value function

abs

Steps using MindOpt APL and MindOpt :

  1. Use MindOpt APL to create the optimization model;

  2. Input the optimization model into MindOpt and set algorithm parameters;

  3. MindOpt solves the optimization problem and retrieves the solution.

5.8.1.3. Example of Non-linear Programming

In the following, we will consider the following nonlinear constrained programming problem, which is a simple logistic regression with regularization constraints:

\[\begin{split}\begin{matrix} \min\nolimits_{x,y,z} & & \ln(1+\exp(x+2y+z)) &+& \ln(1+\exp(x-y-z)) & \\ & + & \ln(1+\exp(-3x+y-z)) &+& \ln(1+\exp(3x+z)) & \\ \mbox{s.t.} & & x^2 + y^2 \leq 1 &\\ \end{matrix}\end{split}\]

We will demonstrate two ways to call MindOpt to solve this optimization problem, based on MindOpt APL and its Python extension package MaplPy.