A Machine Learning Algorithm That Experiences the Evolutionary Algorithm’s Predictions—An Application to Optimal Control
Abstract
:1. Introduction
- -
- The controller acquires the process’s current state and makes optimal predictions to establish the current optimal control values.
- -
- The controller embeds a PM (for example, a set of algebraic and differential equations) to compute the predictions via the PM’s numerical integration.
- -
- The controller organizes the shifting of the prediction horizon.
A Machine Learning Algorithm Extending the Applicability of the EA Predictions
- Realistic datasets apprehending the optimal behaviour of the couple (EA and PM);
- Appropriate ML models.
- What data do we need to capture the optimal behaviour of the couple (EA and PM)?
- How do we generate the datasets for the ML algorithm?
- What ML model can be used to design an appropriate controller (we will name it ML controller)?
- The interesting issue itself which is to find an ML model experiencing the datasets generated by an EA (or another metaheuristic), trying to capture the latter’s optimal behaviour.
- The dataset’s construction as a dynamic trace of the EA predictor, aggregating the trajectories and CPs.
- The dataset extraction for each sampling period as a premise to find a temporally distributed ML model.
- The design procedure for the ML controller and all associated algorithms (simulation and models’ construction algorithms).
- The outstanding decrease in the ML controller’s execution time.
2. Optimal Control Using Evolutionary Algorithms
2.1. Optimal Control Problems with a Final Cost
2.1.1. Process Model
2.1.2. Constraints
2.1.3. Cost Function
2.1.4. An Example of OCP with a Final Cost
2.2. A Discrete-Time Solution Based on EAs
3. Controller Based on Machine Learning
3.1. The General Description of the Proposed Method
- The initial process’s state is input data for the EA.
- The prediction horizon is the same: H − k.
- The PM is the same.
- The M simulations use the same EA.
- Implement a program to simulate the closed loop functioning over the control horizon (H) using the controller based on the EA. To simplify the presentation, we will call it ControlLoop_EA in the sequel. The output data are the quasi-optimal trajectory and its associated control profile ( and ).
- Repeat M times the module ControlLoop_EA to generate and save M quasi-optimal trajectories and their control profiles.
- Extract, for each step k, datasets similar to Table 1 using the data saved at step 2.
- Determine the machine learning model (for example, the set of functions ) experiencing the M trajectories and control profiles.
- Implement the new controller based on ML. It will be called ML controller in the sequel.
- 6.
- Write a simulation program called ControlLoop_ML for the closed loop working with the new controller. This simulation will test the feasibility of the proposed method, the quality of the quasi-optimal solution, the performance index, and the execution time of the new controller.
3.2. Dataset Generation for Machine Learning Model
3.2.1. The Simulation of the Closed-Loop System Based on EA Predictions
3.2.2. Aggregation of Datasets concerning M Optimal Evolutions of the Closed Loop
3.2.3. Extraction of Datasets Characterizing Each Sampling Period
3.3. Construction of Machine Learning Models
Algorithm 1. The structure of the controller’s algorithm using linear regression functions. | |
1 | Get the current value of the state vector, X(k); /* Initialize */ |
2 | /* see Equation (14) */ |
3 | Send towards the Process. |
4 | Wait for the next sampling period. |
3.3.1. Models with Linear Terms for Each State Variable
Algorithm 2. The pseudocode of the models’ construction. | |
/* This pseudocode describes the training and testing of the linear models set */ | |
Input: cell arrays DATAKTrain, DATAKTest | |
Output: matrix COEFF (), cell array MODEL{} storing objects that | |
are the linear models | |
1 | for k = 0…H − 1. |
2 | datakTrain DATAKTrain{k}; /* Recover the dataset from the cell array if it was saved in a file */ |
3 | datakTest DATAKTest{k}; /* Recover the dataset from the cell array if it was saved in a file */ |
4 | mdlfitting_to_data(datakTrain); /* Create the linear regression model that fits datakTrain */ |
5 | #display mdl; |
6 | coef(:)get_the_coefficients(mdl) |
7 | COEFF(k,:) coef(:); /* save the coefficients in the corresponding line of matrix COEFF*/ |
8 | MODEL(k,1)mdl; |
9 | uPred fpredict(mdl, datakTest) /* The predicted control values are stored in the vector uPred */ |
10 | # Represent in the same drawing the values of uPred and datakTask’s last column for comparison. |
11 | end. |
3.3.2. Models Constructed via Stepwise Regression
4. Simulation of the Control-Loop System Equipped with the ML controller
Algorithm 3. The pseudocode of the control loop simulation using linear regression functions. | |
ControlLoop_ML (MODEL, X0) | |
/* This pseudocode describes the simulation of the closed loop that uses the proposed controller (the linear models set ) */ | |
Input: MODEL, | |
X0: the initial process’s state. | |
Output: The vector uML (1, H) representing the quasi-optimal CP, | |
the matrix State (H + 1, n) representing the quasi-optimal trajectory. | |
1 | # Initializations: technological bounds umin, umax; |
2 | # The matrix State will store , k = 0, …, H – 1. Initially, it is put to zero. |
3 | State (1, :) X0 |
4 | for k = 0…H − 1. |
5 | mdl MODEL{k}; /* mdl is a linear regression model */ |
6 | uML(k) feval(mdl, X0(1), X0(2), …, X0(n)); |
7 | # Limit to umin or umax the value of uML(k). |
8 | X0step_PP_RH(uML(k), X0) /* Determine the new state the process evolves when the control value uML(k) is applied. */; |
9 | State(k + 1,:) X0. |
10 | end. |
11 | return uML and State |
The Controller’s Execution Time
5. Discussion
- The issue statement oneself: To find an ML model experiencing the datasets generated by the couple (EA and PM), trying to capture its optimal behaviour. An EA is a product of computational intelligence. This link between two “intelligent” entities is interesting; further developments can be derived from this “equivalence”. The same issue can be considered when instead of EA is another metaheuristic.
- The dataset’s construction as a dynamic trace of the EA predictor by aggregating the trajectories and CPs. The number M is a procedure’s parameter established according to the process complexity. The dynamic trace must include couples (state, optimal control value) spread throughout the evolution space. In this way, the ML model could generalize well.
- The dataset extraction for each sampling period, which is a premise to find an ML model for each k.
- The outstanding decrease in the ML controller’s execution time.
- The design procedure for the ML controller and all associated algorithms (simulation and models’ construction algorithms).
- The ML model is split at the level of each sampling period; a single regression function is the current model;
- A regression function has a very simple expression, which is, in fact, just the control law;
- The PM’s numerical integration is totally avoided.
6. Conclusions
- -
- The controller’s design procedure is feasible using only offline simulations of the closed loop (with EA and PM). The real process states’ evolution is not needed in this phase. All we need is a large dataset that captures the response of the EA predictor in different states and times, regardless of if the state belongs to a real or simulated process. The EA predictor acts in the same way because it uses only the PM in both situations.
- -
- The regression functions are expressed straightforwardly by simple formulas, which are actually the control laws for each sampling period.
- -
- The ML controller works very well in closed-loop mode; it generalizes accurately when the controller obtains the real process states.
- -
- The controller’s execution time decreases remarkably.
Supplementary Materials
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A
The Prediction Function Using an EA
Appendix B
The Models’ Construction Script
k | C0 | C1 | C2 | C3 | C4 | C5 |
---|---|---|---|---|---|---|
0 | −38.079 | 0 | 0 | 14.128 | 6.0244 | −6.0264 |
1 | 5.6291 | −1.3608 × 107 | 2.4367 × 106 | −3.7392 | −0.47639 | 1.139 |
2 | −38.33 | 3.0713 × 105 | 2.2759 × 105 | 21.679 | 1.5663 | 1.8422 |
3 | −28.268 | −40,144 | 4487.7 | 14.638 | 1.1171 | 1.2135 |
4 | −29.163 | 1.6973 × 105 | −1.6184 × 105 | 14.311 | 1.2206 | 0.63983 |
5 | −88.374 | 95,097 | 1.0768 × 105 | 40.145 | 4.0721 | 0.78088 |
6 | −25.715 | 3.5858 × 105 | −3.7572 × 105 | 13.047 | 1.5373 | −1.0067 |
7 | −62.516 | −4.657 × 105 | 4.4453 × 105 | 29.336 | 4.0186 | −2.0782 |
8 | 45.254 | −1.387 × 107 | 1.3915 × 107 | −13.454 | −0.83017 | −2.415 |
9 | 504.78 | −2.211 × 106 | 2.2891 × 106 | −192.32 | −23.957 | −1.8747 |
10 | −236.04 | −82.588 | 11.879 | 95.084 | 12.898 | −1.3842 |
11 | −147.92 | 0.58548 | 0.29874 | 57.825 | 7.5075 | −0.34759 |
12 | 93.46 | −0.37731 | 0.76193 | −35.138 | −4.7889 | 0.094402 |
13 | 34.849 | −1.0111 | 0.66035 | −13.353 | −0.79003 | 0.1234 |
14 | 4.0848 | −0.30413 | 0.29959 | −1.6444 | −0.43335 | 0.11348 |
Appendix C
Implementation of the Stepwise Strategy
Appendix D
Execution Time
Appendix E
The ML controller’s Capacity to Reject Noises Affecting the Process State
Control Profile | J |
---|---|
uML1 = [0.1570 0.2926 0.0000 0.8799 0.5285 0.8301 1.1906 1.4888 1.6225 2.0000 0.0894 0.8711 0.9350 0.9830 1.2488] | 29.6884 |
uML2 = [0.1570 0.2842 0.3744 0.3296 0.6528 0.7238 1.2591 1.4624 1.5555 2.0000 0.1898 0.8700 0.9106 0.9412 1.1815] | 28.4537 |
uML3 = [0.1570 0.2831 0.0873 0.7395 0.5383 0.7105 1.2914 1.4879 1.6041 1.9905 0.0962 0.8693 0.8938 0.9029 1.1856] | 31.8093 |
- -
- The controller succeeded in keeping the stability, but the state evolution changed the look compared to Figure 12b.
- -
- The value is generally smaller than and has different values for different simulations because the noise has random values.
- -
- Technological aspects must be considered when deciding whether or not the controller works acceptably.
References
- Siarry, P. Metaheuristics; Springer: Berlin/Heidelberg, Germany, 2016; ISBN 978-3-319-45403-0. [Google Scholar]
- Talbi, E.G. Metaheuristics—From Design to Implementation; Wiley: Hoboken, NJ, USA, 2009; ISBN 978-0-470-27858-1. [Google Scholar]
- Kruse, R.; Borgelt, C.; Braune, C.; Mostaghim, S.; Steinbrecher, M. Computational Intelligence—A Methodological Introduction, 2nd ed.; Springer: Berlin/Heidelberg, Germany, 2016. [Google Scholar]
- Faber, R.; Jockenhövelb, T.; Tsatsaronis, G. Dynamic optimization with simulated annealing. Comput. Chem. Eng. 2005, 29, 273–290. [Google Scholar] [CrossRef]
- Onwubolu, G.; Babu, B.V. New Optimization Techniques in Engineering; Springer: Berlin/Heidelberg, Germany, 2004. [Google Scholar]
- Valadi, J.; Siarry, P. Applications of Metaheuristics in Process Engineering; Springer International Publishing: Berlin/Heidelberg, Germany, 2014; pp. 1–39. [Google Scholar] [CrossRef]
- Minzu, V.; Riahi, S.; Rusu, E. Optimal control of an ultraviolet water disinfection system. Appl. Sci. 2021, 11, 2638. [Google Scholar] [CrossRef]
- Minzu, V.; Ifrim, G.; Arama, I. Control of Microalgae Growth in Artificially Lighted Photobioreactors Using Metaheuristic-Based Predictions. Sensors 2021, 21, 8065. [Google Scholar] [CrossRef] [PubMed]
- Abraham, A.; Jain, L.; Goldberg, R. Evolutionary Multiobjective Optimization—Theoretical Advances and Applications; Springer: Berlin/Heidelberg, Germany, 2005; ISBN 1-85233-787-7. [Google Scholar]
- Hu, X.B.; Chen, W.H. Genetic algorithm based on receding horizon control for arrival sequencing and scheduling. Eng. Appl. Artif. Intell. 2005, 18, 633–642. [Google Scholar] [CrossRef]
- Hu, X.B.; Chen, W.H. Genetic algorithm based on receding horizon control for real-time implementations in dynamic environments. In Proceedings of the 16th Triennial World Congress, Prague, Czech Republic, 4–8 July 2005; Elsevier IFAC Publications: Amsterdam, The Netherlands, 2005. [Google Scholar]
- Mayne, D.Q.; Michalska, H. Receding Horizon Control of Nonlinear Systems. IEEE Trans. Autom. Control 1990, 35, 814–824. [Google Scholar] [CrossRef]
- Attia, S.A.; Alamir, M.; De Wit, C.C. Voltage Collapse Avoidance in Power Systems: A Receding Horizon Approach. Intell. Autom. Soft Comput. 2006, 12, 9–22. [Google Scholar] [CrossRef]
- Hiskens, I.A.; Gong, B. Voltage Stability Enhancement Via Model Predictive Control of Load. Intell. Autom. Soft Comput. 2006, 12, 117–124. [Google Scholar] [CrossRef]
- Zheng, T. (Ed.) Model Predictive Control; Sciyo: Rijeka, Croatia, 2010; ISBN 978-953-307-102-2. [Google Scholar]
- Christofides, P.D.; Scattolini, R.; de la Pena, D.M.; Liu, J. Distributed model predictive control: A tutorial review and future research directions. Comput. Chem. Eng. 2013, 51, 21–41. [Google Scholar] [CrossRef]
- Qin, S.J.; Badgwell, T.A. A survey of industrial model predictive control technology. Control Eng. Pract. 2003, 11, 733–764. [Google Scholar] [CrossRef]
- Yang, Y.; Lin, X.; Miao, Z.; Yuan, X.; Wang, Y. Predictive Control Strategy Based on Extreme Learning Machine for Path-Tracking of Autonomous Mobile Robot. Intell. Autom. Soft Comput. 2014, 21, 1–19. [Google Scholar] [CrossRef]
- Lopez-Francol, C. Robot Pose Estimation Based on Visual Information and Particle Swarm Optimization. Intell. Autom. Soft Comput. 2018, 24, 431–442. [Google Scholar] [CrossRef]
- Goggos, V.; King, R. Evolutionary predictive control. Comput. Chem. Eng. 1996, 20 (Suppl. S2), S817–S822. [Google Scholar] [CrossRef]
- Sarimveis, H.; Bafas, G. Fuzzy model predictive control of nonlinear processes using genetic algorithms. Fuzzy Sets Syst. 2003, 139, 59–80. [Google Scholar] [CrossRef]
- Venkateswarlu, C.; Reddy, A.D. Nonlinear model predictive control of reactive distillation based on stochastic optimization. Ind. Eng. Chem. Res. 2008, 47, 6949–6960. [Google Scholar] [CrossRef]
- Blanco, T.B.; Willems, P.; Chiang, P.-K.; Haverbeke, N.; Berlamont, J.; De Moor, B. Flood regulation using nonlinear model predictive control. Control Eng. Pract. 2010, 18, 1147–1157. [Google Scholar] [CrossRef]
- Chiang, P.-K.; Willems, P. Combine Evolutionary Optimization with Model Predictive Control in Real-time Flood Control of a River System. Water Resour. Manag. 2015, 29, 2527–2542. [Google Scholar] [CrossRef]
- Minzu, V.; Serbencu, A. Systematic Procedure for Optimal Controller Implementation Using Metaheuristic Algorithms. Intell. Autom. Soft Comput. 2020, 26, 663–677. [Google Scholar] [CrossRef]
- Mînzu, V.; Georgescu, L.; Rusu, E. Predictions Based on Evolutionary Algorithms Using Predefined Control Profiles. Electronics 2022, 11, 1682. [Google Scholar] [CrossRef]
- Goodfellow, I.; Bengio, Y.; Courville, A. Machine Learning Basics. In Deep Learning; The MIT Press: Cambridge, MA, USA, 2016; pp. 95–161. ISBN 978-0262035613. [Google Scholar]
- Zou, S.; Chu, C.; Shen, N.; Ren, J. Healthcare Cost Prediction Based on Hybrid Machine Learning Algorithms. Mathematics 2023, 11, 4778. [Google Scholar] [CrossRef]
- Cuadrado, D.; Valls, A.; Riaño, D. Predicting Intensive Care Unit Patients’ Discharge Date with a Hybrid Machine Learning Model That Combines Length of Stay and Days to Discharge. Mathematics 2023, 11, 4773. [Google Scholar] [CrossRef]
- Albahli, S.; Irtaza, A.; Nazir, T.; Mehmood, A.; Alkhalifah, A.; Albattah, W. A Machine Learning Method for Prediction of Stock Market Using Real-Time Twitter Data. Electronics 2022, 11, 3414. [Google Scholar] [CrossRef]
- Wilson, C.; Marchetti, F.; Di Carlo, M.; Riccardi, A.; Minisci, E. Classifying Intelligence in Machines: A Taxonomy of Intelligent Control. Robotics 2020, 9, 64. [Google Scholar] [CrossRef]
- Banga, J.R.; Balsa-Canto, E.; Moles, C.G.; Alonso, A.A. Dynamic optimization of bioprocesses: Efficient and robust numerical strategies. J. Biotechnol. 2005, 117, 407–419. [Google Scholar] [CrossRef] [PubMed]
- Balsa-Canto, E.; Banga, J.R.; Alonso, A.A.; Vassiliadis, V.S. Dynamic optimization of chemical and biochemical processes using restricted second-order information. Comput. Chem. Eng. 2001, 25, 539–546. [Google Scholar] [CrossRef]
- Newbold, P.; Carlson, W.L.; Thorne, B. Multiple Regression. In Statistics for Business and Economics, 6th ed.; Pfaltzgraff, M., Bradley, A., Eds.; Pearson Education, Inc.: Upper Saddle River, NJ, USA, 2007; pp. 454–537. [Google Scholar]
- Shi, H.; Zhang, X.; Gao, Y.; Wang, S.; Ning, Y. Robust Total Least Squares Estimation Method for Uncertain Linear Regression Model. Mathematics 2023, 11, 4354. [Google Scholar] [CrossRef]
- Goodfellow, I.; Bengio, Y.; Courville, A. Example: Linear Regression. In Deep Learning; The MIT Press: Cambridge, MA, USA, 2016; pp. 104–113. ISBN 978-0262035613. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and neither the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
XT | UT |
---|---|
…… | …… |
k | fk(X) | k | fk(X) |
---|---|---|---|
0 | fk = −10.449 + 10.606∙x2 | 8 | fk = 4.3452 − 0.44551 x5 |
1 | fk = 0.72997 − 0.09299∙x4 | 9 | fk = 36.628 − 8.1574∙x2 − 2.5122 x5 |
2 | fk = −14.476 + 3.0317∙x3 + 1.3432∙x5 + 4.9049∙x3∙x5 | 10 | fk = 4.2061 + 713.02∙x2 − 0.41558∙x5 − 95.461∙x2∙x5 |
3 | fk = −1.5603 + 1.4141∙x2 | 11 | fk = 0.87113 − 0.60908∙x1 |
4 | fk = −1.7596 + 1.552∙x2 | 12 | fk = 1.0149 − 0.30622∙x1 |
5 | fk = −2.351 + 1.9328∙x2 | 13 | fk = 1.2692 − 0.33849∙x1 |
6 | fk = 4.4274 − 0.9024∙x5 | 14 | fk = −0.19244 − 0.41509∙x1 + 0.41057∙x2 + 0.10083∙x5 |
7 | fk = 4.8791 − 0.72412∙x5 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Mînzu, V.; Arama, I. A Machine Learning Algorithm That Experiences the Evolutionary Algorithm’s Predictions—An Application to Optimal Control. Mathematics 2024, 12, 187. https://doi.org/10.3390/math12020187
Mînzu V, Arama I. A Machine Learning Algorithm That Experiences the Evolutionary Algorithm’s Predictions—An Application to Optimal Control. Mathematics. 2024; 12(2):187. https://doi.org/10.3390/math12020187
Chicago/Turabian StyleMînzu, Viorel, and Iulian Arama. 2024. "A Machine Learning Algorithm That Experiences the Evolutionary Algorithm’s Predictions—An Application to Optimal Control" Mathematics 12, no. 2: 187. https://doi.org/10.3390/math12020187
APA StyleMînzu, V., & Arama, I. (2024). A Machine Learning Algorithm That Experiences the Evolutionary Algorithm’s Predictions—An Application to Optimal Control. Mathematics, 12(2), 187. https://doi.org/10.3390/math12020187