AnesthesiaGUIDE: a MATLAB tool to control the anesthesia

The goals of this paper are: (a) to investigate adaptive and fractional-order adaptive control algorithms for an automatic anesthesia process, using a closed-loop system, and (b) to develop an easy-to-use tool for MATLAB/Simulink to facilitate simulations for users with less knowledge about anesthesia and adaptive control. A model reference adaptive control structure was chosen for the entire system. First of all, to control the patient’s state during the surgery process, the patient mathematical model is useful, or even required for simulation studies. The pharmacokinetic/pharmacodynamics (PK/PD) model was determined using MATLAB’s SimBiology tool, starting from a previously available block diagram, and validated through simulation. Then, to achieve the desired control performances, two controllers are designed: a PI adaptive controller and a PI λ (PI-fractional) adaptive controller, using the MIT algorithm. The time response during anesthetic drug infusion for each patient can be plotted with the AnesthesiaGUIDE tool, which is also designed in MATLAB/Simulink. The tool was tested on data from 12 patients, subjected to general anesthesia, with successful results. Through this tool, the article provides a good opportunity for any user to experience with adaptive control for the anesthesia process.

Similar content being viewed by others

Implementation of Model Predictive Control for Closed Loop Control of Anesthesia

Chapter © 2013

Performance of Classical PID Tuning in the Automation Anesthesia Delivery

Chapter © 2022

Technical and clinical evaluation of a closed loop TIVA system with SEDLine TM spectral density monitoring: Multicentric prospective cohort study

Article Open access 09 January 2020

Avoid common mistakes on your manuscript.

1 Introduction

In medicine, general anesthesia plays a very important role during surgical interventions. General anesthesia is a drug-induced state and is achieved through the delivery of different substances which induce hypnosis, muscles relaxation and analgesia [1]. The process is considered a complex one and can be done manually or automatically. Even today, when the process is mostly done automatically, the anesthesiologist must continuously observe the patient’s state in order to react to not desirable effects caused by over or under-dosing [2].

In the case of automatic anesthesia, a closed-loop structure is used to control the depth of hypnosis (DOH) in real-time. The drug effect is measured, and its value is compared with a DOH reference value. The difference between these two, namely the control error, is taken into account by the controller so that the drug infusion is adjusted in such a way that the DOH reference value is timely achieved and the patient is safe during the surgery [2,3,4,5].

In the literature, many closed-loop anesthesia systems are proposed. Some relevant examples may be mentioned here: Ilyas proposed a sliding-mode control algorithm [6][6], Khaqan developed a nonlinear strategy [8], Navarro designed a fractional-order closed-loop model reference adaptive control based on a fractional-order model [9], Mendez used fuzzy predictive control techniques [10], Caiado investigated H-inf robust control [11], Reznanian developed a predictive controller [12], Usharani developed a PID controller strategy [16], Pasin performed a meta-analysis comparing closed-loop with manual drug delivery [17], Sopasakis built a fractional pharmacokinetics model [18], and Gonzalez-Cava proposed a study where an adaptive model deal simultaneously with the variabilities in the clinical response of the patients [19]. Actual trends and challenges are presented by Ghita in [20] and Zaouter in [21]. All the approaches guarantee a steady and safe hypnosis level.

In this paper, a model reference adaptive control (MRAC) system for anesthesia is developed based on two adaptive controllers: proportional–integrative (PI) and fractional proportional–integrative (PI λ ). The control performances achieved by the system are evaluated through simulations, and the efficiency of the proposed methods is proved. Also, a MATLAB/Simulink software tool named “AnesthesiaGUIDE” was developed in order to support researchers and students with less knowledge in MATLAB or adaptive control theory to experience and verify these methods.

The current paper is structured in four sections: i) the first section is the current introduction and the appropriate context setup, ii) in section II a new pharmacokinetic/pharmacodynamics (PK/PD) model is developed using MATLAB, iii) section III presents the control strategy with which the desired system’s performances are achieved, and finally iv) the conclusions are drawn in section IV.

2 The patient model

To derive the control algorithm for the patient’s state during a surgery process and to simulate the control system, a PK/PD patient’s mathematical model is necessary. In this work, a four-compartment model of the patient hypnotic state under propofol (hypnotic drug) infusion rate was developed using MATLAB’s SimBiology toolbox [13]. It is based on a block diagram available in many related papers from the literature [9,10,11,12,13,14].

The obtained differential equations describing the PK/PD model are similar to those presented by Schneider in [9,10,11,12,13,14]:

