Detailed Case Study of Implementing Penalty Function Method in MATLAB

Using the penalty function method, the solution of nonlinear programming problems can be transformed into solving a series of unconstrained extremum problems. This method is also referred to as the Sequential Unconstrained Minimization Technique, abbreviated as SUMT. The idea behind the penalty function method for solving nonlinear programming problems is to construct an augmented objective function with parameters by appropriately defining penalty functions based on the constraint functions of the problem, thus converting the problem into an unconstrained nonlinear programming problem. There are mainly two forms: one is called the external penalty function method, and the other is called the internal penalty function method.

11.3.1 External Penalty Function Method

For a general nonlinear programming problem:

min f(X)

Detailed Case Study of Implementing Penalty Function Method in MATLAB

Let

Detailed Case Study of Implementing Penalty Function Method in MATLAB

Thus, (1) is transformed into an unconstrained optimization problem:

Detailed Case Study of Implementing Penalty Function Method in MATLAB

If we set

Detailed Case Study of Implementing Penalty Function Method in MATLAB

Then it is transformed into solving the following optimization problem:

Detailed Case Study of Implementing Penalty Function Method in MATLAB

Where T(X, M) is called the penalty function, M is the penalty factor, and the term with M is called the penalty term. The penalty function only punishes points that do not satisfy the constraints: when X ∈ D (D is the feasible region), satisfying each gi(X) ≥ 0, hi(X) = 0, thus the penalty term = 0, and no punishment is applied. When X is outside D, there must be constraints where gi(X) < 0 or hi(X) ≠ 0, hence the penalty term > 0, and punishment is applied.

The iterative steps of the SUTM external point method (penalty function method) are as follows:

(1) Arbitrarily set an initial point X0, take M1 > 1, set the allowable error ε > 0, and let k = 1;

(2) Solve the unconstrained extremum problem

Detailed Case Study of Implementing Penalty Function Method in MATLAB

for the optimal solution, denoted as Xk = X(Mk), that is

Detailed Case Study of Implementing Penalty Function Method in MATLAB

(3) If Mp(Xk) > ε, then take Mk > M (Mk+1 = αM, α = 10), let k = k + 1 and return to (2), otherwise, stop the iteration. The optimal solution is X* ≈ Xk.

The disadvantage of the penalty function method is that each approximate optimal solution Xk is often not a feasible solution, but only approximately satisfies the constraints, which may not be usable in practical problems; the computational load in solving a series of unconstrained problems is too large, especially as Mk increases, which may lead to errors.

Example 11.3.1 Solve the following nonlinear programming model:

Detailed Case Study of Implementing Penalty Function Method in MATLAB

Detailed Case Study of Implementing Penalty Function Method in MATLAB

Solution: First, establish the penalty term function li11_3_1p.m file as follows:

Detailed Case Study of Implementing Penalty Function Method in MATLAB

Then establish the penalty function li11_3_1t.m file as follows:

Detailed Case Study of Implementing Penalty Function Method in MATLAB

Finally, establish the main function li11_3_1.m file as follows:

Detailed Case Study of Implementing Penalty Function Method in MATLAB

Executing li11_3_1.m yields

Detailed Case Study of Implementing Penalty Function Method in MATLAB

11.3.2 Internal Penalty Function Method

Consider the problem:

Detailed Case Study of Implementing Penalty Function Method in MATLAB

Let the set D0 = {X | gi(X) > 0, i = 1, 2, …, m} ≠ φ, where D0 is the set of all strictly interior points in the feasible region. Construct the barrier function:

Detailed Case Study of Implementing Penalty Function Method in MATLAB

Let

Detailed Case Study of Implementing Penalty Function Method in MATLAB

or

Detailed Case Study of Implementing Penalty Function Method in MATLAB

Then rb(x) is called the barrier term, and r is the barrier factor. Thus, problem (2) is transformed into solving a series of extremum problems:

Detailed Case Study of Implementing Penalty Function Method in MATLAB

The iterative steps of the interior point method are as follows:

(1) Given an allowable error ε > 0, take r1 > 0, 0 < β < 1;

(2) Find an interior point X0 ∈ D0 of the constraint set D, let k = 1;

(3) Using Xk-1 ∈ D0 as the initial point, solve

Detailed Case Study of Implementing Penalty Function Method in MATLAB

where X ∈ D0 is the optimal solution, denoted as Xk = X(rk) ∈ D0;

(4) Check if |rkb(Xk)| ≤ ε, if satisfied, stop the iteration, X* ≈ Xk; otherwise, take rk+1 = βrk, let k = k + 1, and return to (3).

Example 11.3.2 Use the interior point method to solve the following linear programming problem:

Detailed Case Study of Implementing Penalty Function Method in MATLAB

Solution: First, write the li11_3_2.m program code as follows:

Detailed Case Study of Implementing Penalty Function Method in MATLAB

Detailed Case Study of Implementing Penalty Function Method in MATLAB

Next, write the li11_3_2zhu.m program as follows:

Detailed Case Study of Implementing Penalty Function Method in MATLAB

The program execution result is:

Detailed Case Study of Implementing Penalty Function Method in MATLAB

Leave a Comment