# Modeling and control of switching max-plus-linear systems with random and deterministic switching

- First Online:

- Received:
- Accepted:

DOI: 10.1007/s10626-011-0123-x

- Cite this article as:
- van den Boom, T.J.J. & De Schutter, B. Discrete Event Dyn Syst (2012) 22: 293. doi:10.1007/s10626-011-0123-x

- 3 Citations
- 830 Downloads

## Abstract

Switching max-plus-linear (SMPL) systems are discrete-event systems that can switch between different modes of operation. In each mode the system is described by a max-plus-linear state equation and a max-plus-linear output equation, with different system matrices for each mode. The switching may depend on the inputs and the states, or it may be a stochastic process. In this paper two equivalent descriptions for switching max-plus-linear systems will be discussed. We will also show that a switching max-plus-linear system can be written as a piecewise affine system or as a constrained max-min-plus-scaling system. The last translation can be established under (rather mild) additional assumptions on the boundedness of the states and the inputs. We also develop a stabilizing model predictive controller for SMPL systems with deterministic and/or stochastic switching. In general, the optimization in the model predictive control approach then boils down to a nonlinear nonconvex optimization problem, where the cost criterion is piecewise polynomial on polyhedral sets and the inequality constraints are linear. However, in the case of stochastic switching that depends on the previous mode only, the resulting optimization problem can be solved using linear programming algorithms.

### Keywords

Discrete-event systemsRandomly switching max-plus-linear systemsEquivalent classes Stabilizing controlModel predictive control## 1 Introduction

There exist many modeling frameworks for discrete-event systems such as queueing theory, (extended) state machines, formal languages, automata, temporal logic models, generalized semi-Markov processes, Petri nets, and computer simulation models (see Cassandras and Lafortune 1999; Ho 1992; Peterson 1981 and the references therein). In general, models that describe the behavior of a discrete-event system are nonlinear in conventional algebra. However, there is a class of discrete-event systems that can be described by a model that is “linear” in the max-plus algebra (Baccelli et al. 1992; Cuninghame-Green 1979; Heidergott et al. 2006). Such discrete-event systems are called max-plus-linear systems. Essentially, they can be characterized as discrete-event systems in which only synchronization and no choice occurs. So typical examples are serial production lines, production systems with a fixed routing schedule, railway networks, legged robots, transmission lines, and urban traffic systems.

The basic control problem for MPL systems consists in determining the optimal input times (e.g., feeding times of raw material or starting times of processes or activities) for a given reference signal (e.g., due dates for the finished products or completion dates for processes or activities). In the literature many different approaches are described to solve this problem. Among these the most common ones are based on residuation and on model predictive control (MPC). Residuation essentially consists in finding the largest solution to a system of max-plus inequalities with the input times as variables and the due dates as upper bounds. Residuation-based approaches for computing optimal input times are presented or used in Boimond and Ferrier (1996), Cottenceau et al. (2001), Goto (2008), Lahaye et al. (2008), Libeaut and Loiseau (1995), Maia et al. (2003) and Menguy et al. (1997, 2000a, b). The MPC approach is essentially based on the minimization of the error between the actual output times and the due dates, possibly subject to additional constraints on the inputs and the outputs. The MPC approach for MPL systems has been developed in De Schutter and van den Boom (2001), Masuda (2006), Masuda and Goto (2007), Necoara et al. (2009) and van den Boom and De Schutter (2002). Another approach, based on invariant subspaces, is proposed in Katz (2007) and Maia et al. (2011).

In van den Boom and De Schutter (2006) we have introduced the class of switching max-plus-linear (SMPL) systems. This class consists of discrete-event systems that can switch between different modes of operation. In each mode the system is described by a max-plus-linear state equation and a max-plus-linear output equation, with different system matrices for each mode. In van den Boom and De Schutter (2006) the mode switching was a function of the input signals and the previous state; in the current paper the switching can also depend on a stochastic sequence. The class of SMPL systems with deterministic and stochastic switching contains discrete-event systems with synchronization but no choice, in which the order of events may vary randomly and often cannot be determined a priori. This randomness may be due to e.g. (randomly) changing production recipes, varying customer demands or traffic demands, failures in production units, or faults in transmission links.

In this paper we discuss two types of SMPL system descriptions and we show that the two descriptions are equivalent. Furthermore, we show that an SMPL system can be rewritten as a piecewise affine system or as a max-min-plus-scaling system. Using the results of Heemels et al. (2001) we also implicitly prove that an SMPL system can be rewritten as an (extended) linear complementarity (ELC/LC) system or as a mixed logic dynamical (MLD) system, which are system descriptions that are often used in the field of hybrid systems. Using these results we can transfer properties of piecewise affine systems and max-min-plus-scaling systems to SMPL systems. Finally, we will present a design procedure for stabilizing model predictive controllers for SMPL systems with both types of switching procedures.

This paper will review and extend the results of van den Boom and De Schutter (2006, 2007, 2008a, b). The most important changes with respect to van den Boom and De Schutter (2008b) are the revision of the proofs and the improvement of the presentation of the material. The main change with respect to van den Boom and De Schutter (2007, 2008a) is the correction in Theorem 1. We also relaxed the condition of a row-finite matrix *C* by the condition that the system is structurally observable in Theorem 1. We improved the definitions for the maximum growth rate and we explicitly provide an algorithm to compute this value. Further we have extended the paragraph on the optimization in the MPC algorithm and added some lines to Section 5 to indicate how MPC techniques using PWA and MMPS systems can be used to compute a predictive controller for SMPL systems. Finally we added a paragraph to Section 5 on MPC for SMPL systems with deterministic switching. The paper is organized as follows. In Section 2 we introduce the max-plus algebra and the concept of SMPL systems. In Section 3 we define a second class of SMPL systems and discuss the equivalences between the two classes of SMPL systems. Furthermore we will show that SMPL systems can be rewritten as piecewise affine systems or max-min-plus-scaling systems. Section 4 presents conditions for a stabilizing controller, and in Section 5 we derive a stabilizing model predictive controller for SMPL systems.

## 2 Max-plus algebra and SMPL systems

### 2.1 Max-plus algebra

In this section we give the basic definition of the max-plus algebra (Baccelli et al. 1992; Cuninghame-Green 1979).

*ε*= − ∞ and ℝ

_{ε}= ℝ ∪ {

*ε*}. The max-plus-algebraic addition (⊕) and multiplication (⊗) are defined as follows:

*x*,

*y*∈ ℝ

_{ε}, and

*A*,

*B*∈ ℝ

_{ε}

^{m×n}and

*C*∈ ℝ

_{ε}

^{n×p}. The matrix

*ε*is the max-plus-algebraic zero matrix: [

*ε*]

_{i,j}=

*ε*for all

*i*,

*j*. A max-plus diagonal matrix

*S*= diag

_{⊕}(

*s*

_{1}, ...,

*s*

_{n}) has elements [

*S*]

_{i,j}=

*ε*for

*i*≠

*j*and diagonal elements [

*S*]

_{i,i}=

*s*

_{i}for

*i*= 1, ...,

