<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" article-type="research-article" dtd-version="2.3">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Endocrinol.</journal-id>
<journal-title>Frontiers in Endocrinology</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Endocrinol.</abbrev-journal-title>
<issn pub-type="epub">1664-2392</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.3389/fendo.2021.662348</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Endocrinology</subject>
<subj-group>
<subject>Original Research</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>Performance Analysis of Different Embedded Systems and Open-Source Optimization Packages Towards an Impulsive MPC Artificial Pancreas</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author">
<name>
<surname>Goez-Mora</surname>
<given-names>Jhon E.</given-names>
</name>
<uri xlink:href="https://loop.frontiersin.org/people/1245747"/>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Villa-Tamayo</surname>
<given-names>Mar&#xed;a F.</given-names>
</name>
<uri xlink:href="https://loop.frontiersin.org/people/1246057"/>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Vallejo</surname>
<given-names>Monica</given-names>
</name>
</contrib>
<contrib contrib-type="author" corresp="yes">
<name>
<surname>Rivadeneira</surname>
<given-names>Pablo S.</given-names>
</name>
<xref ref-type="author-notes" rid="fn001">
<sup>*</sup>
</xref>
<uri xlink:href="https://loop.frontiersin.org/people/707535"/>
</contrib>
</contrib-group>
<aff id="aff1">
<institution>Grupo GITA, Facultad de Minas, Universidad Nacional de Colombia</institution>, <addr-line>Medell&#xed;n</addr-line>, <country>Colombia</country>
</aff>
<author-notes>
<fn fn-type="edited-by">
<p>Edited by: Patricio Colmegna, University of Virginia, United States</p>
</fn>
<fn fn-type="edited-by">
<p>Reviewed by: Demi&#xe1;n Garc&#xed;a Violini, National University of Quilmes, Argentina; Jenny Diaz, University of Virginia, United States</p>
</fn>
<fn fn-type="corresp" id="fn001">
<p>*Correspondence: Pablo S. Rivadeneira, <email xlink:href="mailto:psrivade@unal.edu.co">psrivade@unal.edu.co</email>
</p>
</fn>
<fn fn-type="other" id="fn002">
<p>This article was submitted to Clinical Diabetes, a section of the journal Frontiers in Endocrinology</p>
</fn>
</author-notes>
<pub-date pub-type="epub">
<day>26</day>
<month>04</month>
<year>2021</year>
</pub-date>
<pub-date pub-type="collection">
<year>2021</year>
</pub-date>
<volume>12</volume>
<elocation-id>662348</elocation-id>
<history>
<date date-type="received">
<day>01</day>
<month>02</month>
<year>2021</year>
</date>
<date date-type="accepted">
<day>19</day>
<month>03</month>
<year>2021</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#xa9; 2021 Goez-Mora, Villa-Tamayo, Vallejo and Rivadeneira</copyright-statement>
<copyright-year>2021</copyright-year>
<copyright-holder>Goez-Mora, Villa-Tamayo, Vallejo and Rivadeneira</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/">
<p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</p>
</license>
</permissions>
<abstract>
<p>Current technological advances have brought closer to reality the project of a safe, portable, and efficient artificial pancreas for people with type 1 diabetes (T1D). Among the developed control strategies for T1D, model predictive control (MPC) has been emphasized in literature as a promising control for glucose regulation. However, these control strategies are commonly designed in a computer environment, regardless of the limitations of a portable device. In this paper, the performances of six embedded platforms and three open-source optimization solver algorithms are assessed for T1D treatment. Their advantages and limitations are clarified using four MPC formulations of increasing complexity and a hardware-in-the-loop methodology to evaluate glucose control in virtual adult subjects. The performance comparison includes the execution time, the difference concerning the evolution obtained in MATLAB, the processor temperature, energy consumption, time percentage in normoglycemia, and the number of hypo- and hyperglycemic events. Results show that Quadprog is the package that faithfully follows the results obtained with control strategies designed and tuned on a computer with the MATLAB software. In addition, the Raspberry Pi 3 and the Tinker Board S embedded systems present the appropriate characteristics to be implemented as portable devices in the artificial pancreas application according to the criteria set out in this work.</p>
</abstract>
<kwd-group>
<kwd>artificial pancreas</kwd>
<kwd>embedded control systems</kwd>
<kwd>model predictive control</kwd>
<kwd>optimization solver packages</kwd>
<kwd>type 1 diabetes</kwd>
</kwd-group>
<contract-sponsor id="cn001">Departamento Administrativo de Ciencia, Tecnolog&#xed;a e Innovaci&#xf3;n (COLCIENCIAS)<named-content content-type="fundref-id">10.13039/100007637</named-content>
</contract-sponsor>
<counts>
<fig-count count="10"/>
<table-count count="5"/>
<equation-count count="3"/>
<ref-count count="46"/>
<page-count count="15"/>
<word-count count="8107"/>
</counts>
</article-meta>
</front>
<body>
<sec id="s1" sec-type="intro">
<title>Introduction</title>
<p>Closed-loop glucose control, referred to as artificial pancreas, has emerged as the best solution to modulate insulin doses in response to blood glucose (BG) concentration in subjects with type 1 diabetes (T1D). Artificial pancreas systems (APS) have been evaluated in clinical and home studies showing improved results than conventional sensor-augmented pump therapy. This extra-corporeal device consists of a continuous glucose monitoring (CGM) system that provides glucose measurements at regular intervals, a control algorithm that processes the CGM information and computes the appropriate insulin dosage, and an insulin infusion pump to execute the control action. All this process aims to emulate the natural behavior of the pancreas and provide a better quality of life to people with T1D (<xref ref-type="bibr" rid="B1">1</xref>, <xref ref-type="bibr" rid="B2">2</xref>).</p>
<p>The control strategy is the core of APS. It coordinates the insulin delivery by the pump according to real-time CGM values. Numerous control strategies of varying complexity have been formulated for glucose control, as proportional-integral-derivative schemes (<xref ref-type="bibr" rid="B3">3</xref>, <xref ref-type="bibr" rid="B4">4</xref>), model predictive control (MPC) formulations, and fuzzy logic (<xref ref-type="bibr" rid="B1">1</xref>). From these, MPC has received increasing attention due to its good performance in simulation and clinical tests (<xref ref-type="bibr" rid="B5">5</xref>, <xref ref-type="bibr" rid="B6">6</xref>). Some MPC works in literature are the zone MPC (<xref ref-type="bibr" rid="B7">7</xref>) which incorporated the glycemia target as a set instead of a single point, some MPC designs with asymmetric cost function (<xref ref-type="bibr" rid="B8">8</xref>, <xref ref-type="bibr" rid="B9">9</xref>), an MPC which drives glycemia to equilibrium sets and considers impulsive inputs (<xref ref-type="bibr" rid="B10">10</xref>), and an offset-free MPC with impulsive inputs that uses a disturbance model to compensate for a plant-model mismatch (<xref ref-type="bibr" rid="B11">11</xref>, <xref ref-type="bibr" rid="B12">12</xref>). In addition, adaptive control strategies have been formulated as the MPC with adaptive penalization functions for matrices Q, R (<xref ref-type="bibr" rid="B13">13</xref>) and the impulsive offset-free strategy with adaptive features introduced in (<xref ref-type="bibr" rid="B14">14</xref>) and (<xref ref-type="bibr" rid="B15">15</xref>).</p>
<p>Although APS have been demonstrated to be effective in BG regulation, there is a need to design wearable devices to improve the quality of life of people with T1D. A crucial step towards a wearable APS is the implementation of control algorithms such as it performs on low-power and low-memory hardware without compromising the safety of the patient (<xref ref-type="bibr" rid="B16">16</xref>). Few approaches to control algorithm implementations have been reported. For instance, the Medtronic hybrid closed-loop system stands out, as it is the first commercially available device that operates to automatically compute basal doses while no meals are consumed (<xref ref-type="bibr" rid="B17">17</xref>). Also, control strategies implemented on a smartphone and evaluated on subjects with T1D can be found in (<xref ref-type="bibr" rid="B18">18</xref>&#x2013;<xref ref-type="bibr" rid="B20">20</xref>), and a bihormonal wearable device with a custom-made printed circuit board and including a glucagon pump was tested in (<xref ref-type="bibr" rid="B21">21</xref>). Some embedded APS approaches were recently tested using hardware-in-the-loop (HIL) simulations using the cohort of virtual patients of the UVA/Padova simulator. In (<xref ref-type="bibr" rid="B22">22</xref>), an event triggered MPC was implemented in a Raspberry Pi 3B, and in (<xref ref-type="bibr" rid="B16">16</xref>) a periodic zone MPC was tested using an Arduino Feather M0. A complete review of APS architecture was presented in (<xref ref-type="bibr" rid="B2">2</xref>).</p>
<p>Additionally, the implementation of MPC strategies has been addressed from the point of view of the solver used for the intrinsic optimization problem in the control formulation. Active set methods, interior-point methods, and gradient projection methods stand out as families of solution algorithms for MPC (<xref ref-type="bibr" rid="B23">23</xref>). Variants of these methods have been developed as found in (<xref ref-type="bibr" rid="B16">16</xref>, <xref ref-type="bibr" rid="B24">24</xref>&#x2013;<xref ref-type="bibr" rid="B27">27</xref>). Under the APS framework, active-set and interior-point methods were tested with different open-source packages for C language: qsOASES, CVXGEN, ECOS and QPC in (<xref ref-type="bibr" rid="B2">2</xref>), primal-dual interior-point based on the predicator-correction algorithm was used in (<xref ref-type="bibr" rid="B28">28</xref>), a newton projection method was implemented in (<xref ref-type="bibr" rid="B29">29</xref>), and in (<xref ref-type="bibr" rid="B22">22</xref>) CVXOPT package for python was utilized.</p>
<p>In this work, an extended comparison of several available embedded systems is performed in terms of glucose regulation, computing processing unit (CPU) time, energy consumption, and temperature. The comparison is carried out by considering (i) four MPC formulations with increasing complexity; (ii) three different open source packages used for solving the optimization problem: CVXOPT, quadprog, and OSQP for Python; and (iii) six different embedded systems: Raspberry pi 3 model B (<xref ref-type="bibr" rid="B30">30</xref>), Raspberry pi 4 (<xref ref-type="bibr" rid="B31">31</xref>), Tinker Board S (<xref ref-type="bibr" rid="B32">32</xref>), Orange pi PC + (<xref ref-type="bibr" rid="B33">33</xref>), ODROID-XU4 (<xref ref-type="bibr" rid="B34">34</xref>) and Jetson Nano (<xref ref-type="bibr" rid="B35">35</xref>). Each combination of components (MPC strategy, solver, and embedded) is tested under the HIL simulation protocol and by considering scenarios with announced meals, sensor noise, and plant-model mismatch to induce hypoglycemia (BG &lt; 70 mg/dl) and hyperglycemia (BG&#xa0;&gt; 180 mg/dl). For each test, 10 adult virtual subjects are considered, whose parameters have been identified from the UVA/Padova simulator.</p>
<p>Additionally, simulations are performed to test the fidelity of results in embedded systems with respect to those obtained in Matlab. This with the aim of showing when an ARM processor architecture is capable of faithfully executing the computer-designed control algorithms. Moreover, the implementation of different control strategies allows discerning which type of optimization solver package is more suitable when the strategy&#x2019;s complexity increases in terms of the number of decision variables and constraints.</p>
<p>The outline of the paper is as follows: Section II, III, and IV are disposed to briefly explain the four impulsive MPC strategies, three available toolboxes in python for solving the MPC optimization problem, and six embedded systems; Section V describes the simulation scenario and the metrics here considered, in Section VI the results of each simulation are presented; in Section VII the performance of the embedded systems and solver packages is discussed; in Section VIII the conclusions are exposed.</p>
</sec>
<sec id="s2">
<title>Methods</title>
<sec id="s2_1">
<title>Model Predictive Control Strategies</title>
<p>In this section, a brief overview of impulsive MPC strategies for the artificial pancreas is provided. The impulsive scheme is selected knowing that insulin doses are administered as small spaced pulses rather than a continuous or a discrete input; therefore, it is appropriate to emulate the natural treatment of T1D. Here, the control-relevant model used for prediction in all MPC strategies is the one developed in (<xref ref-type="bibr" rid="B36">36</xref>), which has been discretized considering the impulsive form of the insulin delivery as in (<xref ref-type="bibr" rid="B37">37</xref>), and it results:</p>
<disp-formula>
<label>(1)</label>
<mml:math display="block" id="M1">
<mml:mrow>
<mml:mtable columnalign="left">
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mi>k</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>=</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>A</mml:mi>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>k</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>u</mml:mi>
</mml:msub>
<mml:mi>u</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>k</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>r</mml:mi>
</mml:msub>
<mml:mi>r</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>k</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>+</mml:mo>
<mml:mi>E</mml:mi>
<mml:mo>,</mml:mo>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>y</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>k</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>=</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>C</mml:mi>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>k</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>,</mml:mo>
</mml:mrow>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:math>
</disp-formula>
<p>where matrices are related with their continuous counterpart considering a fixed sampling time <italic>T</italic> as <inline-formula>
<mml:math display="inline" id="im1">
<mml:mrow>
<mml:mi>A</mml:mi>
<mml:mo>=</mml:mo>
<mml:msup>
<mml:mi>e</mml:mi>
<mml:mrow>
<mml:mo stretchy="false"/>
<mml:msub>
<mml:mi>A</mml:mi>
<mml:mi>c</mml:mi>
</mml:msub>
<mml:mi>T</mml:mi>
<mml:mo stretchy="false"/>
</mml:mrow>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:mtext>&#xa0;</mml:mtext>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>u</mml:mi>
</mml:msub>
<mml:mo>=</mml:mo>
<mml:msup>
<mml:mi>e</mml:mi>
<mml:mrow>
<mml:mo stretchy="false"/>
<mml:msub>
<mml:mi>A</mml:mi>
<mml:mi>c</mml:mi>
</mml:msub>
<mml:mi>T</mml:mi>
<mml:mo stretchy="false"/>
</mml:mrow>
</mml:msup>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mrow>
<mml:mi>u</mml:mi>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mtext>&#xa0;</mml:mtext>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>r</mml:mi>
</mml:msub>
<mml:mo>=</mml:mo>
<mml:mstyle displaystyle="true">
<mml:mrow>
<mml:msubsup>
<mml:mo>&#x222b;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mi>T</mml:mi>
</mml:msubsup>
<mml:mrow>
<mml:msup>
<mml:mi>e</mml:mi>
<mml:mrow>
<mml:mo stretchy="false"/>
<mml:msub>
<mml:mi>A</mml:mi>
<mml:mi>c</mml:mi>
</mml:msub>
<mml:mi>s</mml:mi>
<mml:mo stretchy="false"/>
</mml:mrow>
</mml:msup>
<mml:mi>d</mml:mi>
<mml:mi>s</mml:mi>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mrow>
<mml:mi>r</mml:mi>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:mstyle>
<mml:mtext>&#xa0;</mml:mtext>
<mml:mi>E</mml:mi>
<mml:mo>=</mml:mo>
<mml:msup>
<mml:mi>e</mml:mi>
<mml:mrow>
<mml:mo stretchy="false"/>
<mml:msub>
<mml:mi>A</mml:mi>
<mml:mi>c</mml:mi>
</mml:msub>
<mml:mi>T</mml:mi>
<mml:mo stretchy="false"/>
</mml:mrow>
</mml:msup>
<mml:msub>
<mml:mi>E</mml:mi>
<mml:mi>c</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> with:</p>
<disp-formula>
<label>(2)</label>
<mml:math display="block" id="M2">
<mml:mrow>
<mml:msub>
<mml:mi>A</mml:mi>
<mml:mi>c</mml:mi>
</mml:msub>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:mo>[</mml:mo> <mml:mrow>
<mml:mtable>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>&#x3b8;</mml:mi>
<mml:mn>0</mml:mn>
</mml:msub>
</mml:mrow>
</mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>&#x3b8;</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
</mml:mrow>
</mml:mtd>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b8;</mml:mi>
<mml:mn>2</mml:mn>
</mml:msub>
</mml:mrow>
</mml:mtd>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:mstyle scriptlevel="+1">
<mml:mfrac>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b8;</mml:mi>
<mml:mn>4</mml:mn>
</mml:msub>
</mml:mrow>
</mml:mfrac>
</mml:mstyle>
</mml:mrow>
</mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:mstyle scriptlevel="+1">
<mml:mfrac>
<mml:mn>1</mml:mn>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b8;</mml:mi>
<mml:mn>4</mml:mn>
</mml:msub>
</mml:mrow>
</mml:mfrac>
</mml:mstyle>
</mml:mrow>
</mml:mtd>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:mstyle scriptlevel="+1">
<mml:mfrac>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b8;</mml:mi>
<mml:mn>4</mml:mn>
</mml:msub>
</mml:mrow>
</mml:mfrac>
</mml:mstyle>
</mml:mrow>
</mml:mtd>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:mstyle scriptlevel="+1">
<mml:mfrac>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b8;</mml:mi>
<mml:mn>5</mml:mn>
</mml:msub>
</mml:mrow>
</mml:mfrac>
</mml:mstyle>
</mml:mrow>
</mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:mstyle scriptlevel="+1">
<mml:mfrac>
<mml:mn>1</mml:mn>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b8;</mml:mi>
<mml:mn>5</mml:mn>
</mml:msub>
</mml:mrow>
</mml:mfrac>
</mml:mstyle>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:mstyle scriptlevel="+1">
<mml:mfrac>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b8;</mml:mi>
<mml:mn>5</mml:mn>
</mml:msub>
</mml:mrow>
</mml:mfrac>
</mml:mstyle>
</mml:mrow>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow> <mml:mo>]</mml:mo>
</mml:mrow>
<mml:mo>,</mml:mo>
</mml:mrow>
</mml:math>
</disp-formula>
<disp-formula>
<mml:math display="block" id="M3">
<mml:mrow>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mrow>
<mml:mi>u</mml:mi>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:mo>[</mml:mo> <mml:mrow>
<mml:mtable>
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:mtable>
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:mtable>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:mfrac>
<mml:mn>1</mml:mn>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b8;</mml:mi>
<mml:mn>4</mml:mn>
</mml:msub>
</mml:mrow>
</mml:mfrac>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow> <mml:mo>]</mml:mo>
</mml:mrow>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2009; &#x2009; &#x2009;</mml:mtext>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mrow>
<mml:mi>r</mml:mi>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:mo>[</mml:mo> <mml:mrow>
<mml:mtable>
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:mtable>
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:mtable>
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:mfrac>
<mml:mn>1</mml:mn>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b8;</mml:mi>
<mml:mn>5</mml:mn>
</mml:msub>
</mml:mrow>
</mml:mfrac>
</mml:mrow>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow> <mml:mo>]</mml:mo>
</mml:mrow>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2009; &#x2009;</mml:mtext>
<mml:msub>
<mml:mi>E</mml:mi>
<mml:mi>c</mml:mi>
</mml:msub>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:mo>[</mml:mo> <mml:mrow>
<mml:mtable>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b8;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msub>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:mtable>
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:mtable>
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow> <mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</disp-formula>
<p>and <inline-formula>
<mml:math display="inline" id="im2">
<mml:mrow>
<mml:mi>C</mml:mi>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:mo>[</mml:mo> <mml:mrow>
<mml:mtable>
<mml:mtr>
<mml:mtd>
<mml:mn>1</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow> <mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>. The five state variables of the system are <italic>x</italic>
<sub>1</sub>, the glycemia (mg/dl); <italic>x</italic>
<sub>2</sub> and <italic>x</italic>
<sub>3</sub>, the delivery rates of insulin in the blood and interstitial space compartments, respectively (U/min); and <italic>x</italic>
<sub>4</sub> and <italic>x</italic>
<sub>5</sub>, the delivery rates of carbohydrates in the stomach and gut compartments, respectively (g/min). The inputs are <italic>u</italic>, the exogenous insulin rate (U/min), and <italic>r</italic>, the carbohydrate intake rate (g/min). The output <italic>y</italic> corresponds to the glycemia. To implement the MPC formulations <italic>via</italic> state-feedback, a state estimator is required to obtain the complete state and reduce the noise of the BG measurement provided by a CGM sensor. In this work, the Kalman filter algorithm is implemented, but other approaches, as the moving horizon estimator, can be used.</p>
<p>In <xref ref-type="table" rid="T1">
<bold>Table 1</bold>
</xref>, four impulsive MPC formulations are reported. These have been previously tested in simulation scenarios <italic>via</italic> MATLAB for T1D treatment (<xref ref-type="bibr" rid="B11">11</xref>). The order in which they are reported in <xref ref-type="table" rid="T1">
<bold>Table 1</bold>
</xref> is according to their complexity, from the standard formulation to steer the state to a set-point to a more complex formulation that corrects plant-model mismatches and steers the state to an equilibrium target zone. All four strategies are initialized at each time step <italic>k</italic> with the initial estimated state <inline-formula>
<mml:math display="inline" id="im3">
<mml:mrow>
<mml:mover accent="true">
<mml:mi>x</mml:mi>
<mml:mo>^</mml:mo>
</mml:mover>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>k</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula>. The solution of each formulation is the optimal input trajectory <bold>
<italic>u</italic>
</bold> = {<italic>u</italic>(0), &#x2026; , <italic>u</italic>(<italic>H<sub>c</sub>
</italic> &#x2013; 1}) and the predicted state trajectory <bold>
<italic>x</italic>
</bold> = {<italic>x</italic>(0), &#x2026; , <italic>x</italic>(<italic>H<sub>p</sub>
</italic> &#x2013; 1)}. From <bold>
<italic>u</italic>
</bold>, only the first element of the sequence is applied to the plant. When new measurement information is available, the optimization problem is reformulated and solved at the next time instant according to the receding horizon policy. The complexity of each MPC strategy can also be visualized in <xref ref-type="table" rid="T2">
<bold>Table 2</bold>
</xref> in terms of decision variables and the number of equality and inequality constraints.</p>
<table-wrap id="T1" position="float">
<label>Table 1</label>
<caption>
<p>MPC strategies.</p>
</caption>
<table frame="hsides">
<thead>
<tr>
<th valign="top" align="left">MPC strategy </th>
<th valign="top" align="center">Description</th>
<th valign="top" align="center">Optimization problem </th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">Standard model predictive control (sMPC)</td>
<td valign="top" align="left">The sMPC aims to steer the system <italic>x</italic>, <italic>u</italic> to a set point <italic>x<sub>ref</sub>
</italic>, <italic>u<sub>ref</sub>
</italic>. It penalizes the deviation to the reference in the prediction and control horizons <italic>H<sub>p</sub>
</italic> and <italic>H<sub>c</sub>
</italic>, and it is subject to the dynamic constraint and the constraint sets <italic>U</italic>, <italic>X</italic>.</td>
<td valign="top" align="center">
<inline-formula>
<mml:math display="inline" id="im4">
<mml:mtable columnalign="left">
<mml:mtr>
<mml:mtd>
<mml:munder>
<mml:mrow>
<mml:mi>min</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi mathvariant="italic">u</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi mathvariant="italic">x</mml:mi>
</mml:mrow>
</mml:munder>
<mml:mstyle displaystyle="true">
<mml:munderover>
<mml:mo>&#x2211;</mml:mo>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>H</mml:mi>
<mml:mi>p</mml:mi>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:mrow>
<mml:mo>||</mml:mo>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mi>r</mml:mi>
<mml:mi>e</mml:mi>
<mml:mi>f</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mo>||</mml:mo>
<mml:mi>Q</mml:mi>
<mml:mn>2</mml:mn>
</mml:msubsup>
</mml:mrow>
</mml:mstyle>
<mml:mo>+</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover>
<mml:mo>&#x2211;</mml:mo>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>H</mml:mi>
<mml:mi>c</mml:mi>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:mrow>
<mml:mo>||</mml:mo>
<mml:mi>u</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>u</mml:mi>
<mml:mrow>
<mml:mi>r</mml:mi>
<mml:mi>e</mml:mi>
<mml:mi>f</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mo>||</mml:mo>
<mml:mi>R</mml:mi>
<mml:mn>2</mml:mn>
</mml:msubsup>
</mml:mrow>
</mml:mstyle>
<mml:mo>+</mml:mo>
<mml:mo>||</mml:mo>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>H</mml:mi>
<mml:mi>p</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mi>r</mml:mi>
<mml:mi>e</mml:mi>
<mml:mi>f</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mo>||</mml:mo>
<mml:mi>P</mml:mi>
<mml:mn>2</mml:mn>
</mml:msubsup>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mtable columnalign="left">
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mo>.</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>.</mml:mo>
</mml:mrow>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>=</mml:mo>
<mml:mover accent="true">
<mml:mi>x</mml:mi>
<mml:mo>^</mml:mo>
</mml:mover>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>k</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>=</mml:mo>
<mml:mi>A</mml:mi>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>u</mml:mi>
</mml:msub>
<mml:mi>u</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>r</mml:mi>
</mml:msub>
<mml:mi>r</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>+</mml:mo>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>u</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>&#x2208;</mml:mo>
<mml:mtext>&#xa0;</mml:mtext>
<mml:mi mathvariant="script">U</mml:mi>
<mml:mo>,</mml:mo>
<mml:mtext>&#xa0;</mml:mtext>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mtext>&#xa0;</mml:mtext>
<mml:mo>&#x2208;</mml:mo>
<mml:mtext>&#xa0;</mml:mtext>
<mml:mi mathvariant="script">X</mml:mi>
</mml:mrow>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td valign="top" align="left">Zone model predictive control (ZMPC)</td>
<td valign="top" align="left">The ZMPC is formulated by adding a new decision variable <italic>&#x3b4;</italic> and defining its upper and lower limits. This creates a zone such that, when the predicted variables are within it, the cost is zero.</td>
<td valign="top" align="center">
<inline-formula>
<mml:math display="inline" id="im5">
<mml:mtable columnalign="left">
<mml:mtr>
<mml:mtd>
<mml:munder>
<mml:mrow>
<mml:mi>min</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi mathvariant="italic">u</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi mathvariant="italic">x</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
</mml:munder>
<mml:mstyle displaystyle="true">
<mml:munderover>
<mml:mo>&#x2211;</mml:mo>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>H</mml:mi>
<mml:mi>p</mml:mi>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:mrow>
<mml:mo>||</mml:mo>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mi>r</mml:mi>
<mml:mi>e</mml:mi>
<mml:mi>f</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>+</mml:mo>
<mml:mi>&#x3b4;</mml:mi>
<mml:msubsup>
<mml:mo>||</mml:mo>
<mml:mi>Q</mml:mi>
<mml:mn>2</mml:mn>
</mml:msubsup>
</mml:mrow>
</mml:mstyle>
<mml:mo>+</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover>
<mml:mo>&#x2211;</mml:mo>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>H</mml:mi>
<mml:mi>c</mml:mi>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:mrow>
<mml:mo>||</mml:mo>
<mml:mi>u</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>u</mml:mi>
<mml:mrow>
<mml:mi>r</mml:mi>
<mml:mi>e</mml:mi>
<mml:mi>f</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mo>||</mml:mo>
<mml:mi>R</mml:mi>
<mml:mn>2</mml:mn>
</mml:msubsup>
</mml:mrow>
</mml:mstyle>
<mml:mo>+</mml:mo>
<mml:mo>||</mml:mo>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>H</mml:mi>
<mml:mi>p</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mi>r</mml:mi>
<mml:mi>e</mml:mi>
<mml:mi>f</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>+</mml:mo>
<mml:mi>&#x3b4;</mml:mi>
<mml:msubsup>
<mml:mo>||</mml:mo>
<mml:mi>P</mml:mi>
<mml:mn>2</mml:mn>
</mml:msubsup>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mtable columnalign="left">
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mo>.</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>.</mml:mo>
</mml:mrow>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>=</mml:mo>
<mml:mover accent="true">
<mml:mi>x</mml:mi>
<mml:mo>^</mml:mo>
</mml:mover>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>k</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>=</mml:mo>
<mml:mi>A</mml:mi>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>u</mml:mi>
</mml:msub>
<mml:mi>u</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>r</mml:mi>
</mml:msub>
<mml:mi>r</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>+</mml:mo>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>u</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>&#x2208;</mml:mo>
<mml:mi mathvariant="script">U</mml:mi>
<mml:mo>,</mml:mo>
<mml:mo>&#xa0;</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>&#x2208;</mml:mo>
<mml:mi mathvariant="script">X</mml:mi>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b4;</mml:mi>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>i</mml:mi>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2264;</mml:mo>
<mml:mi>&#x3b4;</mml:mi>
<mml:mo>&#x2264;</mml:mo>
<mml:msub>
<mml:mi>&#x3b4;</mml:mi>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>a</mml:mi>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td valign="top" align="left">Zone model predictive control with artificial variables (ZMPC-AV)<break/> (<xref ref-type="bibr" rid="B37">37</xref>)</td>
<td valign="top" align="left">The ZMPC-AV introduces new decision variables <italic>x<sub>a</sub>, u<sub>a</sub>
</italic> which are equilibriums of the system. The idea is to steer the system from an initial point to a point (<italic>x<sub>t</sub>
</italic>, <italic>u<sub>t</sub>
</italic>) in the target set <inline-formula>
<mml:math display="inline" id="im6">
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:msubsup>
<mml:mi>X</mml:mi>
<mml:mi>s</mml:mi>
<mml:mrow>
<mml:mi>T</mml:mi>
<mml:mi>a</mml:mi>
<mml:mi>r</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>,</mml:mo>
<mml:msubsup>
<mml:mi>U</mml:mi>
<mml:mi>s</mml:mi>
<mml:mrow>
<mml:mi>T</mml:mi>
<mml:mi>a</mml:mi>
<mml:mi>r</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> through the equilibrium of the impulsive system (<italic>X<sub>s</sub>
</italic>, <italic>U<sub>s</sub>
</italic>).</td>
<td valign="top" align="center">
<inline-formula>
<mml:math display="inline" id="im7">
<mml:mtable columnalign="left">
<mml:mtr>
<mml:mtd>
<mml:munder>
<mml:mrow>
<mml:mi>min</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi mathvariant="bold">u</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi mathvariant="bold">x</mml:mi>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>u</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>t</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>u</mml:mi>
<mml:mi>t</mml:mi>
</mml:msub>
</mml:mrow>
</mml:munder>
<mml:mstyle displaystyle="true">
<mml:munderover>
<mml:mo>&#x2211;</mml:mo>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>H</mml:mi>
<mml:mi>p</mml:mi>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:mrow>
<mml:mo>||</mml:mo>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
<mml:msubsup>
<mml:mo>||</mml:mo>
<mml:mi>Q</mml:mi>
<mml:mn>2</mml:mn>
</mml:msubsup>
</mml:mrow>
</mml:mstyle>
<mml:mo>+</mml:mo>
<mml:mstyle displaystyle="true">
<mml:msubsup>
<mml:mo>&#x2211;</mml:mo>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>H</mml:mi>
<mml:mi>c</mml:mi>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
<mml:mrow>
<mml:mo>||</mml:mo>
<mml:mi>u</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>u</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
<mml:msubsup>
<mml:mo>||</mml:mo>
<mml:mi>R</mml:mi>
<mml:mn>2</mml:mn>
</mml:msubsup>
</mml:mrow>
</mml:mstyle>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mtext>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;</mml:mtext>
<mml:mo>+</mml:mo>
<mml:mi>P</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>i</mml:mi>
<mml:mi>s</mml:mi>
<mml:msub>
<mml:mi>t</mml:mi>
<mml:mrow>
<mml:msubsup>
<mml:mi mathvariant="script">X</mml:mi>
<mml:mi>s</mml:mi>
<mml:mrow>
<mml:mi>T</mml:mi>
<mml:mi>a</mml:mi>
<mml:mi>r</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>+</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>i</mml:mi>
<mml:mi>s</mml:mi>
<mml:msub>
<mml:mi>t</mml:mi>
<mml:mrow>
<mml:msubsup>
<mml:mi mathvariant="script">U</mml:mi>
<mml:mi>s</mml:mi>
<mml:mrow>
<mml:mi>T</mml:mi>
<mml:mi>a</mml:mi>
<mml:mi>r</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>u</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mtable columnalign="left">
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mo>.</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>.</mml:mo>
</mml:mrow>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>=</mml:mo>
<mml:mover accent="true">
<mml:mi>x</mml:mi>
<mml:mo>^</mml:mo>
</mml:mover>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>k</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>=</mml:mo>
<mml:mi>A</mml:mi>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>u</mml:mi>
</mml:msub>
<mml:mi>u</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>r</mml:mi>
</mml:msub>
<mml:mi>r</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>+</mml:mo>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>u</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>&#x2208;</mml:mo>
<mml:mi mathvariant="script">U</mml:mi>
<mml:mo>,</mml:mo>
<mml:mo>&#xa0;</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>&#x2208;</mml:mo>
<mml:mi mathvariant="script">X</mml:mi>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:msub>
<mml:mi>H</mml:mi>
<mml:mi>p</mml:mi>
</mml:msub>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>=</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
<mml:mo>=</mml:mo>
<mml:mi>A</mml:mi>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>u</mml:mi>
</mml:msub>
<mml:msub>
<mml:mi>u</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
<mml:mo>+</mml:mo>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td valign="top" align="left">Offset-free zone model predictive control with artificial variables (ZMPC-AV-OF)<break/> (<xref ref-type="bibr" rid="B12">12</xref>)</td>
<td valign="top" align="left">This strategy compensates for the effect of a plant-model mismatch. To that end, the state is augmented with a disturbance <italic>d</italic>(<italic>k</italic>+1)=<italic>d</italic>(<italic>k</italic>), it is estimated with the state estimator, and then, this information is provided to the MPC problem in the prediction model and equilibrium constraints. The discrete model is now <italic>x</italic>(<italic>k</italic>+1)=<italic>Ax</italic>(<italic>k</italic>)+<italic>B<sub>u</sub>u</italic>(<italic>k</italic>)+<italic>B<sub>r</sub>r</italic>(<italic>k</italic>)+<italic>B<sub>d</sub>d</italic>(<italic>k</italic>)+<italic>E</italic>, <italic>y</italic>(<italic>k</italic>)=<italic>Cx</italic>(<italic>k</italic>)+<italic>C<sub>d</sub>d</italic>(<italic>k</italic>), with <inline-formula>
<mml:math display="inline" id="im8">
<mml:mrow>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>d</mml:mi>
</mml:msub>
<mml:mo>=</mml:mo>
<mml:msup>
<mml:mi>e</mml:mi>
<mml:mrow>
<mml:msub>
<mml:mi>A</mml:mi>
<mml:mi>c</mml:mi>
</mml:msub>
<mml:mi>T</mml:mi>
</mml:mrow>
</mml:msup>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>.</td>
<td valign="top" align="center">
<inline-formula>
<mml:math display="inline" id="im9">
<mml:mtable columnalign="left">
<mml:mtr>
<mml:mtd>
<mml:munder>
<mml:mrow>
<mml:mi>min</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi mathvariant="bold">u</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi mathvariant="bold-italic">x</mml:mi>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>u</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>t</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>u</mml:mi>
<mml:mi>t</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mi mathvariant="bold-italic">d</mml:mi>
</mml:mrow>
</mml:munder>
<mml:mstyle displaystyle="true">
<mml:munderover>
<mml:mo>&#x2211;</mml:mo>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>H</mml:mi>
<mml:mi>p</mml:mi>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:mrow>
<mml:mo>||</mml:mo>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
<mml:msubsup>
<mml:mo>||</mml:mo>
<mml:mi>Q</mml:mi>
<mml:mn>2</mml:mn>
</mml:msubsup>
</mml:mrow>
</mml:mstyle>
<mml:mo>+</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover>
<mml:mo>&#x2211;</mml:mo>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>H</mml:mi>
<mml:mi>c</mml:mi>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:mrow>
<mml:mo>||</mml:mo>
<mml:mi>u</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>u</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
<mml:msubsup>
<mml:mo>||</mml:mo>
<mml:mi>R</mml:mi>
<mml:mn>2</mml:mn>
</mml:msubsup>
</mml:mrow>
</mml:mstyle>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mtext>&#x2003;</mml:mtext>
<mml:mo>+</mml:mo>
<mml:mi>P</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>i</mml:mi>
<mml:mi>s</mml:mi>
<mml:msub>
<mml:mi>t</mml:mi>
<mml:mrow>
<mml:msubsup>
<mml:mi mathvariant="script">X</mml:mi>
<mml:mi>s</mml:mi>
<mml:mrow>
<mml:mi>T</mml:mi>
<mml:mi>a</mml:mi>
<mml:mi>r</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>+</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>i</mml:mi>
<mml:mi>s</mml:mi>
<mml:msub>
<mml:mi>t</mml:mi>
<mml:mrow>
<mml:msubsup>
<mml:mi mathvariant="script">U</mml:mi>
<mml:mi>s</mml:mi>
<mml:mrow>
<mml:mi>T</mml:mi>
<mml:mi>a</mml:mi>
<mml:mi>r</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>u</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mtable columnalign="left">
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mo>.</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>.</mml:mo>
</mml:mrow>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>=</mml:mo>
<mml:mover accent="true">
<mml:mi>x</mml:mi>
<mml:mo>^</mml:mo>
</mml:mover>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>k</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>,</mml:mo>
<mml:mo>&#xa0;</mml:mo>
<mml:mo>&#xa0;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>=</mml:mo>
<mml:mover accent="true">
<mml:mi>d</mml:mi>
<mml:mo>^</mml:mo>
</mml:mover>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>k</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>=</mml:mo>
<mml:mi>A</mml:mi>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>u</mml:mi>
</mml:msub>
<mml:mi>u</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>r</mml:mi>
</mml:msub>
<mml:mi>r</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>d</mml:mi>
</mml:msub>
<mml:mi>d</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>+</mml:mo>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>=</mml:mo>
<mml:mi>d</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>u</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>&#x2208;</mml:mo>
<mml:mi mathvariant="script">U</mml:mi>
<mml:mo>,</mml:mo>
<mml:mo>&#xa0;</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>&#x2208;</mml:mo>
<mml:mi mathvariant="script">X</mml:mi>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:msub>
<mml:mi>H</mml:mi>
<mml:mi>p</mml:mi>
</mml:msub>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>=</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
<mml:mo>=</mml:mo>
<mml:mi>A</mml:mi>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>u</mml:mi>
</mml:msub>
<mml:msub>
<mml:mi>u</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>d</mml:mi>
</mml:msub>
<mml:mi>d</mml:mi>
<mml:mo>+</mml:mo>
<mml:mi>E</mml:mi>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>y</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
<mml:mo>=</mml:mo>
<mml:mi>C</mml:mi>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>a</mml:mi>
</mml:msub>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mi>C</mml:mi>
<mml:mi>d</mml:mi>
</mml:msub>
<mml:mi>d</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
</inline-formula>
</td>
</tr>
</tbody>
</table>
</table-wrap>
<table-wrap id="T2" position="float">
<label>Table 2</label>
<caption>
<p>Complexity of the MPC strategies.</p>
</caption>
<table frame="hsides">
<thead>
<tr>
<th valign="top" align="left">Strategy </th>
<th valign="top" align="center">decision variables </th>
<th valign="top" align="center">number of decision variables </th>
<th valign="top" align="center">number of inequality constraints </th>
<th valign="top" align="center">number of equality constraints </th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">MPC</td>
<td valign="top" align="left">
<italic>u, x</italic>
</td>
<td valign="top" align="left">
<italic>H<sub>c</sub>
</italic>+<italic>n<sub>x</sub>H<sub>p</sub>
</italic>
</td>
<td valign="top" align="left">2<italic>H<sub>c</sub>
</italic>+2<italic>n<sub>x</sub>H<sub>p</sub>
</italic>
</td>
<td valign="top" align="left">0</td>
</tr>
<tr>
<td valign="top" align="left">ZMPC</td>
<td valign="top" align="left">
<italic>u, &#x3b4;, x</italic>
</td>
<td valign="top" align="left">
<italic>H<sub>c</sub>
</italic>+1+<italic>n<sub>x</sub>H<sub>p</sub>
</italic>
</td>
<td valign="top" align="left">2(<italic>H<sub>c</sub>
</italic>+1)+2<italic>n<sub>x</sub>H<sub>p</sub>
</italic>
</td>
<td valign="top" align="left">0</td>
</tr>
<tr>
<td valign="top" align="left">ZMPC-AV</td>
<td valign="top" align="left">
<bold>
<italic>u</italic>
</bold>, <italic>x<sub>a</sub>
</italic>, <italic>u<sub>a,</sub> x<sub>t,</sub> u<sub>t,</sub> </italic>
<bold>
<italic>x</italic>
</bold>
</td>
<td valign="top" align="left">
<italic>H<sub>c</sub>
</italic>+2<italic>n<sub>x</sub>
</italic>+2+<italic>n<sub>x</sub>H<sub>p</sub>
</italic>
</td>
<td valign="top" align="left">2(<italic>Hc</italic>+2<italic>n<sub>x</sub>
</italic>+2)+2<italic>n<sub>x</sub>H<sub>p</sub>
</italic>
</td>
<td valign="top" align="left">3<italic>n<sub>x</sub>
</italic>
</td>
</tr>
<tr>
<td valign="top" align="left">ZMPC-AV-OF</td>
<td valign="top" align="left">
<bold>
<italic>u</italic>
</bold>, <italic>x</italic>
<sub>a</sub>, <italic>u<sub>a</sub>
</italic>, <italic>x<sub>t</sub>
</italic>, <italic>u<sub>t</sub>
</italic>, <bold>
<italic>x</italic>
</bold>, <bold>
<italic>d</italic>
</bold>
</td>
<td valign="top" align="left">
<italic>H<sub>c</sub>
</italic>+2<italic>n<sub>x</sub>
</italic>+2+(<italic>n<sub>x</sub>
</italic>+<italic>n<sub>d</sub>
</italic>)<italic>H<sub>p</sub>
</italic>
</td>
<td valign="top" align="left">2(<italic>H<sub>c</sub>
</italic>+2<italic>n<sub>x</sub>
</italic>+2)+2<italic>n<sub>x</sub>H<sub>p</sub>
</italic>
</td>
<td valign="top" align="left">3<italic>n<sub>x</sub>
</italic>
</td>
</tr>
</tbody>
</table>
<table-wrap-foot>
<fn>
<p>H<sub>c</sub>, control horizon; H<sub>p</sub>, prediction horizon; n<sub>x</sub>, dimension of the state; n<sub>d</sub>, dimension of the disturbance considered in the ZMPC-AV-OF.</p>
</fn>
</table-wrap-foot>
</table-wrap>
</sec>
<sec id="s2_2">
<title>Solvers for Optimization Problems</title>
<p>The most demanding part of an MPC strategy is the repetitive solution of the optimization problem, more strictly a quadratic problem (QP). Nevertheless, the efficiency of implementing an online MPC for embedded control applications depends on both the optimization problem and the selection of the optimization solver (<xref ref-type="bibr" rid="B2">2</xref>). For instance, power consumption can be reduced depending on solver runtimes. However, the optimality level can be altered by limiting the number of iterations performed by the solver.</p>
<p>There are several suitable software packages for real-time applications for solving the optimization problem in embedded systems. Here, only three open-source packages based on the Python programming language are considered:</p>
<sec id="s2_2_1">
<title>Quadprog (Quadratic Programming)</title>
<p>The Quadprog solver uses the method developed by (<xref ref-type="bibr" rid="B38">38</xref>) for solving strictly convex quadratic programs. It is a dual active set method in which an iteration process is made in both primary and dual spaces, i.e., both the point and the Lagrange multipliers shift. The idea of the method is to obtain a primal optimal point for a sub-problem of the original problem, and then, a dual algorithm iterates to achieve primal feasibility that corresponds to dual optimality while assuring the primal optimality corresponding to dual feasibility. This is mainly accomplished by adding or removing constraints of the current active set at each iteration.</p>
<p>An advantage of this method is that a phase for finding a feasible point to start up the algorithm is not required since the unconstrained minimum of the problem is set as a starting point which can be considered as a near-optimal feasible point (as it is the optimal point of a subproblem). Besides, instead of directly using the pseudo-inverse of the normal vector of the constraints and an inverse Hessian operator for the quadratic <italic>f</italic>(<italic>x</italic>) subject to the active set, the Cholesky and QR factorization methods are used to obtain a numerically stable implementation of the algorithm.</p>
</sec>
<sec id="s2_2_2">
<title>CVXOPT (Python Software for Convex Optimization)</title>
<p>This package for convex optimization implements a standard Mehrotra predictor-corrector interior-point algorithm. It allows the user to specify an optimization problem <italic>via</italic> an operator description, i.e., by providing functions for evaluating the linear mappings in the constraints and to supply a custom method for solving the Newton equations.</p>
</sec>
<sec id="s2_2_3">
<title>OSQP (Operator Splitting Quadratic Program)</title>
<p>The OSQP solver is a numerical optimization package for solving convex QPs (<xref ref-type="bibr" rid="B39">39</xref>). It is based on a first-order alternating direction method of multipliers (ADMM), which can be seen as a variant of the alternating projections algorithm for finding a point in the intersection of two convex sets. ADMM has been shown to provide accurate solutions to QPs in a relatively small number of iterations. Hence, it is appropriate for embedded processors as it is computationally very cheap.</p>
<p>The OSQP solver uses an operator splitting technique with which no requirements on problem data as a positive definite cost function or linear independence of constraint are imposed. This solver only requires the problem to be convex. In fact, the splitting technique requires a single setup factorization as it is based on the solution of a quasi-definite linear system with coefficients that remain the same at almost every iteration. Therefore, after the setup, the algorithm is division-free, making it suitable for real-time applications in embedded systems</p>
<p>Additional characteristics of the OSQP solver are the detection of primal or dual infeasibility of the problem, the performance of <italic>solution polishing</italic> to obtain high accuracy solutions, the possibility of a warm start to reduce the number of iterations, a small compiled footprint of the code, among others. For further detail see (<xref ref-type="bibr" rid="B39">39</xref>, <xref ref-type="bibr" rid="B40">40</xref>).</p>
</sec>
</sec>
<sec id="s2_3">
<title>Embedded Systems</title>
<p>For safety-critical applications, as disease treatment, HIL has been gradually considered as a required intermediate step between virtual simulations and complete physical prototyping (<xref ref-type="bibr" rid="B2">2</xref>). Therefore, the focus of this work relies on implementing the control algorithm in embedded systems and analyzing some challenges through HIL simulations. Six embedded systems were tested, whose characteristics are shown in <xref ref-type="table" rid="T3">
<bold>Table 3</bold>
</xref>. All processors have an ARM architecture that uses the reduced instruction set computer (RISC) system, where each command executes one instruction at a time, and the processor is divided into sectors for each type of assigned task, unlike x86 processors where compound commands are run, and the processors are general-purpose cores.</p>
<table-wrap id="T3" position="float">
<label>Table 3</label>
<caption>
<p>Characteristics of Embedded Systems.</p>
</caption>
<table frame="hsides">
<thead>
<tr>
<th valign="top" align="left">Embed </th>
<th valign="top" align="center">CPU </th>
<th valign="top" align="center">Frequency </th>
<th valign="top" align="center">RAM </th>
<th valign="top" align="center">storage </th>
<th valign="top" align="center">connectivity </th>
<th valign="top" align="center">source power </th>
<th valign="top" align="center">OS </th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">Raspberry pi 4</td>
<td valign="top" align="left">Quad core Cortex-A72 (ARM v8) 64-bit</td>
<td valign="top" align="center">1.5 GHz</td>
<td valign="top" align="left">4 GB LPDDR4-3200 SDRAM</td>
<td valign="top" align="left">16 GB Micro SD</td>
<td valign="top" align="left">Gigabit Ethernet, BlueTooth 5.0</td>
<td valign="top" align="center">5V 3A</td>
<td valign="top" align="left">Raspbian</td>
</tr>
<tr>
<td valign="top" align="left">Raspberry pi 3 b</td>
<td valign="top" align="left">Quad Core Broadcom BCM2837 64bit</td>
<td valign="top" align="center">1.2 GHz</td>
<td valign="top" align="left">1GB LPDDR2 SDRAM</td>
<td valign="top" align="left">16 GB MicroSD</td>
<td valign="top" align="left">Ethernet, BlueTooth 4.0</td>
<td valign="top" align="center">5v 2.5A</td>
<td valign="top" align="left">Linux distributions, Windows</td>
</tr>
<tr>
<td valign="top" align="left">Tinker Board S</td>
<td valign="top" align="left">Rockchip RK3288 Cortex-A17 Quad Core 32-bit</td>
<td valign="top" align="center">1.8 GHz</td>
<td valign="top" align="left">2GB dual channel LPDDR3</td>
<td valign="top" align="left">16GB eMMC/MicroSD slot</td>
<td valign="top" align="left">Gigabit Ethernet, BlueTooth 4.0</td>
<td valign="top" align="center">5V/2-3A</td>
<td valign="top" align="left">Linux distributions, TinkerOS</td>
</tr>
<tr>
<td valign="top" align="left">Orange Pi s</td>
<td valign="top" align="left">Quad-core&#xa0;Cortex-A7&#xa0;H.265 64-bit</td>
<td valign="top" align="center">1.6 GHz</td>
<td valign="top" align="left">2GB DDR3</td>
<td valign="top" align="left">8GB EMMC Flash/MicroSD</td>
<td valign="top" align="left">Ethernet, BlueTooth 4.0</td>
<td valign="top" align="center">5V 3A</td>
<td valign="top" align="left">Android Lubuntu, Debian, Raspbian</td>
</tr>
<tr>
<td valign="top" align="left">ODROID-XU4</td>
<td valign="top" align="left">Exynos5422 Cortex-A15 64-bit</td>
<td valign="top" align="center">2 GHz</td>
<td valign="top" align="left">2Gbyte LPDDR3</td>
<td valign="top" align="left">Flash 5.0, 16 GB MicroSD</td>
<td valign="top" align="left">Gigabit Ethernet</td>
<td valign="top" align="center">5V 4A</td>
<td valign="top" align="left">Linux distributions</td>
</tr>
<tr>
<td valign="top" align="left">Jetson Nano</td>
<td valign="top" align="left">Quad-core ARM A57</td>
<td valign="top" align="center">1.43 GHz</td>
<td valign="top" align="left">4 GB LPDDR4 25.6 GB/s</td>
<td valign="top" align="left">microSD</td>
<td valign="top" align="left">Gigabit Ethernet</td>
<td valign="top" align="center">5V 4A</td>
<td valign="top" align="left">Linux distributions NVIDIA Jetson software</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>The Tinker Board S is the only system that uses 32-bit architecture. However, as an extension of the ARMv7 architecture, this board implements the Advanced Single Instruction Multiple Data (SIMDv2) technology that allows supporting vector operations with integers and floating-points, and it also uses the Vector Floating-Point version 4 (VFPv4) for the calculation of the floating-point which is fully compatible with the IEEE-754 standard (<xref ref-type="bibr" rid="B41">41</xref>). The remaining embedded systems have processors of 64-bit ARM but with different configurations among them. The embedded system with the most potent processor architecture is the ODROID-XU4, with eight cores from which at least one reaches up to 2.0 GHz. Among the simplest embedded are the quad-cores of the Raspberry pi 3 and the Orange pi pc + with 1.2 and 1.6 GHz, respectively.</p>
<p>The embedded systems compared in this work use an operating system and are called simple boards (SB). The reasons for using simple-board systems are (i) the amount of memory, (ii) the versatility to use pre-compiled programming languages, (iii) they allow to host the three optimization packages and the four control strategies simultaneously, and (iv) they can be programmed to save and calculate statistics of the performance. The libraries, packages, and software used in this work are open source. This would reduce the equipment&#x2019;s cost and increase acceptance of the open artificial pancreas project developed by the T1D community (<uri xlink:href="https://openaps.org/">https://openaps.org/</uri>). Although there are simpler and less energy-consuming embedded systems, it is better to have flexible electronic devices that can handle software&#x2019;s updating, while algorithms, control strategies, and mathematical models for T1D treatment are in the testing phase.</p>
<p>For all embedded, the 16 GB class 10 microSD storage system is used, the corresponding Linux distribution and the software with the packages required to run the control algorithm are installed. For data transmission, the GPIO ports are configured for serial communication (RS232, Bd 115200, no parity, stopbits&#xa0;= 1, timeout = 90).</p>
</sec>
</sec>
<sec id="s3">
<title>Simulation Scenario and Metrics</title>
<p>The HIL technique is implemented to assess the six embedded systems&#x2019; performance and the three optimization solver packages with the four MPC strategies, as shown in <xref ref-type="fig" rid="f1">
<bold>Figure 1</bold>
</xref>. The HIL is a real-time simulation between a computer that complies with the virtual representation of the plant and a real (hardware) version of the controller, which in this study corresponds to each embedded system that contains the MPC strategies and the estimator (<xref ref-type="bibr" rid="B42">42</xref>).</p>
<fig id="f1" position="float">
<label>Figure 1</label>
<caption>
<p>Hardware-in-the-loop implementation to emulate the AP system. The images used in this graphic are by unknown author under a CC BY-SA license. <uri xlink:href="https://creativecommons.org/licenses/by-sa/3.0/">https://creativecommons.org/licenses/by-sa/3.0/</uri>.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fendo-12-662348-g001.tif"/>
</fig>
<p>To represent the plant (the subject with T1D), model (<xref ref-type="bibr" rid="B1">1</xref>) is implemented in the computer using Matlab. As shown in previous studies, this model serves to emulate a virtual subject when considering proper scenarios (<xref ref-type="bibr" rid="B14">14</xref>, <xref ref-type="bibr" rid="B15">15</xref>). To that extent, four aspects are taken into account:</p>
<list list-type="order">
<list-item>
<p>Model (1) is personalized for 10 virtual adult subjects whose parameters have been identified to fit data from the commercial version of the UVA/Padova simulator (2014) (which is the first simulator approved by the FDA).</p>
</list-item>
<list-item>
<p>The parameters of the model are varied to emulate the net effect of physiological variations in the subject inducing hypoglycemia or hyperglycemia. To that aim, a 3-day simulation scenario is used in which the plant&#x2019;s parameters are varied to induce hypoglycemia on day 1, there are no parameter variations on day 2, and the parameters are changed to induce a state of hyperglycemia in the subjects on day 3. Parameters are simultaneously varied by &#xb1; 10% of their nominal values (the ones identified to fit data), and this information is not provided to the controller.</p>
</list-item>
<list-item>
<p>Meals with different carbohydrate content are provided to the virtual subjects. The meals were set at 7, 10, 13, and 19-h with carbohydrate content of 55, 20, 90, and 70g, respectively. A duration of 15&#xa0;min was considered for each meal, and meals were announced to the control strategies, i.e., this information is sent to the embedded system.</p>
</list-item>
<list-item>
<p>The sensor noise in the measurement is considered to use the CGM signal instead of glycemia. CGM signal has been studied based on Dexcom G5 mobile devices. Its model considers two linear polynomials to describe sensor calibration error, an additive measurement noise modeled by an autoregressive model that follows Gaussian distribution with zero mean and variance <italic>&#x3c3;</italic>
<sup>2</sup>, and the interstitial glucose value (which corresponds to BG value with time delay). The equations describing the sensor error and their parameters can be seen in detail in (<xref ref-type="bibr" rid="B43">43</xref>).</p>
</list-item>
</list>
<p>Afterwards, the CGM signal is transmitted through a communication protocol (RS232) to the physical controller, where the calculations of the control actions are carried out as if they were working with an actual patient. The controller consists of a Kalman filter to estimate the state and reduce the noise effect, and an MPC strategy that finds the insulin dose that minimizes the corresponding optimization problem (according to <xref ref-type="table" rid="T1">
<bold>Table 1</bold>
</xref>). Next, at each time step, the amount of insulin to be delivered to the virtual patient is sent for the same communication protocol (RS232). This complete process facilitates the identification of the strengths, weaknesses, and challenges that must be faced before reaching a clinical study with real patients (<xref ref-type="bibr" rid="B44">44</xref>).</p>
<p>Regarding the set-up of simulations, the control parameters used for every strategy are: a prediction horizon <italic>H<sub>p</sub>
</italic> = 80, a control horizon <italic>H<sub>c</sub>
</italic>=10, a sampling time <italic>T<sub>s</sub>
</italic>=5, and the initial state given by <italic>X</italic>
<sub>0</sub> = [115, <italic>x</italic>
<sub>2</sub>
<italic>
<sub>ss</sub>
</italic>, <italic>x</italic>
<sub>3</sub>
<italic>
<sub>ss</sub>
</italic>, 0, 0]<italic>'</italic>, where <italic>x<sub>2ss</sub>
</italic> and <italic>x<sub>3ss</sub>
</italic> refer to the equilibrium state of model (1) given by <inline-formula>
<mml:math display="inline" id="im10">
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:mi>s</mml:mi>
<mml:mi>s</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>=</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mn>3</mml:mn>
<mml:mi>s</mml:mi>
<mml:mi>s</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>=</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b8;</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>115</mml:mn>
<mml:msub>
<mml:mi>&#x3b8;</mml:mi>
<mml:mn>2</mml:mn>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b8;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msub>
</mml:mrow>
</mml:mfrac>
</mml:mrow>
</mml:math>
</inline-formula>. For the sMPC, the reference was set as 95 mg/dl, and for the other three strategies, the target zone was set as [85-105] mg/dl. Weight matrices <italic>Q, R</italic>, and <italic>P</italic> were tuned in Matlab for each subject and then, these values were used in the tests of the embedded systems and optimization solver packages.</p>
<p>For the embedded systems, a Linux distribution was used with Python 3.x software. The optimization packages tested in the embedded are CVXOPT V1.2.6, Quadprog V0.1.8, and OSQP V0.6.2. The tolerances for each solver are reported in <xref ref-type="table" rid="T4">
<bold>Table 4</bold>
</xref> and can be modified by the exception of Python&#x2019;s Quadprog package. The Python 3.x programming language uses the IEEE-754 standard for floating-point representation by default. Likewise, the embedded systems tested in this work have in their architecture modules compatible with the IEEE-754 standard. This standard uses a 64-bit floating-point format (double precision). Although 53 bits are used in this standard for the precision of calculated data, it should be noted that, in general, Python approaches the significant numbers up to 17 digits (<xref ref-type="bibr" rid="B45">45</xref>). Additionally, since small magnitudes are difficult to execute in an insulin injection mechanism, it was decided to round the result of the optimal insulin dosage at each instant <italic>k</italic> to handle minimum variations of 0.1 Units of insulin.</p>
<table-wrap id="T4" position="float">
<label>Table 4</label>
<caption>
<p>Optimization package tolerances.</p>
</caption>
<table frame="hsides">
<thead>
<tr>
<th valign="top" align="left">Package </th>
<th valign="top" colspan="4" align="center">Value of tolerances </th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">
<bold>Quadprog (MATLAB)</bold>
</td>
<td valign="top" align="left">TolPGG = 1e&#x2013;5</td>
<td valign="top" align="left">Tolcon = 1e&#x2013;4</td>
<td valign="top" align="left">TolX = 1e&#x2013;4</td>
<td valign="top" align="left">Tolfun = 1e&#x2013;4</td>
</tr>
<tr>
<td valign="top" align="left">
<bold>Quadprog (Python)</bold>
</td>
<td valign="top" align="left">N.A.</td>
<td valign="top" align="left">N.A.</td>
<td valign="top" align="left">N.A.</td>
<td valign="top" align="left">N.A.</td>
</tr>
<tr>
<td valign="top" align="left">
<bold>OSQP</bold>
</td>
<td valign="top" align="left">Eps_abs = 1e&#x2013;3</td>
<td valign="top" align="left">Eps_rel = 1e&#x2013;3</td>
<td valign="top" align="left"/>
<td valign="top" align="left"/>
</tr>
<tr>
<td valign="top" align="left">
<bold>CVXOPT</bold>
</td>
<td valign="top" align="left">Feastol &lt;1e&#x2013;7</td>
<td valign="top" align="left">Abstol &lt;1e&#x2013;7</td>
<td valign="top" align="left">Reltol &lt;1e&#x2013;6</td>
<td valign="top" align="left"/>
</tr>
</tbody>
</table>
</table-wrap>
<p>For each test, the following data were saved: processing time per iteration, the total time of the simulation, delivered insulin, and blood glucose levels; and the following sensors were implemented: Gravity sensor - I2C Digital Wattmeter with a tolerance of &#xb1;0.2% to measure energy consumption, and the MLX90614 (GY - 906) sensor with a tolerance of &#xb1;0.5&#xb0;C to measure processor temperature and the ambient temperature. The processor temperature was registered at rest and then stressed for 1&#xa0;min. In addition, a performance reference was established as the one obtained in simulation with Matlab i.e., both the plant and the controller are running in Matlab, using Quadprog as the optimization algorithm. A computer Core i9-9880H with 16 GB RAM was used. The operating system was Windows 10, and the Matlab version was R2020a. This reference is used to compare the performances obtained in each test with the embedded systems.</p>
<p>Finally, a quantitative index was designed to select the embedded system that is more suitable for APS. The index is composed of seven criteria weighted according to their importance. The corresponding weights can be found in <xref ref-type="table" rid="T5">
<bold>Table 5</bold>
</xref>. This index is computed by maintaining the ZMPC-AV-OF strategy and the Quadprog package (with which the best results in glycemic control were obtained). Thus, for the selection of the best platform, the following criteria were considered:</p>
<list list-type="roman-lower">
<list-item>
<p>Percentage of time in range.</p>
</list-item>
<list-item>
<p>The number of events above 180mg/dl.</p>
</list-item>
<list-item>
<p>Coefficient of variation (CV) of blood glucose.</p>
</list-item>
<list-item>
<p>Simulation time.</p>
</list-item>
<list-item>
<p>Energy consumption.</p>
</list-item>
<list-item>
<p>Temperature of the embedded device.</p>
</list-item>
<list-item>
<p>The accuracy of the glycemic response obtained with each embedded system concerning the Matlab reference (measured with the mean absolute error).</p>
</list-item>
</list>
<table-wrap id="T5" position="float">
<label>Table 5</label>
<caption>
<p>Overall performance evaluation for embedded system selection.</p>
</caption>
<table frame="hsides">
<thead>
<tr>
<th valign="top" align="left">Criterion </th>
<th valign="top" align="center">Weight </th>
<th valign="top" align="center">Jetson Nano </th>
<th valign="top" align="center">ODROID-XU4 </th>
<th valign="top" align="center">Orange Pi PC+ </th>
<th valign="top" align="center">Raspberry Pi 3 </th>
<th valign="top" align="center">Raspberry Pi 4 </th>
<th valign="top" align="center">Tinker Board S </th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">% Time in range</td>
<td valign="top" align="center">10,0</td>
<td valign="top" align="center">9,6</td>
<td valign="top" align="center">10,0</td>
<td valign="top" align="center">8,8</td>
<td valign="top" align="center">8,5</td>
<td valign="top" align="center">8,6</td>
<td valign="top" align="center">9,3</td>
</tr>
<tr>
<td valign="top" align="left">Events &gt;180</td>
<td valign="top" align="center">10,0</td>
<td valign="top" align="center">9,6</td>
<td valign="top" align="center">9,4</td>
<td valign="top" align="center">9,6</td>
<td valign="top" align="center">9,4</td>
<td valign="top" align="center">9,4</td>
<td valign="top" align="center">10,0</td>
</tr>
<tr>
<td valign="top" align="left">CV</td>
<td valign="top" align="center">10,0</td>
<td valign="top" align="center">10,0</td>
<td valign="top" align="center">10,0</td>
<td valign="top" align="center">9,9</td>
<td valign="top" align="center">9,9</td>
<td valign="top" align="center">9,6</td>
<td valign="top" align="center">9,8</td>
</tr>
<tr>
<td valign="top" align="left">Simulation time</td>
<td valign="top" align="center">10,0</td>
<td valign="top" align="center">8,4</td>
<td valign="top" align="center">10,0</td>
<td valign="top" align="center">8,2</td>
<td valign="top" align="center">7,8</td>
<td valign="top" align="center">5,0</td>
<td valign="top" align="center">9,1</td>
</tr>
<tr>
<td valign="top" align="left">Energy consumption</td>
<td valign="top" align="center">20,0</td>
<td valign="top" align="center">9,6</td>
<td valign="top" align="center">7,9</td>
<td valign="top" align="center">13,6</td>
<td valign="top" align="center">20,0</td>
<td valign="top" align="center">6,0</td>
<td valign="top" align="center">12,5</td>
</tr>
<tr>
<td valign="top" align="left">Temperature</td>
<td valign="top" align="center">10,0</td>
<td valign="top" align="center">10,0</td>
<td valign="top" align="center">7,8</td>
<td valign="top" align="center">4,9</td>
<td valign="top" align="center">7,5</td>
<td valign="top" align="center">8,5</td>
<td valign="top" align="center">8,0</td>
</tr>
<tr>
<td valign="top" align="left">Accuracy w.r.t Matlab</td>
<td valign="top" align="center">30,0</td>
<td valign="top" align="center">28,3</td>
<td valign="top" align="center">28,0</td>
<td valign="top" align="center">28,5</td>
<td valign="top" align="center">28,6</td>
<td valign="top" align="center">27,6</td>
<td valign="top" align="center">30,0</td>
</tr>
<tr>
<td valign="top" align="left">
<bold>Total</bold>
</td>
<td valign="top" align="center">100,0</td>
<td valign="top" align="center">85,5</td>
<td valign="top" align="center">83,2</td>
<td valign="top" align="center">83,6</td>
<td valign="top" align="center">91,7</td>
<td valign="top" align="center">74,7</td>
<td valign="top" align="center">88,6</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>The last criterion has the highest weighing highlighting its importance (a weight of 30 was set). This term is directly related to this paper&#x2019;s primary objective, which is evaluating the performance of the computer-designed controllers against their implementation in physical embedded systems. The second most important term was weighted with 20, and it is the energy consumption since the envisioned artificial pancreas will be implemented in a portable device with limited energy power.</p>
<p>The remaining factors are of equal importance and were set with a weight of 10. The terms (i)-(iii) can be assessed and improved in previous steps (i.e., in the designing phase) to the implementation of the control strategy in the embedded platform. The terms (iv) and (vi) are related to minor characteristics of the simple boards. The simulation time was considered minor since in a commercial insulin pump, the sampling time is 1 or 5 minutes, and from all the experimental tests, the maximum time obtained for one iteration was 6.9 seconds. Criterion (vi), although it affects the portable device&#x2019;s performance, can be handled with heat sinks.</p>
<p>The weighting procedure for each embedded system consists of determining the platform with the best performance in each criterion and assigning to it the total weight of that term. The values for the remaining embedded systems are proportional to the difference with the best.</p>
</sec>
<sec id="s4" sec-type="results">
<title>Results</title>
<p>Temperature results of each embedded system when stressing their processors with the most complex strategy (the ZMPC-AV-OF) are shown in <xref ref-type="fig" rid="f2">
<bold>Figure 2</bold>
</xref>. The embedded system with the lowest temperature increase when executing the code was the Jetson Nano registering 41&#xb0;C. In contrast, the embedded system with the highest temperature was the Orange Pi pc + with 83&#xb0;C. The average measurement of ambient temperature was 25&#xb0;C, and the temperature at rest for all embedded systems was near 42&#xb0;C.</p>
<fig id="f2" position="float">
<label>Figure 2</label>
<caption>
<p>Temperature of the processor of each embedded system.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fendo-12-662348-g002.tif"/>
</fig>
<p>
<xref ref-type="fig" rid="f3">
<bold>Figure 3</bold>
</xref> depicts the average total computation time for executing the four MPC strategies using the three solver packages and the six embedded systems. The Quadprog package resulted in being the fastest package for any embedded device. Besides, from the embedded systems, the ODROID-XU4 presented the lowest total simulation time (51.5 s), followed by the Tinker Board S (56.62s). On the other hand, the Raspberry pi 4 presented the highest total simulation time with the three solver packages, especially when using the CVXOPT package, with which the total time was five times higher than in the other cases.</p>
<fig id="f3" position="float">
<label>Figure 3</label>
<caption>
<p>Average time to execute the four MPC strategies with the six embedded systems and per optimization solver package.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fendo-12-662348-g003.tif"/>
</fig>
<p>Energy consumption results are visualized in <xref ref-type="fig" rid="f4">
<bold>Figure 4</bold>
</xref>. These are depicted as the average value of the energy consumed when executing the four MPC strategies. In most cases, there is a higher consumption linked to more complex strategies (ZMPC-AV and ZMPC-AV-OF). The Quadprog package generated the lowest consumption in all embedded systems, and the Raspberry Pi 3 stands out with an average consumption of 2.05 W/min, followed by the Orange Pi PC + with 3 W/min. Although the ODROID-XU4 presented the highest instantaneous power energy of all the embedded systems, it is not the one with the highest energy consumption due to the speed with which it executes the algorithm. The Raspberry pi 4 (especially with the CVXOPT package) was the highest energy consumption system because of the long simulation time.</p>
<fig id="f4" position="float">
<label>Figure 4</label>
<caption>
<p>Consumed energy of each embedded system per package.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fendo-12-662348-g004.tif"/>
</fig>
<p>From <xref ref-type="fig" rid="f5">
<bold>Figures 5</bold>
</xref>&#x2013;<xref ref-type="fig" rid="f8">
<bold>8</bold>
</xref>, glycemia evolution controlled with the four MPC strategies is depicted for each embedded system and optimization solver package. Each figure shows the average level of blood glucose in the adult population. <xref ref-type="fig" rid="f5">
<bold>Figures 5</bold>
</xref> and <xref ref-type="fig" rid="f6">
<bold>6</bold>
</xref> show the system&#x2019;s performance controlled by the sMPC and the ZMPC, respectively. As expected, their performances were affected by the parameter variations that induce hypo- and hyperglycemia in the plant. Thus, it is observed how BG levels decrease on day 1 and increase on day 3, evidencing an offset concerning the established target. In general, the glucose trajectories maintain the same trend, i.e., there are no significant variations between the different embedded systems (except for the ZMPC with the OSQP package). Nevertheless, it is observed that for long periods, the BG levels with the embedded systems remain below the BG levels obtained with Matlab (black lines).</p>
<fig id="f5" position="float">
<label>Figure 5</label>
<caption>
<p>Glycemia evolution under the sMPC strategy with the three solver packages.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fendo-12-662348-g005.tif"/>
</fig>
<fig id="f6" position="float">
<label>Figure 6</label>
<caption>
<p>Glycemia evolution under the ZMPC strategy with the three solver packages.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fendo-12-662348-g006.tif"/>
</fig>
<fig id="f7" position="float">
<label>Figure 7</label>
<caption>
<p>Glycemia evolution under the ZMPC-AV strategy with the three solver packages.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fendo-12-662348-g007.tif"/>
</fig>
<fig id="f8" position="float">
<label>Figure 8</label>
<caption>
<p>Glycemia evolution under the ZMPC-AV-OF strategy with the QUADPROG package in each embedded system.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fendo-12-662348-g008.tif"/>
</fig>
<p>
<xref ref-type="fig" rid="f7">
<bold>Figure 7</bold>
</xref> depicts the results under the ZMPC-AV strategy. For the OSQP and CVXOPT packages, the tolerances in <xref ref-type="table" rid="T4">
<bold>Table 4</bold>
</xref> were relaxed to obtain feasible solutions, i.e., to avoid the solver divergence and excessively high computational times (over 20&#xa0;min per simulation). For the CVXOPT package, the tolerances were set as <italic>Abstol=</italic>3<italic>e</italic>-7, <italic>Reltol=</italic>4<italic>e</italic>-2, and <italic>Feastol</italic>=4<italic>e</italic>-2, and for the OSQP package as <italic>Eps</italic>_<italic>abs</italic>=90 y <italic>Eps</italic>_<italic>rel</italic>=9.9. With these two packages, the glycemia evolution controlled with the embedded systems varies with respect to the reference performance (obtained with Matlab). Hypoglycemic events occurred when using CVXOPT, and with the OSQP, control objectives were not achieved during the three days. In contrast, with the Quadprog package, the glycemia evolution controlled with any embedded system resulted very similar to that obtained with Matlab.</p>
<p>The results obtained with the ZMPC-AV-OF strategy can be visualized in <xref ref-type="fig" rid="f8">
<bold>Figures 8</bold>
</xref> and <xref ref-type="fig" rid="f9">
<bold>9</bold>
</xref>. When using the Quadprog solver, the embedded systems&#x2019; results are very close to the Matlab reference, succeeding in avoiding hypoglycemia and reducing hyperglycemia events. Results obtained with CVXOPT and OSQP packages are not depicted because they generated the same issues illustrated with the ZMPC-AV strategy.</p>
<fig id="f9" position="float">
<label>Figure 9</label>
<caption>
<p>Results of each embedded system under the ZMPC-AV-OF strategy, <bold>(A)</bold> Coefficient of Variation, <bold>(B)</bold> Time percentage in normoglycemia, <bold>(C)</bold> Number of cases above 180 mg/dl, and <bold>(D)</bold> Error with respect to MATLAB.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fendo-12-662348-g009.tif"/>
</fig>
<p>
<xref ref-type="fig" rid="f9">
<bold>Figure 9A</bold>
</xref> shows that a similar CV among subjects is obtained with all embedded systems. The CV remains under the 30%; therefore, it can be considered that glycemia does not vary significantly concerning the mean value of 213 mg/dl. <xref ref-type="fig" rid="f9">
<bold>Figure 9B</bold>
</xref> depicts the time percentage in normoglycemia. In general, when using the Quadprog package, a higher time in normoglycemia is obtained; and when using the embedded systems Jetson Nano, ODROID-XU4, and Tinker Board S, a time over 93% resulted. Moreover, <xref ref-type="fig" rid="f9">
<bold>Figure 9C</bold>
</xref>. refers to the number of events above 180 mg/dl. This figure shows that with the Tinker Board S, the lowest number of hyperglycemic events occurred (4.8 &#xb1; 2.4 events). Lastly, <xref ref-type="fig" rid="f9">
<bold>Figure 9D</bold>
</xref> shows the average error of each simple board with respect to the glycemia evolution simulated in Matlab. Although this outcome is affected by the measurement noise, all the embedded systems have a good approximation to the reference (Matlab). The Tinker Board S stands out with the lowest average error of 4.99 mg/dl &#xb1; 4.82 mg/dl.</p>
<p>Finally, in <xref ref-type="fig" rid="f10">
<bold>Figure 10</bold>
</xref>, the weighting obtained by each embedded system in each evaluated criterion is shown. For each criterion, the maximum assigned weight is depicted. The outer section of the plot indicates a better performance in the evaluated criterion. In contrast, the inner section of the spider plot is related to the less attractive measurements. For instance, recall that energy consumption has a maximum weight of 20, i.e., the embedded system with the lowest energy consumption (or most energy efficient) is assigned with a value of 20, which corresponds to the Raspberry Pi 3. The other simple boards are then assigned with a lower value in this criterion as they consume a higher amount of energy. The Raspberry Pi 4 is the board with the highest energy consumption and therefore with the lowest performance in the energy criterion, obtaining a value of 6. The assignment of weights to each platform is similarly done with the other criteria. In the end, the values obtained by each embedded system are added to find the best option.</p>
<fig id="f10" position="float">
<label>Figure 10</label>
<caption>
<p>Weighting obtained by each embedded system in the performance criteria.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fendo-12-662348-g010.tif"/>
</fig>
<p>The Total result of the summation shows that the Raspberry Pi 3 is the best option with a score of 91.7, followed by the Tinker Board S with 88.6. The Jetson Nano, the Orange Pi PC +, and the ODROID-XU4 obtained a score of 85.5, 83.6, and 83.2, respectively. The embedded system with the worst performance is the Raspberry Pi 4. The values of the weighting factors and the final performance index are reported in <xref ref-type="table" rid="T5">
<bold>Table 5</bold>
</xref>.</p>
</sec>
<sec id="s5" sec-type="discussion">
<title>Discussion</title>
<p>Regarding the temperature test, the Jetson Nano presented the lowest increase in temperature because it comes with a heatsink that spans much of the motherboard, which prevents heating the processor but makes it impractical for a portable device due to its size. Similarly, the ODROID-XU4 has a significantly large heatsink compared to the board&#x2019;s size. In contrast, the high temperature obtained with the Orange pi pc + suggests that its operation would require a heatsink and possibly a fan, which is not desired for a portable device.</p>
<p>Although the hardware structure of the Raspberry Pi 4 has improved compared to the Raspberry Pi 3 (<xref ref-type="bibr" rid="B31">31</xref>), the higher energy consumption presented with this embedded system is not due to an increase in power when solving the optimization process. This energy consumption is more closely related to the algorithm&#x2019;s execution time. From <xref ref-type="fig" rid="f3">
<bold>Figure 3</bold>
</xref>, it can be seen that the time required to complete the simulation is substantially longer when implementing the CVXOPT package on the Raspberry Pi4 than with any other simple board, resulting in higher energy consumption, as seen in <xref ref-type="fig" rid="f4">
<bold>Figure 4</bold>
</xref>. This behavior could suggest that there is no complete compatibility between the operating system, the programming language, or the optimization package used when conducting the experimental part of this study. Therefore, rather poor performance is obtained with long periods calculating the optimal insulin dose and high energy consumption.</p>
<p>A clear difference in processing times and energy consumption was obtained when running the complex control strategies (ZMPC-AV and ZMPC-AV-OF) compared to the simpler strategies (sMPC and ZMPC), which is expected. This difference is because of the higher computational cost with the complex strategies since the optimization problem to be solved at each time step has more constraints and more decision variables; therefore, the optimization problem to solve has higher dimensions (as evidenced in <xref ref-type="table" rid="T2">
<bold>Table 2</bold>
</xref>). However, the time per iteration is short compared with the sampling time (5&#xa0;min) even for the most complex strategy, suggesting no impediment to implementing these MPC strategies in real-time. The results presented in (<xref ref-type="bibr" rid="B2">2</xref>) are comparable with the ones here obtained. When using the Raspberry pi 3 and the CVXOPT solver package for a ZMPC strategy in a single subject, the average time per iteration was reported as 50ms &#xb1;10ms, while here, the average time per iteration was 78ms &#xb1;17ms, yet, the prediction horizon used in (<xref ref-type="bibr" rid="B2">2</xref>) is much smaller (<italic>H<sub>p</sub>
</italic>=20).</p>
<p>Regarding the control strategies&#x2019; performances with each solver package, a similar behavior among them was obtained with the simpler strategies: the sMPC and ZMPC. The results of <xref ref-type="fig" rid="f7">
<bold>Figure 7</bold>
</xref> suggest that the OSQP package presents issues when increasing the complexity of the optimization problem (as shown for the ZMPC-AV and ZMPC-AV-OF strategies). For both control strategies, the virtual subjects cannot be kept within normal glucose ranges and substantially deviated from the Matlab results. This poor performance suggests an incompatibility between the OSQP solver and the more complex strategies, in which more decision variables and more equality and inequality constraints are added. The OSQP algorithm cannot find a suitable solution, even when the tolerances were significantly reduced. Other works corroborate this. For instance, in (<xref ref-type="bibr" rid="B16">16</xref>), where a ZMPC strategy was implemented, the fast alternating minimization algorithm (FAMA) was preferred to be used in embedded control systems because, in general, the ADMM algorithm presents limitations in the complexity bounds on the number of iterations and step size. Also, in (<xref ref-type="bibr" rid="B46">46</xref>), it is mentioned that the OSQP package presents an outstanding performance (comparable with commercial solvers) for small to medium-size problems.</p>
<p>A similar situation occurred with the CVXOPT package. With this package, satisfactory results are obtained when implementing the sMPC and ZMPC strategies. These good results were also obtained with a ZMPC formulation in (<xref ref-type="bibr" rid="B2">2</xref>, <xref ref-type="bibr" rid="B22">22</xref>). Nevertheless, in neither paper, the CVXOPT package&#x2019;s performance was tested with more complex optimization problems. The ZMPC used in (<xref ref-type="bibr" rid="B2">2</xref>, <xref ref-type="bibr" rid="B22">22</xref>) has 4<italic>H<sub>c</sub>
</italic>+2(<italic>H<sub>p</sub>
</italic>-<italic>Hu</italic>) inequality constraints, while the ZMPC-AV explained in Section II has 2(<italic>H<sub>c</sub>
</italic>+2<italic>n<sub>x</sub>
</italic>+2) + 2<italic>n<sub>x</sub>H<sub>p</sub>
</italic> inequality constraints plus the 3<italic>n<sub>x</sub>
</italic> equality constraints due to the equilibrium artificial variables (<italic>n<sub>x</sub>
</italic> refers to the dimension of the state). For this package and the ZMPC-AV-OF, it was possible to adjust the performance by modifying the tolerances to obtain feasible solutions. Nevertheless, very high sensitivity was presented in this adjustment, i.e., significant changes over glycemia were obtained for small changes of the tolerances, typically with a magnitude of 0.01, and especially in the gab relative tolerance. Besides, the same tolerances do not work well for all patients. These results suggest that the packages OSQP and CVXOPT are not reliable for T1D treatment, where the robustness and stability are of primal importance. Hence, both packages are considered invalid options for implementing an APS with complex control strategies.</p>
<p>Another factor that stands out from the results is that a complex and expensive architecture is not necessarily the best for all applications. For instance, the Jetson Nano has a GPU designed for parallel processing and focused on machine learning and digital image processing. However, these components are irrelevant for the application under study where the algorithm and its execution are sequential. Therefore, only the main processor&#x2019;s performance is considered, which, although it presented good results, was not the best either in execution time or in performance. Thus, in this case, the Jetson Nano does not represent an advantage but an extra cost. The ODROID-XU4 presents a great instantaneous power consumption, which is compensated by its processing speed. Nevertheless, despite having the best processor specifications, this embedded system does not represent a substantial performance advantage over other simpler and cheaper embedded systems like the Tinker Board S or the Raspberry Pi 3.</p>
<p>On the other hand, the only embedded system with a 32-bit processor architecture is the Tinker Board S. However, The module added to the processor architecture (VFPv4) to compute the floating-point under the IEEE-754 standard (Double-precision) allows this embedded system not only to be compared with the other 64-bit platforms but also it presents an outstanding performance in many aspects evaluated in the tests. For example, this embedded system, together with the Raspberry Pi 3, manages a good balance between the energy consumed, the processing time, and the control objectives.</p>
<p>Regarding the data transmission in the results obtained, no significant differences were observed in the data transmission speeds <italic>via</italic> serial communication between each embedded system and the computer.</p>
<p>The outcomes also allow for assessing the level of confidence in the embedded systems when comparing them with the computer&#x2019;s performance. There are vast differences between a computer and a simple board. The computer uses a processor x86 with the Complex Instruction Set Computer (CISC) architecture to run the algorithm by commands. In contrast, the embedded systems have an ARM processor that uses RISC. However, despite these differences, it could be seen that the results obtained in the computer (in Matlab) can be reproduced in the embedded systems when using the appropriate solver package. Therefore, when designing and tuning the control strategies in computers and then implementing them in the embedded systems, there is confidence that the embedded systems will execute the strategies adequately.</p>
<p>By considering the priorities for the T1D application and the results in each of the tests&#x2019; criteria, the Raspberry Pi 3 and the Tinker Board S turn out as the best options for APS when using advanced control strategies. It should be noted that, even though the Tinker Board S and other embedded systems have a better performance than the Raspberry Pi 3 in glucose regulation and algorithm execution times, the difference between them is not as significant as the low energy consumption presented by the Raspberry Pi 3. This last criterion is why Raspberry Pi 3 is located as the most appropriate for APS.</p>
</sec>
<sec id="s6" sec-type="conclusions">
<title>Conclusions</title>
<p>In this work, the performance of six embedded systems and three open-source optimization packages were analyzed in terms of their implementation in the emulation of an APS using the HIL methodology. The embedded systems and solver packages were tested with four MPC strategies of increasing complexity. The results show that, when using the appropriate optimization package, ARM processors can successfully meet the goal of regulating glycemia in subjects with T1D even under complex control strategies. The Quadprog package resulted in being the best solver with faster and reliable responses concerning the other packages. The results obtained were very similar concerning those obtained in Matlab and gave guarantees of faithfully applying the algorithm in APS even though the optimization method used in the quadprog of MATLAB is different from the one available for python. In contrast, the OSQP and CVXOPT packages show difficulties in handling complex problems regarding the number of decision variables and constraints, making them unacceptable for T1D treatment.</p>
<p>Finally, the results obtained when using the more complex control strategy and the Quadprog package show no considerable difference in the embedded systems&#x2019; performance. However, a substantial difference is found in the energy consumed during the tests&#x2019; execution; thus, the embedded system recommended to be implemented as a portable device under the conditions exposed in this work is the Raspberry Pi 3 followed by the Tinker Board S.</p>
</sec>
<sec id="s7">
<title>Data Availability Statement</title>
<p>The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.</p>
</sec>
<sec id="s8">
<title>Author Contributions</title>
<p>JG-M developed the code of MPC strategies in Python, performed the tests with each embedded system, and drafted the manuscript. MV-T developed the code of the MPC strategies in Matlab and helped draft the manuscript. MV contributed with the theoretical framework of the study regarding embedded systems. PR conceived the study; he contributed with the study&#x2019;s theoretical framework in impulsive control strategies and the analysis of the results. All authors contributed to the article and approved the submitted version.</p>
</sec>
<sec id="s9" sec-type="funding-information">
<title>Funding</title>
<p>This work was supported by Minciencias (Colombia) with Grant 110180763081.</p>
</sec>
<sec id="s10" sec-type="COI-statement">
<title>Conflict of Interest</title>
<p>The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.</p>
</sec>
</body>
<back>
<ref-list>
<title>References</title>
<ref id="B1">
<label>1</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Haidar</surname> <given-names>A</given-names>
</name>
</person-group>. <article-title>The artificial pancreas: How closed-loop control is revolutionizing diabetes</article-title>. <source>IEEE Control Syst</source> (<year>2016</year>) <volume>36</volume>:<fpage>28</fpage>&#x2013;<lpage>47</lpage>. doi:&#xa0;<pub-id pub-id-type="doi">10.1109/MCS.2016.2584318</pub-id>
</citation>
</ref>
<ref id="B2">
<label>2</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Zavitsanou</surname> <given-names>S</given-names>
</name>
<name>
<surname>Chakrabarty</surname> <given-names>A</given-names>
</name>
<name>
<surname>Dassau</surname> <given-names>E</given-names>
</name>
<name>
<surname>Doyle</surname> <given-names>FJ</given-names>
</name>
</person-group>. <article-title>Embedded control in wearable medical devices: Application to the artificial pancreas</article-title>. <source>Processes</source> (<year>2016</year>) <volume>4</volume>:<fpage>35</fpage>. doi:&#xa0;<pub-id pub-id-type="doi">10.3390/pr4040035</pub-id>
</citation>
</ref>
<ref id="B3">
<label>3</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Steil</surname> <given-names>GM</given-names>
</name>
</person-group>. <article-title>Algorithms for a closed-loop artificial pancreas: The case for proportional-integral-derivative control</article-title>. <source>J Diabetes Sci Technol</source> (<year>2013</year>) <volume>7</volume>:<page-range>1621&#x2013;31</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1177/193229681300700623</pub-id>
</citation>
</ref>
<ref id="B4">
<label>4</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Marchetti</surname> <given-names>G</given-names>
</name>
<name>
<surname>Barolo</surname> <given-names>M</given-names>
</name>
<name>
<surname>Jovanovic</surname> <given-names>L,HZ</given-names>
</name>
<name>
<surname>Seborg</surname> <given-names>D</given-names>
</name>
</person-group>. <article-title>An improved pid switching control strategy for type 1 diabetes</article-title>. <source>IEEE Trans BioMed Eng</source> (<year>2006</year>) <volume>55</volume>:<page-range>857&#x2013;65</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1109/TBME.2008.915665</pub-id>
</citation>
</ref>
<ref id="B5">
<label>5</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Dassau</surname> <given-names>E</given-names>
</name>
<name>
<surname>Pinsker</surname> <given-names>J</given-names>
</name>
<name>
<surname>Kudva</surname> <given-names>Y</given-names>
</name>
<name>
<surname>Brown</surname> <given-names>S</given-names>
</name>
<name>
<surname>Gondhalekar</surname> <given-names>R</given-names>
</name>
<name>
<surname>Man</surname> <given-names>C</given-names>
</name>
<etal/>
</person-group>. <article-title>Twelve-week 24/7 ambulatory artificial pancreas with weekly adaptation of insulin delivery settings: Effect on hemoglobin a1c and hypoglycemia</article-title>. <source>Diabetes Care</source> (<year>2017</year>) <volume>40</volume>:<page-range>1719&#x2013;26</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.2337/dc17-1188</pub-id>
</citation>
</ref>
<ref id="B6">
<label>6</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Bequette</surname> <given-names>BW</given-names>
</name>
</person-group>. <article-title>Algorithms for a closed-loop artificial pancreas: The case for model predictive control</article-title>. <source>J Diabetes Sci Technol</source> (<year>2013</year>) <volume>7</volume>:<page-range>1632&#x2013;43</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1177/193229681300700624</pub-id>
</citation>
</ref>
<ref id="B7">
<label>7</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Grosman</surname> <given-names>B</given-names>
</name>
<name>
<surname>Dassau</surname> <given-names>E</given-names>
</name>
<name>
<surname>Zisser</surname> <given-names>HC</given-names>
</name>
<name>
<surname>Jovanovi&#x10d;</surname> <given-names>L</given-names>
</name>
<name>
<surname>Doyle</surname> <given-names>FJ</given-names>
<suffix>II</suffix>
</name>
</person-group>. <article-title>Zone model predictive control: A strategy to minimize hyper- and hypoglycemic events</article-title>. <source>J Diabetes Sci Technol</source> (<year>2010</year>) <volume>4</volume>:<page-range>1546&#x2013;52</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1177/193229681000400428</pub-id>
</citation>
</ref>
<ref id="B8">
<label>8</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Gondhalekar</surname> <given-names>R</given-names>
</name>
<name>
<surname>Dassau</surname> <given-names>E</given-names>
</name>
<name>
<surname>Doyle</surname> <given-names>FJ</given-names>
<suffix>II</suffix>
</name>
</person-group>. <article-title>Velocity-weighting &amp; velocity-penalty mpc of an artificial pancreas: Improved safety &amp; performance</article-title>. <source>Automatica</source> (<year>2018</year>) <volume>91</volume>:<page-range>105&#x2013;17</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1016/j.automatica.2018.01.025</pub-id>
</citation>
</ref>
<ref id="B9">
<label>9</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Lee</surname> <given-names>JB</given-names>
</name>
<name>
<surname>Dassau</surname> <given-names>E</given-names>
</name>
<name>
<surname>Gondhalekar</surname> <given-names>R</given-names>
</name>
<name>
<surname>Seborg</surname> <given-names>DE</given-names>
</name>
<name>
<surname>Pinsker</surname> <given-names>JE</given-names>
</name>
<name>
<surname>Doyle</surname> <given-names>FJ</given-names>
</name>
</person-group>. <article-title>Enhanced model predictive control (empc) strategy for automated glucose control</article-title>. <source>Ind Eng Chem Res</source> (<year>2016</year>) <volume>55</volume>:<page-range>11857&#x2013;68</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1021/acs.iecr.6b02718</pub-id>
</citation>
</ref>
<ref id="B10">
<label>10</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Gonz&#xe1;lez</surname> <given-names>AH</given-names>
</name>
<name>
<surname>Rivadeneira</surname> <given-names>PS</given-names>
</name>
<name>
<surname>Ferramosca</surname> <given-names>A</given-names>
</name>
<name>
<surname>Magdelaine</surname> <given-names>N</given-names>
</name>
<name>
<surname>Moog</surname> <given-names>CH</given-names>
</name>
</person-group>. <article-title>Stable impulsive zone mpc for type 1 diabetic patients based on a long-term model</article-title>. <source>Optimal Control Appl Methods</source> (<year>2020</year>) <volume>41</volume>(<issue>6</issue>):<page-range>2115&#x2013;36</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1002/oca.2647</pub-id>
</citation>
</ref>
<ref id="B11">
<label>11</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Villa Tamayo</surname> <given-names>MF</given-names>
</name>
<name>
<surname>Caicedo &#xc1;lvarez</surname> <given-names>MA</given-names>
</name>
<name>
<surname>Rivadeneira</surname> <given-names>PS</given-names>
</name>
</person-group>. <article-title>Handling parameter variations during the treatment of type 1 diabetes mellitus: In silico results</article-title>. <source>Math Problems Eng</source> (<year>2019</year>) <volume>2019</volume>:<fpage>1</fpage>&#x2013;<lpage>21</lpage>. doi:&#xa0;<pub-id pub-id-type="doi">10.1155/2019/2640405</pub-id>
</citation>
</ref>
<ref id="B12">
<label>12</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Villa-Tamayo</surname> <given-names>MF</given-names>
</name>
<name>
<surname>Caicedo</surname> <given-names>MA</given-names>
</name>
<name>
<surname>Rivadeneira</surname> <given-names>PS</given-names>
</name>
</person-group>. <article-title>Offset-free mpc strategy for nonzero regulation of linear impulsive systems</article-title>. <source>ISA Trans</source> (<year>2020</year>) <volume>101</volume>:<fpage>91</fpage>&#x2013;<lpage>101</lpage>. doi:&#xa0;<pub-id pub-id-type="doi">10.1016/j.isatra.2020.01.005</pub-id>
</citation>
</ref>
<ref id="B13">
<label>13</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Shi</surname> <given-names>D</given-names>
</name>
<name>
<surname>Dassau</surname> <given-names>E</given-names>
</name>
<name>
<surname>Doyle</surname> <given-names>FJ</given-names>
<suffix>II</suffix>
</name>
</person-group>. <article-title>Adaptive zone model predictive control of artificial pancreas based on glucose- and velocity-dependent control penalties</article-title>. <source>IEEE Trans Biomed Eng</source> (<year>2019</year>) <volume>66</volume>:<page-range>1045&#x2013;54</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1109/TBME.2018.2866392</pub-id>
</citation>
</ref>
<ref id="B14">
<label>14</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Villa-Tamayo</surname> <given-names>MF</given-names>
</name>
<name>
<surname>Rivadeneira</surname> <given-names>PS</given-names>
</name>
</person-group>. <article-title>Adaptive impulsive offset-free mpc to handle parameter variations for type 1 diabetes treatment</article-title>. <source>Ind Eng Chem Res</source> (<year>2020</year>) <volume>59</volume>:<page-range>5865&#x2013;76</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1021/acs.iecr.9b05979</pub-id>
</citation>
</ref>
<ref id="B15">
<label>15</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Villa-Tamayo</surname> <given-names>MF</given-names>
</name>
<name>
<surname>Leon-Vargas</surname> <given-names>F</given-names>
</name>
<name>
<surname>Garcia-Jaramillo</surname> <given-names>M</given-names>
</name>
<name>
<surname>Rivadeneira</surname> <given-names>PS</given-names>
</name>
</person-group>. <article-title>Glycemic control strategy based on an impulsive mpc with safety layer coupling for iob limitation</article-title>. <source>IEEE Control Syst Lett</source> (<year>2021</year>) <volume>5</volume>:<page-range>1669&#x2013;74</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1109/LCSYS.2020.3042651</pub-id>
</citation>
</ref>
<ref id="B16">
<label>16</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Chakrabarty</surname> <given-names>A</given-names>
</name>
<name>
<surname>Healey</surname> <given-names>E</given-names>
</name>
<name>
<surname>Shi</surname> <given-names>D</given-names>
</name>
<name>
<surname>Zavitsanou</surname> <given-names>S</given-names>
</name>
<name>
<surname>Doyle</surname> <given-names>FJ</given-names>
</name>
<name>
<surname>Dassau</surname> <given-names>E</given-names>
</name>
</person-group>. <article-title>Embedded model predictive control for a wearable artificial pancreas</article-title>. <source>IEEE Trans Control Syst Technol</source> (<year>2020</year>) <volume>28</volume>(<issue>6</issue>):<page-range>2600&#x2013;7</page-range>. doi: <pub-id pub-id-type="doi">10.1109/TCST.2019.2939122</pub-id>
</citation>
</ref>
<ref id="B17">
<label>17</label>
<citation citation-type="book">
<collab>Medtronic Minimed, Inc</collab>. <source>Medtronic. MiniMed 640G System User Guide</source>. <publisher-loc>Los Angeles</publisher-loc>: <publisher-name>Medtronic</publisher-name> (<year>2017</year>).</citation>
</ref>
<ref id="B18">
<label>18</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Russell</surname> <given-names>SJ</given-names>
</name>
<name>
<surname>Hillard</surname> <given-names>MA</given-names>
</name>
<name>
<surname>Balliro</surname> <given-names>C</given-names>
</name>
<name>
<surname>Magyar</surname> <given-names>KL</given-names>
</name>
<name>
<surname>Selagamsetty</surname> <given-names>R</given-names>
</name>
<name>
<surname>Sinha</surname> <given-names>M</given-names>
</name>
<etal/>
</person-group>. <article-title>Day and night glycaemic control with a bionic pancreas versus conventional insulin pump therapy in preadolescent children with type 1 diabetes: a randomised crossover trial</article-title>. <source>Lancet Diabetes Endocrinol</source> (<year>2016</year>) <volume>4</volume>:<page-range>233&#x2013;43</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1016/S2213-8587(15)00489-1</pub-id>
</citation>
</ref>
<ref id="B19">
<label>19</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Tauschmann</surname> <given-names>M</given-names>
</name>
<name>
<surname>Allen</surname> <given-names>JM</given-names>
</name>
<name>
<surname>Wilinska</surname> <given-names>ME</given-names>
</name>
<name>
<surname>Thabit</surname> <given-names>H</given-names>
</name>
<name>
<surname>Stewart</surname> <given-names>Z</given-names>
</name>
<name>
<surname>Cheng</surname> <given-names>P</given-names>
</name>
<etal/>
</person-group>. <article-title>Day-and-night hybrid closed-loop insulin delivery in adolescents with type 1 diabetes: A free-living, randomized clinical trial</article-title>. <source>Diabetes Care</source> (<year>2016</year>) <volume>39</volume>:<page-range>1168&#x2013;74</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.2337/dc15-2078</pub-id>
</citation>
</ref>
<ref id="B20">
<label>20</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Grosman</surname> <given-names>B</given-names>
</name>
<name>
<surname>Ilany</surname> <given-names>J</given-names>
</name>
<name>
<surname>Roy</surname> <given-names>A</given-names>
</name>
<name>
<surname>Kurtz</surname> <given-names>N</given-names>
</name>
<name>
<surname>Wu</surname> <given-names>D</given-names>
</name>
<name>
<surname>Parikh</surname> <given-names>N</given-names>
</name>
<etal/>
</person-group>. <article-title>Hybrid closed-loop insulin delivery in type 1 diabetes during supervised outpatient conditions</article-title>. <source>J Diabetes Sci Technol</source> (<year>2016</year>) <volume>10</volume>:<page-range>708&#x2013;13</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1177/1932296816631568</pub-id>
</citation>
</ref>
<ref id="B21">
<label>21</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Blauw</surname> <given-names>H</given-names>
</name>
<name>
<surname>van Bon</surname> <given-names>AC</given-names>
</name>
<name>
<surname>Koops</surname> <given-names>R</given-names>
</name>
<name>
<surname>DeVries</surname> <given-names>JH</given-names>
</name>
</person-group>. <article-title>Performance and safety of an integrated bihormonal artificial pancreas for fully automated glucose control at home</article-title>. <source>Diabetes Obes Metab</source> (<year>2016</year>) <volume>18</volume>:<page-range>671&#x2013;7</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1111/dom.12663</pub-id>
</citation>
</ref>
<ref id="B22">
<label>22</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Chakrabarty</surname> <given-names>A</given-names>
</name>
<name>
<surname>Zavitsanou</surname> <given-names>S</given-names>
</name>
<name>
<surname>Doyle</surname> <given-names>FJ</given-names>
</name>
<name>
<surname>Dassau</surname> <given-names>E</given-names>
</name>
</person-group>. <article-title>Event-triggered model predictive control for embedded artificial pancreas systems</article-title>. <source>IEEE Trans Biomed Eng</source> (<year>2018</year>) <volume>65</volume>:<page-range>575&#x2013;86</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1109/TBME.2017.2707344</pub-id>
</citation>
</ref>
<ref id="B23">
<label>23</label>
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Diehl</surname> <given-names>M</given-names>
</name>
</person-group>. <source>Optimization algorithms for model predictive control</source>. <publisher-loc>London</publisher-loc>: <publisher-name>Springer</publisher-name> (<year>2020</year>). p. <fpage>1</fpage>&#x2013;<lpage>11</lpage>. doi:&#xa0;<pub-id pub-id-type="doi">10.1007/978-1-4471-5102-9</pub-id>
</citation>
</ref>
<ref id="B24">
<label>24</label>
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Dang</surname> <given-names>T</given-names>
</name>
<name>
<surname>Ling</surname> <given-names>K</given-names>
</name>
<name>
<surname>Maciejowski</surname> <given-names>J</given-names>
</name>
</person-group>. <source>Embedded admm-based qp solver for mpc with polytopic constraints. European Control Conference, ECC</source> <publisher-loc>Linz, Austria</publisher-loc>: <publisher-name>IEEE</publisher-name> 2015. (<year>2015</year>). pp. <page-range>3446&#x2013;51</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1109/ECC.2015.7331067</pub-id>.</citation>
</ref>
<ref id="B25">
<label>25</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Ding</surname> <given-names>Y</given-names>
</name>
<name>
<surname>Xu</surname> <given-names>Z</given-names>
</name>
<name>
<surname>Zhao</surname> <given-names>J</given-names>
</name>
<name>
<surname>Wang</surname> <given-names>K</given-names>
</name>
<name>
<surname>Shao</surname> <given-names>Z</given-names>
</name>
</person-group>. <article-title>Embedded mpc controller based on interior-point method with convergence depth control</article-title>. <source>Asian J Control</source> (<year>2016</year>) <volume>18</volume>:<page-range>2064&#x2013;77</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1002/asjc.1299</pub-id>
</citation>
</ref>
<ref id="B26">
<label>26</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Johansen</surname> <given-names>TA</given-names>
</name>
</person-group>. <article-title>Toward dependable embedded model predictive control</article-title>. <source>IEEE Syst J</source> (<year>2017</year>) <volume>11</volume>:<page-range>1208&#x2013;19</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1109/JSYST.2014.2368129</pub-id>
</citation>
</ref>
<ref id="B27">
<label>27</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Richter</surname> <given-names>S</given-names>
</name>
<name>
<surname>Jones</surname> <given-names>CN</given-names>
</name>
<name>
<surname>Morari</surname> <given-names>M</given-names>
</name>
</person-group>. <article-title>Computational complexity certification for real-time mpc with input constraints based on the fast gradient method</article-title>. <source>IEEE Trans Automatic Control</source> (<year>2012</year>) <volume>57</volume>:<page-range>1391&#x2013;403</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1109/TAC.2011.2176389</pub-id>
</citation>
</ref>
<ref id="B28">
<label>28</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Chui</surname> <given-names>CK</given-names>
</name>
<name>
<surname>Nguyen</surname> <given-names>BP</given-names>
</name>
<name>
<surname>Ho</surname> <given-names>Y</given-names>
</name>
<name>
<surname>Wu</surname> <given-names>Z</given-names>
</name>
<name>
<surname>Nguyen</surname> <given-names>M</given-names>
</name>
<name>
<surname>Hong</surname> <given-names>GS</given-names>
</name>
<etal/>
</person-group>. <article-title>Embedded real-time model predictive control for glucose regulation</article-title>. <source>IFMBE Proc</source> (<year>2013</year>) <volume>39</volume>:<page-range>1437&#x2013;40</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1007/978-3-642-29305-4_378</pub-id>
</citation>
</ref>
<ref id="B29">
<label>29</label>
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Bleris</surname> <given-names>LG</given-names>
</name>
<name>
<surname>Kothare</surname> <given-names>MV</given-names>
</name>
</person-group>. <source>Implementation of model predictive control for glucose regulation on a general purpose microprocessor. Proceedings of the 44th IEEE Conference on Decision and Control 2005</source>. <publisher-loc>Seville, Spain</publisher-loc>: <publisher-name>IEEE</publisher-name> (<year>2005</year>). pp. <page-range>5162&#x2013;7</page-range>.</citation>
</ref>
<ref id="B30">
<label>30</label>
<citation citation-type="web">
<person-group person-group-type="author">
<collab>FOUNDATION RP</collab>
</person-group>. <source>Raspberry Pi 3 model B Tech specs</source>. (<year>2016</year>). Available at: <uri xlink:href="https://www.raspberrypi.org/products/raspberry-pi-3-model-b/">https://www.raspberrypi.org/products/raspberry-pi-3-model-b/</uri>.</citation>
</ref>
<ref id="B31">
<label>31</label>
<citation citation-type="web">
<person-group person-group-type="author">
<collab>FOUNDATION RP</collab>
</person-group>. <source>Raspberry Pi 4 Tech specs</source>. (<year>2019</year>). Available at: <uri xlink:href="https://www.raspberrypi.org/products/raspberry-pi-4-model-b/specifications/">https://www.raspberrypi.org/products/raspberry-pi-4-model-b/specifications/</uri>.</citation>
</ref>
<ref id="B32">
<label>32</label>
<citation citation-type="web">
<person-group person-group-type="author">
<collab>ASUS</collab>
</person-group>. <source>Tinker Board S Tech specs</source>. (<year>2018</year>). Available at: <uri xlink:href="https://www.asus.com/us/Motherboards-Components/Single-Board-Computer/All-series/Tinker-Board-S/">https://www.asus.com/us/Motherboards-Components/Single-Board-Computer/All-series/Tinker-Board-S/</uri>.</citation>
</ref>
<ref id="B33">
<label>33</label>
<citation citation-type="web">
<person-group person-group-type="author">
<collab>CO SXS</collab>
</person-group>. <source>Orange Pi Pc Plus Tech specs</source>. (<year>2017</year>). Available at: <uri xlink:href="http://www.orangepi.org/orangepipcplus/">http://www.orangepi.org/orangepipcplus/</uri>.</citation>
</ref>
<ref id="B34">
<label>34</label>
<citation citation-type="web">
<person-group person-group-type="author">
<name>
<surname>HardKernel</surname> <given-names>L</given-names>
</name>
</person-group>. <source>ODROID-XU4 Tech specs</source>. (<year>2015</year>). Available at: <uri xlink:href="https://wiki.odroid.com/odroid-xu4/hardware/hardware">https://wiki.odroid.com/odroid-xu4/hardware/hardware</uri>.</citation>
</ref>
<ref id="B35">
<label>35</label>
<citation citation-type="web">
<person-group person-group-type="author">
<collab>NVIDIA</collab>
</person-group>. <source>Jetson Nano Tech specs</source>. NVIDIA (<year>2019</year>). Available at: <uri xlink:href="https://developer.nvidia.com/embedded/jetson-nano-2gb-developer-kit">https://developer.nvidia.com/embedded/jetson-nano-2gb-developer-kit</uri>.</citation>
</ref>
<ref id="B36">
<label>36</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Ruan</surname> <given-names>Y</given-names>
</name>
<name>
<surname>Wilinska</surname> <given-names>ME</given-names>
</name>
<name>
<surname>Thabit</surname> <given-names>H</given-names>
</name>
<name>
<surname>Hovorka</surname> <given-names>R</given-names>
</name>
</person-group>. <article-title>Modeling day-to-day variability of glucose&#x2013;insulin regulation over 12-week home use of closed-loop insulin delivery</article-title>. <source>IEEE Trans Biomed Eng</source> (<year>2017</year>) <volume>64</volume>:<page-range>1412&#x2013;9</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1109/TBME.2016.2590498</pub-id>
</citation>
</ref>
<ref id="B37">
<label>37</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Rivadeneira</surname> <given-names>PS</given-names>
</name>
<name>
<surname>Ferramosca</surname> <given-names>A</given-names>
</name>
<name>
<surname>Gonz&#xe1;lez</surname> <given-names>AH</given-names>
</name>
</person-group>. <article-title>Control strategies for non-zero set-point regulation of linear impulsive systems</article-title>. <source>IEEE Trans Automatic Control</source> (<year>2018</year>) <volume>63</volume>:<fpage>2994</fpage>&#x2013;<lpage>3001</lpage>. doi:&#xa0;<pub-id pub-id-type="doi">10.1109/TAC.2017.2776598</pub-id>
</citation>
</ref>
<ref id="B38">
<label>38</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Goldfarb</surname> <given-names>D</given-names>
</name>
<name>
<surname>Idnani</surname> <given-names>A</given-names>
</name>
</person-group>. <article-title>A numerically stable dual method for solving strictly convex quadratic programs</article-title>. <source>Math Programming</source> (<year>1983</year>) <volume>27</volume>:<fpage>1</fpage>&#x2013;<lpage>33</lpage>. doi:&#xa0;<pub-id pub-id-type="doi">10.1007/BF02591962</pub-id>
</citation>
</ref>
<ref id="B39">
<label>39</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Stellato</surname> <given-names>B</given-names>
</name>
<name>
<surname>Banjac</surname> <given-names>G</given-names>
</name>
<name>
<surname>Goulart</surname> <given-names>P</given-names>
</name>
<name>
<surname>Bemporad</surname> <given-names>A</given-names>
</name>
<name>
<surname>Boyd</surname> <given-names>S</given-names>
</name>
</person-group>. <article-title>Osqp: an operator splitting solver for quadratic programs</article-title>. <source>Math Programming Comput</source> (<year>2020</year>) <volume>12</volume>:<page-range>637&#x2013;72</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1007/s12532-020-00179-2</pub-id>
</citation>
</ref>
<ref id="B40">
<label>40</label>
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Banjac</surname> <given-names>G</given-names>
</name>
<name>
<surname>Stellato</surname> <given-names>B</given-names>
</name>
<name>
<surname>Moehle</surname> <given-names>N</given-names>
</name>
<name>
<surname>Goulart</surname> <given-names>P</given-names>
</name>
<name>
<surname>Bemporad</surname> <given-names>A</given-names>
</name>
<name>
<surname>Boyd</surname> <given-names>S</given-names>
</name>
</person-group>. <source>Embedded code generation using the osqp solver. IEEE 56th Annual Conference on Decision and Control (CDC)</source>. <publisher-loc>Melbourne, Australia</publisher-loc>: <publisher-name>IEEEO</publisher-name> (<year>2017</year>). pp. <page-range>1906&#x2013;11</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1109/CDC.2017.8263928</pub-id>.</citation>
</ref>
<ref id="B41">
<label>41</label>
<citation citation-type="web">
<person-group person-group-type="author">
<collab>ARM</collab>
</person-group>. <source>ARM&#xae; Cortex&#xae;-A17 MPCore Processor Technical Reference Manual</source>. <publisher-name>Arm Limited</publisher-name> (<year>2015</year>). Available at: <uri xlink:href="https://developer.arm.com/documentation/ddi0535/c/introduction/product-documentation-and-design-flow/documentation?lang=en">https://developer.arm.com/documentation/ddi0535/c/introduction/product-documentation-and-design-flow/documentation?lang=en</uri>.</citation>
</ref>
<ref id="B42">
<label>42</label>
<citation citation-type="web">
<person-group person-group-type="author">
<collab>MathWorks</collab>
</person-group>. <source>Hardware-In-The-Loop Simulation</source>. <publisher-name>The MathWorks, Inc.</publisher-name> (<year>2021</year>). Available at: <uri xlink:href="https://la.mathworks.com/help/physmod/simscape/ug/what-is-hardware-in-the-loop-simulation.html">https://la.mathworks.com/help/physmod/simscape/ug/what-is-hardware-in-the-loop-simulation.html</uri>.</citation>
</ref>
<ref id="B43">
<label>43</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Vettoretti</surname> <given-names>M</given-names>
</name>
<name>
<surname>Facchinetti</surname> <given-names>A</given-names>
</name>
<name>
<surname>Sparacino</surname> <given-names>G</given-names>
</name>
<name>
<surname>Cobelli</surname> <given-names>C</given-names>
</name>
</person-group>. <article-title>Type-1 diabetes patient decision simulator for in silico testing safety and effectiveness of insulin treatments</article-title>. <source>IEEE Trans Biomed Eng</source> (<year>2018</year>) <volume>65</volume>:<page-range>1281&#x2013;90</page-range>. doi: <pub-id pub-id-type="doi">10.1109/TBME.2017.2746340</pub-id>
</citation>
</ref>
<ref id="B44">
<label>44</label>
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Dassau</surname> <given-names>E</given-names>
</name>
<name>
<surname>Palerm</surname> <given-names>CC</given-names>
</name>
<name>
<surname>Zisser</surname> <given-names>H</given-names>
</name>
<name>
<surname>Buckingham</surname> <given-names>BA</given-names>
</name>
<name>
<surname>Jovanovic</surname> <given-names>L</given-names>
</name>
<name>
<surname>Doyle</surname> <given-names>FJ</given-names>
</name>
</person-group>. <article-title>In silico evaluation platform for artificial pancreatic &#x3b2;-cell development - a dynamic simulator for closed-loop control with hardware-in-the-loop</article-title>. <source>Diabetes Technol Ther</source> (<year>2009</year>) <volume>11</volume>:<page-range>187&#x2013;94</page-range>. doi:&#xa0;<pub-id pub-id-type="doi">10.1089/dia.2008.0055</pub-id>
</citation>
</ref>
<ref id="B45">
<label>45</label>
<citation citation-type="web">
<person-group person-group-type="author">
<collab>PythonSF</collab>
</person-group>. <source>Floating Point Arithmetic: Issues and Limitations</source>. <publisher-name>Python Software Foundation</publisher-name> (<year>2021</year>). Available at: <uri xlink:href="https://docs.python.org/3/tutorial/floatingpoint.html">https://docs.python.org/3/tutorial/floatingpoint.html</uri>.</citation>
</ref>
<ref id="B46">
<label>46</label>
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Stellato</surname> <given-names>B</given-names>
</name>
<name>
<surname>Naik</surname> <given-names>VV</given-names>
</name>
<name>
<surname>Bemporad</surname> <given-names>A</given-names>
</name>
<name>
<surname>Goulart</surname> <given-names>P</given-names>
</name>
<name>
<surname>Boyd</surname> <given-names>S</given-names>
</name>
</person-group>. <source>Embedded mixed-integer quadratic optimization using the osqp solver. European Control Conference, ECC in press</source>. <publisher-name>Limassol, Cyprus: IEEE</publisher-name> (<year>2018</year>). pp. <fpage>1</fpage>&#x2013;<lpage>6</lpage>.</citation>
</ref>
</ref-list>
</back>
</article>