Elsevier

Computers & Chemical Engineering

Volume 72, 2 January 2015, Pages 21-33
Computers & Chemical Engineering

Embedded optimization for mixed logical dynamical systems

Through personal discussions and specifically through his paper with Raman (Raman and Grossmann, 1992), Ignacio Grossmann brought the techniques for translating propositional logic statements into mixed integer inequalities to our attention. These powerful ideas led us to introduce mixed logical dynamical (MLD) systems as a paradigm for describing hybrid systems (Bemporad and Morari, 1999). MLD systems defined our research program for a decade. The senior author (Manfred Morari) is delighted to dedicate this paper to Ignacio in gratitude for his inspirational leadership and wonderful friendship for more than 35 years.
https://doi.org/10.1016/j.compchemeng.2014.06.005Get rights and content

Highlights

  • First branch-and-bound hybrid MPC solver that targets embedded systems.

  • Problem-specific ANSI-C implementation can be automatically generated.

  • Efficient, problem-specific subtree cuts are generated by pre-processing methods.

  • Relaxations provide trade-off between performance and runtime.

  • Two extensive numerical studies demonstrating the effectiveness of the approach.

Abstract

Predictive control of hybrid systems is currently considered prohibitive using embedded computing platforms. To overcome this limitation for mixed logical dynamical systems of small to medium size, we propose to use (1) a standard branch-and-bound approach combined with a fast embedded interior point solver, (2) pre-processing heuristics, run once and offline, to significantly reduce the number of subproblems to be solved, and (3) relaxations of the original MPC problem that allow a trade off between computation time and closed-loop performance. A problem-specific ANSI C implementation of the proposed method can be automatically generated, and has a fixed memory footprint and a code size that is insignificantly larger than that of the subproblem solver. Two extensive numerical studies are presented, where problems with up to 60 binary variables are solved in less than 0.2 s with a performance deterioration of below 2% when compared to an optimal MPC scheme.

Introduction

Control of hybrid systems is very challenging due to the complex interaction of continuous, possibly switched dynamics with logic. Over the last two decades, receding horizon control (RHC) of mixed logical dynamical (MLD) systems (Bemporad and Morari, 1999) has gained considerable attention, both in research and in industry, as a systematic approach to control synthesis for hybrid systems. The success of this approach, which is often referred to as hybrid model predictive control (hybrid MPC), is based on three key factors. First, the MLD framework offers a systematic modeling approach to hybrid systems, and it is suitable to express complex physical processes involving logic. Under some technical assumptions, MLD systems are equivalent to other problem classes from hybrid system modeling such as piece-wise affine (PWA) or linear complementarity systems (Heemels et al., 2001), and the MLD representation allows for an automatic translation into an optimization problem. Second, the ability to achieve constraint satisfaction and high control performance by design makes MPC the method of choice for controlling constrained systems. Third, the availability of mature software for building MLD models such as HYSDEL (Torrisi and Bemporad, 2004) and for solving the resulting mixed-integer optimization problems (MIPs) by commercial solvers such as CPLEX (International Business Machines Corp, 2013) enables control engineers to deploy hybrid MPC on a desktop computing platform. Although available algorithms are not polynomial-time, existing desktop software implementations are usually able to compute a solution in acceptable run-time.

However, existing general purpose MIP solvers have focused on powerful computing platforms, whereas no such solver is currently available for embedded computing platforms, limiting the applicability of hybrid MPC to simulation studies or slow dynamical systems with considerable IT infrastructure. Examples are buildings (Guan et al., 2010), or applications in the process industry such as the predictive control of a cement kiln (Stadler et al., 2011).

