488-338 - wseas.us

Numerical Solution of Nonlinear Optimal Control Problems
Using Nonlinear Programming
K.P.BADAKHSHAN, A.V. KAMYAD, M.M.FARD
Engineering, Mathematics, Engineering Department
Ferdowsi University of Mashhad
IRAN
Abstract: In solving nonlinear control (NOC) problems and especially nonlinear optimal control problems,
classical methods usually are not efficiency. In this paper we submit a new approach for solving this class of
problems by using nonlinear programming. First, we put the problem to a new problem in form calculus of
variations. Then we discretize the new problem and solve it by using nonlinear packages such as Lingo, Matlab.
Then we obtain the optimal control and states which they are the exact solution of the original problem
(nonlinear optimal control). Also we can obtain the nonlinear optimal control problems as a combination of
power functions and periodic functions. Then, we bringing some different examples that efficiency of the
proposed method has been confirmed.
Key words and phrases: nonlinear optimal control, nonlinear programming, approximation, discretization.
1 Introduction
Many methods are proposed to control of nonlinear
systems, such as feedback linearization [1], Robust
control [2], adaptive control [3] and other people
apply combinational numerical algorithms, as
genetic algorithm, Neural network, and fuzzy
theory. Some of them are able to solve a few
nonlinear systems but are not a general algorithm
for all systems and have some difficulty, such as
instability, non robust with respect to system
disturbance, non causal, expensive, solution time
explication and many other difficulties [4,5].
Kamyad and his coworker converted partial
differential equations (PDEs) to a classical optimal
control problem by using artificial control then
solved this problem by measure theory [6] and
solved nonlinear PDEs as a control problem by
using measure theory [7-11]. He was applied
measure theory in PDEs and time-varying system
in [12].
In this paper we continue our algorithm [13] that
worked on linear systems. This algorithm
introduces an approximate solution of the NOC
based on optimization. In this approach, we define
an equivalent minimization problem to the NOC.
Then by discretizing the new problem, we reach to
a nonlinear programming (NLP) problem that in
fact the analytic solution of the new problem is the
solution of the original problem. But the solution of
the new problem is an approximate solution of the
original problem. Moreover error of this obtained
approximate solution is controllable. Finally our
algorithm is proposed to solve different control
problems such as optimal control problem;
especially control of nonlinear systems. This
approach may be applied to all systems as linear,
nonlinear and time varying systems. In case of
linear time varying systems, main problem is
approximated to a linear programming (LP)
problem, which is solved with large variants of
powerful software such as LINDO and so on,
which for nonlinear systems it is changed to a
nonlinear programming (NLP) problem, and can be
solved by nonlinear programming packages such as
LINGO. Also we applied our algorithm to some
example of NOC problems and the result confirms
the efficiency of the algorithm.
2 Nonlinear Optimal Control (NOC)
Problem:
1.1 Definition 1:
We focused on following nonlinear time varying
system:
x (t )  g ( x, u, t )
s.t x(a)  xa
(1)
x(b)  xb
Where g is a continues nonlinear time varying
function, g : A U  [a, b]  n , t  (a, b)   ,
x(t )  A , u (t ) U and A  n , U  m are
s.t
x(b)  xb
compact subset and must be chosen so that the
system reach from initial state x(a ) to final state
x (b ) . Also x(t )  ( x1 (t ),..., xn (t )) is the state
x(a)  xa , ( x, t )  A  U  [a, b]
And for NOC problem (2) we define
function and u (t )  (u1 (t ),..., um (t )) is the control
function, and xa  ( xa1 ,..., xan ) xb  ( xb1 ,..., xbn )
Minimize
are given initial and final state in  , respectively,
that may be fix or free.
s.t
n
We may use the above formulation to obtain a
solution for the NOC problem as follows:
s.t
J ( x, u , t ) 
a
x (t )  g ( x, u, t ) , ( x, t )  A  U  [a, b]
x(a)  xa
(5)
x(b)  xb
1.2 Definition 2:
Minimize
b
J ( x, u, t )   E ( x, u, t )dt
b

