mites is

73
ON PREDICTIVE CONTROLS FOR HYBRID SYSTEMS SUBJECT TO MIXED STATE-CONTROL CONSTRAINTS AND STATE JUMPS A Thesis Presented to The Academic Faculty by Daniel Felipe Cort´ es Sanabria In Partial Fulfillment of the Requirements for the Degree Master in Electronics Engineering in the Faculty of Engineering Pontificia Universidad Javeriana May 2015

Upload: henrydcl

Post on 13-Sep-2015

4 views

Category:

Documents


2 download

DESCRIPTION

Mites Is

TRANSCRIPT

  • ON PREDICTIVE CONTROLS FOR HYBRID SYSTEMS SUBJECTTO MIXED STATE-CONTROL CONSTRAINTS AND STATE JUMPS

    A ThesisPresented to

    The Academic Faculty

    by

    Daniel Felipe Cortes Sanabria

    In Partial Fulfillmentof the Requirements for the Degree

    Master in Electronics Engineering in theFaculty of Engineering

    Pontificia Universidad JaverianaMay 2015

  • ON PREDICTIVE CONTROLS FOR HYBRID SYSTEMS SUBJECTTO MIXED STATE-CONTROL CONSTRAINTS AND STATE JUMPS

    Approved by:

    Professor Diego Alejandro Patino Guevara,AdvisorDepartment of Electronic EngineeringPontificia Universidad Javeriana-Bogota

    Date Approved: May 2015

  • Contents

    LIST OF FIGURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v

    I INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    1.1 General Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    1.2 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    1.2.1 General Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    1.2.2 Specific Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    1.3 Contribution and Organization . . . . . . . . . . . . . . . . . . . . . . . . 3

    II SWITCHED DYNAMICAL SYSTEMS . . . . . . . . . . . . . . . . . . . 5

    2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    2.1.1 Hybrid Dynamical Systems . . . . . . . . . . . . . . . . . . . . . . 6

    2.1.2 Switched Dynamical Systems . . . . . . . . . . . . . . . . . . . . . 8

    2.2 Switched systems with state jumps . . . . . . . . . . . . . . . . . . . . . . 10

    2.2.1 Nonlinear Constrained Switched Systems with State Jump . . . . . 10

    2.2.2 Autonomous Switched Systems with State Jump . . . . . . . . . . 14

    2.3 Constrained switched systems with controlled switching . . . . . . . . . . . 17

    2.4 Constrained switched systems with autonomous switching . . . . . . . . . 18

    III OPTIMAL CONTROL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    3.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    3.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    3.2.1 Pontryagins Minimum Principle . . . . . . . . . . . . . . . . . . . . 21

    3.3 Optimal control for constrained switched systems with controlled switching 22

    3.3.1 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    3.3.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    3.4 Optimal control for constrained switched systems with autonomous switching 41

    3.4.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

    IV MODEL PREDICTIVE CONTROL . . . . . . . . . . . . . . . . . . . . . 47

    4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

    4.2 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

    iii

  • 4.3 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

    4.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

    V CONCLUDING REMARKS . . . . . . . . . . . . . . . . . . . . . . . . . . 55

    5.1 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

    5.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

    Appendix A C/GMRES METHOD . . . . . . . . . . . . . . . . . . . . . 57

    Appendix B COMPLEMENTARITY SYSTEM . . . . . . . . . . . . . 61

    iv

  • List of Figures

    1 Hybrid Dynamical System Representation . . . . . . . . . . . . . . . . . . . 7

    2 Bouncing Ball Representation . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    3 Bouncing Ball Automata Representation . . . . . . . . . . . . . . . . . . . . 8

    4 Initialization of the control input after the state jump . . . . . . . . . . . . 13

    5 State trajectory for the switched system with state jump . . . . . . . . . . . 16

    6 Artificial Neuron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

    7 Neural Network Performance Example . . . . . . . . . . . . . . . . . . . . . 32

    8 FCC Converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    9 State Variables for the FCC when the Optimal Control law is applied . . . 35

    10 Optimal control laws for the FCC . . . . . . . . . . . . . . . . . . . . . . . . 35

    11 Boost Converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

    12 Optimal Control law for the Boost Converter when xref = (0.78, 27.46) andx(0) = (2.22, 44.4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    13 Optimal Control law for the Boost Converter when xref = (2.22, 44.4) andx(0) = (0, 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

    14 Optimal Control law for the Boost Converter when xref = (2.22, 44.4) andx(0) = (1.11, 66.6) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

    15 Optimal Control law for the Boost Converter obtained by using our secondproposal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

    16 Optimal Control law for the Autonomous Boost Converter . . . . . . . . . . 46

    17 Model Predictive Control Design . . . . . . . . . . . . . . . . . . . . . . . . 49

    18 Lookup Table for a 2-dimensional system . . . . . . . . . . . . . . . . . . . 52

    19 Predictive Control law for the Boost Converter when the Neural Networkmethod is used and the fine adjustment is not considered . . . . . . . . . . 53

    20 Predictive Control law for the Boost Converter when the Neural Networkmethod is used and the fine adjustment is considered . . . . . . . . . . . . . 53

    21 Predictive Control law for the Boost Converter when the Lookup Tablemethod is used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

    v

  • Nota de Advertencia

    La universidad no se hace responsable de los conceptos emitidos por sus alumnos en sus

    proyectos de grado. Solo velara porque no se publique nada contrario al dogma y la moral

    catolica y porque los trabajos no contengan ataques o polemicas puramente personales.

    Antes bien, que se vea en ellos el anhelo de buscar la verdad y la justicia.

    Artculo 23 de la Resolucion No. 13, del 6 de julio de 1946, por la cual se reglamenta lo

    concerniente a Tesis y Examenes de Grado en la Pontificia Universidad Javeriana.

    vi

  • Reminder Note

    This university is not responsible for the concepts issued by its students in their grade

    project. This university will only ensure that they do not publish anything contrary to the

    catholic dogma and that this work does not contain personal attacks or polemics. Rather

    than that, it is seen in them the desire to seek truth and justice.

    Article 23 in the resolution issued in 6th of july of 1946, which regulates the issues concerning

    the thesis and grade exams in the Pontificia Universidad Javeriana.

    vii

  • Chapter I

    INTRODUCTION

    1.1 General Introduction

    A large class of systems, which involves both continuous and discrete dynamics, are called

    Hybrid Dynamical Systems (HDS). These systems may simplify the study of nonlinear sys-

    tems. They also model some real world systems, that may not be modelled by continuous

    or discrete models independently, such as the bouncing ball problem [7].

    Consequently, HDS are widely used in many fields of science, for example biological systems

    exhibit continuous characteristics during normal operation and discontinuous when some

    impulsive stimulus occurs; they are also used in power converters [27, 24, 23], in which

    there are analogue and digital components, then voltage and current continuously change

    according to circuit laws, but discrete behavior occurs when some switch opens or closes.

    Additionally, all real world problems implicitly have some constraints because of the prob-

    lem physics. For example, actuators have limitations on amplitude and response velocity,

    which implies that the control signal must be constrained. Also, in a tank system, the

    minimum and maximum levels of liquid in the tanks mean state constraints.

    In this research, we work with three classes of switched systems: switched systems with

    controlled switchings, in which the switchings are externally generated ; switched systems

    with autonomous switchings, in which the switchings are internally forced due to the dy-

    namics itself; and switched systems with state jumps, in which discontinuities arise between

    mode transitions. It is worth mentioning that the first two classes include input and state

    constraints.

    For the first class of systems, we obtained optimal and predictive control laws. It is well

    known that model predictive control may be understood as an extension of optimal control,

    because online optimal control problems for a receding horizon have to be solved [1]. How-

    ever, obtaining an optimal control law for this kind of systems using numerical methods

    1

  • is not usually easy, since one has to deal with many numerical issues, and the search of

    analytic solutions, even for low dimensional systems, is complex.

    A method to overcome these problems has been proposed in [27]. The authors include the

    set of necessary conditions, deduced from the Pontryagins Minimum Principle, as a set of

    complementary constraints, and then they add them to the Hamiltonian system to form a

    complementarity system. Nevertheless, we have noticed that this inclusion has some incon-

    gruities as we explain further down.

    In that sense, we used their arguments to correctly obtain optimal control laws, and then

    to extend them to predictive control laws. For that reason, we reformulated their theorems

    for the optimal control problem.

    In order to obtain the set of online optimal control laws to compute the predictive control

    law, we proposed a neural network method, a linear optimization method, and a lookup

    table method. We tested these control laws, by using the proposed theorems and methods,

    in a flying capacitor converter and a boost converter.

    For the second class of systems, we obtained only optimal control laws. In that case, we

    proposed one theorem which includes state and input constraints. This theorem provides

    necessary conditions that the optimal control law must satisfy. This theorem was tested by

    computing an optimal control for a boost converter.

    For switched systems with state jumps, we reviewed literature regarding this topic. Study-

    ing this theme is marked by great importance, for example when a power converter is

    analyzed, the switch is assumed as an open circuit or a short circuit, and this assumption

    may prompt inconsistent initial conditions and discontinuities on the state variables.

    We also briefly explained some differences between these approaches and some numerical

    examples have been shown.

    1.2 Objectives

    1.2.1 General Objective

    Formulate control laws for a hybrid system subject to state and input constraints, and to

    state jumps.

    2

  • 1.2.2 Specific Objectives

    Formulate control laws for a hybrid system subject to state and input constraints.

    Formulate control laws for a system subject to state jumps.

    Simulate the proposed laws in systems previously studied by others.

    1.3 Contribution and Organization

    This work has three important contributions: the first one includes the reformulation of op-

    timal control laws for input-state constrained switched systems with controlled switchings,

    which have been previously proposed. The second one is the extension of these optimal

    control laws to predictive control laws. These methods involve an important advantage

    since analytical computing of singular arcs is not necessary, instead some conditions are

    used.

    The third contribution is the inclusion of input and state constraints in switched systems

    with autonomous switchings in order to obtain optimal control laws. The document is or-

    ganized in 7 chapters and is structured as follows.

    Chapter I: this chapter is a general introduction for the topics that were studied in this

    work. The purposes of the study are also included here.

    Chapter II: this chapter describes the classes of switched systems that were worked in

    this research. The mathematical models for theses systems are included.

    Chapter III: this chapter includes theorems that provide necessary conditions to obtain

    optimal control laws for the systems studied. A discussion regarding previous works has

    been included. It also explains some considerations that are needed in order to numerically

    compute optimal control laws. Two methods, including simulations, for easily fitting these

    control laws are presented. In this chapter we include the reformulation of the optimal

    control for constrained switched systems with controlled switchings as well as the Theorem

    for the necessary conditions for switched systems with autonomous switchings, which are

    two of our contributions.

    Chapter IV: this chapter explains in detail the way that was used to extend the optimal

    3

  • control laws in order to obtain the predictive control laws. Three methods to perform this

    tasks are presented. The extension of optimal control laws to predictive control laws is one

    of our contributions.

    Chapter V: this chapter contains some considerations regarding switched systems with

    state jumps. Two methods that were found in literature have been explained.

    Chapter VI: this chapter presents the results of applying the theorems proposed to some

    power converters. Some analyses from the results obtained are also presented in this chap-

    ter.

    Chapter VII: this chapter presents the conclusions of the work. It also contains some

    problems and new perspectives, encountered during the performance of this thesis, that

    would be interesting to be covered by future works.

    4

  • Chapter II

    SWITCHED DYNAMICAL SYSTEMS

    2.1 Overview

    Hybrid Dynamical Systems and Switched Dynamical Systems are systems that exhibit

    characteristics of both continuous time systems and discrete time systems. The importance

    of these systems is increasing day by day because they have traits that can be used in

    real-world problems, so they constitute an active area of current research. They can model

    special behaviors that can not be described by continuous or discrete systems. Applications

    include biological systems, which have continuous changes during normal operation and

    discontinuous change due to an impulsive stimulus. Similarly, velocities in a multibody

    system continuously change according to Newtons second law but undergo instantaneous

    changes in velocity and momentum due to collisions [7]. In power applications, these

    systems let model power circuits in which voltage and current continuously change according

    to classical electrical networks laws, but discontinuously change due to switches opening or

    closing [23] [24] [27]. In industrial applications, there is a wide range in which they are

    used, for example in process industries where the control of liquid level in storage tanks and

    reactions vessels is the major problem [4]; in transport industry modelling and designing

    cruise control, or dynamics of the car which change with the gear [20].

    Hybrid systems are common and useful in engineering and they require more advanced

    control laws to guarantee the desired perfomance. Furthermore, the trend to use electronic

    components adds discrete behaviors to the continuous dynamics.

    Many times, because of the nature of the real world systems we have to deal with state

    and input constraints, they are usually omitted, but sometimes it is not possible when the

    operating region is close to the constraints. For example, real actuators have limitations

    that involves amplitude and response velocity, sometimes the tank liquid level must not

    descend of a minimum, this implies constraints in the control signal and the dynamical

    5

  • state respectively.

    2.1.1 Hybrid Dynamical Systems

    The model of a hybrid system is related to other modelling framework such as hybrid

    automata, impulsive differential equations and switched systems.

    Definition 2.1. A HDS or hybrid automata can be defined as an eightfold. The formal

    definition of the HDS is given as follows [23]:

    H = (Q, E , x,D,F , Init,G,S) (1)

    Where:

    Q = {1, 2, ..., q} is a finite set containing discrete states or modes of H, q Z 1

    E Q Q is a collection of ordered pairs also called edges indicating transitionsbetween system modes.

    = {X1,X2, . . . ,Xq} ,Xi Qn is the set containing the continuous variables.

    D = {D1,D2, ...,Dq} ,Di Qn i Q is a set of functions called domain ofthe hybrid automata to represent the relation between discrete states and continuous

    variables. Xi is Lipschitz on Di i Q.

    F = {F1, F2, ..., Fn} ,F : nQ n, called flow. It is the set that contains dynamicsof continuous variables regarding to particular modes. Dynamics are described by

    differential equations or difference equations.

    Init n is a set of initial states for each continuous variable.

    G = {G(e) : e = (i, j), e E} is a set of guards that takes the continuous variableschanging from mode i to j.

    R = {R(e, x) : e = (i, j), e E} is the collection of resets. R(e, x) represents the rela-tion between G(e) and elements from Dj

    6

  • D1 D2

    x X1

    x = F(q1, x) x = F(q2, x)

    x X2

    G(q1, q2)

    S(q1, q2)

    G(q2, q1)

    S(q2, q1)

    Figure 1: Hybrid Dynamical System Representation

    A hybrid automaton can be presented graphically as in Figure 1. To illustrate a hybrid

    dynamical system, example 2.1 is included.

    Example 2.1. (Bouncing Ball) Let us consider an elastic ball falling free from certain

    height with zero initial velocity. With each bounce, the ball loses a fraction of its energy.

    The continuous motion of the ball is governed by Newtons laws of motion [28]. Let x1

    denote the vertical position of the ball and x2 its vertical velocity. This is shown graphically

    in Figure 2.

    The hybrid automata and the whole set of equations are shown in Figure 3, where g denote

    the gravitational acceleration and c [0, 1] represents the energy absorbed at the impact.

    x1

    g

    (a) System

    x1

    x2

    time

    (b) System States

    Figure 2: Bouncing Ball Representation

    7

  • x1 = x2

    x2 = g

    x1 0

    G(1, 1) = {(0, x2) : x2 0}R(1, 1) = (0,cx2)

    x1 0

    Figure 3: Bouncing Ball Automata Representation

    The automata representation is a general form to present HDS [17, 28]. However,

    there are not tractable methods to analyze general hybrid systems available. Then, several

    authors have focused on special subclasses of hybrid dynamical systems for which analysis

    and/or control design techniques are currently being developed [10]. Some of them are:

    Linear Complementary Systems (LC) [9, 11], Piecewise Affine Systems (PWA) [29, 5]

    and Mixed Logical Dynamical Systems (MLD) [18, 14]. These systems can make easier

    to analyze properties such as stability, design and robustness of control laws from different

    perspectives; each one has its own advantages over the others.

    2.1.2 Switched Dynamical Systems

    Switched Dynamical Systems (SDS) are continuous-time systems with isolated switching

    events. A SDS can be obtained from a HDS by ignoring details of the discrete behavior

    and instead considering all possible switching patterns from a certain class [16]. For that

    sense, SDS are HDS in which the discrete dynamics are simple. Then, that simplification

    is extreme when all possible solutions of the discrete component of the state are admissible

    solutions; however, constraints on the discrete evolution may be imposed [12].

    8

  • To formalize this, the simplest model of an HDS is given by,

    x = f (q(t), x(t)) , x Rn, q N (2)

    (q(t), x(t)) = limt

    (q(), x()),

    where x and q are the continuous and discrete components of the state respectively. On the

    other hand, the SDS is given as

    x = f(x(t)), x Rn (3)

    x(t) = limt

    ((t), (), x()), , x S,

    where S , set of admissible pairs (, x), with : [0,) Q N a switching signal and xa signal in Rn. This shows what was said above.

    Thus, in a HDS for each initial condition q(0), x(0) there is only one solution and in a SDS

    for each x(0) there could be several solutions, one for each admissible [13].

    SDS may be classified according to the switching events into state-dependent switching,

    time-dependent switching, autonomous switching and controlled switching.

    State-dependent switching: These systems may be thought as if the continuous state

    space is partitioned into a finite or infinite number of operating regions by means of the

    guards or switching surfaces; in each region a continuous dynamical system is given. Then,

    whenever the systems trajectory reaches a guard, the continuous state instantaneously

    jumps to a new value, which is specified by a reset map.

    Time-dependent switching: In this kind of systems, the switching occurs according to

    a switching signal -like the one described above-, as this signal has a finite number of

    discontinuities on every bounded time and takes a constant value on every interval between

    two consecutive switching times, it specifies at each time instant t, which is the active

    subsystem.

    Autonomous switching: In autonomous switching systems, there is no direct control

    over the switching mechanism that triggers the discrete event. This category may include

    systems with state-dependent switching in which locations of the guards are predetermined,

    as well as systems with time dependent switching, in which the way the switching signal is

    9

  • determined is unknown.

    Controlled switching: In these systems, the switching is imposed by the designer in

    order to accomplish a desired behavior of the system. Then, the switching mechanism

    (state-dependent or time-dependent) may be controlled directly. Embedded systems are

    interesting examples for this category [16].

    Following we formalize some of the systems we studied in this thesis.

    2.2 Switched systems with state jumps

    We have reviewed some literature regarding this topic since there are very few studies

    about it. We have focused on two different approaches, the first one addresses the problem

    of model predictive control for nonlinear constrained systems with state jump, this research

    consider only one switching in which the dynamics changes and the state jump occurs; it also

    formulates an extended continuation generalized minimum residual algorithm (C/GMRES)

    for the open loop optimal control online calculation [21, 15, 22]. The second approach deals

    with the problem of obtaining optimal controls for autonomous switched systems with state

    jump, in this method a prestablished switching sequence is considered; they propose an

    algorithm to find the optimal switching instants [34]. These methods are explained in the

    following.

    2.2.1 Nonlinear Constrained Switched Systems with State Jump

    Let us consider a nonlinear system

    dx(t)

    dt= f(x(t), u(t)) (4)

    where x(t) Rn denotes the state vector and u(t) Rmu the input vector. Since MPC is acontrol method solving at each sampling instant an open loop optimal control problem, over

    a finite horizon, based on the current state, then the state vector is redefined considering a

    finite horizon, (0 T ), along the predictive time axis as follows.

    dx(, t)

    dt= f(x(, t), u(, t)) (5)

    x(0, t) = x(t) (6)

    10

  • where x(, t) is the trajectory of the state on the horizon departing from x(t) at = 0.

    Additionally, T depends on time (i.e. T = T (t)). Notice that t is the current time. The

    MPC problem consist in obtaining an optimal control by minimizing a cost functional (7)

    over a finite horizon, then applying only the initial input, u(0, t), of the optimal sequence,

    u(, t), as the current control input, u(t).

    J = (x(T, t)) +

    T0

    L(x(, t), u(, t))d (7)

    However, the optimal control is usually obtained by using numerical algorithms, then the

    discretized problem when the horizon T is divided by N steps is considered in the following

    equations.

    xi+1(t) = xi(t) + f(xi(t), ui(t))(t) (8)

    x0(t) = x(t) (9)

    J = (xN (t)) +

    N1i=0

    L(xi(t), ui(t))(t) (10)

    where (t) , T (t)/N , and xi(t) describes the ith state departing from x(t) and corre-

    sponding to x(i, t) of the continuous system. Then, for a given initial state the problem

    consist in finding the optimal control sequence {ui(t)}N1i=0 that minimizes (10).When a state jump occurs, [15] considers that the system changes its dynamics (i.e. it is

    a hybrid system). It is assumed that the jump occurs at a known instant (jump instant)

    denoted as tj. Also, the jump step ij is the ith+1 step such that t+i < tj t+(i+1) .Then the system including the state jump is considered in the following equations. From

    now, subscripts 1 and 2 denote the system before and after the state jump respectively.

    xi+1(t) = xi(t) + f1(xi(t), ui(t))(t) (i < ij) (11)

    xi+1(t) = xi(t) + f2(xi(t), ui(t))(t) (i ij) (12)

    In addition, xij and xij+ denote the state just before and after the state jump. These

    variables must satisfy the following interior point constraint.

    (xij , xij+) = 0 (13)

    11

  • where is a q dimensional function (q n). Moreover, as the state jump occurs, theperformance index (10) may also change as follows.

    J = (xN (t)) +

    ij1i=0

    L1(xi(t), ui(t))(t) +N1i=ij

    L2(xi(t), ui(t))(t) (14)

    Furthermore, state and input constraints were considered in (15), where C : Rn Rmu Rmc .

    C(xi(t), ui(t)) = 0 (15)

    In order to adjoin the input and state constraints as well as the interior point constraints,

    some Lagrange multipliers are used. (t) Rn is associated with the costate, (t) Rmc

    is associated with the equality constraint, and (t) Rq with the interior point constraint.Then the Hamiltonian functions are defined by the following equations.

    H1 = L1(x, u) + T f1(x, u) +

    TC(x, u) (16)

    H2 = L2(x, u) + T f2(x, u) +

    TC(x, u) (17)

    All these considerations lead us to a set of necessary conditions for the control to be optimal,

    specifically the conditions for the continuous system are given as follows [22].

    H

    u= 0 (18)

    T () = Hx

    (19)

    T (t+ T ) =

    x(t+ T )(20)

    T (i) = T

    x(i), T (i+) = T

    x(i+)(21)

    A fast algorithm may be used in order to obtain the optimal control, since for many kind

    of systems it has to be done on real time. Then, an extension of the C/GMRES (general

    C/GMRES is explained in Appendix A) to a system with state jump is considered.

    The vector for the input and Lagrange multipliers is defined by:

    U(t) , [uT0 (t), T0 (t), , uTN1(t), TN1(t)]T , (22)

    12

  • where U(t) RmN and m = mu+mc. Then the equation of the optimal conditions is givenas

    F (U(t), x(t), t) :=

    HT1u(x0(t), 1(t), u0(t), 0(t))

    C(x0(t), u0(t))

    ...

    HT1u(xij1(t), ij(t), uij1(t), ij1(t))

    C(xij1(t), uij1(t))

    HT2u(xij+(t), ij+1(t), uij (t), ij (t))

    C(xij+(t), uij (t))

    ...

    HT2u(xN1(t), N (t), uN1(t), N1(t))

    C(xN1(t), uN1(t))

    = 0. (23)

    In order to extend the C/GMRES method for switched systems with state jump, the fol-

    lowing two problems have to be addressed.

    1. Initialization of the Optimal Input: As it is shown in Appendix A, when the solution

    {ui(t)}N1i=0 is integrated, the control input sequence starting off at the next samplinginstant can be determined as {ui(t+ t)}N1i=0 . However, the control at step ij 1 atts horizon differs from the control at step ij 1 at t + ts horizon when the statejump occurs, as it is shown in Figure 4. In that case, it is necessary to initialize the

    tj

    uij2(t) uij1(t) uij (t)

    uij2(t+ t) uij1(t+ t) uij (t+ t) uN1(t+ t)u0(t+ t)

    uN1(t)u0(t)

    Figure 4: Initialization of the control input after the state jump

    control input uij1(t + t) and its differentialuij1(t + t). Therefore, the input at

    the jump step in ts horizon is used as the initial input at the jump step in t + ts

    13

  • horizon, as follows:

    uij2(t+ t) = uij2(t) +uij2(t)t

    uij1(t+ t) = uij (t) (24)

    uij(t+ t) = uij (t) +uij (t)t.

    Furthermore, the differential is given as uij1(t+ t) = uij (t+ t).

    2. Forward Difference Approximation: When this method is used, evaluation of the

    horizons with different initial conditions is performed, once with x0(t) as the initial

    state, and the other when time has passed by h, i.e. x0(t+h). Nevertheless, the jump

    steps should not differ in the two horizons since the same input sequence is used, then

    a condition is needed in order to ensure that the state jump occurs at the same ij

    step, even if the initial state is moved.

    If x0(t) is given, a horizon with its jump at tj satisfies:

    t+ (ij 1)t < tj t+ ijt. (25)

    This implies that the horizon which has been moved by h needs to satisfy,

    t+ h+ (ij 1)t < tj t+ h+ ijt. (26)

    Then h must be sufficiently small to satisfy:

    h < tj t (ij 1)t. (27)

    2.2.2 Autonomous Switched Systems with State Jump

    Optimal control for switched systems with autonomous switching is considered in [34]. The

    system is described by the following equation:

    x = fi(x), fi : Rn Rn, i I = {1, 2, ,M}, (28)

    and whenever the system dynamics switches from subsystem ik to subsystem ik+1, a jump

    of the state x occurs. Jumps are described by the function,

    x(t+k ) = ik,ik+1(x(tk )) (29)

    14

  • where x(t+k ) and x(t

    k ) are the righthand and lefthand limits of the state at tk respec-

    tively. Then it is assumed that a prespecified sequence of active subsystems is given as

    (1, 2, ,K,K + 1) in [t0, tf ], with 0 K < and t0 t1 tK tf , then subsys-tem k is active in [tk1, tk) and subsystem K + 1 in [tK , tf ]. The state jump function at

    the kth switching is denoted as k for simplicity. Thus, the problem is to find the optimal

    switching instants such that the continuous state trajectory departs from a given initial

    state x0 = x(0) and the cost

    J(t1, , tK) = (x(tf )) + tft0

    L(x)dt+Kk=1

    k(x(tk )) (30)

    is minimized. For this problem t0 and tf are given. It is assumed that fks, L, , ks and

    ks are smooth enough. Therefore, the following algorithm is formulated:

    Algorithm 1.

    (1) Set the iteration index j = 0. Choose an initial tj .

    (2) Find J(tj), Jt(tj) and

    2J

    t2(tj).

    (3) Use the gradient projection method or the Newtons method to update tj to be tj+1 =

    jdtj . Set the iteration index j = j + 1.

    (4) Repeat steps (2), (3) and (4) until a prespecified termination condition is satisfied.

    For example,J

    t

    2< , where is a given small number.

    Example The hybrid autonomous system consistent of the following three subsystems:

    f1 =

    x1 = x1 + 0.5sin(x2)

    x2 = 0.5cos(x1) x2

    f2 =

    x1 = 0.3sin(x1) + 0.5x2

    x2 = 0.5x1 + 0.3cos(x2)(31)

    f3 =

    x1 = x1 0.5cos(x2)

    x2 = 0.5sin(x1) + x2

    15

  • is considered. It is assumed that t0 = 0, tf = 3, the system switches at t = t1 from

    subsystem 1 to 2 and from subsystem 2 to 3 at t2 (0 t1 t2 3), x1(0) = 1 andx2(0) = 3. Also, when the system switches from 1 to 2, it satisfies:

    x1(t

    +1 ) = x1(t

    1 ) + 0.2

    x2(t+1 ) = x2(t

    1 ) + 0.2

    (32)

    when the system switches from 2 to 3, it satisfies:

    x1(t+2 ) = x1(t

    2 ) + 0.2

    x2(t+2 ) = x2(t

    2 ) 0.2(33)

    and the goal is to find the optimal switching instants such that that the following cost

    functional

    J = 0.5

    (x21(tf ) + x

    22(tf ) +

    30

    (x21(t) + x

    22(t)

    )dt+

    2k=1

    (x21(t

    k ) + x22(t

    k )))

    (34)

    is minimized. Then, we obtained the results shown in Figure 5. The optimal cost is 18.8310,

    and this cost is obtained with the optimal instants t1 = 0.4847 and t2 = 1.9273. It is worth

    0.5 1 1.5 2 2.5 3 3.50

    0.5

    1

    1.5

    2

    2.5

    3

    x1

    x 2

    Figure 5: State trajectory for the switched system with state jump

    16

  • noting that both of the methods we have explained in this section deal with control for

    switched systems with state jump. However, there are some differences:

    The first method studies only one state jump while the second studies multiple jumps,these jumps occur always at the switching instants.

    In the second method the switching instants are optimally determined and there is nocontrol input for these systems. On the other hand, the control is optimally obtained

    with first method, also some methods to fast obtain online optimal control laws are

    included.

    2.3 Constrained switched systems with controlled switching

    The type of systems we studied in this section are switched systems in which we may just

    decide the switching signal and there is no continuous input; furthermore, the dynamical

    states and the switching signal may be constrained.

    We considered the systems that were studied in [27]. These are constrained switched input

    affine nonlinear systems which are described as follows:

    x(t) = f(x(t)) +

    mi=1

    ui(t)gi(x(t)) (35)

    x(0) = x0 (36)

    c(x(t)) 0, (37)

    where u(t) Rm is the control law and x(t) Rn is the state variable vector at time t. Themaps f() : Rn Rn, c() : Rn Rr and gi() : Rn Rn are supposed sufficiently smooth.It is important to mention that (37) defines the rdimension state-path constraints.A more specific class is obtained when u(t) U = {0, 1}m, which results in a class ofswitched systems greatly used to describe the dynamics of nonsmooth mechanical systems

    or electric circuits. On the contrary, when u(t) co(U) = [0, 1]m and co(U) is the convexhull of U , (35) describes a relaxed system.

    Links between the solutions of the relaxed and the switched system can be found, and it

    is possible to obtain a switching law for the switched system that approaches as close as

    17

  • desired to the one for the relaxed system. For this reason, the operating point set of the

    switched system, denoted by Xref , is defined as the set of equilibrium points of the relaxed

    system (xref ) as follows:

    Xref =

    {xref Rn : f(xref) +

    mi=1

    ui,refgi(xref ) = 0, ui,ref [0, 1]}

    (38)

    Then, finding a control law for the state of the relaxed system by using the set above, it

    is possible to obtain a control law for the switched system. However, it is important to

    mention that none of the controls, uref co(U)\U , corresponding to an equilibrium point,xref , is admissible for the switched system.

    2.4 Constrained switched systems with autonomous switching

    In this section, we studied switched systems in which there is no control on the switching,

    but the continuous input may be controlled instead. However, it exists a set of constraints

    over the input and the dynamical states. In these systems, the switchings occur when the

    state trajectory reaches some subset of the state space, in fact this is the guard set.

    The specifications of a constrained switched system with autonomous switching are given

    by:

    x(t) = fi(x(t), u(t)) (39)

    x(0) = x0 (40)

    G(i1,i2) Xi1 Xi2 , i1, i2 I i1 6= i2 (41)

    C(x, u) 0, (42)

    where x(t) Xi, u(t) Rm and Xi Rn are the state variable vector, the controlsignal and some feasible subset for each active subsystem respectively; the maps fi :

    Xi Rm Rn and C : Rn Rr , that describe the mixed state-control constraints,are supposed sufficiently smooth; i I , {1, 2, . . . ,M} is the set of modes; and G(i1,i2) ={x | g(i1,i2)(x) = 0, g(i1 ,i2) : Rn Rl(i1,i2)

    }is the guard set, then if the state trajectory in-

    tersects G(i1,i2) at i1, the system will switch from i1 to i2.Even though one may only control these systems through the continuous control input, u(t),

    18

  • a switching sequence ((t0, i0), (t1, i1), . . . , (tK , iK)) is generated implicitly according to the

    system evolution. In addition, we assume fi and C are sufficiently smooth. In [35], the

    authors study some similar systems, but they do not take into account any constraint.

    19

  • Chapter III

    OPTIMAL CONTROL

    3.1 Motivation

    Classical control system design is generally a trial and error method, in which various

    methods of analysis are employed to determine the design parameters of a system based on

    performance criterion as peak time, settling time, rising time, maximum overshoot and so

    on. However, radically different performance criteria must be satisfied because of modern

    technologies, where it can be required the control law to optimize the global performance

    because the associated cost with doing something could be very large [32].

    Consequently, the optimal control theory deals with many complex problems. The optimal

    control problem (OPC) of dynamical systems might be understood as the search of a control

    signal that takes the system in the best way from a given initial state to a final state in

    some desired subset.

    Finding the optimal solution for this problem can be a demanding task for instance when

    the system presents nonlinearities or the search spaces are nonconvex and high dimensional.

    A lot of research have been done on this topic. One of the most important results is known as

    Pontryagins Minimum Principle, which establishes a set of necessary conditions for a control

    to be optimal. Since the Pontryagins Minimum Principle does not establish sufficient

    conditions, performing a-posteriori process in order to eliminate nonoptimal candidates is

    needed. Moreover, many times we have to deal with some issues because of the nature of

    problems as we will see later.

    3.2 Overview

    In many applications it can be required the control law to optimize the global performance

    because the associated cost with doing something could be very large. The performance

    objective could be to minimize cost, minimize time, minimize fuel, maximize profit, etcetera.

    Then, the algorithms that optimize some performance measure are optimal control laws.

    20

  • Let us consider the dynamical system given by,

    x(t) = f(x(t), u(t), t), (43)

    where x(t) Rn represents the state variable vector, u(t) Rm represents the controlvariable, f : RnRm [t0, tf ] Rn, and t0 and tf are the initial and final time respectively.The optimal control problem for this system is:

    minuU

    J [u ()] = tft0

    L [x(t), u(t), t] dt

    s.t. x(t) = f(x(t), u(t), t) (44)

    x(0) = x0 x(tf ) = free

    where U is the set of admissible controls, L : RnRm [t0, tf ] R, and the goal is to findan admissible control u(t) that minimizes the performance index J [u ()].

    3.2.1 Pontryagins Minimum Principle

    Let us define the Hamiltonian function H : Rn Rn Rm [t0, tf ] R for the problemgiven in (44) as:

    H(x(t), (t), u(t), t) = T (t)f(x(t), u(t)), (45)

    where Rn is a vector of dynamical Lagrange multipliers known as costate vector. Ifthe optimal control exists, Pontryagins Minimum Principle (PMP) gives a set of necessary

    conditions for a control to be optimal.

    Theorem 3.2.1. (Pontryagins Minimum Principle). If u(t) U is an optimal controlfor the optimal control problem (44), then there must exist a continuous and piecewise

    differentiable function (t), such that the following necessary conditions are satisfied:

    1. The dynamics of x(t) and (t) are obtained from the coupled Hamiltonian System.

    x(t) =H(x(t), u(t), (t), t)

    (46)

    (t) = H(x(t), u(t), (t), t)x

    21

  • 2. If H does not depend explicitly on time, then H takes on a global minimum value with

    respect to u U at every point x along the trajectory x(t) generated by u(t).

    If the final time is fixed, the minimum value of H at every point is equal to aconstant c.

    minuU

    H (x(t), u, (t)) = H (x(t), u(t), ) = c (47)

    If the final time is free, the minimum value of H at every point is zero.

    minuU

    H (x(t), u, (t)) = H (x(t), u(t), ) = 0 (48)

    3. The boundary conditions are given by:

    (t0) = free (tf ) = 0 (49)

    It is worth noting that these conditions are only necessary and not in general sufficient.

    This implies that there may be controls that satisfy the minimum principle but are not

    optimal [32].

    3.3 Optimal control for constrained switched systems with controlledswitching

    In [27], the authors addressed the problem of optimal control for switched input affine

    nonlinear systems subject to path constraints (Eqs. (35)-(37)). For that purpose, they

    introduce a relaxed system and establish the connection between the solution of this system

    and the solution of a switched system; however, the optimal solution might be singular as

    we will explain.

    The optimal control problem for the system (Eqs. (35)-(37)) is:

    minu()

    tft0

    L(x(t), xref )dt, (50)

    where L : RnRn R is the continuously differentiable performance function, xref Rn isan equilibrium point in Xref , and t0 and tf are the fixed initial and final time respectively.

    They defined the Hamiltonian function by:

    H(t) = T (t)(f(x) + g(x)u(t)) + L(x(t), xref ), (51)

    22

  • where (t) Rn describes the costate. According to PMP, a control u(t) that minimizesthe Hamiltonian function leads to the following inclusion:

    ui(t)

    0 if i(t) > 0

    [0, 1] if i(t) = 0 i = 1, ,m

    1 if i(t) < 0

    (52)

    where (t) = Hu(t) = T (t)g(x(t)) defines the switching function. When ui(t) = 0 or 1, the

    control is called regular. On the other hand, when ui(t) takes values in co(U)\U on a timeinterval t [a, b], b > a, it refers to a singular control (singular arc). It occurs because theHamiltonian function depends linearly on the control u(t), then if i(t) vanishes identically

    on that time interval, PMP is inconclusive regarding the control value ui() on [a, b].To determine singular arcs, it is required to do successive time differentiations until at least

    one component of the control appears. The smallest positive integer q, such that (53) is

    satisfied is called the order of singularity, if it exists. For single input systems, this number

    is always even and for multiple input system might be odd [25]. The main difficulty in

    applying this analytical technique is that the obtained algebraic expressions are tractable

    only for low order systems n 3; nevertheless, it is not very easy to do it. Furthermore,(54) must be satisfied in order to find the singular arcs.

    u

    (dq

    dtqHu(x, , u)

    )6= 0 (53)

    dq

    dtqHu(x, , u) = 0 q = 1, , q (54)

    The authors of [27] also defined the mixed control-state path constraints as,

    p(x, u) =dq

    dtqc(x) 0, (55)

    which help to find the optimal control on the boundary, c(x) = 0; and the Lagrangian

    function as,

    L(x, u, , ) = H(x, u, ) + T p(x, u), (56)

    where 0 represents the rdimensional vector of Lagrange multipliers. It is worthmentioning that the index q is the first time that u appears explicitly in the successive time

    23

  • differentiation of c(x).

    In addition, some slack variables, s, were included in order to incorporate the singular

    arcs conditions as complementary constraints in the problem (See Appendix B for further

    explanation about the complementarity problem).

    Then, Theorem 3.3.1 and Theorem 3.3.2 were proposed.

    Theorem 3.3.1. If u is the optimal control for the state constraint system (35)-(37) when

    the cost is defined by (50), then u satisfies the following constraint optimization problem:

    minu()

    tft0

    L(x(t), xref )dt (57)

    x = L = Lx (58)

    x(t0) = x0 (tf ) = 0 (59)

    0 s1 u 0 (60)

    0 s2 (1 u) 0 (61)

    0 = s1 s2 Lu(x, , u) (62)

    0 i (s1 + s2)j 0, i = 1, , r j = 1, ,m (63)

    0 c(x) 0 (64)

    Theorem 3.3.2. If u is the optimal control of problem defined by cost (50) and state

    constraint system (35)-(37), then u satisfies the conditions given in Theorem 3.3.1 and the

    following additional constraints related to the order of the singularity (54):

    0 = s2q+1 s2q+2 dq

    dtq, q = 1, , q (65)

    0 r

    i=1

    ci(x)u(1 u) (s2q+1 + s2q+2) 0 (66)

    0 s2q+1 s2q+2 0 (67)

    In both theorems, s represents the mdimension slack variable. Additionally, s1 ands2q+1 are the positive parts of Lu(x, , u) and d

    q

    dtq respectively, as well as s2 and s2q+1 are

    the negative parts of them.

    Despite all that, we have found some incongruities between Theorems 3.3.1 and 3.3.2.

    24

  • In that sense, the whole Theorem 3.3.1 regards many results related to singular arcs and

    optimization, so there is no contradiction on its own. Equations (65) and (67) are related

    to singular arcs too. Results referring to the switching function differentiation until the

    control appears may be found in [2], furthermore, the set of complementary constraints for

    Theorem 3.3.1 may be easily obtained too. Then, we think the issue is in Eq. (66), since it

    doesnt make sense as we will explain later.

    Our starting point is to force Eq. (63) to be satisfied. To simplify the analysis, we just

    consider the single input and single constraint case. Then, we have the following situations:

    s1 + s2 > 0 implies that = 0, then the control must be regular. This means thatu = 1 s1 = 0 s2 > 0 or u = 0 s2 = 0 s1 > 0, so (60), (61) and (62) are satisfied.To guarantee (64) to be satisfied c(x) > 0 or c(x) = 0 must occur. Moreover, asthe control is regular, s2q+1 + s2q+2 > 0 and u(1 u) = 0 guarantee (66). Finally,it just remains to ensure the compliance of (65) and (67). Then, both theorems are

    satisfied.

    > 0 implies that s1 + s2 = 0 and c(x) = 0, then the control must be singularand (64) is satisfied. Moreover, as the control is singular, s1 = 0 s2 = 0 s2q+1 =0 s2q+2 = 0 u [0, 1] guarantee (60), (61), (62), (65), (66) and (67). Then, boththeorems are satisfied.

    If = 0 and s1 + s2 = 0, then the control is singular and s1 = 0 s2 = 0 s2q+1 =0 s2q+2 = 0 u [0, 1] guarantee (60), (61), (62), (65) and (67). There are onlytwo options in order to satisfy (64), either c(x) = 0 or c(x) > 0. The formerimplies the compliance of (66). However, the second option is contradictory because

    if u(1 u) > 0, then c(x) 0 must be satisfied in order to guarantee (66), and thisfact contradicts the problem formulation.

    Then there is no option to have both, singular control and inactive constraints, at the

    same time, and this contradicts the figures they show for the Boost Converter.

    Under those circumstances, we have made the following two proposals according to what

    [27] explains. The first proposal is given as follows.

    25

  • Theorem 3.3.3. If u is the optimal control for the state constraint system (35)-(37) when

    the cost is defined by (50), then u satisfies the following constraint optimization problem:

    minu()

    tft0

    L(x(t), xref )dt (68)

    x = L = Lx (69)

    x(t0) = x0 (tf ) = 0 (70)

    0 s1 u 0 (71)

    0 s2 (1 u) 0 (72)

    0 = s1 s2 Lu(x, , u) (73)

    0 i (s1 + s2)j 0, i = 1, , r j = 1, ,m (74)

    0 c(x) 0 (75)

    Theorem 3.3.4. If u is the optimal control of problem defined by cost (50) and state

    constraint system (35)-(37), then u satisfies the conditions given in Theorem 3.3.3 and the

    following additional constraints related to the order of the singularity (54):

    0 = s2q+1 s2q+2 dq

    dtq, q = 1, , q (76)

    0 r

    i=1

    ci(x)u(1 u) (s2q+1 + s2q+2) 0 (77)

    0 s2q+1 s2q+2 0 (78)

    According to the path constraints, there are two possible behaviors in the system: active

    (c(x) = 0) or inactive (c(x) < 0). In the first case, when the control is singular, it is obtained

    from the mixed control-state path constraints, then s1, s2 in (71) and (72) must be equal

    to zero in order to the control to be unique; for that reason, dq

    dtq in (76) must not be equal

    to zero, then s2q+1 and s2q+2 do not have to be forced to be equal to zero; therefore, (77) is

    necessary to ensure that if s2q+1 > 0 or s2q+2 > 0, it is because the control is regular (i.e.

    u(1 u) = 0) or the path constraint is active.On the other hand, when the path constraints are inactive and the control is singular,

    u(1 u) > 0 and ci(x) > 0 are satisfied, then there are no contradictions between (75)and (77), and s2q+1 and s2q+2 are forced to be equal to zero for the purpose that the control

    26

  • to be uniquely determined.

    Finally, when the control is regular, there are no incongruities between any of the equations

    in both Theorems. All what we have mentioned is related to what the authors wrote to

    explain their Theorems.

    Our second proposal does not include the mixed path control-state constraints, but we use

    the path constraint c(x) instead. Then, this is detailed in the Theorems 3.3.5 and 3.3.6.

    However, this time, L(x, u, , ) = H(x, u, ) + T c(x). These Theorems may be easilyproved by using Optimization Theory. It is important to emphasize that (88) let us find

    the optimal control, since this time it may not be found from the path constraints.

    Theorem 3.3.5. If u is the optimal control for the state constraint system (35)-(37) when

    the cost is defined by (50), then u satisfies the following constraint optimization problem:

    minu()

    tft0

    L(x(t), xref )dt (79)

    x = L = Lx (80)

    x(t0) = x0 (tf ) = 0 (81)

    0 s1 u 0 (82)

    0 s2 (1 u) 0 (83)

    0 = s1 s2 Hu(x, , u) (84)

    0 i (s1 + s2)j 0, i = 1, , r j = 1, ,m (85)

    0 c(x) 0 (86)

    Theorem 3.3.6. If u is the optimal control of problem defined by cost (50) and state

    constraint system (35)-(37), then u satisfies the conditions given in Theorem 3.3.5 and the

    following additional constraints related to the order of the singularity (54):

    0 = s2q+1 s2q+2 dq

    dtq, q = 1, , q (87)

    0 u(1 u) (s2q+1 + s2q+2) 0 (88)

    0 s2q+1 s2q+2 0 (89)

    27

  • It is worth mentioning, that in all of the Theorems mentioned above, the inclusion of

    the complementary constraints is practically made by including a penalization term in the

    cost functional.

    3.3.1 Implementation

    In order to implement the Theorems to obtain the optimal control for the systems described

    in the former section, we have used the GPOPS toolbox for Matlab; however, we have had

    to deal with some numerical issues. Additionally, when we use the GPOPS toolbox, ob-

    taining each optimal control takes an excessive amount of time, so we have decided to use

    some fitting tools for the purpose of acquiring the optimal control laws.

    We have used the GPOPS toolbox for Matlab because it allows to solve Multi-phase opti-

    mal control problems for linear and nonlinear dynamics in continuous-time or discrete-time.

    These traits are useful because since we know that singular arcs occur, then the possible op-

    timal solution involves a combination of regular control and singular control [2]. Moreover,

    formulating the problem as a multi-phase optimal control problem helps obtain a smoother

    optimal solution [26].

    3.3.1.1 Obtaining the singular arc conditions

    We consider singular arc conditions only for the systems in Section 2.3. Nevertheless,

    for the systems described in Section 2.4, one might have to deal with singular arcs if the

    Hamiltonian function depends linearly on the control; in that case, similar arc conditions

    might be obtained.

    Therefore, we include the constraints (58)-(65) and (67) as part of the optimization problem

    for the purpose of avoiding numerical issues. It means that we take into account additional

    states (one for each costate) and additional controls (one for each s signal and for each

    Lagrange multiplier), instead of doing a direct transcription of the problem (35)-(37). It is

    important to mention that we do not take into account (66) because it is wrong as we have

    explained in Section 3.3.

    However, obtaining the singular arc conditions for (53), (62) and (65) analytically is not

    easy. Then, a method to overcome this difficulty has been proposed in [25]. This method

    28

  • is explain in the following.

    The authors start by considering the following optimal control problem over a control-affine

    system:

    minu()

    T0

    L(z(t) zref )dt (90)

    s.t. z(t) = r(z(t)) + s(z(t))u(t)

    = r(z(t)) +

    mi=1

    ui(t)si(z(t))

    z(0) = z0 u(t) U = {0, 1}m,

    where z Rv(v N) is the state, r, si : Rv Rv, i = 1, ,m (m N), L : Rv R is theperformance function, and zref is an equilibrium point of the system.

    The Mayer form of (90) is obtained by adding the performance function as a variable and

    redefining the maps as follows.

    xn(t) =

    T0

    L(z() zref )d

    x(t) = [zT (t), xn(t)]T

    x0 = [zT0 , 0]

    T

    f(x(t)) = [rT (z(t)), L(z(t) zref )]T

    g(x(t)) = [sT (z(t)), 0]T

    They obtain the equivalent problem given by:

    minu()

    xn(T ) (91)

    s.t. x(t) = f(x(t)) + g(x(t))u(t)

    x(0) = x0 u(t) U = {0, 1}m,

    where x Rn(n = v + 1). Then, the Hamiltonian H is given as,

    H = H((t), x(t), u(t)) (92)

    = T (t)f(x(t)) + T (t)g(x(t))u(t),

    29

  • where (t) is the costate vector. Moreover, the dynamics of x and are given by (93).

    x = H and = Hx (93)

    Thus, there are two possible cases in order to obtain the conditions for singular arcs. But it is

    worth remembering that singular arcs only occur when the switching function (t) = Hu = 0

    and (t) Rm.

    Single control case m = 1In this case, they define the problem order q as the smallest integer, such that u

    explicitly appears in the (2q) derivative (2q), where in each derivative x and are

    replaced by their expression given in 93. Then, the derivatives take the form given by

    (94), where [f, g](x) := gx(x)f(x) fx(x)g(x) denotes the Lie bracket and adkfg(x) =[f(x), adk1f ], ad

    0fg(x) = g(x) the iterated Lie bracket.

    (k) = Tadkfg(x) = 0, k = 0, , 2q 1 (94)

    (2q) = Tad2qf g(x) + T [g, ad2q1f g](x)u = 0

    Multiple control case m > 1In this case, a singular trajectory may exist when at least one component of iden-

    tically vanishes on a non-zero measure time interval [a,b]. The terms giui for which

    does not vanish in that interval are added to the term f , which is named fdrift. In

    this point, they define the problem order q as the number where at least one control

    explicitly appears for the first time in the 2q derivative with respect to t of any of the

    m switching functions. It is worth mentioning that the problem order might not be

    an integer number. Then, the derivatives take the form given by (95).

    (k)i =

    Tadkfdriftgi(x) = 0, k = 0, , 2q 1 i M (95)

    (2q) = Tad2qfdriftgi(x) + TjM

    [gj , ad2q1fdrift

    gj ](x)uj = 0, i M

    In (95) M is a subset of {1, ,m} such that:

    i(t) = 0, i M on [a, b]

    i(t) 6= 0, i 6M on [a, b]

    30

  • 3.3.1.2 Fitting the Function for the Optimal Control

    As we have mentioned before, obtaining the optimal control law takes an excessive amount

    of time and when it is required in a real system, and either the initial or the reference

    conditions change, it might be a problem. Also, as our goal is to obtain predictive control

    laws for some particular system, then the initial conditions always change at each step of

    time.

    Therefore, we acquire some data sets for a particular system; its size depends on factors

    such as: how accurate we need the results, the amount of time that takes obtaining each

    control and so on. Then, we train a fitting tool in order to be able to obtain the optimal

    control just based on the initial and reference conditions.

    These are systems in which the input signal is the set of initial and reference conditions

    and the output signal is the optimal control law. Fitting using a Neural Network

    Artificial neural networks represent a type of computing that is based on the way that the

    brain performs computations. Neural networks are good at fitting non-linear functions and

    recognizing patterns. A neural network can take a set of measured data points and fit a

    curve to them according to any desired accuracy.

    Artificial neural networks consist of: inputs, layer of neurons, connection between neurons

    and outputs. Consequently, each neuron consists of the input x, the weight w, the bias b,

    the summer, the transfer function f and the output y as shown in Figure 6. So, the output

    of the neuron is a = f(wp+ b) [8].

    fp

    w

    b

    a

    Figure 6: Artificial Neuron

    Matlab provides a very useful toolbox, which contains a GUI to ease its use, so we have

    used it. After obtaining the trained neural network, we have done some predictions and we

    have also proved by filtering them by using a moving average filter.

    31

  • Example: We consider the boost converter explained in Section 3.3.2.2 for which we pre-

    calculated some set of optimal control laws, and then we tried fitting them with the method

    explained above. We do not include the system in this part since its matter is only to show

    how the fitting methods work for a precalculated set of control laws.

    For this neural network we considered two initial conditions and two reference conditions

    as the inputs, and 500-dimensional samples, corresponding to the optimal control law, as

    the output. Then 500 neurons in the output layer have been considered.

    In Figure 7 we show the results when the neural network is used. One might see that the

    predicted output has some noise, so when we use the filtering stage, the control is highly

    close to the optimal control.

    0 1 2 3 4 5x 10 3

    0

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    Time (seconds)

    Optimal Controller and Predictions by Using Neural Networks

    Optimal ControlPredictedPredicted and Filtered

    u

    Figure 7: Neural Network Performance Example

    32

  • 3.3.2 Examples

    For this class of systems, we simulated some power converters, specifically the Flying Ca-

    pacitor Converter (FCC) or multicellular converter, and the Boost converter. For the first

    one, we just obtained the optimal control law as we explained in previous sections, but for

    the second, we obtained the optimal control law and the predictive control law.

    3.3.2.1 Flying Capacitor Converter Converter

    The schematic for the FCC is shown in Figure 8. In the case of a few megawatt power

    applications, the classical power converters are not very useful, since they have a very high

    voltage in the switching components. Then, the FCC converter may be a good alternative

    to deal with that problem [27]. Furthermore, the FCC topopology has a natural voltage

    balancing property, and this is a necessity that multilevel converters have in order to be

    able to generate an output voltage with high quality [30]. However, control is complicated

    to track the voltage level for all of the capacitors [19].

    Figure 8: FCC Converter

    Three switching cells can be isolated, each of them is able to operate in two complementary

    modes. The behavior of each cell may be described using only one boolean control variable

    ui {0, 1} with i = 1, 2, 3. ui = 1 means that the upper switch is closed and the lowerswitch is open, whereas ui = 0 means that the upper switch is open and the lower switch is

    closed.

    33

  • The state equations for this converter have an affine form given by:x1

    x2

    x3

    =

    0

    0

    RLx3

    +

    x3

    C1

    x3C1

    0

    0 x3C2

    x3C2

    x1L

    x2x1L

    Ex2L

    u1

    u2

    u3

    (96)

    where x1, x2 are the voltage on each capacitor respectively, and x3 is the load current.

    The chosen parameters are E = 30V , R = 10, C1 = C2 = 40F and L = 10mF . The

    capacitor voltages must be set to 20V and 10V , while the demanding load current is fixed

    to 2A. Then, xref = [20 10 2]T . Also, the initial conditions are x0 = [0 0 0]

    T . The

    optimization problem consists in minimizing the quadratic criteria:

    minu()

    T0

    (x xref )TQ(x xref )dt (97)

    where the horizon time T is 3ms, and the weight matrix Q is

    0.2 0.1 00.1 0.1 00 0 200

    .

    When the simulation was run, we might obtain the results for the state variables and for

    the control laws, which are shown in Figures 9 and 10 respectively. As we expected, the

    control law for that relaxed system is singular almost all time. Additionally, the states

    reach smoothly the selected reference.

    For this problem, we were able to reproduce the results shown in [27]. It is worth mentioning

    that, for this purpose, we used Theorems 3.3.1 and 3.3.2. Since this FCC converter does

    not include any path constraint, then there is no contradiction with equation (66); for that

    reason, we may state that these Theorems work properly in any unconstrained case.

    3.3.2.2 Boost Converter

    The schematic for the Boost Converter is shown in Fig. 11. This converter has three

    operation modes: when the diode does not conduct current and SW is closed, when the

    diode conducts and SW is open, and when the diode current vanishes and SW is open. The

    first two modes correspond to the case in which the converter works in continuous conduction

    mode, and the third one to the case in which the converter works in discontinuous conduction

    34

  • 0 0.5 1 1.5 2 2.5 3x 103

    0

    10

    20

    t(seconds)x 1

    (volts

    )

    0 0.5 1 1.5 2 2.5 3x 103

    0

    20

    40

    t(seconds)

    x 2(vo

    lts)

    0 0.5 1 1.5 2 2.5 3x 103

    0

    2

    4

    t(seconds)

    x 3(am

    peres

    )

    Figure 9: State Variables for the FCC when the Optimal Control law is applied

    0 0.5 1 1.5 2 2.5 3x 103

    0

    0.5

    1

    t(seconds)

    u1

    0 0.5 1 1.5 2 2.5 3x 103

    0

    0.5

    1

    t(seconds)

    u2

    0 0.5 1 1.5 2 2.5 3x 103

    0.70.80.9

    t(seconds)

    u3

    Figure 10: Optimal control laws for the FCC

    35

  • Figure 11: Boost Converter

    mode. The system is described by x = Aix+BiE, i = 1, 2, 3, where x1 represents the current

    through the coil, x2 is the voltage across the capacitor, and the matrices are the following:

    A1 =

    RL 0

    0 1RoC

    B1 =

    1L0

    A2 =

    RL 1L

    1C

    1RoC

    B2 =

    1L0

    (98)

    A3 =

    0 00 1

    RoC

    B3 =

    00

    The objective at this point is to find the optimal switching signal, u, for the following

    relaxed system, considering that this one may describe all the operation modes given in

    (98),

    x = u(A1x+B1) + (1 u)(A2x+B2) (99)

    where u [0, 1]. The cost functional is given by:

    minu()

    T0

    (x xref )TQ(x xref )dt (100)

    and the optimal control problem is solved with the path constraint x1 > 0. The parameters

    for the converter are: E = 20V , R0 = 50, R = 1, L = 2mH and C = 100F . The

    time horizon T is set to 5ms. Additionally the matrix Q is

    10 0

    0 1

    .

    For this converter, we obtained optimal controls by using Theorems 3.3.3 and 3.3.4. First,

    we use x(0) = (2.22, 44.4) as the initial condition, xref = (0.78, 27.46) as the reference

    36

  • condition, this case corresponds to uref = 0.3. The results in this case are shown in Figure

    12.

    The simulation shows that at the beginning, the converter works in continuous conduction

    mode and the path constraints are inactive, then it goes to discontinuous conduction mode

    and the path constraints become active, and it returns to continuous conduction mode

    approximately after 2.5ms and the path constraints become inactive again. The state

    variables smoothly reach the references as we expected; however, the control has some

    little discontinuities when the system changes the conduction mode, this because some

    numerical difficulties occur between these transitions. Notice that the control is regular at

    the beginning, and then it becomes singular.

    0 1 2 3 4 5x 103

    5

    0

    5

    t(seconds)

    x 1(am

    peres

    )

    0 1 2 3 4 5x 103

    20

    40

    60

    t(seconds)

    x 2(vo

    lts)

    0 1 2 3 4 5x 103

    1

    0

    1

    t(seconds)

    u

    Figure 12: Optimal Control law for the Boost Converter when xref = (0.78, 27.46) andx(0) = (2.22, 44.4)

    Additionally, we obtained a set of optimal control laws when the equilibrium point is:

    xref = (2.22, 44.4), corresponding to uref = 0.6 , and the set of initial conditions is given

    in Table 1.

    At this point, we present the simulation results when the initial conditions are x(0) =

    37

  • Table 1: Initial Conditions for the Boost Converter

    x1(0) x2(0) x1(0) x2(0) x1(0) x2(0)

    0 0 0 88.8 1.11 22.2

    1.11 66.6 1.66 33.3 1.66 55.5

    2.78 33.3 2.78 55.5 3.33 22.2

    3.33 66.6 4.44 0 4.44 88.8

    2.22 44.4 0 11.1 0 22.2

    0 33.3 0 44.4 0 55.5

    0 66.6 0 77.7 0 88.8

    0.55 0 0.55 11.1 0.55 22.2

    0.55 33.3 0.55 44.4 0.55 55.5

    0.55 66.6 0.55 77.7 0.55 88.8

    (0, 0) and x(0) = (1.11, 66.6), these results are shown in Figures 13 and 14 respectively.

    In the first case, the states reach the desired reference as well as the control reaches the

    corresponding equilibrium point. The trajectories are smooth. Also, the converter works

    in continuous conduction mode the whole cycle; as a consequence, the path constraints are

    inactive. Notice that the control apparently does not exhibit numerical issues. The control

    is regular at the beginning of the simulation, and then it becomes singular.

    In the second case, the states also reach the desired reference as well as the control reaches

    the corresponding equilibrium point. However, the simulation shows that at the beginning,

    the converter works in continuous conduction mode and the path constraints are inactive,

    then it goes to discontinuous conduction mode and the path constraints become active.

    After approximately 1ms, the converter returns to continuous conduction mode and the

    path constraints get inactive again. The control is regular just at the the beginning, then

    it becomes singular.

    In both cases the control signal and the state variables stabilize after 2.5ms approximately.

    Finally, we simulated the same boost converter by using our second proposal (i.e. Theorems

    3.3.5 and 3.3.6), and considering xref = (2.22, 44.4) and x(0) = (0, 0). The corresponding

    results are shown in Figure 15.

    For this simulation the prediction horizon has been set to 5ms, the control horizon N has

    been set to 20, the sample time has been set to 0.2ms, and the integration step has been

    38

  • 0 1 2 3 4 5x 103

    0

    2

    4

    t(seconds)x 1

    (ampe

    res)

    0 1 2 3 4 5x 103

    0

    50

    t(seconds)

    x 2(vo

    lts)

    0 1 2 3 4 5x 103

    0

    0.5

    1

    t(seconds)

    u

    Figure 13: Optimal Control law for the Boost Converter when xref = (2.22, 44.4) andx(0) = (0, 0)

    0 1 2 3 4 5x 103

    0

    2

    4

    t(seconds)

    x 1(am

    peres

    )

    0 1 2 3 4 5x 103

    40

    60

    80

    t(seconds)

    x 2(vo

    lts)

    0 1 2 3 4 5x 103

    0

    0.5

    1

    t(seconds)

    u

    Figure 14: Optimal Control law for the Boost Converter when xref = (2.22, 44.4) andx(0) = (1.11, 66.6)

    39

  • set to 0.01ms.

    In this simulation, the states reach the desired reference as well as the control reaches the

    corresponding equilibrium point. The trajectories are smooth. Also, the converter works

    in continuous conduction mode the whole cycle; as a consequence, the path constraints are

    inactive. The control is regular and singular.

    Nevertheless, this control exhibits some jumps due possibly to numerical difficulties. As

    we have explained, we think that it is because of the problem of assigning weights for the

    inclusion of the complementary constraints in the cost functional. However, we consider

    that the results are good enough, so we have left the simulation with other initial and

    reference conditions as well as other examples as future work.

    In this case the control signal and the state variables stabilize after 2.5ms approximately,

    exactly as it occurred with the first proposal.

    0 1 2 3 4 5x 103

    1

    0

    1

    t(seconds)

    u

    0 1 2 3 4 5x 103

    0

    5

    t(seconds)

    x 1(am

    peres

    )

    0 1 2 3 4 5x 103

    0

    50

    t(seconds)

    x 2(vo

    lts)

    Figure 15: Optimal Control law for the Boost Converter obtained by using our secondproposal

    40

  • 3.4 Optimal control for constrained switched systems with autonomousswitching

    Despite of the authors in [35] studied optimal control for similar systems, they did not

    take into account any constraint. So, in this point our main contribution is to formulate

    necessary conditions for a control to be optimal.

    The optimal control problem for the system (39)-(42) is:

    minu()

    J(u()) = minu()

    ((x(tf )) +

    tft0

    L(x(t), u(t))dt

    ), (101)

    where L : Rn Rm R and : Rn R are the continuously differentiable performancefunctions, and t0 and tf are the fixed initial and final time respectively.

    Thus, we assume that a fixed time interval [t0, tf ] and a pre-established switching sequence

    = (i0, i1, . . . , iK) are given. Then, we need to find the optimal continuous input, such that

    the system departs from x(t0) = x0 at the initial active subsystem and reaches an (n lf )dimensional smooth manifold Sf =

    {x | f (x) = 0, f : Rn Rlf

    }at tf .

    Hence, Theorem 3.4.1 provides necessary conditions for the optimal control input.

    Theorem 3.4.1. Consider the constrained switched system given by (39)-(42) and the

    cost functional (101) with all the assumptions that we have made. Also assume that the

    subsystem ik is active in [tk1, tk) for 1 k K and the subsystem K + 1 in [tK , tf ],also that x Gk =

    {x | gk(x) = 0, gk : Rn Rlk

    }at the switching instant tk. Let u be a

    continuous input control, such that the state trajectory departs from the given initial state

    x(t0) and reaches Sf ={x | f (x) = 0, f : Rn Rlf

    }at tf . If u

    is the optimal control

    for this problem, then u satisfies the following conditions:

    1. = (H

    x+ T

    C

    X

    )

    x =H

    2.H

    u+ T

    C

    u= 0 (102)

    3.

    (

    x(x(tf ))

    )T+ T

    fx

    (x(tf )) = (tf )

    4. vTkgkx

    (x(tk)) + (t+k ) (tk ) = 0, k = 1, ,K

    41

  • Where , (t) Rn is the co-state vector; H(x, u, ) , L(x, u)+T (t)fk(x, u) is the Hamilto-nian function; and vk , and are lk, lf and r dimensional vectors of Lagrange multipliers

    respectively; also, 0 C 0 must be satisfied.

    Proof. We use dynamical () and statical (vk, , ) Lagrange multipliers to adjoin the

    dynamical system equations and its constraints to the cost function. So, the augmented cost

    function is:

    J = (x(tf )) + Tf (x(tf )) +

    Kk=1

    vTk gk(x(tk)) +

    K+1k=1

    tktk1

    (H(x, u, ) + TC T x)dt

    (103)

    As we do not know the first variation of x, we should integrate by parts the following part

    of the integral.

    K+1k=1

    tktk1

    T xdt

    = K+1k=1

    Tx

    tk

    t+k1

    +

    K+1k=1

    tktk1

    Txdt

    =(t0)x(t0) (tf )x(tf ) +Kk=1

    ((t+k )x(tk) (tk )x(tk)) +K+1k=1

    tktk1

    Txdt (104)

    Then replacing (104) in (103) we have:

    J =(x(tf )) + Tf (x(tf )) +

    Kk=1

    vTk gk(x(tk)) +

    K+1k=1

    tktk1

    (H(x, u, ) + TC + Tx)dt

    + (t0)x(t0) (tf )x(tf ) +Kk=1

    ((t+k )x(tk) (tk )x(tk)) (105)

    From the calculus of variations we can obtain the first variation of J

    J =

    x(x(tf ))x(tf ) +

    T fx

    (x(tf ))x(tf ) +

    Kk=1

    vTkgkx

    (x(tk))x(tk)

    +K+1k=1

    tktk1

    ((H

    x+ T

    C

    x+ T

    )x+

    (H

    x

    )+

    (H

    u+ T

    C

    u

    )u

    )dt

    (tf )x(tf ) +Kk=1

    ((t+k )x(tk) (tk )x(tk)) (106)

    According to the Lagrange theory, a necessary condition for a solution to be optimal is

    J = 0. This is true only if the coefficients of the independent increments x, u, ,

    x(tf ) and x(tk) are equal to zero, which results in the set of equalities in (102).

    42

  • Theorem 3.4.1 might be simplified to be used for the model predictive control problem

    because we only need to follow a fixed reference along the trajectory, so we do not need

    to include a term in the cost functional to minimize (x(tf )). Furthermore, depending on

    the problem one might ignore the control constraints and assume that u U , where U is afeasible set; then, these constraints are verified a posteriori.

    In that case, the following theorem is provided.

    Theorem 3.4.2. Consider the constrained switched system given by (107)-(110), where

    x(t) Xi, u(t) U , Xi Rn and U Rm are the state variable vector, the control signal,some feasible subset for each active subsystem and some feasible subset for the controls

    respectively; the maps fi : Xi U Rn and C : Rn Rr , that describe the stateconstraints, are supposed sufficiently smooth; i I , {1, 2, . . . ,M} is the set of modes;and G(i1,i2) =

    {x | g(i1,i2)(x) = 0, g(i1 ,i2) : Rn Rl(i1,i2)

    }is the guard set, then if the state

    trajectory intersects G(i1,i2) at i1, the system will switch from i1 to i2.

    x(t) = fi(x(t), u(t)) (107)

    x(0) = x0 (108)

    G(i1,i2) Xi1 Xi2 , i1, i2 I i1 6= i2 (109)

    C(x) 0 (110)

    Also, consider the cost functional (111), where xref is any equilibrium point of the system,

    such that Xref = {xref |fi(xref , uref ) = 0} is the set of equilibrium points. Moreover,L : Rn Xref R is the continuously differentiable performance function, and t0 and tfare the initial and final time respectively. Then, we assume that a fixed time interval [t0, tf ]

    and a pre-established switching sequence = (i0, i1, . . . , iK) are given.

    minu()U

    J(u()) = minu()U

    tft0

    L(x(t), xref )dt (111)

    Also assume that the subsystem ik is active in [tk1, tk) for 1 k K and the subsystemK + 1 in [tK , tf ], then x Gk =

    {x | gk(x) = 0, gk : Rn Rlk

    }at the switching instant tk.

    Let u be a continuous input control, such that the state trajectory departs from the given

    initial state x(t0) and reaches some desired equilibrium point xref at tf . If u is the optimal

    43

  • control for this problem, then u satisfies the following conditions:

    1. = (H

    x+ T

    C

    X

    )

    x =H

    2.H

    u= 0 (112)

    3. (tf ) = 0

    4. vTkgkx

    (x(tk)) + (t+k ) (tk ) = 0, k = 1, ,K

    Where , (t) Rn is the co-state vector; H(x, u, ) = L(x, u) + T (t)fk(x, u) is the Hamil-tonian function; and vk and are lk and r dimensional vectors of Lagrange multipliers

    respectively; also 0 C 0 must be satisfied.

    3.4.1 Example

    For this class of systems, we analyse the same boost converter in Section 3.3.2.2, but this

    time we suppose that we may control the switchings. Then we assume that the system has

    one input: the voltage E (Figure 11). In this case, the time duration is externally defined

    according to the systems time period and the duty cycle.

    In that sense, the converter has two linear operation modes: when the diode does not

    conduct current and SW is closed, and when the diode conducts and SW is open. This

    system is described by

    x = Ax+BE, = 1, 2 (113)

    where x1 represents the current through the coil, x2 is the voltage across the capacitor,

    is the switching signal, and the matrices are the following:

    A1 =

    RL 0

    0 1RoC

    B1 =

    1L0

    A2 =

    RL 1L

    1C

    1RoC

    B2 =

    1L0

    (114)

    44

  • However, in order to calculate the equilibrium point of the system, we need to obtain an

    average system. First, we assume that the average system may be described by:

    x = (A1x+B1E)d + (A2x+B2E)(1 d) (115)

    where x is the average state vector, and d is the duty cycle. It is worth mentioning that E

    and d must be fixed in order to obtain the equilibrium points of the average system. Then

    this system is obtained as follows:

    x = A2x+B2E + d(A1 A2)x

    =

    RL x1 1L x2 + 1LE

    1Cx1 1RoC x2

    + d

    1L x2 1

    Cx1

    (116)

    = f(x) + dg(x) (117)

    Under those circumstances, we set d = 0.5 since the duty cycle is 50%. Then, the average

    system is obtained (118). x1x2

    =

    RL x1 0.5 1L x2 + 1LE

    0.5 1Cx1 1RoC x2

    (118)

    Finally, E is set to 20, and the system equals to zero in order to obtain the equilibrium

    point vector. The equilibrium point vector is xref = [1.48, 37.03] under these conditions.

    The objective at this point is to find the optimal switching signal, E, for system (113).

    Also, the cost functional is given by:

    minu()

    T0

    (x xref )TQ(x xref )dt (119)

    and the optimal control problem is solved with the path constraint x1 > 0, and the control

    constraint 0 u 50. The parameters for the converter are: E = 20V , R0 = 50,

    R = 1, L = 2mH and C = 100F . Additionally the matrix Q is

    40 0

    0 1

    .

    For this converter, we obtained optimal controls by using Theorem 3.4.1. In order to

    simulate this system, the time horizon T is set to 50ms, and the period time to 5ms. We

    include this simulation in Figure 16.

    45

  • 0 0.01 0.02 0.03 0.04 0.0520

    0

    20

    t(seconds)x 1

    (ampe

    res)

    0 0.01 0.02 0.03 0.04 0.0550

    0

    50

    t(seconds)

    x 2(vo

    lts)

    0 0.01 0.02 0.03 0.04 0.05100

    0

    100

    t(seconds)

    E(vo

    lts)

    Figure 16: Optimal Control law for the Autonomous Boost Converter

    The simulation shows that the states reach the desired references. However, they do not

    become stable. Regarding the control, it is 0 or 50 almost all time. This occurs because the

    control is constrained, and since the Hamiltonian depends linearly on u, then it must be on

    the extreme points

    It is worth mentioning that the mode sequence (i.e. the evolution of the modes in the

    system) for this system is = {0, 2.5ms, 5ms, 7.5, ms, , 50ms}, and the time sequence(i.e. the moments in which the system switches) is Q = {1, 2, 1, 2, , 1, 2}.Including more simulations has been left as future work, since setting the weights in the

    cost functional is not the main matter of this work, and it is not easy as we have explained.

    46

  • Chapter IV

    MODEL PREDICTIVE CONTROL

    4.1 Overview

    Model Predictive control (MPC) is a control methodology based on the dynamics of the

    process to be controlled. The process model has an important role to guarantee the good

    behavior of the closed loop. It is not a specific control strategy, rather it is a technique

    that use a wide range of control methods to obtain the control law by using explicitly the

    mathematical model and minimizing an objective function. The main advantages of this

    technique include:

    It takes into account feed forward control, so measurable disturbances can be com-pensated.

    It is easy to implement as it can be done in a computer.

    According to the model, MIMO systems can easily be controlled.

    The control can be limited with constraints over the states or the control signal andthese can be included during the design process.

    MPC is a strategy similar to human behavior for control law calculation. Let us take the

    case of driving a car. Its driver knows the car traits and the desired reference trajectory for

    a finite control horizon, then this can take control actions to reach it (accelerator, brakes).

    For the purpose of implementing a MPC strategy, the system model allows to predict

    the future plant outputs based on past and current values and on the proposed optimal

    future control actions. These predicted outputs are obtained for a future window called

    the prediction horizon. From them, it is possible to obtain the control law based on an

    optimization criterion then apply it to the model, keep predicting and calculating future

    laws and so on.

    A predictive control law may be computed by following next steps.

    47

  • 1. Prediction: The predicted outputs of the model are obtained from the past and ac-

    tual input and outputs, and the future control signals that are going to be sent and

    computed. All this, by using the system model.

    2. Optimization: The control signal must be calculated from an optimization criterion

    to keep the process as close as possible to the desired trajectory. Taking quadratic

    forms in the cost function makes the problem convex so a solution can be computed

    at some point. An example of the optimization criterion is given in (120), where rk

    represents the reference or some smoothed version of the reference, Q > 0 is a positive

    definite matrix assigning weights to each individual component of xk and rk, and N

    is the size of the prediction horizon.

    minuk,uk+1,...,uk+N

    Ni=1

    (xk+i rk+i)TQ(xk+i rk+i) (120)

    3. Signal update: The first sample of the control signal is applied to the process and the

    next output is already known, so the process starts again. [3]

    Then, we need to solve an optimal control problem each step of the prediction horizon in

    order to obtain the Predictive Control law. This is easy to implement in Matlab by using

    some loops.

    4.2 Design

    In Figure 17, we show a general Flow Diagram, which exhibits how to obtain a predictive

    control law. In this diagram, k is the time index, i and j are counters, uaux is the control

    law that satisfies some optimization criterion similar to the one given in (120), u is the

    predictive control law, xp is the predicted state variable vector, xmea is the measured state

    variable vector, max iter is the maximum number of iterations to stop the algorithm, and

    N is the control horizon (i.e. it is the number of control samples, from an optimal control,

    applied to the process), after which the control law is recalculated. Additionally, the sample

    time for the predictive control is N multiplied by the integration step (which is defined by

    GPOPS).

    Including the concept of control horizon as well as step 14 is important since the system

    48

  • has been solved by using a computing tool (i.e. it has been solved with numerical methods

    in discrete time) [33].

    Start

    k=0i=2j=0

    Calculate the control

    signal uaux

    u(k) = uaux(j)

    Apply the control u(k)

    to the process

    Predict xp(k + 1)

    k=k+1i=i+1j=j+1

    k max iter?

    End

    Yes

    Noi = N + 1?

    No

    Yes i=1j=0

    Set the initial conditions

    to xmea(k)

    Measure xmea(k)

    Set the initial conditions

    to xmea(k)

    Measure xmea(k)

    Figure 17: Model Predictive Control Design

    The diagram is explained by the following steps.

    1. Set the counters i and j to 2 and 0 respectively, and set the time index k to 0.

    2. Measure the state variable vector.

    49

  • 3. Set the initial conditions to xmea(k).

    4. Calculate the control (uaux), that minimizes the optimization criterion (121), accord-

    ing to the initial conditions and the system model.

    minuaux

    T0

    (xp xref )TQ(xp xref)dt (121)

    5. Make u(k) = uaux(j).

    6. Apply the control u(k) to the system or the process.

    7. Predict the state variable vector xp(k + 1).

    8. Increase in one the counters and the time index.

    9. If the maximum number of iterations is reached (k = max iter), end the algorithm;

    otherwise, go step 10.

    10. If the maximum for the horizon control counter is reached (i = N +1) , go to step 11;

    otherwise go to step 14.

    11. Set the counters i and j to 1 and 0 respectively.

    12. Set the initial condition vector to the last measured state vector (xmea(k)).

    13. Go to step 4.

    14. Measure the state variable vector.

    15. Go to step 5.

    4.3 Implementation

    In this section, we explain the method that we used to compute the control law, uaux,

    that guarantees the optimization criterion. As we clarified in Chapter 3.3.1, obtaining this

    control law is not easy, since it involves many numerical issues. One of the causes for this

    numerical issues is the inclusion of the complementary constraints in the cost function, since

    setting these weights is still an open problem of study.

    50

  • We tried fitting the control law just by using neural networks, as we have explained before.

    However, this method have not given good results because the predictive control law does not

    reach the reference trajectory, and sometimes this oscillates around the reference trajectory.

    Then, we have included a fine adjustment condition when the states are highly close to the

    desired reference. This adj