*n*. The matrix

*E*= diag

_{⊕}(0, ..., 0) is the max-plus identity matrix. The max-plus-algebraic matrix power of

*A*∈ ℝ

_{ε}

^{n×n}is defined as follows: \(A^{\otimes^{0}} = E\) and \(A^{\otimes^{k}} = A {\otimes} A^{\otimes^{k-1}}\) for

*k*= 1, 2, .... Let \(S^{\otimes^{-1}}\) denote the inverse of

*S*in max-plus algebra, so \(S \otimes S^{\otimes^{-1}} = S^{\otimes^{-1}} \otimes S = E\). diagonal up to a permutation of rows.

*S*is invertible if it has one and only one entry in each row and column which is different from

*ϵ*. If all

*s*

_{i}are finite, the max-plus inverse of a max-plus diagonal matrix

*S*= diag

_{⊕}(

*s*

_{1}, ...,

*s*

_{n}) is equal to \(S^{\otimes^{-1}}={\mathrm{diag}}_\oplus(-s_1,\ldots,-s_n)\).

### 2.2 SMPL systems

^{1}We assume that there are

*n*

_{L}possible modes.

The index *k* is called the event counter. For SMPL systems the state *x*(*k*) typically contains the time instants at which the internal events occur for the *k*th time, the input *u*(*k*) contains the time instants at which the input events occur for the *k*th time, the output *y*(*k*) contains the time instants at which the output events occur for the *k*th time, and the mode ℓ(*k*) determines which max-plus linear model is valid during the *k*th event.

*k*) then in general depends on both stochastic variables as well as deterministic variables (state and inputs). The switching actions are determined by a switching mechanism. For the SMPL system (1) and (2), the mode switching variable ℓ(

*k*) is a stochastic process that depends on the previous mode ℓ(

*k*− 1), the previous state

*x*(

*k*− 1), the input variable

*u*(

*k*), and an (additional) control variable

*v*(

*k*). We denote the probability of switching to mode ℓ(

*k*) given ℓ(

*k*− 1),

*x*(

*k*− 1),

*u*(

*k*), and

*v*(

*k*) by

*P*[

*L*(

*k*) = ℓ(

*k*)|ℓ(

*k*− 1),

*x*(

*k*− 1),

*u*(

*k*),

*v*(

*k*)], where

*L*(

*k*) is a stochastic variable and ℓ(

*k*) is its value. We assume that for all \(\ell(k),\ell(k-1)\in \{1,\ldots,{n_{L}} \}\), the probability

*P*is piecewise affine on polyhedral sets in the variables

*x*(

*k*− 1),

*u*(

*k*), and

*v*(

*k*). Since

*P*is a probability, we have

To illustrate the different types of mode switching, we will now present three simple examples. In the first example we discuss deterministic switching, in which the mode switching only depends on the previous state or an input signal. In a second example we discuss random switching, in which the mode switching entirely depends on a stochastic sequence. In a third example we discuss stochastic switching with a probability depending on the state.

### Example 1

*k*. Let

*v*(

*k*) be a control variable that determines the system to stay in mode 1 (for

*v*(

*k*) < 0.3), to switch from mode 1 to mode 2 (for 0.3 ≤

*v*(

*k*) < 0.7), or to switch to mode 3 (for

*v*(

*k*) ≥ 0.7).

### Example 2

*k*. In this case of stochastic switching we assume that the probability to stay in mode 1 is equal to

*γ*, that the probability to switch from mode 1 to mode 2 is equal to

*β*, and that the probability to switch from mode 1 to mode 3 is equal to 1 −

*β*−

*γ*, where

*β*,

*γ*∈ [0, 1] are constants and

*γ*+

*β*≤ 1.

### Example 3

*k*. In this example, the switching probability depends on the state of the system. Consider a system with state

*x*(

*k*). Let

*x*

_{1}(

*k*) be the first entry of the state. We assume the system always stays in mode 1 for

*x*

_{1}(

*k*) < 0, and always switches from mode 1 to a mode 2 for

*x*

_{1}(

*k*) > 1; for

*x*

_{1}(

*k*) ∈ [0, 1] we have a probability equal to

*x*

_{1}(

*k*) to stay in mode 1, and a probability equal to 1 −

*x*

_{1}(

*k*) to switch from mode 1 to mode 2.

**Definition 1**

_{i},

*i*= 1, ...,

*n*

_{s}of the form

^{2}where the entries stand for either ≤ or < and there holds

**Definition 2**

(van den Boom and De Schutter 2007, 2008a, b) Consider the system (1) and (2) with *n*_{L} possible modes and let the probability of switching to mode ℓ(*k*) given ℓ(*k* − 1), *x*(*k* − 1), *u*(*k*), *v*(*k*) be denoted by *P*[*L*(*k*) = ℓ(*k*)|ℓ(*k* − 1), *x*(*k* − 1), *u*(*k*), *v*(*k*)]. Then the system (1) and (2) is a type-1 Switching Max-Plus-Linear (SMPL) system if for any given ℓ(*k*) ∈ {1, ..., *n*_{L} }, \(\>P[L(k)=\ell(k)|\cdot,\cdot,\cdot,\cdot]\) is a probability function that is piecewise affine on polyhedral partition of the space of the variables ℓ(*k* − 1), *x*(*k* − 1), *u*(*k*), *v*(*k*).

### Remark 1

*P*. If we define the vector \(w(k)= \left[{\ell(k-1) \;x^T(k-1) u^T(k) \;v^T(k)}\right]^T \in {\mathbb{R}}^{n_w}\), then there exist a polyhedral partition \(\{\Gamma_i\}_{i=1,\ldots,n_{s}}\) of \({\mathbb{R}}^{n_w}\) and vectors

*α*

_{m,i}, and scalars

*β*

_{m,i}for

*i*= 1, ...,

*n*

_{s},

*m*∈ {1, ...,

*n*

_{L}} such that the probability

*P*can be written as

### Remark 2

*P*is a probability, for any

*w*(

*k*) we have

### Remark 3

As was mentioned in Section 1, the switching of the mode cannot always be determined a priori, but may have a stochastic behavior. For example, in the case of a production system we can use the probability *P* to describe the changing production recipes or varying customer demands; or in transmission links each mode may represent a network with a specific set of faults, and the probability *P* may describe the chance of this set of faults to occur.

### Example 4

*M*

_{1},

*M*

_{2}, and

*M*

_{3}. Three products (A, B, C) can be made with this system, each with its own recipe, meaning that the order in the production sequence is different for every product.

For product A (using recipe ℓ(*k*) = 1) the production order is *M*_{1}-*M*_{2}-*M*_{3}, which means that the raw material is fed to machine *M*_{1} where it is processed. Next, the intermediate product is sent to machine *M*_{2} for further processing, and finally the product A is finished in machine *M*_{3}. Similarly, for product B (using recipe ℓ(*k*) = 2) the processing order is *M*_{2}-*M*_{1}-*M*_{3}, and for product C (using recipe ℓ(*k*) = 3) the processing order is *M*_{1}-*M*_{3}-*M*_{2}. We assume that the type of the *k*th product (A, B or C) is available at the start of the production, so that we do know ℓ(*k*) when computing *u*(*k*).