In this paper, we propose a numerical solver for the class of convex integer multistage problems, into which most hybrid MPC problems can be cast, that enables an implementation on embedded platforms. This is achieved by using a standard branch-and-bound algorithm (Bertsimas and Weismantel, 2005) on top of the recently developed FORCES solver for convex multistage problems (Domahidi et al., 2012). In addition, we propose pre-processing heuristics that can significantly reduce the number of subproblems to be explored during the online solution of the MIP. We demonstrate that the proposed method enables the solution to numerous practical problems, which involve a non-trivial number of discrete and continuous variables, on embedded systems. Furthermore, since the subproblem solver is based on an interior point method, hybrid MPC problems with integer convex quadratic constraints can be solved. To the best knowledge of the authors, this is the first such solver that targets embedded systems.

The performance of the proposed method is examined on two extensive numerical examples: (1) the energy management control for fuel cells as an example for switched systems where long prediction horizons are required, and (2) a traffic junction as an example of scheduling and multi-agent switched servicing problems. In all examples, our method achieves computation times in the order of or below those required by CPLEX (International Business Machines Corp, 2013), which is equipped with numerous other heuristics, while being directly implementable on low-cost embedded hardware.

Recently, it has been demonstrated by various research groups that solving convex optimization problems on embedded computing hardware with iterative methods is feasible at very high sampling rates (Domahidi et al., 2012, Domahidi et al., 2013, Richter, 2012, Jerez et al., 2013, Kögel and Findeisen, 2011, Ferreau et al., 2008, Frasch et al., 2014). The main tools to achieve this performance are tailored optimization methods, which exploit problem structure, in combination with code generation mechanisms that can automatically generate an implementation for the particular embedded platform and problem (Domahidi, 2012, Mattingley and Boyd, 2012, Ullmann and Richter, 2012, Zometa et al., 2013). Using these techniques, today the majority of convex, linear MPC problems without discrete decision variables admit an implementation even on low-power embedded computing platforms.

In contrast, solving optimization problems arising from hybrid MPC on embedded platforms remains computationally prohibitive. The only exception are small systems with few discrete variables, for which the finite horizon optimal control problem with fixed discrete variables can be pre-solved by means of multi-parametric programming for each admissible initial state (Bemporad et al., 2002). Such problems appear, for example, in power electronics, where computation times of below a millisecond are required, cf. (Mariéthoz et al., 2012, Almer et al., 2013). Even in these applications, one is forced to restrict the prediction and control horizon to one or two time steps due to the combinatorial nature of the problem and the resulting memory requirements, potentially sacrificing the favorable properties of MPC with long horizons in terms of closed-loop performance and constraint satisfaction (Rodriguez et al., 2007).

Existing work on the online solution of MIPs for hybrid MPC (Axehill, 2008) employs dual active set methods as subproblem solvers, which have the advantage of effective warm-starting, as well as dual gradient projection methods, resulting in substantial speedups when compared to general purpose solvers. However, both subproblem solvers are restricted to the class of convex quadratic programs (QPs). Semi-definite programming (SDP) relaxations, which are tighter than the standard relaxations used in this paper, are examined by Axehill et al. (2010), but it is unclear whether the numerical performance and robustness of SDP solvers is competitive in a real-time setting. Kirches, 2011, Sager, 2005, Sager et al., 2011 present efficient numerical methods for systems with nonlinear, continuous-time dynamics and discrete states or inputs, applying direct multiple shooting and sequential quadratic programming techniques combined with a branch-and-bound algorithm to solve the mixed-integer nonlinear program very efficiently. A tailored rounding scheme is presented by Sager et al. (2012), for the same setting, giving bounds on the integer approximation error. This is applied to discrete-time systems with combinatorial constraints, in particular switching constraints (Jung et al., 2014).

In order to reduce the average computation time for solving the MIP arising from hybrid MPC, we propose to use, in addition to a standard branch-and-bound algorithm (Bertsimas and Weismantel, 2005), two heuristics that can be applied to all integer convex multistage problems, and examine their effect on the closed-loop performance in extensive numerical experiments.

