# Model Predictive Control of Non-Linear Systems Using Tensor Flow-Based Models
## 1 Introduction  
Nowadays, control systems have an important role in the automation industry due to the increasingly tight requirements posed over precision, performance, efficiency, and safety metrics of automatic systems. Moreover, they become ubiquitously present in many aspects of our daily life such as in housing heating systems, household appliances, among many other \"intelligent\" products that we rely on every day. While this \"intelligence\" is still far from accomplishing the same challenges humans can, the closed coupling between advanced control algorithms and good domain-specific process models has significantly expanded the application scenarios of autonomous computational systems. Model Predictive Control algorithms and the _TensorFlow_ variant of Artificial Neural Networks (ANN) have many proven concepts and advantages in their specific areas of application (control and system modeling respectively) but, up to the author's best knowledge have not been used in synergy. Model-based Predictive Control (MPC) is considered as an advanced technique of control and it is widely used in several industrial applications [1]. The concept of MPC does not refer to a specific control strategy. Instead, it is a set of control techniques (such as Dynamic Matrix Control (DMC) [2] and Generalized Predictive Control [3]) which makes use of a system's model to calculate the control actions over a time horizon by minimizing a cost function. Thus, the core of the MPC strategy is the mathematical model which describes the dynamics of the system to be controlled. MPC is a computationally expensive and time-consuming algorithm [4] which in the case of low-resource systems imposes a challenge. Because of that, it was firstly used in systems with slow dynamics [5, 6], due to its compatibility with the required control rate. Due to the tremendous technological evolution, computer processing units have become much faster allowing a larger number of operations per second, which facilitated using the MPC algorithm in more demanding systems. For example, [PERSON] [7] proposes an MPC controller to control a flotation column while other works use MPC controllers for systems with faster dynamics [8; 9]. On the other side, machine learning has been applied successfully in different research fields such as image classification [10], speech recognition [11], natural language processing [12] and system behavior prediction [13] due to its capability to build models that can learn non-linear mappings from data. ANNs cover a small subset of machine learning implementations being some of them openly debated and freely available to foster science advancement. Some examples of machine learning frameworks that have been gathering a great amount of interest from the community are TensorFlow [14], Keras [15], Caffe [16] while Ensmallen [17] has provided efficient mathematical optimization methods supporting the referred frameworks. More recently, new opportunities for machine learning are emerging in the domains of small portable devices using the Tensor Flow Lite implementation [18] and even in embedded systems and other devices with only kilobytes of memory using ported versions of Tensor Flow Lite implementation such as TinyML [19] or CMSIS-NN [20]. In this work it is used a framework created by [PERSON] ([[https://github.com/rayryeng](https://github.com/rayryeng)]([https://github.com/rayryeng](https://github.com/rayryeng))), _NeuralNetPlayground_[21], inspired by the _TensorFlow Neural Networks Playground_ interface, to build small deep learning systems in Matlab for regression and classification of non-linear data applications. These models, based on neural network structures, are trained during an initial open loop actuation of a non-linear process to learn its relevant dynamic features. After the model extraction procedure, they are integrated in an indirect closed loop controller synthesis procedure in order to manipulate the process according to a set of required operation conditions.