a
f ( x, u, t )dt
x (t )  g ( x, u, t ) , ( x, t )  A  U  [a, b]
x(a)  xa
(2)
x(b)  xb
Where f : A  U  [a, b]   is a continues
function. Particularly in optimal control
problems f can be an energy or fuel function as
below:
f ( x, u, t )  12 u 2 (t )
Where E ( x, u, t )  f ( x, u, t ) and other parameters
are as same as calculus variable problem (4). In the
following, we assume original NOC problem is (5)
thus for reach to problem (4) this is sufficient to
change E ( x, u , t ) from equation (3).
To solve a NOC problem using Euler-Lagrange
method may cause many difficulties. So, numerical
solution used to obtain an approximate solution for
NOC problem. Here we convert the problem to a
nonlinear programming problem and finally we
obtain an approximate solution for the original
problem by using the solution of the NLP problem.
Now, the following theorem that is a key lemma is
demonstrated.
3.1 Lemma.1
If E ( x , x, u , t ) is a nonlinear continuous function
on A  U  [a, b] and non-negative E  0 , then it
f ( x, u, t )  u(t )
In general, J also may be a multi purpose or multi
objective functional, for example minimization of
fuel dissipation or maximization of benefit is a
common multi objective function.
may be written:
b

a
Edt  0  E  0
Proof:
3 A Calculus Variation Problem
Equivalent to NOC Problem:
 Let assume
Consider nonlinear system (1) at first, we define
following functional that is called the error
functional. Let:
E( x, x, u, t )  x(t )  g ( x, u, t )
(3)
where . is the absolute value function and other
parameter introduced in definition.1. We define the
following problem in calculus of variations:
Minimize
b
J ( x, x, u, t )   E ( x, x, u, t )dt
a
(4)
b

a
Edt  0 and E( x1 )  0 for
some ( x1 )  A and let E( x1 )  0 , since E is a
continues function so E ( x)  0 for some
neighborhood of x1 . Therefore
b

a
Edt  0 this is
contradiction to our assumption.
 Where E  0 on A  U  [a, b] then obviously
b

a
Edt  0 , thus proves the lemma.
3.2 Theorem.1
Necessary and sufficient condition for u be a
solution of NOC problem (1) is J ( x, x, u, t )  0 in
minimization problem (4).
Where ui ,k are n l unknown control parameters.
proof:
xi 
 If x is the solution of NOC problem, the E  0 on
A  U  [a, b] so by definition we have J  0 .
 If x* and u * be a function where
J ( x * , x* , u * , t )  0 , then we have E  0 ,
( x, t )  N . Because the absolute value function
. is continuous, and also functions x (t ), x(t ) and
For the first derivative we have:
xi1,k  xi ,k
 n( xi1,k  xi ,k )
x
Thus, we obtain discretized problem (6) in the
form:
Minimize
J ( xi ,k , u j ,k , t k )
n
 
u (t ) are continuous. Then E0 is a nonnegative
continues function. Therefore from assumption
b