The first heuristic is based on relaxing the multistage optimization problem in all but the first M < N time steps, where N is the control horizon length, either in terms of integer feasibility or in terms of optimality. This idea is motivated by the implementation of MPC in a receding horizon fashion, where at each sampling time only the first input of the sequence of computed inputs is applied to the system. One such relaxation is to allow the binary variables to take continuous values from the unit interval [0, 1]. While this generally reduces the worst-case runtime by effectively changing the depth of the branch-and-bound tree, our numerical experiments show that the effect of this partial relaxation on the closed-loop performance can be counter-intuitive and in general hard to predict. Instead, we propose to relax only the minimization of the objective function after M time steps, but not the variables themselves. This relaxation of optimality reduces computation time by searching for an N-step feasible solution that is M-step optimal. While the theoretical worst-case runtime of this approach is the same as solving the original hybrid MPC problem, in practice the computational performance can be significantly improved if feasible trajectories can be found early in the branch-and-bound procedure. Moreover, the results on the closed-loop performance are predictable, allowing one to intuitively trade off computation time vs. closed-loop performance.

The second heuristic discussed in this paper revolves around the Cut function in the branch-and-bound algorithm, which is used to decide whether a subtree should be explored further or cut from the tree. A pre-processing procedure is proposed, which runs off-line and computes integer combinations that are infeasible or suboptimal, and hence will not be chosen by the optimizer. Using this information, a customized Cut function is proposed, which cuts a subtree whenever it encounters binary combinations that cannot be part of an optimal solution. For some problems, and in contrast to existing methods such as the combinatorial integral approximation from Jung et al. (2014), the proposed problem-specific tree cutting procedure allows one to shift essentially all computational burden related to the evaluation of the Cut function to an offline pre-processing step, while the online computation time is negligible. This is particularly interesting for MPC, where typically the structure of the combinatorial constraint sets is known a-priori, a fact that we exploit in this paper.

The method employed in this paper can be fully implemented by an automatic code generation system such as FORCES (Domahidi, 2012), which generates efficient, embeddable code that runs on any platform for which a C compiler is available. Only code for one such (QC)QP solver needs to be generated, with the lower and upper bounds of the binary variables defined as parameters. The generated solver can then be used to solve all relaxed problems, where some of the binary variables are fixed to 0 or 1 by means of equating the upper and lower bounds. The resulting implementation has a fixed memory footprint, which is known at compile time, and does not rely on a memory manager. Moreover, the code size is essentially the same as that of the convex subproblem solver, since the branch-and-bound algorithm can be implemented very efficiently using recursion, and the maximum memory usage can be traded off against the number of subproblems that are eventually solved multiple times.

While in general interior point methods are not a common choice in (mixed) integer programming because of their limited warm-starting capabilities, we employ FORCES because it has been designed and optimized for the multistage structure that arises also in predictive control problems with MLD dynamics, enabling computation times of below a millisecond per subproblem. In addition, FORCES supports quadratic constraints, and advances in warm-starting techniques for primal-dual interior-point methods (Skajaa et al., 2013, Gondzio and Grothey, 2002), which recently have been employed successfully for solving large-scale integer programs (Munari and Gondzio, 2013), suggest that the computational times reported in this paper could be further improved.

While efficient implementations of dual active set methods such as qpDUNES (Frasch et al., 2014), which exploits warm-starting and the multistage structure, may outperform FORCES, our aim is to demonstrate that by using an iterative optimization algorithm to solve the subproblems, the proposed method can solve mixed integer multistage quadratically constrained quadratic programs (MI-QCQPs) even up to a large number of continuous variables, where a parametric approach (Bemporad et al., 2002) is rendered infeasible. This enables the deployment of hybrid MPC controllers on embedded platforms for closed-loop control, without the need for licensing expensive commercial solvers.

The rest of the paper is organized as follows. In Section 3, we provide the background on MLD systems and multistage optimization problems. The proposed branch-and-bound heuristic for solving integer convex multistage problems arising in hybrid MPC on embedded platforms is described in Section 4. Two detailed numerical examples are presented in Section 5, demonstrating that the online optimization based control of medium-sized MLD systems is feasible in real-time.