The first three equations represent the PK part of the model, while the last one is the PD part. The meaning of each parameter in (1) is detailed in Table 1.

figure 1

To validate the model presented in Eq. 3, the time responses for several patients to a constant input are plotted and analyzed (Fig. 2). The patients’ clinical parameters (i.e., age, weight, height, and gender) are taken from [14], and the values for the pharmacokinetic parameters are calculated considering the equations proposed by Schneider and presented in many papers [8, 9].

figure 2

The patients’ responses are different for the same propofol drug dose (50 mg/min). In the absence of a control loop [14], their time response is normal to tend to zero. The same behavior is obtained with the new model as well (Fig. 2), so the model can be validated.

Some patients have a higher sensitivity to the drug (the response decreases faster, e.g., patients 4 and 5), while others have less sensitivity (the response decreases slower, e.g., patients 1 and 2). Such behaviors are strongly influenced by the \(<\mathrm>_\) \(EC_\) and \(\gamma\) parameters. The new parameter introduced in the PK model can adjust the patients’ sensitivity to the drug administration, which might be considered an improvement (e.g., some responses do not decrease so faster).

3 MRAC-PI and MRAC- PI λ controllers design

To control the anesthesia, a model reference adaptive control structure is proposed (Fig. 3). This structure is preferred for two reasons. First, there are two loops that can assure the system’s control performances imposed by the reference model (chosen by the user) and the stability of the closed-loop system. Second, the patient’s behavior under drug infusion can be analyzed without recalculating the controller’s parameters for each patient; the values will be adapted automatically for a new patient by the adjustment mechanism in the system.

figure 3

To achieve this objective, i.e., to maintain the BIS level at 50, two adaptive control laws were proposed: an adaptive PI and an adaptive PIλ (PI fractional) control law, respectively. The two PI controllers are described by the following transfer functions:

where \(k_

\) and \(k_\) are the controller’s parameters and α is the fractional order [22].

In both cases, the controller’s parameters must be adapted by an adjustment mechanism so that the system’s performances are fulfilled. For the adjustment mechanism, the MIT rule (gradient method) is going to be used [22]:

$$\frac> = - \gamma \frac<\partial J><<\partial \theta >> = - \gamma^ \frac<\partial e><<\partial \theta >>$$

where \(<\uptheta >\) is a vector containing the controller’s parameters, \(\theta = [k_

,k_ ]\) ; \(\upgamma\) \(\gamma\) is the adaptation gain; \(J(\theta ) = (1/2)e^\) is the minimization criterion, chosen so that the controller’s parameters are adjusted in the direction of a negative gradient; \(e\) is the error between the system’s output and reference model output (very small).

Further on, the adjustment mechanism proposed in (6) is modified for the PI λ controller’s parameters (by introducing the fractional-order calculus [22]):

$$\frac>^<<\upalpha >> <\uptheta >>>>t^<<\upalpha >> >> = - <\upgamma >\frac<\partial J><<\partial <\uptheta >>> = - <\upgamma >e\frac<\partial e><<\partial <\uptheta >>>$$Considering the patient’s model, by its transfer function presented in (3), and the controller’s transfer functions presented in (4)-(5), the closed-loop transfer functions are:

$$G_ <0>(s) = \frac> = \frac (s^ + b_ s + b_ )(k_

s + k_ )>> <s + k_ )>>$$

Based on the Eqs. 8 – 9 and considering the required system’s performances (i.e., the overshot as small as possible and the settling time around 180 s), the transfer function of the reference model is chosen as follows:

Basically, the performances are imposed by the term (60 s + 1) of the denominator. All the other terms are chosen to have little or no influence over the system behavior. (The poles and zeros are far away from the dominant pole 1/60.)

Having Eq. 9 and considering the adjustment mechanism from Eq. 6, the variation of the controller’s parameters \(k_

\) and \(k_\) is [15]:

If the PI λ controller is used, the adjustment mechanism for \(k_

\) and \(k_\) parameters is similar to the one presented in Eq. 11. Hence,

Based on the reference model action and together with the proposed controllers, the system’s performances and the stability in closed loop are guaranteed, i.e., the BIS value to be around 50 and the error to lead to zero.

4 AnesthesiaGUIDE – a MATLAB tool

To test the behavior of each patient under drug infusion, a MATLAB tool, named “AnesthesiaGUIDE”, was developed. By using it, any user can experience the methods proposed in this paper and run simulations on the presented control scheme, less knowledge on MATLAB/Simulink and adaptive control theory being required.

