Keywords

1 Introduction

Several ionic models are available to describe the evolution of the electrical potential across cardiac cell membranes. These models usually read as a systems of coupled highly nonlinear differential equations with many adjustable parameters. The adjustment of parameters becomes increasingly important to be able to personalise these models using medical data (see for instance [9, 10]) or to compare models with each other in the best possible way. It is not easy to study the combined effect of varying the parameters and the literature is usually not too explicit on the way the parameters are adjusted in ionic models. Moreover, methods are not available to check in a systematic way if two models could provide a similar solution (e.g. same recording of the potential at a cell over time), for instance when parameters are well adjusted in one model to fit the other model.

Parameter adjustment is possible with simpler ionic models using asymptotic formula connecting the parameters with the phase durations [7, 10, 11]. The conductance can be adjusted to the conduction velocity (CV) using Eikonal equations as in [10]. Very few attempts have been made to address the adjustment of the ionic model parameters or the conductance using fully nonlinear models. We are aware of the very recent paper [5] where a genetic algorithm was used to build a cell-specific cardiac electrophysiology model and [6] where simulated annealing is used to compare two ionic models.

This paper proposes numerical methods to optimally adjust the parameters in ionic models, in particular when these models involve terms (ionic currents or gating source terms) that are not continuous or stiff in the state variables. Our method is based on the numerical solution of an optimal control problem with a least-square objective function. Three types of least-square functions will be used. The first one attempts to fit the main features of the cardiac action potential (AP), namely the action potential duration (APD), the depolarization time (DT), recovery time (RT), etc. The second function attempts to fit the trans-membrane potential predicted by the model to experimental recording on a single cell. The third least-square function fits the CV predicted by the monodomain model to an experimental value.

We will illustrate the efficiency of the method for the Mitchell-Schaeffer model [7], which is a simple two variables ionic model with a limited set of parameters and one discontinuity in the r.h.s. of the ODE for the gating variable. Our methodology is not limited to this model. Numerical results are presented, in particular model fitting to experimental AP measurements obtained through an optical fluorescence imaging technique.

2 Mathematical Models

2.1 Mitchell-Schaeffer Model

As one particular example where the proposed parameter identification technique can be applied, we consider the Mitchell-Schaeffer (MS) two-variable model [7]. This model describes the dynamics of the trans-membrane potential u in the myocardium and a gating variable v representing in a lumped way the opening and closing of ionic channels controlling the passage of ions across the cell membranes. Here we will consider two situations, either the 0D model for a single cell (no space dependence of the variables u and v) or the monodomain model where spatial propagation is assumed in the myocardium.

Single-Cell Model: The dependent variables \(u=u(t)\) and \(v=v(t)\), \(t>0\), are solutions of:

$$\begin{aligned} \dfrac{du}{dt} = f(u,v) + I_{stim}(t),\quad \text {with} \quad f(u,v)=\frac{1}{\tau _{in}}vu^{2}(1-u) - \frac{1}{\tau _{out}}u, \end{aligned}$$
(1)
$$\begin{aligned} \dfrac{dv}{dt}= g(u,v),\quad \text {with} \quad g(u,v)={\left\{ \begin{array}{ll} \dfrac{1-v}{\tau _{open}}, \quad \text { if }\quad u< u_{gate}, \\ \\ \dfrac{-v}{\tau _{close}},\quad \text { if }\quad u\ge u_{gate}.\\ \end{array}\right. } \end{aligned}$$
(2)

The trans-membrane current f(uv) is the sum of the gated inward current \(vu^{2}(1-u)/\tau _{in}\) with time scale \(\tau _{in}\) that tends to depolarize the cardiac cell and the ungated current \(-u/\tau _{out}\) that tends to repolarize the cardiac cell with time scale \(\tau _{out}\). Finally, \(I_{stim}\) represent an external current produced by a stimulation electrode. The dynamics of the gating variable v depends on the threshold potential \(u_{gate}\) for the initiation of an action potential, and on two time constants, \(\tau _{open}\) and \(\tau _{close}\), respectively controlling the opening and closing of the gate. We set \(\tau = [\tau _{in}, \tau _{out}, \tau _{open}, \tau _{close}]\) to simplify notations. The functions f and g depend on the parameter \(\tau \). Eqs. (1)–(2) requires initial conditions \(u(0)=u_0\) and \(v(0)=v_0\), where \(u_0,v_0\in [0,1]\) are given.

Monodomain Model:

The dependent variables \(u=u(x,t)\) and \(v=v(x,t)\), \(x\in \varOmega \), \(t>0\), are solutions of:

$$\begin{aligned} \dfrac{ \partial u}{\partial t} - \nabla \cdot (\sigma \nabla u) = f(u,v) + I_{stim}(t), \end{aligned}$$
(3)
$$\begin{aligned} \dfrac{ \partial v}{\partial t}= g(u,v). \end{aligned}$$
(4)

The functions f and g are defined as for the single-cell MS model, except that the unknowns u and v depends also on the space variable x. The cardiac tissue constitutes the domain \(\varOmega \) where the equations are solved. The parameter \(\sigma \) is the conductance of the cardiac tissue, usually taken as a 2-tensor to represent the anisotropic conduction properties of the myocardium. In our test cases, we consider the 1D monodomain model where propagation is assumed to be in one spatial direction only (e.g. planar waves). In this case, \(\sigma \) is a scalar constant (e.g. conductance along the fibers). Eqs (3)–(4) come with initial and boundary conditions, here taken as homogeneous Neumann boundary conditions.

2.2 Optimal Control Problems

We introduce three different control problems. The first problem adjusts the parameter \(\tau \) for the single-cell MS model so that the durations of the four phases are close to known values, while the second one fits the trans-membrane potential u from the model to a recorded experimental potential \(\tilde{u}=\tilde{u}(t)\). The third problem adjusts the conductance \(\sigma \) of the monodomain model to match the speed of propagation of the AP.

Least Square Fit on the Phase Durations: Consider the phase durations \(\varDelta T_{i}^{*}\), \(i=1,2,3,4\), (i.e. DT, APD, RT and recovery phase duration) obtained experimentally. To identify the parameters \(\tau \) in the model (1)–(2), we introduce an optimization problem whose goal is to reduce the gap between the phase durations \(\varDelta T_{i}\) predicted by the model and the target durations \(\varDelta T_{i}^{*}\).

This optimization problem reads as: Find \(\tau ^{*}\) minimizing the following least square function

$$\begin{aligned} J(\tau ) =\frac{1}{2} \sum _{i=1}^{4}\omega _{i}(\varDelta T_{i}-\varDelta T_{i}^{*})^2, \end{aligned}$$
(5)

where \(\omega _{i}\ge 0,\) \(i=1,2,3,4\), are weight constants for varying the relative importance of each variable to adjust, u and v are solution of (1)–(2), the times \( T_{i}= T_{i}(\tau )\), \( T_{1}<T_{2}<\ldots <T_{5} \), are such that

$$\begin{aligned} {\left\{ \begin{array}{ll} u(T_{i})=\gamma _{i},\quad i = 1,3,4, \quad \gamma _{i} \quad \text {thresholds given}, \\ u(T_{2})=\max \limits _{t}(u(t)), \\ v(T_{5})=\gamma _{5},\quad \gamma _{5} \quad \text {given}. \end{array}\right. } \end{aligned}$$
(6)

We set \(\varDelta T_{i} =T_{i+1}-T_{i}\).

The thresholds \(\gamma _i\) are characteristic values of the potential u (or v for \(\gamma _5\)) indicating the beginning or the end of the phases. The values of the thresholds \(\gamma _{1}=0.13\), \(\gamma _{3}=0.5 \), \(\gamma _{4}=0.05 \) and \(\gamma _{5}=0.9\) are used for all our test cases. For instance, \(\gamma _1=0.13\) since \(u_{gate}=0.13\) is the threshold potential to initiate a depolarization. The maximum of the potential is reached at time \(t_2\), hence \(\varDelta T_1\) is the duration of the depolarization phase (DT). The threshold \(\gamma _3\) flags the end of the plateau, hence \(\varDelta T_2\) is the duration of the plateau (more or less the APD). The threshold \(\gamma _4\) is close to the equilibrium or rest value of the potential u, hence \(\varDelta T_3\) is the repolarization time. The threshold \(\gamma _5\) is used to flag the return of the recovery variable to equilibrium when the cell is excitable again. The time \(t_5\) thus corresponds to the end of the refractory period. We call \(\varDelta T_5\) the recovery period, which is nothing but the refractory period minus the APD.

A natural choice for making each square dimensionless in the function J is given by

$$\begin{aligned} \omega _{i} = \left( \dfrac{1}{\varDelta T_{i}^{*}}\right) ^{2}, i=1,2,3,4. \end{aligned}$$
(7)

Least Square Fit of the Potential: We change the least square function to adjust the potential \(u=u(t)\) predicted by the single-cell MS model to a given potential \(\tilde{u}=\tilde{u}(t)\), \(t\in [0,T]\) (measured or obtained with an other ionic model). This optimization problem reads as: Find \(\tau ^{*}\) minimizing

$$\begin{aligned} J(\tau ) = \dfrac{1}{2} \int _{0}^{T}\mid u(s,\tau ) - \tilde{u}(s)\mid ^{2} ds, \end{aligned}$$
(8)

where u and v are solution of (1)–(2) with parameters \(\tau \). It is no longer needed to set thresholds \(\gamma _i\), recover phase durations and wave speed. The connection between the parameter \(\tau \) and the objective function J is more direct, but still subject to the lack of regularity induced by the discontinuity in the function g. We successfully solved this optimization problem to fit various ionic models among each other (up to 3 variables and 8 parameters – not shown here). It is possible to add other least square terms to fit other variables.

Least Square Fit on the Wave Speed: Consider the wave speed \(c^{*}\) obtained experimentally. To identify the conductance \(\sigma \) in the model (3)–(4), we introduce an optimization problem whose goal is to reduce the gap between the speed of the wave c predicted by the model and the target wave speed \(c^{*}\). It is known from an asymptotic argument presented in [11] that the parameters in the 1D MS model are in one-to-one relation with the durations \(\varDelta T_{i}^{*}\) and wave speed \(c^{*}\). It thus makes sense to try to identify the conductance \(\sigma \) by matching the wave speed.

This optimization problem reads as: Find \(\sigma ^{*}\) minimizing the following least square function

$$\begin{aligned} J(\sigma ) =\frac{1}{2}(c-c^{*})^{2}, \end{aligned}$$
(9)

where u and v are solutions of (3)–(4), and the wave speed \(c=c(\sigma )\) is considered a function of \(\sigma \) only since the parameters \(\tau \) are assumed known from minimizing either (5) or (8). We calculate the wave speed from the solution of the model using

$$c=\dfrac{x_{2}-x_{1}}{t_{2}-t_{1}},$$

where \(t_1<t_2\) are the passage times of the wave at the points \(x_1<x_2\) given in the domain where the AP wave is propagated. At each point \(x_i\), the passage of the wave can be flagged by finding the smallest time \(t_i>0\) such that \(u(x_i,t_i)=\gamma _1\), with \(\gamma _1\) the threshold for the initiation of the AP given above.

2.3 Numerical Methods

The Eqs (1)–(2) are solved using the function ode in Scilab, which implements the Adams predictor-corrector method. The Eqs (3)–(4) are solved by discretizing with finite difference formulae in space and the second order semi-implicit backward differentiation formulae (SBDF2) in time [4]. Eq. (6) are solved using linear interpolation within time steps to ensure the accuracy of the times \(T_i\).

The function g is discontinuous in u, which eventually leads to a lack of regularity of the solution (uv) of (1)–(2) (similarly for (3)–(4)) and consequently of the function \(J=J(\tau )\). The derivatives of J with respect to \(\tau \) may not be well defined. Attempts with numerical differentiation of J and plots of the square terms in J showed that numerical derivatives do not converge when the steps in \(\tau \) are refined. Direct computations of the sensitivities \(\delta u\) and \(\delta v\) with respect to \(\tau \) by solving numerically the sensitivity ODEs for a regularized version of the MS model were not more successful. To avoid the computations of the sensitivities and the gradient of J with respect to \(\tau \) (or \(\sigma \)), we use non-differentiable optimization methods [2]. A two-step strategy was required to identify the parameters \(\tau ^{*}\) and \(\sigma ^{*}\). First, we solve the optimization problem (1)–(2)+(5)–(6) for \(\tau ^{*}\) using the Nelder-Mead method. Setting the parameters \(\tau ^{*}\) from this first step, we then solved the optimization problem (1)–(2)+(9) for \(\sigma ^{*}\) using the Golden Section method. We used the function fminsearch in Scilab that implements the Nelder-Mead method. We implemented our own script for the Golden Section method in Scilab.

Changing from one to an other least square function presented above is possible at no cost since the Nelder-Mead method requires only values of J at given iterates \(\tau _k\), and no derivatives of this function.

The optimization method used introduces a sensitivity to the initial guess of the parameters (or the initial interval for the Golden section method). If convergence is reached (e.g. measured in distance between consecutive iterates) but the value of the least-square function J is not small for the final iterate, the minimum is likely to be local only and new initial guesses must be attempted in the hope of getting a better fit. Asymptotic formula from [11] could be used to obtain initial guesses for the parameters \(\tau \) in the MS model. We used our experience with the fitted models as well as trial and error to find good initial guesses.

3 Numerical Results

3.1 Validation

To validate our approach, we tried to recover with the help of the Nelder-Mead method the value of the parameters \(\tau ^{*} = [0.3, 6, 130, 150]\) that correspond to \(J(\tau ^{*}) = 0\) for \(\varDelta T^{*} = [6.71, 251.48504, 34.311947, 270.42669]\), the phase durations obtained by solving the 0D MS with this \(\tau ^{*}\). We studied the behavior of the method varying the tolerance Tol and the initial parameter values \(\tau _{0}\), where the convergence criteria is given by

$$||\tau _{k+1}-\tau _{k}|| < Tol,$$

for two successive iterates \(\tau _{k}\) and \(\tau _{k+1}\). Table 1 shows the impact of varying Tol. NIter et NEval are the number of iterations of the Nelder-Mead method and the number of function evaluations, respectively. The global minimizer is reached with an accuracy of \(10^{-2}\), while the global minimum of J is accurate at \(10^{-10}\). Starting from \(\tau _{0} = [0.37, 7, 140, 160]\), the best value of \(\tau ^*\) achieved is \(\tau _{final}=[0.3413, 5.707, 132.41, 169.48 ]\) with \(J(\tau _{final}) = 0.7975322\) (table not shown here). Hence initial values \(\tau _{0}\) must be chosen carefully to ensure convergence to the global minimum. The value of \(J(\tau _{final})\) is a good measure of the fit (the closer to zero, the better!).

A similar validation test case was carried for recovering \(\sigma ^*\) with the Golden Section method, with similar conclusions on the sensitivity to the interval chosen to initialize the method.

Table 1. Sensitivity of Nelder-Mead method to Tol. \(\tau _{0}\) = [0.27, 5.8, 127, 140]
Table 2. Experimental durations (ms) and wave speed (m/s) for three tissues
Table 3. Results from the parameter identification in the 0D MS model

3.2 Application to Three Cardiac Tissues

We proceed now with an application of the methodology introduced above. Table 2 presents commonly accepted values of the phase durations and wave speed (see for instance [3]). Note that the recovery period corresponds in our approach to phase between the time when the potential u goes back to rest (end of the repolarization) and the time where the gating variable v goes back to rest (end of the refractory period). Table 3 shows the parameters \(\tau _{final}\) obtained by solving the control problem for the 0D model with the Nelder-Mead method, the value of the minimum \(J(\tau _{final})\) and the phase durations \(\varDelta T_{i}\) predicted by the MS model for these parameter values. Table 4 shows the conductance \(\sigma _{final}\) obtained by solving the control problem for the 1D model with the Golden Section method. Since we have a range of experimental conduction speeds, we obtained a range of possible conductances. This table also presents the conduction velocities and phase durations predicted by the 1D MS model using the parameters fitted with the two-step identification method. For the Purkinje fibers, we provide only values for \(c=2\) m/s. Larger speeds require a very large domain with a very fine numerical resolution for the fit to be reliable because of the fast moving and highly spread AP wave.

The fit is exceptionally good in both parameter identification steps, between the experimental phase durations and the ones predicted by both the 0D and 1D MS models. The same remark is valid for the conduction speed. A joint identification of \(\tau \) and \(\sigma \) could probably improve the fit, but the difficulty of getting initial values that lead to convergence of the Nelder-Mead method is avoided with the two-step method with a limited impact on the quality of the fit.

Table 4. Results from the parameter identification in the 1D MS model

3.3 Adjusting Models to Experimental Data

Data Acquisition. For experimental validation and mathematical model parameterization, action potentials waves were recorded using voltage-based optical fluorescence imaging, as described in [8]. Briefly, fluorescence dye (di4-ANEPPS) and mechanical uncoupler (to block contraction) were injected into coronary circulation of a healthy explanted swine heart connected to a Langendorff perfusion system. The optical dye was excited with green light (\(530\pm 20\) nm) via 150 W halogen source lamps. The emitted signals from the heart were filtered (\(> 610\) nm) and captured by a high-speed dual CCD system (MICAM02, BrainVision Inc. Japan) with 3.91 ms temporal resolution (256 frames/second). The field of view was \(184 \times 124\) pixels (\(12 \times 10\) cm), yielding an approximately 0.7mm spatial resolution. The temporal change in fluorescence signal intensity recorded at each pixel, gives directly the action potential waves. For fitting the models, we use the AP recorded at one pixel selected from an area in the left ventricle (LV) where tissue was homogeneously illuminated, and also both fluorescence signal and tissue perfusion were homogeneous. Notably, we did not average the optical fluorescence signal over a selected ROI in purpose, since this would result in a smoother AP wave form, particularly a smoother up-stroke (which can result in incorrect model parameters).

Fig. 1.
figure 1

A-P and MS models fitted to AP recorded by optical fluorescence

Model Fitting. The AP recorded by optical fluorescence were fitted with two different models, the MS model presented above and the Aliev-Panfilov (A-P) model [1]. The A-P model has 2 variables (a potential u and a gating variable v) and 5 adjustable parameters. The goal is to compare the quality of fit of the two models.

A single AP was isolated from a sequence of recorded AP. This AP was renormalized between 0 and 1 to obtain the potential \(\tilde{u}=\tilde{u}(t)\), \(t\in [0,1400]\) (in ms) required in the least square function (8). The Nelder-Mead method was used to solve the 0D parameter fitting problem (step 1 only). A single AP is triggered with different stimulation currents for the two models: a current lasting 50ms and starting at t = 100 ms is used for for the MS model, and a current lasting 20ms and starting at t = 105 ms for the A-P model. These stimulation currents were adjusted manually to ensure the best fit of the models. Figure 1 shows the solution (u and v) and the experimental potential. The MS model achieves a much better fit than the A-P model. This is seen by comparing the graphs and the value of the least square function that is 32 times smaller for the MS model.

No efforts were made to control the evolution of the variable v for both models, since this variable is not included in the least square function J. The result is that the duration of the recovery (and refractory) period is different for the two models. The A-P model gives a cell that is excitable again after 1000 ms (roughly), while the MS model predicts that more 1400 ms are required for this to occur. This situation could be improved by adding a term to control the variable v in the least square function, assuming that experimental data on the refractory period are available.

4 Conclusions and Perspectives

We provided a new framework for fitting electrophysiology model parameters based on control theory. Three least-square functions are proposed, allowing the adjustment of parameters in simple single-cell ionic models to fit either the durations of the various phases of the AP or the shape of the trans-membrane potential to experimental recording. The methodology can be extended to adjust the conductance in the monodomain model in order to fit an experimentally recorded CV. Differentiability of the ionic model is not required as no derivatives are computed. The method is thus potentially applicable to the many ionic models that lack differentiability (e.g. through jump functions included in those models). In its current form, the methodology is capable of fitting models with a modest number of parameters. So far, it has been tested and worked for models with up to 8 parameters (not shown here), but it may eventually work for models with a larger number of parameters as long as good initial guesses are available.

The accuracy of the fit is easily below \(1\%\) on the fitted AP phase durations in the single-cell MS model, except for the depolarization phase which is very short and thus subject to larger relative error (\(2-20\%\) – still below 1.5 ms in absolute error). The two-step approach allows a perfect fit of the CV while introducing a minimal extra error on the phase durations. The least-square function (8) gave a good fit of the trans-membrane potential predicted by the model to the potential recorded over time on a single cell. However, the fit for this latter is as good as a given ionic model can represent the data. For instance, the A-P model did not turn out to be as flexible as the MS model in representing the potential recorded by optical fluorescence imaging. The approach can definitely be used to sort out models in terms of their capability to reproduce a given AP, be it experimental or from an other ionic model, while using the optimal value in the parameter space.

Future applications of the methodology include fitting the CV in more complex situations and for adjusting the restitution properties of ionic models. The fact that no derivatives are required in the optimization method is particularly appealing for the latter. We will have to be careful in adjusting the conductance with spatially distributed data (e.g. with our optical imaging), as there is a limitation in the number of parameters that can be adjusted with the current approach. For instance, fitting the conductance at the 256 \(\times \) 256 pixels of our optical fluorescence image is out of reach of the proposed method. We acknowledge that the model parameters might be different in the right ventricle, RV (e.g. shorter APD). Thus, in the future we will investigate these parameters using optical signals recorded from RV. Furthermore, we will perform data fitting on 26 AHA segments (17 in the LV and 9 in the RV) as in [9].