Section snippets

Notation

an denotes a column vector, and kn denotes a column vector of nonnegative integers of length n, respectively. For two vectors an (or an) and bm (or bm), we denote the concatenation by

(a,b)abn+morabn+m.

Mixed logical dynamical systems

Physical processes that interact with or are part of a system that involves some form of logic can be modeled in the general framework of mixed logical dynamical (MLD) systems (Bemporad and Morari, 1999). A discrete-time MLD system with linear or piece-wise affine dynamics can be represented in the form (Torrisi and Bemporad, 2004): x+=Ax+Bu+Vw+gy=Cx+Du+Ww+gy0E1x+E2u+E3w+h where x  (xc, xb) with xcnxc, xb  {0, 1}nxb denotes the continuous and discrete states of the system and the vector u  (uc,

Optimization algorithm

In this section, we describe the proposed algorithm in detail. In particular, we give a recursive implementation of the branch-and-bound algorithm in Section 4.1, and describe two heuristics in Sections 4.2 Relaxation after, 4.4 Reduction of independent set constraints, which can significantly reduce the computation time for solving hybrid MPC problems.

Energy management using fuel cells

Fuel cells are a source of green energy, providing high efficiency and energy density (Barbir, 2012). They need to be carefully controlled to stay within the admissible operating range. In particular, frequent switching between the ON and OFF state drastically reduces the performance and lifetime of the device. As a consequence, fuel cells are often used in combination with energy storage devices, such as batteries or super capacitors, which provide for fast transients, while the fuel cell is

Conclusion

It has been demonstrated in this paper that a simple combination of a standard branch-and-bound procedure with a fast interior point solver for multistage problems can be used to solve hybrid MPC problems with a significant number of binary variables in time frames that admit an implementation on embedded systems. The computation time is reduced by cuts introduced in the branch-and-bound tree based on the maximum independent set of binary constraints as well as extended constraint formulations

Acknowledgment

The initial idea of combining FORCES with a branch and bound mechanism by Stephen Boyd is gratefully acknowledged.

References (45)

  • D. Axehill

    Integer quadratic programming for control and communication

    (2008)
  • F. Barbir

    PEM Fuel Cells: Theory and Practice

    (2012)
  • P. Belotti et al.

    Mixed-integer nonlinear optimization

  • D. Bertsimas et al.
    (2005)
  • F. Borrelli
    (2003)
  • S. Boyd et al.

    Branch and Bound Methods, Lecture Notes

    (2010)
  • R. Diestel
    (2005)
  • A. Domahidi et al.

    Efficient interior point methods for multistage problems arising in receding horizon control

  • A. Domahidi et al.

    ECOS: an SOCP solver for embedded systems

  • A. Domahidi

    FORCES: fast optimization for real-time control on embedded systems

    (2012)
  • H.J. Ferreau et al.

    An online active set strategy to overcome the limitations of explicit MPC

    Int J Robust Nonlinear Control

    (2008)
  • J.V. Frasch et al.

    A New Quadratic Programming Strategy for Efficient Sparsity Exploitation in SQP-Based Nonlinear MPC and MHE

  • Cited by (42)

    • Design, implementation and simulation of an MPC algorithm for switched nonlinear systems under combinatorial constraints

      2019, Journal of Process Control
      Citation Excerpt :

      presents an approach for modeling and predictive control of hybrid systems referred to as Mixed Logical Dynamical (MLD) systems (linear systems with both continuous and discrete inputs and states and subject to linear constraints) and solves the resulting MIOCPs using an available, general Mixed-Integer Quadratic Program (MIQP) solver. Today, tailored algorithms that aim to exploit special aspects of MIOCPs for MLD systems have been presented, e.g., by [18]. This is exemplary for several approaches that can be found in the literature that aim towards decreasing solution times of mixed integer problems for real-time applications by tailored solution methods. [34]

    View all citing articles on Scopus
    View full text