a
i 1 k 1
s.t
Edt  0 , we conclude E  0 every where on
A  U  [a, b]  3 , or:
x (t )  g ( x, u, t )  0
, ( x, t )  N
Note: Without loss of generality, we may assume
a  0 and b  1 .
 E( x
i ,k
As we know, an approximate value of integral
b

K ( x)dx is (b  a) K (c) , where c is any point
such that a  c  b . So, applying above remark,
the minimization problem (5) is formed as
Minimize
J ( xi ,k , u j ,k , t k )
4 Discretization
1
1
and t  . Let:
n
l
tk  tk 1  t
t1  0
tl  1
xi ,k  xi1 (t k )  x
k  1,2,..., l
x1,k  x(0)  xa
i  1,2,..., n
xn ,k  x(1)  xb
u j ,k  u j (tk )
and also assume:
g i , j ,k  g ( xi ,k , u j ,k , t k )
j  1,2,..., m
(7)
4.1 Remark:
l
 
We partition interval x  [0,1] to n parts and also
t  [0,1] to l equal subinterval (cells), where n
and l be arbitrary fixed positive integer, then
, u j ,k , tk )dt
0
xn ,k  xb
n
x 
1
n( xi1,k  xi ,k )  g i , j ,k
x1,k  xa ,
a
Therefore, theorem.2 is proved.
l
i 1 k 1
s.t
1
E ( xi ,k , u j ,k , t k )
nl
(8)
n( xi1,k  xi ,k )  g i , j ,k
x1,k  xa ,
xn ,k  xb
In general the problem (8) is a NLP problem and
we may obtain its solution by many packages
(Lingo, Matlab, Gino, etc). Finally by obtaining the
solution of problem (8), we recognize the value of
unknown admissible pair ( xi ,k , u j ,k ) state and
control function at n  l point. We can construct
the optimal solution for NOC problem by two
piecewise functions ( x*i ,k , u * j ,k ). Also we may fit
two curves by those functions and introduce two
time variant continues functions for optimal state
and control. Theorem 3 will show existence of the
optimal solution for the NOC problem (1).
4.2 Theorem.2
If ( x*i ,k , u * j ,k ) be the pair constructed solution of
the above NLP problem and optimal objective
function be zero
E( xi*,k , u*j ,k , tk )  0
then ( x*i ,k , u * j ,k ) is a solution for problem (1).
Eijk  S1ijk  S 2ijk
proof:
By assumption ( x*i ,k , u * j ,k ) is a pair piecewise
continues function with the corresponding objective
zero, so by theorem.1 we can write ( x*i ,k , u * j ,k ) is
a solution of problem (1).
at the end, the minimization problem (8) is formed
as below LP problem:
4.3 Remark:
s.t
Minimize
J ( xi , j , u j ,k , t k )
n
i 1
If we want to control the total error of the problem
(8) which is discretized of the original problem [6],
it is sufficient to add the following restriction to
problem (8)
n
l

i 1 k 1
1
E ( xi ,k , u j ,k , t k )  
nl
n
l
J ( xi ,k , u j ,k , t k )  
i 1 k 1
x1,k  xa , xn ,k  xb
n
l

i 1 k 1
n( xi1,k  xi ,k )  g i , j ,k
(10)
x1,k  xa
xn ,k  xb
4.5 Theorem.3
Supposing the nonlinear system x  h( x, t ) that
1
h :    and x  a, b   , t  c, d   
E ( xi ,k , u j ,k , t k )
then
assume:
nl
n( xi1,k  xi ,k )  g i , j ,k
s.t
1
( S1ijk  S 2ijk )
k 1 nl
It can be solved by many powerful packages, such
as Lindo and Matlab.
Where  is a known acceptable error. Then we
have new minimization problem:
Minimize
l
 
1
E ( xi ,k , u j ,k , t k )  
nl
(9)
A  x  h( x, t )
to obtain the answer, we expect A  0 . In this case
if we discretize the problem and AN is the
problem’s solution by sampling  
Note: When we are going to solve problem (9), it is
possible that we have no solution for the problem
(infeasible problem). In this case we should to
increase the numbers n and l .
have:
4.4 LP formulation for Linear wave
Problem
If g ( x, u , t ) is a linear function, we can transfer the
Where
new obtained nonlinear programming problem (8)
or (9) to a linear programming problem [18]. So,
we may decompose the value of Eijk by a
difference of two non negative values S1ijk and
S 2ijk , i.e. S1ijk , S 2ijk  0 as follows:
Eijk  S1ijk  S 2ijk
(11)
AN 
xk 1  xk
 h ( xk , t )