Each machine starts working as soon as possible on each batch, i.e., as soon as the raw material or the required intermediate products are available, and as soon as the machine is idle (i.e., the previous batch has been finished and has left the machine). We define *u*(*k*) as the time instant at which the system is fed with the raw material for the *k*th product, *x*_{i}(*k*) as the time instant at which machine *i* starts processing the *k*th product, and *y*(*k*) as time instant at which the *k*th product leaves the system. We assume that all the internal buffers are large enough, and no overflow will occur.

*M*

_{1},

*M*

_{2}and

*M*

_{3}to be given by

*d*

_{1}= 1,

*d*

_{2}= 2 and

*d*

_{3}= 3, respectively. The system equations for recipe A are given by

*k*, then the probability of having the same recipe for product

*k*+ 1 is 64%, and the probability of a switching to each other recipe is 18%.

### Example 5

*M*

_{2}-

*M*

_{1}-

*M*

_{3}for B and

*M*

_{1}-

*M*

_{3}-

*M*

_{2}for C). This means that if we need to produce a product B/C we can choose the recipe (so either B or C. We therefore introduce an auxiliary binary control variable

*v*(

*k*) ∈ {0, 1} that can be used to choose between processing recipe B and C. The switching probability from one recipe to the next one is now given by:

*v*(

*k*) ∈ {0, 1} there holds

*P*[

*L*(

*k*) = 1|

*i*,

*x*(

*k*− 1),

*u*(

*k*),

*v*(

*k*)] +

*P*[

*L*(

*k*) = 2|

*i*,

*x*(

*k*− 1),

*u*(

*k*),

*v*(

*k*)] +

*P*[

*L*(

*k*) = 3|

*i*,

*x*(

*k*− 1),

*u*(

*k*),

*v*(

*k*)] = 1 for

*i*= 1, 2, 3.

### Remark 4

In the Examples 4 and 5 we have assumed sufficiently large internal buffers and negligible transportation times between the machines. Note however that we have done so to simplify the example; it is not a limitation in the theory.

## 3 Equivalence in classes of SMPL systems

**Definition 3**

*n*

_{L}possible modes. The mode ℓ(

*k*) =

*m*if

*d*(

*k*) ∈ [0, 1] is a uniformly distributed stochastic scalar signal, and where Ω

_{m}is a union of polyhedra, so \(\Omega_m={\cup}_{j=1}^{n_m} \Omega_{m,j}\) in which \(\{\Omega_{m,j}\}_{\begin{array}{c} m=1,\ldots,{n_{L}} \\ j=1,\ldots,n_m \end{array}}\) is a polyhedral partition.

### Remark 5

A type-1 SMPL model is easy for modeling where we consider the probabilities of switching from one mode to another. The model gives a lot of physical insight into the system and is usually more intuitive for the user. A type-2 SMPL model is signal-based and the properties of probabilities of switching are translated into the properties of a stochastic signal. The fact that type-2 SMPL models are signal-based makes that this type of SMPL system can easily be translated into another model in one of the other classes of hybrid systems (see Propositions 3 and 4).

**Proposition 1**

*The class of type-*1* SMPL systems and the class of type-*2* SMPL systems are equivalent in the sense of input-state-output-mode behavior.*

### Proof

*Type-*1

*SMPL*→

*type-*2

*SMPL*Consider a type-1 SMPL system of the form (1) and (2) as given in Definition 2. The probability

*P*is given by

*η*such that

*w*(

*k*) ∈ Γ

_{i}we find

*d*(

*k*) ∈ [0, 1]. Let

*P*

_{d}[

*L*(

*k*) =

*m*|

*w*(

*k*)] as the probability that

*L*(

*k*) =

*m*according to Eq. 8. For a uniformly distributed

*d*(

*k*) and scalars

*a*,

*b*with 0 ≤

*a*≤

*b*≤ 1 there holds

*P*[

*a*<

*d*(

*k*) <

*b*] =

*b*−

*a*. Using this we find that

*η*: (

*m*,

*w*(

*k*)) →

*η*(

*m*,

*w*(

*k*)) is an affine function if

*w*(

*k*) ∈ Γ

_{i}(or equivalently \(S_i\,w(k) - s_i\, {\preceq}^s_i\, 0\)), and so we can rewrite Eq. 9 as

*Type-*2

*SMPL*→

*type-*1

*SMPL*Consider a type-2 SMPL system, so

*t*. Define

*R*

_{m,t,1}and

*R*

_{m,t,2}such that

*d*(

*k*) ∈ [0, 1] is a scalar. Let

*d*

_{m,t,max}(

*w*(

*k*)) be the maximum value of

*d*such that Eq. 10 is satisfied, and let

*d*

_{m,t,min}(

*w*(

*k*)) be the minimum value of

*d*such that Eq. 10 is satisfied. If for some

*w*(

*k*) there exists no

*d*(

*k*) ∈ [0, 1] such that Eq. 10 is satisfied, we define

*d*

_{m,t,max}(

*w*(

*k*)) =

*d*

_{m,t,min}(

*w*(

*k*)) = 0. Finding

*d*

_{m,t,max}(

*w*(

*k*)) and

*d*

_{m,t,min}(

*w*(

*k*)) can be done using a linear programming algorithm, which means that

*d*

_{m,t,max}(

*w*(

*k*)) and

*d*

_{m,t,min}(

*w*(

*k*)) are piecewise affine in

*w*(

*k*) (Borelli 2003). So there exist matrices

*S*

_{i,m,t}, vectors

*s*

_{i,m,t},

*p*

_{m,t,i,max},

*p*

_{m,t,i,min}and scalars

*q*

_{m,t,i,max}and

*q*

_{m,t,i,min}, such that

*i*= 1, ...,

*M*

_{m,t},

*t*= 1, ...,

*n*

_{m}and \(m=1,\ldots,{n_{L}} \).

*k*) =

*m*, given

*w*(

*k*) can be written as

*i*= 1, ...,

*M*

_{m,t},

*t*= 1, ...,

*n*

_{m}and

*m*= 1, ...,

*n*

_{L}. This is equal to the switching mechanism of a type-1 SMPL system.□

**Proposition 2**

*A type-2 SMPL system can always be rewritten in the form:*

*such that the mode κ*(

*k*) =

*m if*

*where d*(

*k*) ∈ [0, 1]

*is a uniformly distributed stochastic scalar signal, and where*\(\{\bar{\Omega}_m\}_{m=1,\ldots,{n_\kappa}}\)

*is a polyhedral partition and*\(\bar{\Omega}_{m}\)

*can be written as*

### Proof

*j*= 1, ...,

*n*

_{ℓ}, then we obtain a system of the form (11)–(13).□

### Remark 6

For the form of Definition 3 every region Ω_{ℓ(k)} for mode ℓ(*k*) is a union of polyhedra. For the form of Proposition 2 every region \(\bar{\Omega}_{\kappa(k)}\) for mode *κ*(*k*) is a polyhedron. The consequence is that we usually need more modes for the latter form than for the original form.