The AnesthesiaGUIDE tool opens when the command “AnesthesiaGUIDE” is entered in the MATLAB’s command window. The main window of the application (Fig. 4) is divided into five sections:

figure 4

The application is available for download at https://ati.unitbv.ro/anesthesiaguide/, where a short description and tutorial are also available.

4.1 Simulations and results

By using this tool, the state evolution for several patients under anesthesia is analyzed. The tool was tested on the clinical parameters of 12 patients from [14], but for better visibility, the results are presented only for six patients.

Figure 5a shows the response of each patient under drug infusion ( \(\gamma_

= 5\) , \(\gamma_ = 0.00001\) ). For all patients, the induction phase achieves the value of 50 for the BIS index, in nearly 50 s. On some of the patients, the BIS time response has an oscillatory behavior (except patient 2). Then, the maintenance phase (steady-state regime) begins. The evolution of the error is depicted in Fig. 5b. The error leads to zero, so the stability in a closed-loop is guaranteed.

figure 5

In these simulations, the PI adaptive controller was used. The results show the controller’s capability to achieve and maintain the desired hypnosis level. The duration of the transient responses (induction phase), 50 s, is lesser than in other studies from the literature [7, 9, 12].

The results obtained when the PI λ adaptive controller is used are presented in Figs. 6 and 7, respectively. In Fig. 6a, all patients achieve the hypnosis level without any oscillations, which demonstrates the improved efficiency of the fractional-order controllers (with λ = 0.5 in these case). However, by increasing the value of λ (see Figs. 6b, c), the control performances are maintained while having small oscillations or overshoot.

figure 6

figure 7

By comparing the results obtained with the proposed controllers, we may conclude that better results are obtained when a PI λ controller is used. The IAE (Integral of Absolute Error) index is calculated to support this conclusion (Table 1). As a remark, better performance (small overshoot), means a smaller value of IAE. Other basic criteria to evaluate the system’s performances are the rise time and settling time. So, the ISE (Integral Square Error) and ITAE (Integral Time Absolute Error) indexes were also calculated (Table 2). In some cases (e.g., patient 1), checking the ISE and ITAE values, a good rise time but poor settling time was obtained with the PI controller and vice versa with the PI λ controller (λ = 0.75).

Table 2 The IAE, ISE, and ITAE values

5 Conclusions

The main contributions of this paper are to develop a new PK/PD model of the anesthesia process and to design a strategy to control it. Both are implemented in a tool called “AnesthesiaGUIDE”, which is made for use with MATLAB/ Simulink. This tool offers the user an easy way to understand and simulate the control system, despite having less knowledge of control theory or anesthesia. Using these two methods, the hypnosis level is achieved and maintained.

The tool can be improved by adding a performance analysis based on IAE, ISE, and ITAE criteria. So far, the tool cannot run simulations for several patients at once and some errors caused by setting wrong parameters are detectable while others not (e.g., if in the field ‘Age’ some letters are introduced, the user will be notified through an error message, but for the value 400 or –10 the simulation starts).

By deriving the PK/PD model from the block diagram in the literature using SimBiology, a new model was obtained that can adjust the patients’ sensitivity to the drug administration.

Having the differential equations of the PK/PD model, two adaptive strategies to control the system are proposed. The results show that the approach presented to control the anesthesia offers good control performances.