a b
we
N
, k  1,2,..., N
N is the number of subinterval of partition
a, b. So,
lim AN  0
N 
proof:
Let
H x, x, t   x  h( x, t ) ,
H :    . So, A  H x, x, t   x(t )  h( x, t )
functional
and we can define the following function:
T
where i  1,2,..., n and j  1,2,..., m . Considering
the determination of absolute value in the definition
norm function (3), such that:
Err   H x, x, t dt
0
Considering the given discretization method that
explained in the previous part, it may be defined:
AN    H ( xi , t j )dt
where we assume the control function be piecewise
constant function.
thus, by minimization AN and solving the NLP
problem, the optimal solution of NLP problem is
x* and AN  0 .
5 Simulation:
Therefore, because Min ( AN )  Min ( A) then:
5.1 Example 1:
N ti 1
i 1 ti
Find a suitable control for minimization of
following nonlinear functional:
T
Min A   H ( x  , x , t )dt  0
1
0
with indicate A  0 in the equation (11), it’s
enough to specify
N
ti 1
i 0
ti
0
 H ( x , x , t )dt  


In this section we use our algorithm for some
nonlinear systems:
,   0
So, as 0  Min A   ,   0 that  may be
taken such small that A  0 , Thus,
J ( x, u )   ( x 2 (t )  u (t ))dt
0
s.t x (t )  u (t )
x(t )  [1,1] , u (t )  [1,1] , t  [0,1]
x(0)  0 , x(1)  .5
For this system we choose partitioning [0, l] to 10
equal subintervals. So t1  0 , t2  .1 , … , t10  1 .
The formulation of corresponding NLP problem is
as the following:
10
N
Lim 
N 
i 0
ti 1
 ( x , t )dt  0
i
j
ti
Therefore, the theorem is proved.
4.6 Degree of Desirability:
In general it may be written that solution of the
NOC equation (1) by Theorem.4 about
optimization may be solved by applying our
method. In this case, if a suboptimal approximated
solution for the NOC equation (1) is obtained by
solving NLP problem (9) with desirability solution
may be defined as follow. If ( x*1 , u *1 ) be a
solution obtained by (9), then let:
J1 ( x1* , u1* )    1
so, the desirability of the solution is:
~
A  {x1* , u1* ,  J1 ) :
 A~ ( x1* , u1* )  1  J1 ( x1* , u1* )
 1 
Note: Usually we may obtain also the exact solution for
the original problem, it sufficient to show E (.,.,.)  0 ,
Min
 (x
i 1
 2u j ,k )
2
i
s.t
10( xi1,k  xi ,k )  g i , j ,k ,
i  1,2,...,10
x1,k  xa j  1,2,...,100
x10,k  xb
k  1,2,...,10
 1  xi ,k  1
 1  u j ,k  1
xi ,k , u j ,k
free
The optimal objective function value for this NLP
is zero. The approximation of trajectory function
obtained from the solution of the above NLP is
shown in fig.1 (dotted line). Another approach to
show the result is curve fitting by Fourier series.
We fit state function in fig. 1 (bold line) with
following Fourier series:
3
f (t )  a0   an sin( nx)  bn cos( nx)
n 1
where
  0.4445 , a0  .379 , a1  .7825 ,