**Definition 4**

An SMPL system is structurally finite if for any finite (*x*(*k* − 1), *u*(*k*)) we have that *x*(*k*) and *y*(*k*) are finite for all \(\ell(k-1)\in \{1,\ldots,{n_{ L}} \}\) and any *d*(*k*) ∈ [0, 1].

**Lemma 1**

*A SMPL system is structurally finite if and only if the matrix*

*is row-finite for all*\(\ell=1,\ldots,{n_{L}} \)

*(i.e. for each*ℓ

*every row of the matrix H*

^{(ℓ)}

*has at least one finite entry).*

### Proof

- Part 1:
**(if)** - Let
*x*(*k*− 1) and*u*(*k*) be finite. NowIf all elements of$$ \begin{aligned} x_i(k) & = \max\limits_{j} \left( \left[A^{(\ell)} \; B^{(\ell)}\right]_{i,j}+\left[\begin{array}{c}x(k-1)\\u(k)\end{array}\right]_j\right) \\ y_s(k) & = \max\limits_t \left( [C^{(\ell)}]_{s,t} + x_t(k) \right) \end{aligned} $$*x*(*k*− 1) and*u*(*k*) are finite and every row of*H*^{(ℓ)}has at least one finite elements, we will find that the elements*x*_{i}(*k*),*i*= 1, ...,*n*_{x}are finite as well. Similarly for finite*x*(*k*) we find finite elements*y*_{s}(*k*),*s*= 1, ...,*n*_{y}. - Part 2:
**(only if)** - We will prove the second part of lemma by contradiction. First, definethen system equations (1) and (2) can be written as$$\begin{array}{rll} \omega(k) &=& \left[\begin{array}{c}x(k) \\ y(k) \end{array}\right] \in {\mathbb{R}}^{n_\omega}={\mathbb{R}}^{n_x+n_y},\\ \theta(k)&=& \left[\begin{array}{c} x(k-1) \\ u(k) \\ x(k) \end{array}\right]\in {\mathbb{R}}^{n_\theta}={\mathbb{R}}^{2n_x+n_y}\end{array}$$(15)and finiteness of$$ \omega(k) = H^{(\ell)} (k) {\otimes}\theta(k) \;\;\;\mathrm{for}\;\; R_\ell\,z(k)\, {\preceq}^r_\ell\, r_\ell $$
*x*(*k*) and*u*(*k*) implies finiteness of*θ*(*k*).Now suppose that for a given ℓ the

*i*-th row of*H*^{(ℓ)}has no finite entries, so \([H^{(\ell)}]_{i,j}=\varepsilon\), ∀*j*. Then \(\omega_i(k) = \max\Big( [H^{(\ell)}]_{i,j} (k) + \theta_j(k) \Big) = \varepsilon\), which means that the system is not structurally finite. We may conclude that the system is structurally finite if and only if*H*^{(ℓ)}is row-finite for all ℓ = 1, ...,*n*_{L}.□

### Remark 7

(van den Boom and De Schutter 2008a) Note that physical systems are typically structurally finite.

Next we will show that SMPL systems can be rewritten as piecewise affine systems or max-min-plus-scaling systems. The following definition is an extension of Sontag (1981):

**Definition 5**

*i*= 1, ...,

*N*where the signal

*d*(

*k*) ∈ [0, 1] is a uniformly distributed stochastic scalar signal and {Ω

_{i}}

_{i = 1,...,N}is a polyhedral partition of \({\mathbb{R}}^{n_x+n_u+1}\).

**Proposition 3**

*Every structurally finite SMPL system of type-2 can be written as type-d piecewise affine system.*

### Proof

*k*) =

*m*if

*z*(

*k*) satisfies \(R_m \,z(k)\, {\preceq}^r_m\, r_m\). Let

*ω*(

*k*) and

*θ*(

*k*) be given by Eq. 15. The SMPL system is structurally finite, which means that if

*θ*is finite, then

*ω*(

*k*) will be finite. Let \(h^{(\ell)}_{i,p} = [H^{(\ell)}]_{i,p}\) and define the set

^{3}

*n*

_{tot}= #Φ, then \(n_{\mathrm{tot}} \leq {n_{\small L}} \,n_{\omega}^{n_{\theta}}\). Note that \(\omega_{i}(k) = \max_p ( h^{(\ell_t)}_{i,p} + \theta_p(k)) = h^{(\ell_t)}_{i,p_{i,t}} + \theta_{p_{i,t}}(k)\) is equivalent to

*p*= 1, ...,

*n*

_{ω},

*j*= 1, ...,

*n*

_{θ}we obtain that

*i*= 1, ...,

*n*

_{ω},

*j*= 1, ...,

*n*

_{θ}, and

*t*= 1, ...,

*n*

_{tot}, we have:

*E*

^{(t)}

*e*

^{(t)}] can be removed.) It is clear that from Eq. 17 we can derive the matrices

*A*

_{i},

*B*

_{i},

*C*

_{i},

*D*

_{i}and vectors

*f*

_{i}and

*g*

_{i}such that we obtain a description of the form Eq. 16. The polyhedra are described by the inequalities

*E*

^{(t)}

*θ*(

*k*) ≤

*e*

^{(t)}and \(R_{\ell_t} \,z(k)\, {\preceq}^r_{\ell_t}\, r_{\ell_t}\). The total number of different polyhedra is less than or equal to \(N={n_{\small L}} \,n_\omega^{n_\theta}\).□

**Definition 6**

*f*of the variables

*x*

_{1}, ...,

*x*

_{n}is defined by the syntax

^{4}

*i*∈ {1, 2, ...,

*n*},

*α*,

*β*∈ ℝ, and where

*f*

_{k},

*f*

_{l}are again MMPS expressions.

**Definition 7**

*f*

_{x},

*f*

_{y}are MMPS expressions in terms of the components of

*x*(

*k*),

*u*(

*k*), and the auxiliary variables

*d*(

*k*), which are all real-valued. Such systems will be called max-min-plus-scaling (MMPS) systems. If in addition, we have a condition of the form

*f*

_{c}are MMPS expressions and \({\preceq}_i\) is a vector where the entries stand for either ≤ or <, we speak about constrained MMPS systems.

**Proposition 4**

*Every structurally finite SMPL system of type-2 can be written as a constrained MMPS system provided that the variables x*(*k* − 1)* and u*(*k*)* are bounded.*

Note that this proposition is a direct consequence of the equivalence between the class of type-d piecewise affine systems and MMPS systems (see Heemels et al. 2001). However we will provide a direct proof here that transfers SMPL systems directly into MMPS systems.

### Proof

*k*) =

*m*if

*z*(

*k*) satisfies \(R_m \,z(k)\, {\preceq}^r_m\, r_m\). Define

*ω*(

*k*),

*θ*(

*k*) and

*H*

^{(ℓ(k))}as in Eqs. 15 and 14. Then

*δ*

_{m}(

*k*) ∈ {0, 1}, for

*m*= 1, ...,

*n*