References

  1. Dumont GA. (2012) ClooseLoop of anesthesia - A review. 8th IFAC Symposium on Biological and Medical Systems. The Inter. Federation of Automatic Contro, Budapest, 29–31, pp 373–378
  2. Chang JJ, Kamil R, Syafiie S, Liam TA. (2014) Automation of Anesthesia. A Review on Multivariabile Control. J Clin Monitor Comput, pp 1–11
  3. Bibiani S, Dumont GA, Black I (2015) Cloosed-loop target- controlled infusion systems: stability and performance aspects. Mil Med 180:96–103 ArticleGoogle Scholar
  4. Heusden K, West N, Umedaly A, Ansermino JM, Merchant RN, Dumont GA. (2014) Safety, constraints and anti-windup in cloosed-loop anesthesia, Proceedings of the 19th World Congress. The International Federation of Automatic Control, Cape-Town, South Africa, 24–29, pp 6569–6574
  5. Heusden K, Yousefi M, Ansermino M, Dumont GA (2018) Cloosed-Loop MISO identification of propofol effect on blood pressure and deph of hypnosis. IEEE Trans Control Syst Technol, pp 99–108
  6. Iylias M, Khaqan A, Iqbal J, Riaz RA (2015) Regulation of phynosis in propofol anesthesia administration based on non-linear control strategy. Revista Brasiliera de Anestesiologia 2:122–130 Google Scholar
  7. Ilyas M, Iqbal J, Ahmad S, Uppal AA, Imtiaz WA, Riaz RA (2020) Hypnosis regulation in propofol anaesthesia employing super-twisting sliding mode control to compensate variability dynamics. IET Syst Biol 14(2):59–67 ArticleGoogle Scholar
  8. Khaqan A, Bilal M, Iylias M, Ijaz B, Riaz RA (2016) Control law design for propofol infusion to regulate deph of hypnosis: a nonlinear control strategy. Hindawi Publish Corpor Comput Math Methods Med 2016:1–10 ArticleGoogle Scholar
  9. Navarro-Guerrero G, Tang Y (2018) Fractional-order cloosed-loop model reference adaptive control for anesthesia. Algorithms 11(106):1–35 MATHGoogle Scholar
  10. Mendez JA, Marrero A, Reboso JA, Leon A (2016) Adaptive fuzzy predictive controller for anesthesia delivery. Control Eng Pract 2016:1–9 ArticleGoogle Scholar
  11. Caiado D, Lemos J, Costa B (2013) Robust control of anesthesia based on hinf control. Archiv Control Sci 23(1):41–59 ArticleGoogle Scholar
  12. Reznanian S, Towhidkhah F, Ghahramani N, Reznanian A (2011) Increasing robustness of the anesthesia process form difference patient’s delay using a state-space model predictive controller. Adv Control Eng Inform Sci 15:928–932 Google Scholar
  13. http://www.sbtoolbox.org/SBtoolbox/content/documentation/TUTOTIAL/TUTORIAL.pdf
  14. Ionescu C, Copot D, De Keyser R (2016) Modelling for control of deph of hypnosis – a patient friendly approach, IEEE International Conference on Systems, Man and Cybernetics (SMC), pp 2653–2658
  15. Simoni RF, Miziara LE, Esteves LO et al (2013) Comparative study between fast and slow induction of propofol given by target-controlled infusion: expected propofol concentration at the effect site. randomized controlled trial. Revista Brasiliera de Anestesiologia 2:99–103 Google Scholar
  16. Usharani S, Neelanarayanan V (2019) Control of anesthesia concentration using PID controller. Int J Innov Technol Exp Eng (IJITEE) 8:356–360 Google Scholar
  17. Pasin L, Nardelli P, Pintaudi M, Greco M et al (2017) Closed-loop delivery systems versus manually controlled administration of total iv anesthesia: a meta-analysis of randomized clinical trials. Anesth Analg 124(24):456–464 ArticleGoogle Scholar
  18. Sopasakis JP, Sarimveis H, Macheras P, Dokoumetzidis A (2018) Fractional calculus in pharmacokinetics. J Pharmacokinet Pharmacodynam 45(1):107–125 ArticleGoogle Scholar
  19. Gonzalez-Cava JM, Reboso JA, Calvo-Rolle JL, Mendez-Perez JA (2020) Adaptive drug interaction model to predict depth of anesthesia in the operating room. Biomed Signal Process Control 59:1–9 ArticleGoogle Scholar
  20. Ghita M, Neckebroek M, Muresan C, Copot D (2020) Closed-loop control of anesthesia: survey on actual trends. Chall Perspect, IEEE Access 8:206264–206279 ArticleGoogle Scholar
  21. Zaouter C, Joosten A, Rinehart J, Struys MMRF, Hemmerling TM (2020) Autonomous systems in anesthesia: where do we stand in 2020? A narrative review. Anesth Analg 130(5):1120–1132 ArticleGoogle Scholar
  22. Tepljakov A, Alagoz BB, Gonzalez E et al (2018) Model reference adaptive control scheme for retuning method based fractional-order PID control with disturbance rejection applied to closed-loop control of a magnetic levitation system. J Circuits, Syst Comput 27:1–29 ArticleGoogle Scholar

Funding

This work was supported by a grant of the Romanian National Authority for Scientific Research and Innovation, CCCDI-UEFISCDI, project number ERANET-PERMED-PeCaN, within PNCDI III.

Author information

Authors and Affiliations

  1. Automation and Information Technology Department, Transilvania University of Brasov, Brașov, Romania Simona Coman
  2. University of Bucharest, Bucharest, Romania Diana Iosif
  1. Simona Coman