LifeV
IonicLuoRudyI.cpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  @file
29  @brief Ionic model Luo-Rudy I
30  @date 01-2013
31  @author Simone Rossi <simone.rossi@epfl.ch>
32 
33  @contributors
34  @mantainer Simone Rossi <simone.rossi@epfl.ch>
35  @last update 01-2013
36  */
37 
38 
39 #include <lifev/electrophysiology/solver/IonicModels/IonicLuoRudyI.hpp>
40 
41 
42 namespace LifeV
43 {
44 
45 // ===================================================
46 //! Constructors
47 // ===================================================
48 IonicLuoRudyI::IonicLuoRudyI() :
49  super ( 8 , 6 ),
50  M_ENa ( 54.4 ),
51  M_gNa ( 23.0 ),
52  M_gsi ( 0.09 ),
53  M_K0 ( 5.4 ),
54  M_EK ( -77 ),
55  M_EK1 ( -87.26),
56  M_EKp ( M_EK1 ),
57  M_gKp ( 0.0183),
58  M_gb ( 0.03921)
59 {
60  M_gK = computeGK (M_K0);
61  M_gK1 = computeGK1 (M_K0);
62 
63  //V
64  M_restingConditions.at (0) = -84.0;
65  //m
66  M_restingConditions.at (1) = minf ( M_restingConditions.at (0) );
67  //h
68  M_restingConditions.at (2) = hinf ( M_restingConditions.at (0) );
69  //j
70  M_restingConditions.at (3) = jinf ( M_restingConditions.at (0) );
71  //d
72  M_restingConditions.at (4) = dinf ( M_restingConditions.at (0) );
73  //f
74  M_restingConditions.at (5) = finf ( M_restingConditions.at (0) );
75  //X
76  M_restingConditions.at (6) = Xinf ( M_restingConditions.at (0) );
77  //Ca
78  M_restingConditions.at (7) = 2e-4;
79 }
80 
81 IonicLuoRudyI::IonicLuoRudyI ( Teuchos::ParameterList& parameterList ) :
82  super ( 8, 6 )
83 {
84  M_ENa = parameterList.get ("ENa", 54.4 );
85  M_gNa = parameterList.get ("gNa", 23.3 );
86  M_gsi = parameterList.get ("gsi", 0.09 );
87  M_K0 = parameterList.get ("K0", 5.4 );
88  M_EK = parameterList.get ("EK", -77.0 );
89  M_EK1 = parameterList.get ("EK1", -87.26 );
90  M_EKp = parameterList.get ("EKp", -87.26 );
91  M_gKp = parameterList.get ("gKp", 0.0183 );
92  M_gb = parameterList.get ("gb", 0.03921 );
93 
94  M_gK = computeGK (M_K0);
95  M_gK1 = computeGK1 (M_K0);
96 
97  //V
98  M_restingConditions.at (0) = parameterList.get ("V0", -84.0 );
99  //m
100  M_restingConditions.at (1) = minf ( M_restingConditions.at (0) );
101  //h
102  M_restingConditions.at (2) = hinf ( M_restingConditions.at (0) );
103  //j
104  M_restingConditions.at (3) = jinf ( M_restingConditions.at (0) );
105  //d
106  M_restingConditions.at (4) = dinf ( M_restingConditions.at (0) );
107  //f
108  M_restingConditions.at (5) = finf ( M_restingConditions.at (0) );
109  //X
110  M_restingConditions.at (6) = Xinf ( M_restingConditions.at (0) );
111  //Ca
112  M_restingConditions.at (7) = parameterList.get ("Ca0", 2e-4 );
113 }
114 
115 IonicLuoRudyI::IonicLuoRudyI ( const IonicLuoRudyI& model )
116 {
117  M_ENa = model.M_ENa;
118  M_gNa = model.M_gNa;
119  M_gsi = model.M_gsi;
120  M_K0 = model.M_K0;
121  M_EK = model.M_EK;
122  M_EK1 = model.M_EK1;
123  M_EKp = model.M_EKp;
124  M_gKp = model.M_gKp;
125  M_gb = model.M_gb;
126 
127  M_gK = computeGK (M_K0);
128  M_gK1 = computeGK1 (M_K0);
129  M_numberOfEquations = model.M_numberOfEquations;
130  M_numberOfGatingVariables = model.M_numberOfGatingVariables;
131  M_restingConditions = model.M_restingConditions;
132 
133 }
134 
135 // ===================================================
136 //! Operator
137 // ===================================================
138 IonicLuoRudyI& IonicLuoRudyI::operator= ( const IonicLuoRudyI& model )
139 {
140  M_ENa = model.M_ENa;
141  M_gNa = model.M_gNa;
142  M_gsi = model.M_gsi;
143  M_K0 = model.M_K0;
144  M_EK = model.M_EK;
145  M_EK1 = model.M_EK1;
146  M_EKp = model.M_EKp;
147  M_gKp = model.M_gKp;
148  M_gb = model.M_gb;
149 
150  M_gK = computeGK (M_K0);
151  M_gK1 = computeGK1 (M_K0);
152  M_numberOfEquations = model.M_numberOfEquations;
153  M_numberOfGatingVariables = model.M_numberOfGatingVariables;
154  M_restingConditions = model.M_restingConditions;
155 
156  return *this;
157 }
158 
159 
160 // ===================================================
161 //! Methods
162 // ===================================================
163 void IonicLuoRudyI::computeGatingRhs ( const std::vector<Real>& v,
164  std::vector<Real>& rhs )
165 {
166  Real V = v[0];
167  Real m = v[1];
168  Real h = v[2];
169  Real j = v[3];
170  Real d = v[4];
171  Real f = v[5];
172  Real X = v[6];
173  Real Ca = v[7];
174 
175  //m
176  rhs[0] = dm (V, m);
177  //h
178  rhs[1] = dh (V, h);
179  //j
180  rhs[2] = dj (V, j);
181  //d
182  rhs[3] = dd (V, d);
183  //f
184  rhs[4] = df (V, f);
185  //X
186  rhs[5] = dX (V, X);
187  //Ca
188  rhs[6] = dCa (V, d, f, Ca);
189 }
190 
191 void IonicLuoRudyI::computeNonGatingRhs ( const std::vector<Real>& v,
192  std::vector<Real>& rhs )
193 {
194  Real V = v[0];
195  Real d = v[4];
196  Real f = v[5];
197  Real Ca = v[7];
198 
199  //Ca
200  rhs[0] = dCa (V, d, f, Ca);
201 }
202 
203 void IonicLuoRudyI::computeRhs ( const std::vector<Real>& v,
204  std::vector<Real>& rhs )
205 {
206  Real V = v[0];
207  Real m = v[1];
208  Real h = v[2];
209  Real j = v[3];
210  Real d = v[4];
211  Real f = v[5];
212  Real X = v[6];
213  Real Ca = v[7];
214 
215  //V
216  rhs[0] = - Itot (V, m , h , j , d, f, X, Ca);
217  //m
218  rhs[1] = dm (V, m);
219  //h
220  rhs[2] = dh (V, h);
221  //j
222  rhs[3] = dj (V, j);
223  //d
224  rhs[4] = dd (V, d);
225  //f
226  rhs[5] = df (V, f);
227  //X
228  rhs[6] = dX (V, X);
229  //Ca
230  rhs[7] = dCa (V, d, f, Ca);
231 }
232 
233 void IonicLuoRudyI::computeGatingVariablesWithRushLarsen ( std::vector<Real>& v, const Real dt )
234 {
235  Real V = v[0];
236  Real m = v[1];
237  Real h = v[2];
238  Real j = v[3];
239  Real d = v[4];
240  Real f = v[5];
241  Real X = v[6];
242 
243  v[1] = minf (V) - ( minf (V) - m ) * std::exp (- dt / tm (V) );
244  v[2] = hinf (V) - ( hinf (V) - h ) * std::exp (- dt / th (V) );
245  v[3] = jinf (V) - ( jinf (V) - j ) * std::exp (- dt / tj (V) );
246  v[4] = dinf (V) - ( dinf (V) - d ) * std::exp (- dt / td (V) );
247  v[5] = finf (V) - ( finf (V) - f ) * std::exp (- dt / tf (V) );
248  v[6] = Xinf (V) - ( Xinf (V) - X ) * std::exp (- dt / tX (V) );
249 
250 }
251 
252 Real IonicLuoRudyI::computeLocalPotentialRhs ( const std::vector<Real>& v )
253 {
254  Real dPotential (0.0);
255 
256  Real V = v[0];
257  Real m = v[1];
258  Real h = v[2];
259  Real j = v[3];
260  Real d = v[4];
261  Real f = v[5];
262  Real X = v[6];
263  Real Ca = v[7];
264 
265  dPotential = - Itot (V, m , h , j , d, f, X, Ca);
266 
267  return dPotential;
268 }
269 
270 
271 void IonicLuoRudyI::showMe()
272 {
273  std::cout << "\n\n************************************";
274  std::cout << "\n\tHi, I'm the Luo Rudy Phase I model";
275 
276  std::cout << "\nENa: " << M_ENa;
277  std::cout << "\ngNa: " << M_gNa;
278  std::cout << "\ngsi: " << M_gsi;
279  std::cout << "\nK0: " << M_K0;
280  std::cout << "\nEK: " << M_EK;
281  std::cout << "\nEK1: " << M_EK1;
282  std::cout << "\nEKp: " << M_EKp;
283  std::cout << "\ngKp: " << M_gKp;
284  std::cout << "\ngb: " << M_gb;
285  std::cout << "\n************************************\n\n";
286 }
287 
288 
289 }
void updateInverseJacobian(const UInt &iQuadPt)
double Real
Generic real data.
Definition: LifeV.hpp:175