_{L}such that

*x*(

*k*) and

*u*(

*k*) are bounded, and

*d*∈ [0, 1] we find that there exist bounded sets \({\mathcal{E}}\) and \({\mathcal{Z}}\) such that \(\theta(k) \in {\mathcal{E}}\) and \(z(k) \in {\mathcal{Z}}\). Let

*σ*

^{*}is finite because the system is structurally finite and

*x*(

*k*− 1) and

*u*(

*k*) are bounded), then the system is described by the following equation

*k*) =

*m*, then

*δ*

_{m}(

*k*) = 1 and

*δ*

_{q}(

*k*) = 0 for all

*q*≠

*m*, and so Eq. 24 reduces to

*θ*and

*δ*. Hence, we have proven that a type-2 SMPL system, with bounded states and inputs, can be rewritten as a constrained MMPS system.□

### Remark 8

Recall that the state *x*(*k*) and input *u*(*k*) denote the time instant at which a state event or an input event occurs for the *k*th time, respectively. This means that both state and input are non-decreasing and grow unboundedly. In Section 4 we will introduce a shifted system, in which we consider the deviations of the state and input signals with respect to a reference signal. Therefore in a shifted system the shifted state and shifted input *u*(*k*) can be bounded and can thus easily be transformed into a type-d MMPS system.

In the following example we will illustrate some of the equivalences.

### Example 6

*x*(

*k*),

*u*(

*k*),

*y*(

*k*) ∈ ℝ

_{ε}and

^{5}

*P*[

*L*(

*k*) =

*i*|

*j*,

*x*(

*k*− 1),

*u*(

*k*)] ≤ 1, for

*i*,

*j*= 1, 2, and

*P*[

*L*(

*k*) = ℓ(

*k*)|

*w*(

*k*)] can be written as a piecewise function:

*k*− 1) ≤ 1.5 represents the case ℓ(

*k*− 1) = 1, and the inequality − ℓ(

*k*− 1) < − 1.5 represents the case ℓ(

*k*− 1) = 2.

The presented system is a type-1 SMPL system. We will now rewrite this system as a type-2 SMPL system. Consider a uniformly distributed stochastic scalar signal *d*(*k*) ∈ [0, 1], and define \(z(k) = \left[w^T(k) \; d(k) \right]^T\).

*k*− 1) = 2. Let ℓ(

*k*) = 1 if

*x*(

*k*− 1) +

*d*(

*k*) < 0 and let ℓ(

*k*) = 2 if

*x*(

*k*− 1) +

*d*(

*k*) ≥ 0. This defines the regions

*k*− 1) = 1, we always have ℓ(

*k*) = 2, and so

*i*= 1, 2:

*κ*= 1, 2, 3, with

*κ*(

*k*) =

*m*if

*u*(

*k*) ≤ 2 and that the initial state is in the bounded set − 1 ≤

*x*(0) ≤ 1. Introduce the binary variables

*δ*

_{m}(

*k*) ∈ {0, 1}, for

*m*= 1, 2, 3 such that \(\delta_m(k)=1 \;\;\Leftrightarrow \;\;\bar{R}_{m} \,\bar{z}(k)\, {\preceq}^{-}_m\, \bar{r}_{m} \). It is easy to derive that in that case

*x*(

*k*) for

*k*≥ 0 will be bounded:

*δ*

_{m}(

*k*) ∈ [0, 1] and subject to

## 4 Conditions for stability

In this section we will derive conditions for stability in Theorem 1. These conditions will be used in Section 5 to derive a stabilizing model predictive controller for SMPL systems.

Just like in van den Boom and De Schutter (2002), we adopt the notion of stability for discrete-event systems from Passino and Burgess (1998), in which a discrete-event system is called stable if all its buffer levels remain bounded. In this paper we consider discrete-event systems with a due-date signal. This due date signal is a reference for the time that the output event should occur (e.g. in production systems the finished part has to be removed from the output buffer before the due-dates). This means that if the output event occurs after the given due-date there is a delay in the system. For a proper operation of the system, the delays have to remain bounded. In the remainder of the paper the due-date signal will be called “reference signal”, as is usual in MPC literature.

*r*(

*k*) that stability is achieved if and only if there exist finite constants

*k*

_{0},

*M*

_{yr},

*M*

_{yx}and

*M*

_{xu}such that

*k*>

*k*

_{0}. Condition (27) means that the delay between the actual output date

*y*(

*k*) and the reference

*r*(

*k*) has to remain bounded, and on the other hand, that the stock time has to remain bounded. Conditions (28) and (29) mean that the throughput time (i.e. the time between the starting date,

*u*(

*k*) and the output date,

*y*(

*k*)) is bounded. Consider a reference signal vector defined as

*ξ*is a vector describing the bounded variation of the reference around an average slope

*k*

*ρ*with

*ρ*a positive scalar. (If

*r*(

*k*) is strictly increasing we need the additional constraint

*ξ*

_{i}(

*k*) >

*ξ*

_{i}(

*k*− 1) −

*ρ*.) For the asymptotically increasing reference signal (30), the conditions (27)–(29) imply finite buffer levels.

Similar to max-plus-linear systems, stability is not an intrinsic feature of the SMPL system, but it also depends on the reference signal. In van den Boom and De Schutter (2002) we already observed that for max-plus-linear systems, the max-plus-algebraic eigenvalue of the system matrix *A* gives an upper bound on the asymptotic slope of the reference sequence. For a max-plus-linear system with a strongly connected *A*-matrix^{6}, this *A*-matrix only has one max-plus-algebraic eigenvalue *λ* and a corresponding max-plus-algebraic eigenvector *v* ≠ *ε*, such that *A* ⊗ *v* = *v* ⊗ *λ* (Baccelli et al. 1992). For SMPL systems we cannot use the max-plus-algebraic eigenvalue, but we use the concept of maximum autonomous growth rate:

**Definition 8**

*A*

^{(ℓ)}, \(\ell=1,\ldots,{n_{L}} \). Define the matrices \(A^{(\ell)}_\alpha\) with \([A^{(\ell)}_\alpha]_{i,j} = [A^{(\ell)}]_{i,j} - \alpha\). Define the set \({\mathcal{S}}_{\mathrm{fin},n}\) of all

*n*×

*n*max-plus diagonal matrices with finite diagonal entries, so \({\mathcal{S}}_{\mathrm{fin},n}= \{ \>S\>|\>S={\mathrm{diag}}_\oplus(s_1,\ldots,s_n), \>s_i\;\text{is f\/inite}\>\}\). The maximum autonomous growth rate

*λ*of the SMPL system is defined by

### Remark 9

*λ*is finite, or more precisely:

*S*= diag

_{⊕}(0, ..., 0) we obtain

*λ*≤

*λ*′. The maximum autonomous growth rate

*λ*can be easily computed by solving a linear programming problem:

*λ*=

*α*

^{*}.

### Remark 10

For a max-plus-linear system (so *n*_{L} = 1), the maximum autonomous growth rate *λ* is equivalent to the largest max-plus-algebraic eigenvalue of the matrix *A*^{(1)}.