a3  .0299 ,
a2  .0961,
b2  .1304 and b3  .0602 .
b1  .2125 ,
5.3 Example 3:
Find suitable control for the following nonlinear
system subject to minimize this functional.
1
Then the approximation of control function is
shown in fig.2 (dotted line) and fitting a curve by
Fourier series is scheme in fig. 2 (bold line).
J ( x, u )   ( x12 (t )  x22 (t ))dt
0
s.t
x1 (t )  x2 (t )
x2 (t )  10 x13 (t )  u(t )
x1 (0)  0 , x1 (1)  .1
x2 (0)  0 , x2 (1)  .3
Fig.1: Approximation solution of the state function
with fitting the curve
The optimal objective function value for this NLP
is 0.01348171 with LINGO software, and given
result in reference [14] is 0.024, which show our
algorithm advantage. The sate functions (dotted
line) and fitting curves by polynomial are scheme
in fig. 3 (bold line). The approximation solution of
the control function is obtained from the above
NLP (dotted line) with fitting the curve by
following polynomial (bold line) is shown in fig.4.
6
f (t )   pn x n
n 0
where
p1  9.375 , p2  4.12 ,
p4  699.7 , p5  786.4 and
p0  .946 ,
p3  230.2 ,
p6  302.7 .
Fig.2: the control function with fitting the curve
5.2 Example 2:
Obtain a control u (t ) and simultaneously state of
the following nonlinear system:
x (t )   x 2 (t )  2tu(t )
s.t x(0)  0
x(1) is free
u (t )  [10,10]
Obtained objective function value is 0.1468870E-06
Fig.3: Approximation solution of the state functions with
fitting curves
Fig.4: the control function with fitting the curve
6- conclusion:
Discretize the classic control problem to a NLP or
LP to obtain an approximate solution of the original
problem, is the main goal of this paper. Because the
classic methods for the solution of nonlinear
systems and in easier case for linear time varying
systems are caused a linear or nonlinear set of
equations. Common methods as nonlinear system
linearization cause non-predictable and noncontrollable errors. All found solutions are local
optimum, which are tailor expansion around
Equilibrium point, and are not global solutions.
However in non convex search space, classic
theory is inefficient. In this paper, our algorithm
was applied to NOC systems. By using the
algorithm,
in
addition,
analyze
system
controllability in general form, can be enable the
users to restrict actuating signal. This is an
important result to make more applied control
problems. Although, this approach removes all
difficulties that contact in optimal control problem
solution. Simulations confirmed the approach
ability to solve NOC problems, which is compared
with [14] and better solution was presented.
References:
[1] Jean-Jacques E. Slotine, Weiping Li, Applied
Nonlinear Control, Printice-Hall, 1991
[2] B. Fernandez R. and J. K. Hedrick, “Control of
multivariable non-linear systems by the sliding
model”, Int. J. Control, vol. 46, no. 3, pp. 10191040, 1987.
[3] D. Leith and W. Leithead, “Survey of gainscheduling analysis and design,” Int. J. Control,
vol. 73, no. 11, pp. 1001–1025, 2000.
[4] H.K. Khalil, Nonlinear Systems, Prentice Hall,
2nd edition, 1996.
[5] P. Kokotovi and M. Arcak, Constructive
nonlinear control: A historical perspective” (survey
paper). Automatica, 37(5):637–662, May 2001.
[6]. M. Gachpazan and A. V. Kamyad, “Solving of
second order nonlinear PDE problems by using
artificial controls with controlled error”, J. Appl.
Math. & Computing, Vol.15, no.1-2, 2004, pp.173184.
[7]. A. V. Kamyad, A. H. Borzabadi, “Strong
controllability and optimal of the heat equation
with a thermal source”, to appear in The Korean
Journal of Computational Applied Mathematics.
[8]. A. V. Kamyad, J. E. Rubio, and D. A. Wilson,
“An optimal control problem for the
multidimensional diffusion equation with a
generalized control variable”, J. Opt. Theory and
Apl., Vol. 75, No.1, 1992, pp.101-132.
[9]. A. V. Kamyad, J.E. Rubio, and D. A. Wilson,
“The optimal control of the multidimensional
diffusion equation”, J. Opt. Theory and Apl., Vol.
70, 1991, pp.191-209.
[10]. S. A. Alavi, A. V. Kamyad, and M. H. Farahi,
“The optimal control of an inhomogeneous wave
problem with internal control and their numerical
solution”, Bulletin of the Iranian Mathematical
society, Vol. 23, No.2, 1997, pp.9-36.
[11]. S. A. Alavi, A. V. Kamyad, and M.
Gachpazan, “Solving of nonlinear ordinary
differential equations as a control problem by using
measure theory” , Scientia Iranica, Vol. 7, No.1,
2000, pp.1-7.
[12]. A. H. Borzabadi, A. V. Kamyad, M.H.
Farahi, “Optimal control of the heat equation in an
inhomogeneous body”, J. Appl. Math. &
Computing, Vol.15, no.1-2, 2004, pp.127-146.
[13]. A. V. Kamyad, H.H. Mehne, “A linear
programming approach to the controllability of
time-varying system”, IUST- International J. of
eng. Science, vol.14, no,4, 2003, pp.143-151.
[14] J. E. Rubio, control and optimization the linear
treatment of nonlinear problems,Manchester
university press, 1985.