For a given integer *N*, let the set \({\mathcal{L}}_N=\{ \>[\>\ell_1\;\cdots\;\ell_N\>]^T\>|\>\ell_m \in \{1,\ldots,{n_{\small L}} \},\> m=1,\ldots,N\}\) denote the set of all possible consecutive mode switchings vectors.

**Definition 9**

*α*∈ ℝ be given. Define the matrices \(A^{(\ell)}_\alpha\) with \([A^{(\ell)}_\alpha]_{i,j} = [A^{(\ell)}]_{i,j} - \alpha\). An SMPL system is structurally controllable if there exists a finite positive integer

*N*such that for all \({\tilde{\ell}} = \left[ \ell_1 \; \ldots \; \ell_N \right] ^T \in {\mathcal{L}}_N\) the matrices

*ε*.

**Definition 10**

*α*∈ ℝ be given. Define the matrices \(A^{(\ell)}_\alpha\) with \([A^{(\ell)}_\alpha]_{i,j} = [A^{(\ell)}]_{i,j} - \alpha\). An SMPL system is structurally observable if there exists a finite positive integer

*M*such that for all \({\tilde{\ell}} = \left[ \ell_1 \; \ldots \; \ell_M \right]^T \in {\mathcal{L}}_M\) the matrices

*ε*.

### Remark 11

Note that the structural controllability and structural observability are structural properties and do not depend on the actual value of *α*. If a SMPL system is structurally controllable (observable) for one finite value of *α* it is structurally controllable (observable) for any finite value of *α*.

**Theorem 1**

*Consider an SMPL system with maximum autonomous growth rate λ*

*and consider a reference signal*(30)

*with growth rate ρ*

*. Define the matrices*\(A^{(\ell)}_\rho\)

*with*\([A^{(\ell)}_\rho]_{i,j} = [A^{(\ell)}]_{i,j} - \rho\)

*. Now if*

*then any input signal*

*for a finite value μ*

_{max}

*, will stabilize the SMPL system.*

### Proof

*ρ*>

*λ*holds if and only if there exists a max-plus diagonal matrix

*S*such that

*S*be the max-plus diagonal matrix with finite diagonal elements such that (35) is satisfied, and define the signals

*ρ*a shifted system

*z*

_{max},

*w*

_{max}, such that

*i*,

*k*for a given finite value

*μ*

_{max}. Let \(\bar{z}(k) = \max_i z_i(k)\) and \(\bar{b}_{\max}=\max_{\ell,i,j}([{\bar{B}}^{(\ell)}]_{i,j})\), then

*z*(

*k*) have a finite upper bound

*z*

_{max}.

*μ*

_{i}(

*k*) ≥ −

*μ*

_{max}, ∀

*i*,

*k*, and let

*N*and

*M*be such that \(\gamma_{i,\max}({\tilde{\ell}})=\max_{j}([\Gamma^N_\rho({\tilde{\ell}})]_{i,j}) \) are finite for all \(i,{\tilde{\ell}}\), and \(\omega_{i,\max}({\tilde{\ell}})=\max_{j}([{\mathcal{O}}^M_\rho({\tilde{\ell}})]_{i,j}) \) are finite for all \(i,{\tilde{\ell}}\). Note that a finite

*N*and a finite

*M*exist due to condition 2 and 3 of the theorem (see also Definitions 9 and 10). Now define

*m*≥

*N*there holds

*z*(

*k*+

*m*),

*m*≥

*N*we derive:

*s*

_{min}= min

_{p}(

*s*

_{p}) and \(\gamma_{\min}=\min_{{\tilde{\ell}},i} \gamma_{i,\max}({\tilde{\ell}})\). We conclude that after

*N*event steps we have a lower bound for the shifted state

*z*(

*k*).

*m*≥

*N*+

*M*there holds

*w*(

*k*+

*m*),

*m*≥

*N*+

*M*we derive:

*s*

_{max}= max

_{p}(

*s*

_{p}) and \(\omega_{\min}=\min_{{\tilde{\ell}},i} \omega_{i,\max}({\tilde{\ell}})\). Now from (40) it follows that

*N*+

*M*event steps

*w*

_{i}(

*k*) will be bounded by

*k*>

*N*+

*M*, there holds

*y*

_{i}(

*k*) −

*x*

_{j}(

*k*) and

*x*

_{j}(

*k*) −

*u*

_{m}(

*k*) we can prove that

*x*

_{j}(

*k*) −

*y*

_{i}(

*k*) and

*u*

_{m}(

*k*) −

*x*

_{j}(

*k*) are bounded. This proves stability for the SMPL system (1) and (2).

## 5 A stabilizing model predictive controller

In this section we develop a stabilizing model predictive controller for SMPL systems with both deterministic and stochastic switching. Model predictive control (MPC) (Maciejowski 2002) is a model-based control approach that has its origins in the process industry and that has mainly been developed for linear or nonlinear time-driven systems. Its main ingredients are: a prediction model, a performance criterion to be optimized over a given horizon, constraints on inputs and outputs, and a receding horizon approach. Just as for time-driven systems (where more than 80% of the advanced controllers are model predictive controllers), we like to use the advantages of the model predictive control strategy for SMPL discrete-event systems. The main advantage of using MPC is that it is the only closed-loop control method that can handle constraints in an adequate way. Feedback is incorporated into MPC by repeating the state measurement and control input calculation at regular time instants. Furthermore, MPC features an simple tuning process and can easily adapt to model changes. The algorithms to compute the optimal input signal are mostly linear programming algorithms, with means that the computational effort is usually very low. In more complicated situations where we deal with different modes and the switching mechanism has stochastic properties, MPC gives a framework to deal with these issues and the controller computes an optimal control input.

A Model Predictive Control (MPC) approach for MPL systems has been introduced in De Schutter and van den Boom (2001). In De Schutter and van den Boom (2001) and van den Boom and De Schutter (2002) it has been shown that for a broad range of performance criteria and constraints, max-plus linear MPC results in a linear programming problem, which can be solved very efficiently. In van den Boom and De Schutter (2006, 2007, 2008a) we have extended this approach to SMPL systems with both stochastic and deterministic switching. In this paper we review these results and discuss the algorithms to solve the MPC problem for different types of switching (stochastic and/or deterministic).

*y*(

*k*+

*j*) based on knowledge at event step

*k*,

*u*(

*k*+

*j*) denotes the (future) input at event step

*k*+

*j*, ℓ(

*k*+

*j*) denotes the (future) mode at event step

*k*+

*j*,

*r*(

*k*+

*j*) denote the (future) reference at event step

*k*+

*j*, and

*N*

_{p}is the prediction horizon (so it determines how many event steps we look ahead in our control law design).

*L*(

*k*+

*j*) = ℓ(

*k*+

*j*) given ℓ(

*k*+

*j*− 1),

*x*(

*k*+

*j*− 1),

*u*(

*k*+

*j*),

*v*(

*k*+

*j*)) can be written as

*P*denotes the switching probability (see Section 2.2). Note that from (42) we find that for a fixed \({\tilde{\ell}}(k)\) the state

*x*(

*k*+

*j*) is piecewise affine on polyhedral sets in the variables

*x*(

*k*− 1) and \({\tilde{u}}(k)\). From that we can conclude that for a fixed \({\tilde{\ell}}(k)\),

*x*(

*k*− 1) and ℓ(

*k*− 1) the probability

*P*is piecewise affine on polyhedral sets in the variables \({\tilde{u}}(k)\) and \({\tilde{v}}(k)\). The probability for the switching sequence \({\tilde{\ell}}(k)\in {\mathcal{L}}_{{N_{\mathrm{p}}}}\), given ℓ(

*k*− 1),

*x*(

*k*− 1), \({\tilde{u}}(k)\), \({\tilde{v}}(k)\) is computed as

*P*, and will therefore be a piecewise polynomial function on polyhedral sets in the variables \({\tilde{u}}(k)\), \({\tilde{v}}(k))\) (for a given \({\tilde{\ell}}(k)\),

*x*(

*k*− 1), and ℓ(

*k*− 1)).

*J*(

*k*), subject to linear constraints on the inputs. The cost criterion reflects the input and output cost functions (

*J*

_{in}and

*J*

_{out}, respectively) in the event period

*k*, ...,

*k*+

*N*

_{p}− 1:

*β*≥ 0 is a tuning parameter, chosen by the user. The output cost function is defined by

*IE*stands for the expectation over all possible switching sequences, and \(\bar{0}\) is a column vector consisting of zeros. The output cost function

*J*

_{out}measures the tardiness of the system, which is equal to the delay between the output dates \({\tilde{y}}_i(k)\) and reference dates \({\tilde{r}}_i(k)\) if \({\tilde{y}}_i(k)-{\tilde{r}}_i(k)>0\), and zero otherwise.

*J*

_{i}n maximizes the input dates \({\tilde{u}}_i(k)\) for just-in-time production, the second term can be used to (possibly) penalize specific actions of the variable \({\tilde{v}}_i(k)\).

Note that the input cost function is linear in \({\tilde{u}}(k)\) and \({\tilde{v}}(k)\).

*k*as

So the optimization in the MPC algorithm boils down to a nonlinear optimization problem, where the cost criterion is piecewise polynomial and the inequality constraints are linear. This problem can be solved in several ways. Let \(\mathcal{P}=\{\mathcal{P}_1,\ldots,\mathcal{P}_K\}\) be the set of polyhedral regions formed by the intersection of linear constraints (47)–(51) and the regions on which the piecewise polynomial functions expressing *J* are defined. If the number *K* of polyhedral regions in \(\mathcal{P}\) is small, one could apply for each region \(\mathcal{P}_i\) a multi-start optimization method for smooth, linearly constrained functions such as steepest descent with gradient projection or sequential quadratic programming (Pardalos and Resende 2002), and afterwards take the minimum over all regions \(\mathcal{P}_i\). If *K* is larger, global optimization methods like tabu search (Glover and Laguna 1997), genetic algorithms (Davis 1991), simulated annealing (Eglese 1990), or (multi-start) pattern search (Audet and Dennis 2007) could be applied.^{7}

Note that in the special case where each probability *P* is a piecewise constant function, *J* will be a piecewise affine function, and then it can be shown (using an approach similar to the one used in Bemporad and Morari 1999) that the optimization problem reduces to a mixed-integer linear programming problem, for which reliable and efficient algorithms are available (Atamtürk and Savelsbergh 2005; Fletcher and Leyffer 1998). If some of the control variables are integer-valued, we get a mixed-integer nonlinear programming problem, which could be solved using branch-and-bound methods (Leyffer 2001).

We can rewrite the SMPL system with both deterministic and stochastic switching as a stochastic MMPS system or as a stochastic PWA system using the algorithms given in Section 3. Necoara et al. (2004) solves the model predictive control problem using a stochastic MMPS system description. In Kerrigan and Mayne (2002), Lazar et al. (2007) and Rakovic et al. (2004) the model predictive control problem using a stochastic PWA system description is solved.

*MPC for SMPL systems with deterministic switching* In some applications the mode switching is deterministic, which means that the switching probability is either zero or one (so *P*[*L*(*k*) = ℓ(*k*)|ℓ(*k* − 1), *x*(*k* − 1), *u*(*k*), *v*(*k*)] ∈ {0, 1}). If we rewrite such an SMPL system into the type-2 form, the stochastic signal *d*(*k*) will not be needed. We can then use the transformation formulas of Section 3 to rewrite the system as a deterministic PWA system or a deterministic MMPS system. For PWA systems there are many MPC algorithms available (see e.g. Alessio and Bemporad 2009; Johansson 2003) and for MMPS systems we can use the MPC algorithm of De Schutter and van den Boom (2004).

Sometimes the mode switching only depends on the auxiliary variable *v*(*k*). In that case the MPC problem can be directly recast into a Mixed Integer Linear Program (MILP).

*MPC for SMPL systems with mode-dependent stochastic switching*We will now study the MPC algorithm in the special case of a mode-dependent stochastic switching. We will show that for this subclass of SMPL systems the optimization that arises from the MPC problem boils down to a linear programming problem. For SMPL systems with mode-dependent stochastic switching the probability of switching to mode ℓ(

*k*) depends entirely on the previous mode ℓ(

*k*− 1) (and not on the previous state or input signals), so we now define a new probability function

*P*

_{s}such that

**Theorem 2**

*Consider a type-1 SMPL systems with mode-dependent stochastic switching, so the switching probability is given by Eq.*52

*and*53

*. Assume that*\({\mathcal{L}}_{{N_{\mathrm{p}}}}\)

*can be rewritten as*\({\mathcal{L}}_{{N_{\mathrm{p}}}}= \{ {\tilde{\ell}}^1 , {\tilde{\ell}}^2, \ldots, {\tilde{\ell}}^M \}\)

*for*\(M = {n_{\small L}} ^{{N_{\mathrm{p}}}}\)

*. The MPC problem*(46)–(49)

*can be recast as a linear programming problem:*

*subject to*

### Proof

If we would minimize *J*_{out}(*k*) + *βJ*_{i}n(*k*) subject to Eqs. 56–61 then, given the fact that the values of \({\tilde{P}}_{\mathrm{s}}[{\tilde{L}}(k)={\tilde{\ell}}^m|\ell(k-1)]\) are nonnegative, and that the variables *t*_{i,m} only appear on the left-hand side of the inequalities (56)–(58), one of the inequalities indeed becomes an equality for at least one of the indices and so *t*_{i,m} will be equal to the maximum (62).

This implies that the MPC problem (46)–(49) can indeed be written as the linear programming problem (55)–(61).□

So the optimization in the MPC algorithm boils down to a linear programming problem, which is polynomially solvable (Khachiyan 1979). Usually we will find that \(M \ll {n_{\small L}} ^{{N_{\mathrm{p}}}}\) (as not all mode transitions are possible and so the corresponding probabilities will be zero) and we can efficiently solve the optimization.

*Timing issues*Switching max-plus-linear systems are different from conventional time-driven systems in the sense that the event counter

*k*is not directly related to a specific time. So far we have assumed that at event step

*k*the state

*x*(

*k*) is available (recall that

*x*(

*k*) contains the time instants at which the internal activities or processes of the system start for the

*k*th cycle). Therefore, we will present a method to address the availability issue of the state at a certain time instant

*t*. Since the components of

*x*(

*k*) correspond to event times, they are in general easy to measure. So we consider the case of full state information. Also note that measurements of occurrence times of events are in general not as susceptible to noise and measurement errors as measurements of continuous-time signals involving variables such as temperature, speed, pressure, etc. Let

*t*be the time instant when an MPC problem has to be solved. We can define the initial cycle

*k*as follows:

*x*(

*k*) is completely known at time

*t*and thus

*u*(

*k*− 1) is also available (due to the fact that in practical applications the entries of the system matrices are nonnegative or take the value

*ε*). Note that at time

*t*some components of the future

^{8}states and of the forthcoming inputs might be known (so

*x*

_{i}(

*k*+

*l*) ≤

*t*and

*u*

_{j}(

*k*+

*l*− 1) ≤

*t*for some

*i*,

*j*and some

*l*> 0). Due to causality, these states are completely determined by the known forthcoming inputs. During the optimization at time instant

*t*the known values of the input have to be fixed by equality constraints, which fits perfectly in the framework of a (mixed-integer) linear programming problem. Due to the information at time

*t*it might be possible to conclude that certain future modes (ℓ(

*k*+

*l*) for

*l*> 0) are not feasible any more. In that case we can set the switching probabilities for this mode at zero, and normalize the switching probabilities of the other modes. With these new probabilities we can perform the MPC optimization at time

*t*.

*Examples* The production systems of Examples 4 and 5 are used to demonstrate the design procedure for stabilizing model predictive controllers for SMPL systems with both types of switching procedures. In the first example the switching is purely stochastic, while in the second example the switching is both deterministic and stochastic.

*Example: Production system I*

*λ*= 6.5. We choose a reference signal given by

*r*(

*k*) =

*ρ*·

*k*, where

*ρ*= 7.15 >

*λ*. The initial state is taken equal to \(x(0)= \left[5\;5\;5\right]^T\), and

*J*is given by Eq. 43 for

*N*

_{p}= 4, and

*β*= 10

^{ − 4}. In the experiment, the true switching sequence is simulated for a random sequence with the switching probability (4). We apply the presented MPC algorithm to this system. The optimization is done using a linear programming algorithm. Figure 6a gives the tracking error between the reference signal and the output signal

*y*(

*k*), for the switching sequence given in Fig. 6c, when the system is in closed loop with the receding horizon model predictive controller. It can be observed that

*y*(

*k*) −

*r*(

*k*) is initially larger than zero, which is due to the initial state. The error decreases rapidly and for

*k*≥ 13 the error is always equal to zero, which means that the product is delivered in time for all

*k*≥ 13. Figure 7b gives the difference between the input signal

*u*(

*k*) and the reference signal

*r*(

*k*).

*Example: Production system II*

Consider the production system of Example 5. Note that also this SMPL system is structurally controllable and structurally observable. The maximum growth rate of the system is equal to *λ* = 6.5. We choose a reference signal given by *r*(*k*) = *ρ* · *k*, where *ρ* = 7.15 > *λ*. The initial state is equal to \(x(0)= \left[5\;5\;5\right]^T\), and *J* is given by Eq. 43 for *N*_{p} = 4, and *β* = 10^{ − 4}. In the experiment, the true switching sequence is simulated for a random sequence with the switching probability (5). We apply the MPC algorithm as presented in Section 5 to this system. The optimization turns out to be a mixed-integer linear programming problem. Figure 7a gives the reference error between the reference signal *r*(*k*) and the output signal *y*(*k*), for a switching sequence given in Fig. 7c, when the system is in closed loop with the receding horizon model predictive controller. It can be observed that *y*(*k*) − *r*(*k*) is initially larger than zero, which is due to the initial state. The error decreases rapidly and for *k* ≥ 9 the error is always equal to zero, which means that the the product is delivered in time for all *k* ≥ 9. Note that for *v*(*k*) = 0 we choose recipe B_{1} (so ℓ(*k*) = 2) and for *v*(*k*) = 1 we choose recipe B_{2} (so ℓ(*k*) = 3). For ℓ(*k*) = 1, the value *v*(*k*) is indefinite (which means that for mode 1 the value of signal *v*(*k*) has no influence). Figure 7b gives the difference between the input signal *u*(*k*) and the reference signal *r*(*k*).

## 6 Discussion

We have considered the control of switching max-plus-linear (SMPL) systems, a subclass of the discrete-event systems, in which the system can switch between different modes of operation. The switching between the modes can be deterministic or stochastic, and in each mode the discrete-event system is described by a max-plus-linear state space model with different system matrices for each mode.

In this paper we have revisited type-1 SMPL and type-2 SMPL systems, and we have shown that these two classes of SMPL systems are equivalent. Furthermore we have proven that every structurally finite SMPL system of these two types can be written as a type-d piecewise affine system or as a constrained max-min-plus-scaling system (provided that the output and state variables are bounded). An advantage of the equivalency is that we can use many tools, derived for piecewise affine system and max-min-plus-scaling systems, to analyze our SMPL systems.

We have also derived a stabilizing model predictive controller for SMPL systems. The resulting optimization problem is nonlinear with a piecewise polynomial cost criterion and linear inequality constraints. In the case of stochastic switching depending only on the previous mode, the resulting optimization problem can be solved using linear programming.

In future research we will continue our study on the relation between the various classes of SMPL systems. Further we will extend the SMPL system by the introduction of stochasticity in the system parameters, as was done in van den Boom and De Schutter (2004) for MPL systems. In this way we will be able to capture more stochastic issues in SMPL systems.

Note that if we consider an SMPL system with only one mode, we have a special subclass, namely the class of regular max-plus-linear systems.

We need this construction that allows both strict and non-strict inequalities since the sets Γ_{i} have to be non-overlapping.

Note that the entry of *A*^{(2)} is negative. This happens when *x*(*k*) represent the delay with respect to some constantly increasing reference signal (cf. Remark 8 and also see the shifted system (39) and (40) in Section 4 or in Necoara et al. (2007)).

A matrix *A* is called strongly connected if its graph is strongly connected. This means that for any two nodes *i*,*j* of the graph, node *j* is reachable from node *i* (Heidergott et al. 2006).

Note that often these global optimization algorithms will not give satisfactory results within an acceptable computation time, even for small problems.

## Acknowledgements

Research partially funded by the Dutch Technology Foundation STW project “Model-predictive railway traffic management – A framework for closed-loop control of large-scale railway systems” and by the European 7th Framework Network of Excellence “Highly-complex and networked control systems (HYCON2)”.

**Open Access**

This article is distributed under the terms of the Creative Commons Attribution Noncommercial License which permits any noncommercial use, distribution, and reproduction in any medium, provided the original author(s) and source are credited.