00001 #ifndef _FaberRudy2000Version3Optimised
00002 #define _FaberRudy2000Version3Optimised
00003
00015 #include <cmath>
00016 #include <cassert>
00017 #include "AbstractCardiacCell.hpp"
00018 #include "Exception.hpp"
00019 #include "AbstractStimulusFunction.hpp"
00020 #include "OdeSystemInformation.hpp"
00021
00022 class FaberRudy2000Version3OptimisedLookupTables
00023 {
00024 public:
00025 static FaberRudy2000Version3OptimisedLookupTables* Instance()
00026 {
00027 if (mpInstance == NULL)
00028 {
00029 mpInstance = new FaberRudy2000Version3OptimisedLookupTables;
00030 }
00031 return mpInstance;
00032 }
00033
00034
00035
00036 inline double _lookup_0(unsigned i, double factor)
00037 {
00038 double y1 = _lookup_table_0[i][0];
00039 double y2 = _lookup_table_0[i+1][0];
00040 return y1 + (y2-y1)*factor;
00041 }
00042
00043 inline double _lookup_1(unsigned i, double factor)
00044 {
00045 double y1 = _lookup_table_0[i][1];
00046 double y2 = _lookup_table_0[i+1][1];
00047 return y1 + (y2-y1)*factor;
00048 }
00049
00050 inline double _lookup_2(unsigned i, double factor)
00051 {
00052 double y1 = _lookup_table_0[i][2];
00053 double y2 = _lookup_table_0[i+1][2];
00054 return y1 + (y2-y1)*factor;
00055 }
00056
00057 inline double _lookup_3(unsigned i, double factor)
00058 {
00059 double y1 = _lookup_table_0[i][3];
00060 double y2 = _lookup_table_0[i+1][3];
00061 return y1 + (y2-y1)*factor;
00062 }
00063
00064 inline double _lookup_4(unsigned i, double factor)
00065 {
00066 double y1 = _lookup_table_0[i][4];
00067 double y2 = _lookup_table_0[i+1][4];
00068 return y1 + (y2-y1)*factor;
00069 }
00070
00071 inline double _lookup_5(unsigned i, double factor)
00072 {
00073 double y1 = _lookup_table_0[i][5];
00074 double y2 = _lookup_table_0[i+1][5];
00075 return y1 + (y2-y1)*factor;
00076 }
00077
00078 inline double _lookup_6(unsigned i, double factor)
00079 {
00080 double y1 = _lookup_table_0[i][6];
00081 double y2 = _lookup_table_0[i+1][6];
00082 return y1 + (y2-y1)*factor;
00083 }
00084
00085 inline double _lookup_7(unsigned i, double factor)
00086 {
00087 double y1 = _lookup_table_0[i][7];
00088 double y2 = _lookup_table_0[i+1][7];
00089 return y1 + (y2-y1)*factor;
00090 }
00091
00092 inline double _lookup_8(unsigned i, double factor)
00093 {
00094 double y1 = _lookup_table_0[i][8];
00095 double y2 = _lookup_table_0[i+1][8];
00096 return y1 + (y2-y1)*factor;
00097 }
00098
00099 inline double _lookup_9(unsigned i, double factor)
00100 {
00101 double y1 = _lookup_table_0[i][9];
00102 double y2 = _lookup_table_0[i+1][9];
00103 return y1 + (y2-y1)*factor;
00104 }
00105
00106 inline double _lookup_10(unsigned i, double factor)
00107 {
00108 double y1 = _lookup_table_0[i][10];
00109 double y2 = _lookup_table_0[i+1][10];
00110 return y1 + (y2-y1)*factor;
00111 }
00112
00113 inline double _lookup_11(unsigned i, double factor)
00114 {
00115 double y1 = _lookup_table_0[i][11];
00116 double y2 = _lookup_table_0[i+1][11];
00117 return y1 + (y2-y1)*factor;
00118 }
00119
00120 inline double _lookup_12(unsigned i, double factor)
00121 {
00122 double y1 = _lookup_table_0[i][12];
00123 double y2 = _lookup_table_0[i+1][12];
00124 return y1 + (y2-y1)*factor;
00125 }
00126
00127 inline double _lookup_13(unsigned i, double factor)
00128 {
00129 double y1 = _lookup_table_0[i][13];
00130 double y2 = _lookup_table_0[i+1][13];
00131 return y1 + (y2-y1)*factor;
00132 }
00133
00134 inline double _lookup_14(unsigned i, double factor)
00135 {
00136 double y1 = _lookup_table_0[i][14];
00137 double y2 = _lookup_table_0[i+1][14];
00138 return y1 + (y2-y1)*factor;
00139 }
00140
00141 inline double _lookup_15(unsigned i, double factor)
00142 {
00143 double y1 = _lookup_table_0[i][15];
00144 double y2 = _lookup_table_0[i+1][15];
00145 return y1 + (y2-y1)*factor;
00146 }
00147
00148 inline double _lookup_16(unsigned i, double factor)
00149 {
00150 double y1 = _lookup_table_0[i][16];
00151 double y2 = _lookup_table_0[i+1][16];
00152 return y1 + (y2-y1)*factor;
00153 }
00154
00155 inline double _lookup_17(unsigned i, double factor)
00156 {
00157 double y1 = _lookup_table_0[i][17];
00158 double y2 = _lookup_table_0[i+1][17];
00159 return y1 + (y2-y1)*factor;
00160 }
00161
00162 inline double _lookup_18(unsigned i, double factor)
00163 {
00164 double y1 = _lookup_table_0[i][18];
00165 double y2 = _lookup_table_0[i+1][18];
00166 return y1 + (y2-y1)*factor;
00167 }
00168
00169 inline double _lookup_19(unsigned i, double factor)
00170 {
00171 double y1 = _lookup_table_0[i][19];
00172 double y2 = _lookup_table_0[i+1][19];
00173 return y1 + (y2-y1)*factor;
00174 }
00175
00176 inline double _lookup_20(unsigned i, double factor)
00177 {
00178 double y1 = _lookup_table_0[i][20];
00179 double y2 = _lookup_table_0[i+1][20];
00180 return y1 + (y2-y1)*factor;
00181 }
00182
00183 inline double _lookup_21(unsigned i, double factor)
00184 {
00185 double y1 = _lookup_table_0[i][21];
00186 double y2 = _lookup_table_0[i+1][21];
00187 return y1 + (y2-y1)*factor;
00188 }
00189
00190 inline double _lookup_22(unsigned i, double factor)
00191 {
00192 double y1 = _lookup_table_0[i][22];
00193 double y2 = _lookup_table_0[i+1][22];
00194 return y1 + (y2-y1)*factor;
00195 }
00196
00197 inline double _lookup_23(unsigned i, double factor)
00198 {
00199 double y1 = _lookup_table_0[i][23];
00200 double y2 = _lookup_table_0[i+1][23];
00201 return y1 + (y2-y1)*factor;
00202 }
00203
00204 inline double _lookup_24(unsigned i, double factor)
00205 {
00206 double y1 = _lookup_table_0[i][24];
00207 double y2 = _lookup_table_0[i+1][24];
00208 return y1 + (y2-y1)*factor;
00209 }
00210
00211 inline double _lookup_25(unsigned i, double factor)
00212 {
00213 double y1 = _lookup_table_0[i][25];
00214 double y2 = _lookup_table_0[i+1][25];
00215 return y1 + (y2-y1)*factor;
00216 }
00217
00218 inline double _lookup_26(unsigned i, double factor)
00219 {
00220 double y1 = _lookup_table_0[i][26];
00221 double y2 = _lookup_table_0[i+1][26];
00222 return y1 + (y2-y1)*factor;
00223 }
00224
00225 inline double _lookup_27(unsigned i, double factor)
00226 {
00227 double y1 = _lookup_table_0[i][27];
00228 double y2 = _lookup_table_0[i+1][27];
00229 return y1 + (y2-y1)*factor;
00230 }
00231
00232 inline double _lookup_28(unsigned i, double factor)
00233 {
00234 double y1 = _lookup_table_0[i][28];
00235 double y2 = _lookup_table_0[i+1][28];
00236 return y1 + (y2-y1)*factor;
00237 }
00238
00239 inline double _lookup_29(unsigned i, double factor)
00240 {
00241 double y1 = _lookup_table_0[i][29];
00242 double y2 = _lookup_table_0[i+1][29];
00243 return y1 + (y2-y1)*factor;
00244 }
00245
00246 inline double _lookup_30(unsigned i, double factor)
00247 {
00248 double y1 = _lookup_table_0[i][30];
00249 double y2 = _lookup_table_0[i+1][30];
00250 return y1 + (y2-y1)*factor;
00251 }
00252
00253 inline double _lookup_31(unsigned i, double factor)
00254 {
00255 double y1 = _lookup_table_0[i][31];
00256 double y2 = _lookup_table_0[i+1][31];
00257 return y1 + (y2-y1)*factor;
00258 }
00259
00260 inline double _lookup_32(unsigned i, double factor)
00261 {
00262 double y1 = _lookup_table_0[i][32];
00263 double y2 = _lookup_table_0[i+1][32];
00264 return y1 + (y2-y1)*factor;
00265 }
00266
00267 inline double _lookup_33(unsigned i, double factor)
00268 {
00269 double y1 = _lookup_table_0[i][33];
00270 double y2 = _lookup_table_0[i+1][33];
00271 return y1 + (y2-y1)*factor;
00272 }
00273
00274 inline double _lookup_34(unsigned i, double factor)
00275 {
00276 double y1 = _lookup_table_0[i][34];
00277 double y2 = _lookup_table_0[i+1][34];
00278 return y1 + (y2-y1)*factor;
00279 }
00280
00281 inline double _lookup_35(unsigned i, double factor)
00282 {
00283 double y1 = _lookup_table_0[i][35];
00284 double y2 = _lookup_table_0[i+1][35];
00285 return y1 + (y2-y1)*factor;
00286 }
00287
00288 inline double _lookup_36(unsigned i, double factor)
00289 {
00290 double y1 = _lookup_table_0[i][36];
00291 double y2 = _lookup_table_0[i+1][36];
00292 return y1 + (y2-y1)*factor;
00293 }
00294
00295 inline double _lookup_37(unsigned i, double factor)
00296 {
00297 double y1 = _lookup_table_0[i][37];
00298 double y2 = _lookup_table_0[i+1][37];
00299 return y1 + (y2-y1)*factor;
00300 }
00301
00302 inline double _lookup_38(unsigned i, double factor)
00303 {
00304 double y1 = _lookup_table_0[i][38];
00305 double y2 = _lookup_table_0[i+1][38];
00306 return y1 + (y2-y1)*factor;
00307 }
00308
00309
00310 protected:
00311 FaberRudy2000Version3OptimisedLookupTables(const FaberRudy2000Version3OptimisedLookupTables&);
00312 FaberRudy2000Version3OptimisedLookupTables& operator= (const FaberRudy2000Version3OptimisedLookupTables&);
00313 FaberRudy2000Version3OptimisedLookupTables()
00314 {
00315 assert(mpInstance == NULL);
00316 for (int i=0; i<20001; i++)
00317 {
00318 double var_membrane__V = -100.0001 + i*0.01;
00319 _lookup_table_0[i][0] = 80.0 * exp((-var_membrane__V) * 0.0909090909091);
00320 }
00321
00322 for (int i=0; i<20001; i++)
00323 {
00324 double var_membrane__V = -100.0001 + i*0.01;
00325 _lookup_table_0[i][1] = (var_membrane__V < -40.0) ? (135.0 * exp((80.0 + var_membrane__V) * -0.147058823529)) : 0.0;
00326 }
00327
00328 for (int i=0; i<20001; i++)
00329 {
00330 double var_membrane__V = -100.0001 + i*0.01;
00331 _lookup_table_0[i][2] = (var_membrane__V < -40.0) ? ((3560.0 * exp(0.079 * var_membrane__V)) + (310000000.0 * exp(0.35 * var_membrane__V))) : (1000.0 / (0.13 * (1.0 + exp((var_membrane__V + 10.66) * -0.0900900900901))));
00332 }
00333
00334 for (int i=0; i<20001; i++)
00335 {
00336 double var_membrane__V = -100.0001 + i*0.01;
00337 _lookup_table_0[i][3] = (var_membrane__V < -40.0) ? ((1000.0 * (-((127140.0 * exp(0.2444 * var_membrane__V)) + (3.474e-05 * exp( -0.04391 * var_membrane__V)))) * (var_membrane__V + 37.78)) / (1.0 + exp(0.311 * (var_membrane__V + 79.23)))) : 0.0;
00338 }
00339
00340 for (int i=0; i<20001; i++)
00341 {
00342 double var_membrane__V = -100.0001 + i*0.01;
00343 _lookup_table_0[i][4] = (var_membrane__V < -40.0) ? ((121.2 * exp( -0.01052 * var_membrane__V)) / (1.0 + exp( -0.1378 * (var_membrane__V + 40.14)))) : ((300.0 * exp( -2.535e-07 * var_membrane__V)) / (1.0 + exp( -0.1 * (var_membrane__V + 32.0))));
00344 }
00345
00346 for (int i=0; i<20001; i++)
00347 {
00348 double var_membrane__V = -100.0001 + i*0.01;
00349 _lookup_table_0[i][5] = exp((2.0 * var_membrane__V * 96485.0) * 3.87996927064e-07);
00350 }
00351
00352 for (int i=0; i<20001; i++)
00353 {
00354 double var_membrane__V = -100.0001 + i*0.01;
00355 _lookup_table_0[i][6] = exp((2.0 * var_membrane__V * 96485.0) * 3.87996927064e-07) - 1.0;
00356 }
00357
00358 for (int i=0; i<20001; i++)
00359 {
00360 double var_membrane__V = -100.0001 + i*0.01;
00361 _lookup_table_0[i][7] = exp((1.0 * var_membrane__V * 96485.0) * 3.87996927064e-07);
00362 }
00363
00364 for (int i=0; i<20001; i++)
00365 {
00366 double var_membrane__V = -100.0001 + i*0.01;
00367 _lookup_table_0[i][8] = exp((1.0 * var_membrane__V * 96485.0) * 3.87996927064e-07) - 1.0;
00368 }
00369
00370 for (int i=0; i<20001; i++)
00371 {
00372 double var_membrane__V = -100.0001 + i*0.01;
00373 _lookup_table_0[i][9] = exp((1.0 * var_membrane__V * 96485.0) * 3.87996927064e-07);
00374 }
00375
00376 for (int i=0; i<20001; i++)
00377 {
00378 double var_membrane__V = -100.0001 + i*0.01;
00379 _lookup_table_0[i][10] = exp((1.0 * var_membrane__V * 96485.0) * 3.87996927064e-07) - 1.0;
00380 }
00381
00382 for (int i=0; i<20001; i++)
00383 {
00384 double var_membrane__V = -100.0001 + i*0.01;
00385 _lookup_table_0[i][11] = (1.0 / (1.0 + exp((var_membrane__V + 32.0) * 0.125))) + (0.6 / (1.0 + exp((50.0 - var_membrane__V) * 0.05)));
00386 }
00387
00388 for (int i=0; i<20001; i++)
00389 {
00390 double var_membrane__V = -100.0001 + i*0.01;
00391 _lookup_table_0[i][12] = 0.001 / ((0.0197 * exp(-pow(0.0337 * (var_membrane__V + 10.0), 2.0))) + 0.02);
00392 }
00393
00394 for (int i=0; i<20001; i++)
00395 {
00396 double var_membrane__V = -100.0001 + i*0.01;
00397 _lookup_table_0[i][13] = 1.0 / (1.0 + exp((-(var_membrane__V + 14.0)) * 0.0925925925926));
00398 }
00399
00400 for (int i=0; i<20001; i++)
00401 {
00402 double var_membrane__V = -100.0001 + i*0.01;
00403 _lookup_table_0[i][14] = 0.0037 + (0.0061 / (1.0 + exp((var_membrane__V + 25.0) * 0.222222222222)));
00404 }
00405
00406 for (int i=0; i<20001; i++)
00407 {
00408 double var_membrane__V = -100.0001 + i*0.01;
00409 _lookup_table_0[i][15] = 1.0 / (1.0 + exp((var_membrane__V + 60.0) * 0.178571428571));
00410 }
00411
00412 for (int i=0; i<20001; i++)
00413 {
00414 double var_membrane__V = -100.0001 + i*0.01;
00415 _lookup_table_0[i][16] = 1.0 / (1.0 + exp((var_membrane__V + 9.0) * 0.0446428571429));
00416 }
00417
00418 for (int i=0; i<20001; i++)
00419 {
00420 double var_membrane__V = -100.0001 + i*0.01;
00421 _lookup_table_0[i][17] = 1.0 / (1.0 + exp((-(var_membrane__V + 21.5)) * 0.133333333333));
00422 }
00423
00424 for (int i=0; i<20001; i++)
00425 {
00426 double var_membrane__V = -100.0001 + i*0.01;
00427 _lookup_table_0[i][18] = 0.001 / (((0.00138 * (var_membrane__V + 14.2)) / (1.0 - exp( -0.123 * (var_membrane__V + 14.2)))) + ((0.00061 * (var_membrane__V + 38.9)) / (exp(0.145 * (var_membrane__V + 38.9)) - 1.0)));
00428 }
00429
00430 for (int i=0; i<20001; i++)
00431 {
00432 double var_membrane__V = -100.0001 + i*0.01;
00433 _lookup_table_0[i][19] = 1.0 / (1.0 + exp((-(var_membrane__V - 1.5)) * 0.059880239521));
00434 }
00435
00436 for (int i=0; i<20001; i++)
00437 {
00438 double var_membrane__V = -100.0001 + i*0.01;
00439 _lookup_table_0[i][20] = 0.001 / (((7.19e-05 * (var_membrane__V + 30.0)) / (1.0 - exp( -0.148 * (var_membrane__V + 30.0)))) + ((0.000131 * (var_membrane__V + 30.0)) / (exp(0.0687 * (var_membrane__V + 30.0)) - 1.0)));
00440 }
00441
00442 for (int i=0; i<20001; i++)
00443 {
00444 double var_membrane__V = -100.0001 + i*0.01;
00445 _lookup_table_0[i][21] = 1.0 / (1.0 + exp((-(var_membrane__V - 1.5)) * 0.059880239521));
00446 }
00447
00448 for (int i=0; i<20001; i++)
00449 {
00450 double var_membrane__V = -100.0001 + i*0.01;
00451 _lookup_table_0[i][22] = 0.004 / (((7.19e-05 * (var_membrane__V + 30.0)) / (1.0 - exp( -0.148 * (var_membrane__V + 30.0)))) + ((0.000131 * (var_membrane__V + 30.0)) / (exp(0.0687 * (var_membrane__V + 30.0)) - 1.0)));
00452 }
00453
00454 for (int i=0; i<20001; i++)
00455 {
00456 double var_membrane__V = -100.0001 + i*0.01;
00457 _lookup_table_0[i][23] = 1.0 / (1.0 + exp((7.488 - var_membrane__V) * 0.167224080268));
00458 }
00459
00460 for (int i=0; i<20001; i++)
00461 {
00462 double var_membrane__V = -100.0001 + i*0.01;
00463 _lookup_table_0[i][24] = 0.8 - (0.65 / (1.0 + exp((var_membrane__V + 125.0) * 0.0666666666667)));
00464 }
00465
00466 for (int i=0; i<20001; i++)
00467 {
00468 double var_membrane__V = -100.0001 + i*0.01;
00469 _lookup_table_0[i][25] = exp(var_membrane__V * 0.01);
00470 }
00471
00472 for (int i=0; i<20001; i++)
00473 {
00474 double var_membrane__V = -100.0001 + i*0.01;
00475 _lookup_table_0[i][26] = (10000.0 * exp((var_membrane__V - 40.0) * 0.04)) / (1.0 + exp((var_membrane__V - 40.0) * 0.04));
00476 }
00477
00478 for (int i=0; i<20001; i++)
00479 {
00480 double var_membrane__V = -100.0001 + i*0.01;
00481 _lookup_table_0[i][27] = (10000.0 * exp((-(var_membrane__V + 90.0)) * 0.04)) / (1.0 + exp((-(var_membrane__V + 90.0)) * 0.04));
00482 }
00483
00484 for (int i=0; i<20001; i++)
00485 {
00486 double var_membrane__V = -100.0001 + i*0.01;
00487 _lookup_table_0[i][28] = 15.0 / (1.0 + exp((var_membrane__V + 60.0) * 0.2));
00488 }
00489
00490 for (int i=0; i<20001; i++)
00491 {
00492 double var_membrane__V = -100.0001 + i*0.01;
00493 _lookup_table_0[i][29] = (100.0 * exp((var_membrane__V + 25.0) * 0.2)) / (1.0 + exp((var_membrane__V + 25.0) * 0.2));
00494 }
00495
00496 for (int i=0; i<20001; i++)
00497 {
00498 double var_membrane__V = -100.0001 + i*0.01;
00499 _lookup_table_0[i][30] = 2.25 * (1.0 / (1.0 + (0.1245 * exp(( -0.1 * var_membrane__V * 96485.0) * 3.87996927064e-07)) + (0.0365 * 0.872719796652 * exp(((-var_membrane__V) * 96485.0) * 3.87996927064e-07)))) * 1.0;
00500 }
00501
00502 for (int i=0; i<20001; i++)
00503 {
00504 double var_membrane__V = -100.0001 + i*0.01;
00505 _lookup_table_0[i][31] = exp((1.0 * var_membrane__V * 96485.0) * 3.87996927064e-07);
00506 }
00507
00508 for (int i=0; i<20001; i++)
00509 {
00510 double var_membrane__V = -100.0001 + i*0.01;
00511 _lookup_table_0[i][32] = exp((1.0 * var_membrane__V * 96485.0) * 3.87996927064e-07) - 1.0;
00512 }
00513
00514 for (int i=0; i<20001; i++)
00515 {
00516 double var_membrane__V = -100.0001 + i*0.01;
00517 _lookup_table_0[i][33] = exp((1.0 * var_membrane__V * 96485.0) * 3.87996927064e-07);
00518 }
00519
00520 for (int i=0; i<20001; i++)
00521 {
00522 double var_membrane__V = -100.0001 + i*0.01;
00523 _lookup_table_0[i][34] = exp((1.0 * var_membrane__V * 96485.0) * 3.87996927064e-07) - 1.0;
00524 }
00525
00526 for (int i=0; i<20001; i++)
00527 {
00528 double var_membrane__V = -100.0001 + i*0.01;
00529 _lookup_table_0[i][35] = exp(( -0.85 * var_membrane__V * 96485.0) * 3.87996927064e-07);
00530 }
00531
00532 for (int i=0; i<20001; i++)
00533 {
00534 double var_membrane__V = -100.0001 + i*0.01;
00535 _lookup_table_0[i][36] = exp((var_membrane__V * 96485.0) * 3.87996927064e-07);
00536 }
00537
00538 for (int i=0; i<20001; i++)
00539 {
00540 double var_membrane__V = -100.0001 + i*0.01;
00541 _lookup_table_0[i][37] = exp(( -0.85 * var_membrane__V * 96485.0) * 3.87996927064e-07);
00542 }
00543
00544 for (int i=0; i<20001; i++)
00545 {
00546 double var_membrane__V = -100.0001 + i*0.01;
00547 _lookup_table_0[i][38] = exp((var_membrane__V * 96485.0) * 3.87996927064e-07);
00548 }
00549
00550 }
00551 private:
00553 static FaberRudy2000Version3OptimisedLookupTables *mpInstance;
00554
00555 double _lookup_table_0[20001][39];
00556
00557 };
00558
00559 FaberRudy2000Version3OptimisedLookupTables* FaberRudy2000Version3OptimisedLookupTables::mpInstance = NULL;
00560
00561 class FaberRudy2000Version3Optimised : public AbstractCardiacCell
00562 {
00563 public:
00564 FaberRudy2000Version3Optimised(boost::shared_ptr<AbstractIvpOdeSolver> pSolver,
00565 boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus)
00566 : AbstractCardiacCell(pSolver, 25, 0, pIntracellularStimulus)
00567 {
00568
00569 mpSystemInfo = OdeSystemInformation<FaberRudy2000Version3Optimised>::Instance();
00570
00571 Init();
00572
00573 }
00574
00575 ~FaberRudy2000Version3Optimised(void)
00576 {
00577 }
00578
00579
00580 unsigned _table_index_0;
00581 double _factor_0;
00582
00583 double GetIIonic()
00584 {
00585 std::vector<double>& rY = rGetStateVariables();
00586 double var_membrane__V = rY[0];
00587
00588 double var_fast_sodium_current_m_gate__m = rY[1];
00589
00590 double var_fast_sodium_current_h_gate__h = rY[2];
00591
00592 double var_fast_sodium_current_j_gate__j = rY[3];
00593
00594 double var_L_type_Ca_channel_d_gate__d = rY[4];
00595
00596 double var_L_type_Ca_channel_f_gate__f = rY[5];
00597
00598 double var_T_type_Ca_channel_b_gate__b = rY[6];
00599
00600 double var_T_type_Ca_channel_g_gate__g = rY[7];
00601
00602 double var_rapid_delayed_rectifier_potassium_current_xr_gate__xr = rY[8];
00603
00604 double var_slow_delayed_rectifier_potassium_current_xs1_gate__xs1 = rY[9];
00605
00606 double var_slow_delayed_rectifier_potassium_current_xs2_gate__xs2 = rY[10];
00607
00608 double var_transient_outward_current_zdv_gate__zdv = rY[11];
00609
00610 double var_transient_outward_current_ydv_gate__ydv = rY[12];
00611
00612 double var_calcium_dynamics__Cai = rY[13];
00613
00614 double var_ionic_concentrations__Nai = rY[23];
00615
00616 double var_ionic_concentrations__Ki = rY[24];
00617
00618
00619
00620 #define COVERAGE_IGNORE
00621 if (var_membrane__V>99.9999 || var_membrane__V<-100.0001)
00622 EXCEPTION(DumpState("V outside lookup table range"));
00623 #undef COVERAGE_IGNORE
00624 double _offset_0 = var_membrane__V - -100.0001;
00625 double _offset_0_over_table_step = _offset_0 * 100.0;
00626 unsigned _table_index_0 = (unsigned) floor(_offset_0_over_table_step);
00627 double _factor_0 = _offset_0_over_table_step - _table_index_0;
00628
00629 double var_fast_sodium_current__E_Na = 26.7123387055 * log(132.0 / var_ionic_concentrations__Nai);
00630 double var_fast_sodium_current__i_Na = 16.0 * pow(var_fast_sodium_current_m_gate__m, 3.0) * var_fast_sodium_current_h_gate__h * var_fast_sodium_current_j_gate__j * (var_membrane__V - var_fast_sodium_current__E_Na);
00631 double var_membrane__i_Na = var_fast_sodium_current__i_Na;
00632 double var_L_type_Ca_channel_f_Ca_gate__f_Ca = 1.0 / (1.0 + (var_calcium_dynamics__Cai * 1666.66666667));
00633 double var_L_type_Ca_channel__i_CaCa = var_L_type_Ca_channel_d_gate__d * var_L_type_Ca_channel_f_gate__f * var_L_type_Ca_channel_f_Ca_gate__f_Ca * ((((0.00054 * 4.0 * var_membrane__V * 9309355225.0) * 3.87996927064e-07) * ((1.0 * var_calcium_dynamics__Cai * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_5(_table_index_0, _factor_0)) - 0.6138)) / FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_6(_table_index_0, _factor_0));
00634 double var_L_type_Ca_channel__i_CaNa = var_L_type_Ca_channel_d_gate__d * var_L_type_Ca_channel_f_gate__f * var_L_type_Ca_channel_f_Ca_gate__f_Ca * ((((6.75e-07 * 1.0 * var_membrane__V * 9309355225.0) * 3.87996927064e-07) * ((0.75 * var_ionic_concentrations__Nai * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_7(_table_index_0, _factor_0)) - 99.0)) / FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_8(_table_index_0, _factor_0));
00635 double var_L_type_Ca_channel__i_CaK = var_L_type_Ca_channel_d_gate__d * var_L_type_Ca_channel_f_gate__f * var_L_type_Ca_channel_f_Ca_gate__f_Ca * ((((1.93e-07 * 1.0 * var_membrane__V * 9309355225.0) * 3.87996927064e-07) * ((0.75 * var_ionic_concentrations__Ki * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_9(_table_index_0, _factor_0)) - 3.375)) / FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_10(_table_index_0, _factor_0));
00636 double var_L_type_Ca_channel__i_Ca_L = var_L_type_Ca_channel__i_CaCa + var_L_type_Ca_channel__i_CaK + var_L_type_Ca_channel__i_CaNa;
00637 double var_membrane__i_Ca_L = var_L_type_Ca_channel__i_Ca_L;
00638 double var_calcium_background_current__E_Ca = 13.3561693527 * log(1.8 / var_calcium_dynamics__Cai);
00639 double var_T_type_Ca_channel__i_Ca_T = 0.05 * var_T_type_Ca_channel_b_gate__b * var_T_type_Ca_channel_b_gate__b * var_T_type_Ca_channel_g_gate__g * (var_membrane__V - var_calcium_background_current__E_Ca);
00640 double var_membrane__i_Ca_T = var_T_type_Ca_channel__i_Ca_T;
00641 double var_time_independent_potassium_current__E_K = 26.7123387055 * log(4.5 / var_ionic_concentrations__Ki);
00642 double var_rapid_delayed_rectifier_potassium_current__i_Kr = 0.0238624460886 * var_rapid_delayed_rectifier_potassium_current_xr_gate__xr * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_16(_table_index_0, _factor_0) * (var_membrane__V - var_time_independent_potassium_current__E_K);
00643 double var_membrane__i_Kr = var_rapid_delayed_rectifier_potassium_current__i_Kr;
00644 double var_slow_delayed_rectifier_potassium_current__i_Ks = (0.433 * (1.0 + (0.6 / (1.0 + pow(3.8e-05 / var_calcium_dynamics__Cai, 1.4))))) * var_slow_delayed_rectifier_potassium_current_xs1_gate__xs1 * var_slow_delayed_rectifier_potassium_current_xs2_gate__xs2 * (var_membrane__V - (26.7123387055 * log(6.91956 / (var_ionic_concentrations__Ki + (0.01833 * var_ionic_concentrations__Nai)))));
00645 double var_membrane__i_Ks = var_slow_delayed_rectifier_potassium_current__i_Ks;
00646 double var_sodium_activated_potassium_current__i_K_Na = 0.0 * (0.85 / (1.0 + pow(66.0 / var_ionic_concentrations__Nai, 2.8))) * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_24(_table_index_0, _factor_0) * (var_membrane__V - var_time_independent_potassium_current__E_K);
00647 double var_membrane__i_K_Na = var_sodium_activated_potassium_current__i_K_Na;
00648 double var_ATP_sensitive_potassium_current__i_K_ATP = 2.75741043608e-08 * (var_membrane__V - var_time_independent_potassium_current__E_K);
00649 double var_membrane__i_K_ATP = var_ATP_sensitive_potassium_current__i_K_ATP;
00650 double var_transient_outward_current__i_to = 0.0 * pow(var_transient_outward_current_zdv_gate__zdv, 3.0) * var_transient_outward_current_ydv_gate__ydv * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_25(_table_index_0, _factor_0) * (var_membrane__V - var_time_independent_potassium_current__E_K);
00651 double var_membrane__i_to = var_transient_outward_current__i_to;
00652 double var_Na_Ca_exchanger__i_NaCa = (0.00025 * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_35(_table_index_0, _factor_0) * ((FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_36(_table_index_0, _factor_0) * pow(var_ionic_concentrations__Nai, 3.0) * 1.8) - (2299968.0 * var_calcium_dynamics__Cai))) / (1.0 + (0.0001 * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_37(_table_index_0, _factor_0) * ((FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_38(_table_index_0, _factor_0) * pow(var_ionic_concentrations__Nai, 3.0) * 1.8) + (2299968.0 * var_calcium_dynamics__Cai))));
00653 double var_membrane__i_NaCa = var_Na_Ca_exchanger__i_NaCa;
00654 double var_time_independent_potassium_current_K1_gate__alpha_K1 = 1020.0 / (1.0 + exp(0.2385 * ((var_membrane__V - var_time_independent_potassium_current__E_K) - 59.215)));
00655 double var_time_independent_potassium_current__i_K1 = 0.684653196881 * (var_time_independent_potassium_current_K1_gate__alpha_K1 / (var_time_independent_potassium_current_K1_gate__alpha_K1 + ((1000.0 * ((0.49124 * exp(0.08032 * ((var_membrane__V - var_time_independent_potassium_current__E_K) + 5.476))) + exp(0.06175 * ((var_membrane__V - var_time_independent_potassium_current__E_K) - 594.31)))) / (1.0 + exp( -0.5143 * ((var_membrane__V - var_time_independent_potassium_current__E_K) + 4.753)))))) * (var_membrane__V - var_time_independent_potassium_current__E_K);
00656 double var_membrane__i_K1 = var_time_independent_potassium_current__i_K1;
00657 double var_plateau_potassium_current__i_Kp = 0.00552 * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_23(_table_index_0, _factor_0) * (var_membrane__V - var_time_independent_potassium_current__E_K);
00658 double var_membrane__i_Kp = var_plateau_potassium_current__i_Kp;
00659 double var_sarcolemmal_calcium_pump__i_p_Ca = (1.15 * var_calcium_dynamics__Cai) / (0.0005 + var_calcium_dynamics__Cai);
00660 double var_membrane__i_p_Ca = var_sarcolemmal_calcium_pump__i_p_Ca;
00661 double var_sodium_background_current__i_Na_b = 0.004 * (var_membrane__V - var_fast_sodium_current__E_Na);
00662 double var_membrane__i_Na_b = var_sodium_background_current__i_Na_b;
00663 double var_calcium_background_current__i_Ca_b = 0.003016 * (var_membrane__V - var_calcium_background_current__E_Ca);
00664 double var_membrane__i_Ca_b = var_calcium_background_current__i_Ca_b;
00665 double var_sodium_potassium_pump__i_NaK = ((FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_30(_table_index_0, _factor_0) / (1.0 + pow(10.0 / var_ionic_concentrations__Nai, 2.0))) * 4.5) * 0.166666666667;
00666 double var_membrane__i_NaK = var_sodium_potassium_pump__i_NaK;
00667 double var_non_specific_calcium_activated_current__i_ns_Na = (((((0.0 * 1.0 * var_membrane__V * 9309355225.0) * 3.87996927064e-07) * ((0.75 * var_ionic_concentrations__Nai * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_31(_table_index_0, _factor_0)) - 99.0)) / FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_32(_table_index_0, _factor_0)) * 1.0) / (1.0 + pow(0.0012 / var_calcium_dynamics__Cai, 3.0));
00668 double var_non_specific_calcium_activated_current__i_ns_K = (((((0.0 * 1.0 * var_membrane__V * 9309355225.0) * 3.87996927064e-07) * ((0.75 * var_ionic_concentrations__Ki * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_33(_table_index_0, _factor_0)) - 3.375)) / FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_34(_table_index_0, _factor_0)) * 1.0) / (1.0 + pow(0.0012 / var_calcium_dynamics__Cai, 3.0));
00669 double var_non_specific_calcium_activated_current__i_ns_Ca = var_non_specific_calcium_activated_current__i_ns_Na + var_non_specific_calcium_activated_current__i_ns_K;
00670 double var_membrane__i_ns_Ca = var_non_specific_calcium_activated_current__i_ns_Ca;
00671
00672 return var_membrane__i_Na+var_membrane__i_Ca_L+var_membrane__i_Ca_T+var_membrane__i_Kr+var_membrane__i_Ks+var_membrane__i_K_Na+var_membrane__i_K_ATP+var_membrane__i_to+var_membrane__i_NaCa+var_membrane__i_K1+var_membrane__i_Kp+var_membrane__i_p_Ca+var_membrane__i_Na_b+var_membrane__i_Ca_b+var_membrane__i_NaK+var_membrane__i_ns_Ca;
00673 }
00674
00675 void EvaluateYDerivatives (
00676 double var_environment__time,
00677 const std::vector<double> &rY,
00678 std::vector<double> &rDY)
00679 {
00680
00681
00682 var_environment__time *= 1e-3;
00683 double var_membrane__V = rY[0];
00684
00685 double var_fast_sodium_current_m_gate__m = rY[1];
00686
00687 double var_fast_sodium_current_h_gate__h = rY[2];
00688
00689 double var_fast_sodium_current_j_gate__j = rY[3];
00690
00691 double var_L_type_Ca_channel_d_gate__d = rY[4];
00692
00693 double var_L_type_Ca_channel_f_gate__f = rY[5];
00694
00695 double var_T_type_Ca_channel_b_gate__b = rY[6];
00696
00697 double var_T_type_Ca_channel_g_gate__g = rY[7];
00698
00699 double var_rapid_delayed_rectifier_potassium_current_xr_gate__xr = rY[8];
00700
00701 double var_slow_delayed_rectifier_potassium_current_xs1_gate__xs1 = rY[9];
00702
00703 double var_slow_delayed_rectifier_potassium_current_xs2_gate__xs2 = rY[10];
00704
00705 double var_transient_outward_current_zdv_gate__zdv = rY[11];
00706
00707 double var_transient_outward_current_ydv_gate__ydv = rY[12];
00708
00709 double var_calcium_dynamics__Cai = rY[13];
00710
00711 double var_calcium_dynamics__Ca_JSR = rY[14];
00712
00713 double var_calcium_dynamics__Ca_NSR = rY[15];
00714
00715 double var_calcium_dynamics__APtrack = rY[16];
00716
00717 double var_calcium_dynamics__APtrack2 = rY[17];
00718
00719 double var_calcium_dynamics__APtrack3 = rY[18];
00720
00721 double var_calcium_dynamics__Cainfluxtrack = rY[19];
00722
00723 double var_calcium_dynamics__OVRLDtrack = rY[20];
00724
00725 double var_calcium_dynamics__OVRLDtrack2 = rY[21];
00726
00727 double var_calcium_dynamics__OVRLDtrack3 = rY[22];
00728
00729 double var_ionic_concentrations__Nai = rY[23];
00730
00731 double var_ionic_concentrations__Ki = rY[24];
00732
00733
00734
00735
00736 #define COVERAGE_IGNORE
00737 if (var_membrane__V>99.9999 || var_membrane__V<-100.0001)
00738 EXCEPTION(DumpState("V outside lookup table range"));
00739 #undef COVERAGE_IGNORE
00740 double _offset_0 = var_membrane__V - -100.0001;
00741 double _offset_0_over_table_step = _offset_0 * 100.0;
00742 unsigned _table_index_0 = (unsigned) floor(_offset_0_over_table_step);
00743 double _factor_0 = _offset_0_over_table_step - _table_index_0;
00744
00745
00746 double var_membrane__I_st = GetStimulus(var_environment__time*1000);
00747 double var_fast_sodium_current__E_Na = 26.7123387055 * log(132.0 / var_ionic_concentrations__Nai);
00748 double var_fast_sodium_current__i_Na = 16.0 * pow(var_fast_sodium_current_m_gate__m, 3.0) * var_fast_sodium_current_h_gate__h * var_fast_sodium_current_j_gate__j * (var_membrane__V - var_fast_sodium_current__E_Na);
00749 double var_membrane__i_Na = var_fast_sodium_current__i_Na;
00750 double var_L_type_Ca_channel_f_Ca_gate__f_Ca = 1.0 / (1.0 + (var_calcium_dynamics__Cai * 1666.66666667));
00751 double var_L_type_Ca_channel__i_CaCa = var_L_type_Ca_channel_d_gate__d * var_L_type_Ca_channel_f_gate__f * var_L_type_Ca_channel_f_Ca_gate__f_Ca * ((((0.00054 * 4.0 * var_membrane__V * 9309355225.0) * 3.87996927064e-07) * ((1.0 * var_calcium_dynamics__Cai * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_5(_table_index_0, _factor_0)) - 0.6138)) / FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_6(_table_index_0, _factor_0));
00752 double var_L_type_Ca_channel__i_CaNa = var_L_type_Ca_channel_d_gate__d * var_L_type_Ca_channel_f_gate__f * var_L_type_Ca_channel_f_Ca_gate__f_Ca * ((((6.75e-07 * 1.0 * var_membrane__V * 9309355225.0) * 3.87996927064e-07) * ((0.75 * var_ionic_concentrations__Nai * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_7(_table_index_0, _factor_0)) - 99.0)) / FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_8(_table_index_0, _factor_0));
00753 double var_L_type_Ca_channel__i_CaK = var_L_type_Ca_channel_d_gate__d * var_L_type_Ca_channel_f_gate__f * var_L_type_Ca_channel_f_Ca_gate__f_Ca * ((((1.93e-07 * 1.0 * var_membrane__V * 9309355225.0) * 3.87996927064e-07) * ((0.75 * var_ionic_concentrations__Ki * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_9(_table_index_0, _factor_0)) - 3.375)) / FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_10(_table_index_0, _factor_0));
00754 double var_L_type_Ca_channel__i_Ca_L = var_L_type_Ca_channel__i_CaCa + var_L_type_Ca_channel__i_CaK + var_L_type_Ca_channel__i_CaNa;
00755 double var_membrane__i_Ca_L = var_L_type_Ca_channel__i_Ca_L;
00756 double var_calcium_background_current__E_Ca = 13.3561693527 * log(1.8 / var_calcium_dynamics__Cai);
00757 double var_T_type_Ca_channel__i_Ca_T = 0.05 * var_T_type_Ca_channel_b_gate__b * var_T_type_Ca_channel_b_gate__b * var_T_type_Ca_channel_g_gate__g * (var_membrane__V - var_calcium_background_current__E_Ca);
00758 double var_membrane__i_Ca_T = var_T_type_Ca_channel__i_Ca_T;
00759 double var_time_independent_potassium_current__E_K = 26.7123387055 * log(4.5 / var_ionic_concentrations__Ki);
00760 double var_rapid_delayed_rectifier_potassium_current__i_Kr = 0.0238624460886 * var_rapid_delayed_rectifier_potassium_current_xr_gate__xr * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_16(_table_index_0, _factor_0) * (var_membrane__V - var_time_independent_potassium_current__E_K);
00761 double var_membrane__i_Kr = var_rapid_delayed_rectifier_potassium_current__i_Kr;
00762 double var_slow_delayed_rectifier_potassium_current__i_Ks = (0.433 * (1.0 + (0.6 / (1.0 + pow(3.8e-05 / var_calcium_dynamics__Cai, 1.4))))) * var_slow_delayed_rectifier_potassium_current_xs1_gate__xs1 * var_slow_delayed_rectifier_potassium_current_xs2_gate__xs2 * (var_membrane__V - (26.7123387055 * log(6.91956 / (var_ionic_concentrations__Ki + (0.01833 * var_ionic_concentrations__Nai)))));
00763 double var_membrane__i_Ks = var_slow_delayed_rectifier_potassium_current__i_Ks;
00764 double var_sodium_activated_potassium_current__i_K_Na = 0.0 * (0.85 / (1.0 + pow(66.0 / var_ionic_concentrations__Nai, 2.8))) * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_24(_table_index_0, _factor_0) * (var_membrane__V - var_time_independent_potassium_current__E_K);
00765 double var_membrane__i_K_Na = var_sodium_activated_potassium_current__i_K_Na;
00766 double var_ATP_sensitive_potassium_current__i_K_ATP = 2.75741043608e-08 * (var_membrane__V - var_time_independent_potassium_current__E_K);
00767 double var_membrane__i_K_ATP = var_ATP_sensitive_potassium_current__i_K_ATP;
00768 double var_transient_outward_current__i_to = 0.0 * pow(var_transient_outward_current_zdv_gate__zdv, 3.0) * var_transient_outward_current_ydv_gate__ydv * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_25(_table_index_0, _factor_0) * (var_membrane__V - var_time_independent_potassium_current__E_K);
00769 double var_membrane__i_to = var_transient_outward_current__i_to;
00770 double var_Na_Ca_exchanger__i_NaCa = (0.00025 * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_35(_table_index_0, _factor_0) * ((FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_36(_table_index_0, _factor_0) * pow(var_ionic_concentrations__Nai, 3.0) * 1.8) - (2299968.0 * var_calcium_dynamics__Cai))) / (1.0 + (0.0001 * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_37(_table_index_0, _factor_0) * ((FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_38(_table_index_0, _factor_0) * pow(var_ionic_concentrations__Nai, 3.0) * 1.8) + (2299968.0 * var_calcium_dynamics__Cai))));
00771 double var_membrane__i_NaCa = var_Na_Ca_exchanger__i_NaCa;
00772 double var_time_independent_potassium_current_K1_gate__alpha_K1 = 1020.0 / (1.0 + exp(0.2385 * ((var_membrane__V - var_time_independent_potassium_current__E_K) - 59.215)));
00773 double var_time_independent_potassium_current__i_K1 = 0.684653196881 * (var_time_independent_potassium_current_K1_gate__alpha_K1 / (var_time_independent_potassium_current_K1_gate__alpha_K1 + ((1000.0 * ((0.49124 * exp(0.08032 * ((var_membrane__V - var_time_independent_potassium_current__E_K) + 5.476))) + exp(0.06175 * ((var_membrane__V - var_time_independent_potassium_current__E_K) - 594.31)))) / (1.0 + exp( -0.5143 * ((var_membrane__V - var_time_independent_potassium_current__E_K) + 4.753)))))) * (var_membrane__V - var_time_independent_potassium_current__E_K);
00774 double var_membrane__i_K1 = var_time_independent_potassium_current__i_K1;
00775 double var_plateau_potassium_current__i_Kp = 0.00552 * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_23(_table_index_0, _factor_0) * (var_membrane__V - var_time_independent_potassium_current__E_K);
00776 double var_membrane__i_Kp = var_plateau_potassium_current__i_Kp;
00777 double var_sarcolemmal_calcium_pump__i_p_Ca = (1.15 * var_calcium_dynamics__Cai) / (0.0005 + var_calcium_dynamics__Cai);
00778 double var_membrane__i_p_Ca = var_sarcolemmal_calcium_pump__i_p_Ca;
00779 double var_sodium_background_current__i_Na_b = 0.004 * (var_membrane__V - var_fast_sodium_current__E_Na);
00780 double var_membrane__i_Na_b = var_sodium_background_current__i_Na_b;
00781 double var_calcium_background_current__i_Ca_b = 0.003016 * (var_membrane__V - var_calcium_background_current__E_Ca);
00782 double var_membrane__i_Ca_b = var_calcium_background_current__i_Ca_b;
00783 double var_sodium_potassium_pump__i_NaK = ((FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_30(_table_index_0, _factor_0) / (1.0 + pow(10.0 / var_ionic_concentrations__Nai, 2.0))) * 4.5) * 0.166666666667;
00784 double var_membrane__i_NaK = var_sodium_potassium_pump__i_NaK;
00785 double var_non_specific_calcium_activated_current__i_ns_Na = (((((0.0 * 1.0 * var_membrane__V * 9309355225.0) * 3.87996927064e-07) * ((0.75 * var_ionic_concentrations__Nai * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_31(_table_index_0, _factor_0)) - 99.0)) / FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_32(_table_index_0, _factor_0)) * 1.0) / (1.0 + pow(0.0012 / var_calcium_dynamics__Cai, 3.0));
00786 double var_non_specific_calcium_activated_current__i_ns_K = (((((0.0 * 1.0 * var_membrane__V * 9309355225.0) * 3.87996927064e-07) * ((0.75 * var_ionic_concentrations__Ki * FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_33(_table_index_0, _factor_0)) - 3.375)) / FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_34(_table_index_0, _factor_0)) * 1.0) / (1.0 + pow(0.0012 / var_calcium_dynamics__Cai, 3.0));
00787 double var_non_specific_calcium_activated_current__i_ns_Ca = var_non_specific_calcium_activated_current__i_ns_Na + var_non_specific_calcium_activated_current__i_ns_K;
00788 double var_membrane__i_ns_Ca = var_non_specific_calcium_activated_current__i_ns_Ca;
00789 double var_fast_sodium_current_m_gate__E0_m = var_membrane__V + 47.13;
00790 double var_L_type_Ca_channel_d_gate__E0_d = var_membrane__V + 10.0;
00791 double var_L_type_Ca_channel_d_gate__d_infinity = 1.0 / (1.0 + exp((-var_L_type_Ca_channel_d_gate__E0_d) * 0.160256410256));
00792 double var_L_type_Ca_channel_d_gate__tau_d = (fabs(var_L_type_Ca_channel_d_gate__E0_d) < 1e-05) ? 0.00457875457875 : ((0.001 * var_L_type_Ca_channel_d_gate__d_infinity * (1.0 - exp((-var_L_type_Ca_channel_d_gate__E0_d) * 0.160256410256))) / (0.035 * var_L_type_Ca_channel_d_gate__E0_d));
00793 double var_L_type_Ca_channel_f_gate__f_infinity = FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_11(_table_index_0, _factor_0);
00794 double var_L_type_Ca_channel_f_gate__tau_f = FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_12(_table_index_0, _factor_0);
00795 double var_transient_outward_current_zdv_gate__alpha_zdv = FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_26(_table_index_0, _factor_0);
00796 double var_transient_outward_current_zdv_gate__beta_zdv = FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_27(_table_index_0, _factor_0);
00797 double var_transient_outward_current_ydv_gate__alpha_ydv = FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_28(_table_index_0, _factor_0);
00798 double var_transient_outward_current_ydv_gate__beta_ydv = FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_29(_table_index_0, _factor_0);
00799 double var_calcium_dynamics__i_rel = ((var_calcium_dynamics__Cainfluxtrack > 0.00018) ? (((60000.0 * (var_calcium_dynamics__Cainfluxtrack - 0.00018)) / ((0.0008 + var_calcium_dynamics__Cainfluxtrack) - 0.00018)) * (1.0 - var_calcium_dynamics__APtrack2) * var_calcium_dynamics__APtrack2) : ((var_calcium_dynamics__Cainfluxtrack <= 0.00018) && (var_calcium_dynamics__OVRLDtrack2 > 0.0)) ? (4000.0 * (1.0 - var_calcium_dynamics__OVRLDtrack2) * var_calcium_dynamics__OVRLDtrack2) : 0.0) * (var_calcium_dynamics__Ca_JSR - var_calcium_dynamics__Cai);
00800 double var_calcium_dynamics__i_up = (8.75 * var_calcium_dynamics__Cai) / (var_calcium_dynamics__Cai + 0.00092);
00801 double var_calcium_dynamics__i_leak = 0.583333333333 * var_calcium_dynamics__Ca_NSR;
00802 double var_calcium_dynamics__i_tr = (var_calcium_dynamics__Ca_NSR - var_calcium_dynamics__Ca_JSR) * 5.55555555556;
00803 double d_dt_membrane__V;
00804 if (mSetVoltageDerivativeToZero)
00805 {
00806 d_dt_membrane__V = 0.0;
00807 }
00808 else
00809 {
00810 d_dt_membrane__V = -1000.0 * (var_membrane__i_Na + var_membrane__i_Ca_L + var_membrane__i_Ca_T + var_membrane__i_Kr + var_membrane__i_Ks + var_membrane__i_K_Na + var_membrane__i_K_ATP + var_membrane__i_to + var_membrane__i_K1 + var_membrane__i_Kp + var_membrane__i_NaCa + var_membrane__i_p_Ca + var_membrane__i_Na_b + var_membrane__i_Ca_b + var_membrane__i_NaK + var_membrane__i_ns_Ca + var_membrane__I_st);
00811 }
00812 double d_dt_fast_sodium_current_m_gate__m = (((fabs(var_fast_sodium_current_m_gate__E0_m) >= 1e-05) ? ((320.0 * var_fast_sodium_current_m_gate__E0_m) / (1.0 - exp( -0.1 * var_fast_sodium_current_m_gate__E0_m))) : 3200.0) * (1.0 - var_fast_sodium_current_m_gate__m)) - (FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_0(_table_index_0, _factor_0) * var_fast_sodium_current_m_gate__m);
00813 double d_dt_fast_sodium_current_h_gate__h = (FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_1(_table_index_0, _factor_0) * (1.0 - var_fast_sodium_current_h_gate__h)) - (FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_2(_table_index_0, _factor_0) * var_fast_sodium_current_h_gate__h);
00814 double d_dt_fast_sodium_current_j_gate__j = (FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_3(_table_index_0, _factor_0) * (1.0 - var_fast_sodium_current_j_gate__j)) - (FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_4(_table_index_0, _factor_0) * var_fast_sodium_current_j_gate__j);
00815 double d_dt_L_type_Ca_channel_d_gate__d = ((var_L_type_Ca_channel_d_gate__d_infinity / var_L_type_Ca_channel_d_gate__tau_d) * (1.0 - var_L_type_Ca_channel_d_gate__d)) - (((1.0 - var_L_type_Ca_channel_d_gate__d_infinity) / var_L_type_Ca_channel_d_gate__tau_d) * var_L_type_Ca_channel_d_gate__d);
00816 double d_dt_L_type_Ca_channel_f_gate__f = ((var_L_type_Ca_channel_f_gate__f_infinity / var_L_type_Ca_channel_f_gate__tau_f) * (1.0 - var_L_type_Ca_channel_f_gate__f)) - (((1.0 - var_L_type_Ca_channel_f_gate__f_infinity) / var_L_type_Ca_channel_f_gate__tau_f) * var_L_type_Ca_channel_f_gate__f);
00817 double d_dt_T_type_Ca_channel_b_gate__b = (FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_13(_table_index_0, _factor_0) - var_T_type_Ca_channel_b_gate__b) / FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_14(_table_index_0, _factor_0);
00818 double d_dt_T_type_Ca_channel_g_gate__g = (FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_15(_table_index_0, _factor_0) - var_T_type_Ca_channel_g_gate__g) / ((var_membrane__V <= 0.0) ? (( -0.000875 * var_membrane__V) + 0.012) : 0.012);
00819 double d_dt_rapid_delayed_rectifier_potassium_current_xr_gate__xr = (FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_17(_table_index_0, _factor_0) - var_rapid_delayed_rectifier_potassium_current_xr_gate__xr) / FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_18(_table_index_0, _factor_0);
00820 double d_dt_slow_delayed_rectifier_potassium_current_xs1_gate__xs1 = (FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_19(_table_index_0, _factor_0) - var_slow_delayed_rectifier_potassium_current_xs1_gate__xs1) / FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_20(_table_index_0, _factor_0);
00821 double d_dt_slow_delayed_rectifier_potassium_current_xs2_gate__xs2 = (FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_21(_table_index_0, _factor_0) - var_slow_delayed_rectifier_potassium_current_xs2_gate__xs2) / FaberRudy2000Version3OptimisedLookupTables::Instance()->_lookup_22(_table_index_0, _factor_0);
00822 double d_dt_transient_outward_current_zdv_gate__zdv = ((var_transient_outward_current_zdv_gate__alpha_zdv / (var_transient_outward_current_zdv_gate__alpha_zdv + var_transient_outward_current_zdv_gate__beta_zdv)) - var_transient_outward_current_zdv_gate__zdv) / (1.0 / (var_transient_outward_current_zdv_gate__alpha_zdv + var_transient_outward_current_zdv_gate__beta_zdv));
00823 double d_dt_transient_outward_current_ydv_gate__ydv = ((var_transient_outward_current_ydv_gate__alpha_ydv / (var_transient_outward_current_ydv_gate__alpha_ydv + var_transient_outward_current_ydv_gate__beta_ydv)) - var_transient_outward_current_ydv_gate__ydv) / (1.0 / (var_transient_outward_current_ydv_gate__alpha_ydv + var_transient_outward_current_ydv_gate__beta_ydv));
00824 double d_dt_calcium_dynamics__APtrack = (( -1000.0 * (var_membrane__i_Na + var_membrane__i_Ca_L + var_membrane__i_Ca_T + var_membrane__i_Kr + var_membrane__i_Ks + var_membrane__i_K_Na + var_membrane__i_K_ATP + var_membrane__i_to + var_membrane__i_K1 + var_membrane__i_Kp + var_membrane__i_NaCa + var_membrane__i_p_Ca + var_membrane__i_Na_b + var_membrane__i_Ca_b + var_membrane__i_NaK + var_membrane__i_ns_Ca + var_membrane__I_st)) > 150000.0) ? ((100000.0 * (1.0 - var_calcium_dynamics__APtrack)) - (500.0 * var_calcium_dynamics__APtrack)) : ( -500.0 * var_calcium_dynamics__APtrack);
00825 double d_dt_calcium_dynamics__APtrack2 = ((var_calcium_dynamics__APtrack < 0.2) && (var_calcium_dynamics__APtrack > 0.18)) ? ((100000.0 * (1.0 - var_calcium_dynamics__APtrack2)) - (500.0 * var_calcium_dynamics__APtrack2)) : ( -500.0 * var_calcium_dynamics__APtrack2);
00826 double d_dt_calcium_dynamics__APtrack3 = ((var_calcium_dynamics__APtrack < 0.2) && (var_calcium_dynamics__APtrack > 0.18)) ? ((100000.0 * (1.0 - var_calcium_dynamics__APtrack3)) - (500.0 * var_calcium_dynamics__APtrack3)) : ( -10.0 * var_calcium_dynamics__APtrack3);
00827 double d_dt_calcium_dynamics__Cainfluxtrack = (var_calcium_dynamics__APtrack > 0.2) ? (( -1.434e-07 * (((var_L_type_Ca_channel__i_CaCa + var_T_type_Ca_channel__i_Ca_T) - var_Na_Ca_exchanger__i_NaCa) + var_sarcolemmal_calcium_pump__i_p_Ca + var_calcium_background_current__i_Ca_b)) * 200477.689034) : ((var_calcium_dynamics__APtrack2 > 0.01) && (var_calcium_dynamics__APtrack <= 0.2)) ? 0.0 : ( -500.0 * var_calcium_dynamics__Cainfluxtrack);
00828 double d_dt_calcium_dynamics__OVRLDtrack = (((1.0 / (1.0 + (0.8 / var_calcium_dynamics__Ca_JSR))) > 0.7) && (var_calcium_dynamics__OVRLDtrack3 < 0.37) && (var_calcium_dynamics__APtrack3 < 0.37)) ? (50000.0 * (1.0 - var_calcium_dynamics__OVRLDtrack)) : ( -500.0 * var_calcium_dynamics__OVRLDtrack);
00829 double d_dt_calcium_dynamics__OVRLDtrack2 = ((var_calcium_dynamics__OVRLDtrack > 0.98) && (var_calcium_dynamics__OVRLDtrack2 < 0.98)) ? (50000.0 * (1.0 - var_calcium_dynamics__OVRLDtrack2)) : ( -500.0 * var_calcium_dynamics__OVRLDtrack2);
00830 double d_dt_calcium_dynamics__OVRLDtrack3 = ((var_calcium_dynamics__OVRLDtrack > 0.98) && (var_calcium_dynamics__OVRLDtrack3 < 0.98)) ? (50000.0 * (1.0 - var_calcium_dynamics__OVRLDtrack3)) : ( -10.0 * var_calcium_dynamics__OVRLDtrack3);
00831 double d_dt_calcium_dynamics__Ca_JSR = (1.0 / (1.0 + (8.0 / pow(0.8 + var_calcium_dynamics__Ca_JSR, 2.0)))) * (var_calcium_dynamics__i_tr - var_calcium_dynamics__i_rel);
00832 double d_dt_calcium_dynamics__Ca_NSR = ((((-var_calcium_dynamics__i_tr) * 1.8246370132e-13) * 476568879782.0) - var_calcium_dynamics__i_leak) + var_calcium_dynamics__i_up;
00833 double d_dt_calcium_dynamics__Cai = (1.0 / (1.0 + (0.000119 / pow(0.00238 + var_calcium_dynamics__Cai, 2.0)) + (3.5e-05 / pow(0.0005 + var_calcium_dynamics__Cai, 2.0)))) * ((( -1.434e-07 * (((var_L_type_Ca_channel__i_CaCa + var_T_type_Ca_channel__i_Ca_T) - (2.0 * var_Na_Ca_exchanger__i_NaCa)) + var_sarcolemmal_calcium_pump__i_p_Ca + var_calcium_background_current__i_Ca_b)) * 200477.689034) + ((var_calcium_dynamics__i_rel * 1.8246370132e-13) * 38686179652.9) + (((var_calcium_dynamics__i_leak - var_calcium_dynamics__i_up) * 2.09833256519e-12) * 38686179652.9));
00834 double d_dt_ionic_concentrations__Nai = ((-(var_fast_sodium_current__i_Na + var_L_type_Ca_channel__i_CaNa + var_sodium_background_current__i_Na_b + var_non_specific_calcium_activated_current__i_ns_Na + (var_Na_Ca_exchanger__i_NaCa * 3.0) + (var_sodium_potassium_pump__i_NaK * 3.0))) * 1.434e-07) * 400955.378068;
00835 double d_dt_ionic_concentrations__Ki = ((-(var_L_type_Ca_channel__i_CaK + var_rapid_delayed_rectifier_potassium_current__i_Kr + var_slow_delayed_rectifier_potassium_current__i_Ks + var_time_independent_potassium_current__i_K1 + var_plateau_potassium_current__i_Kp + var_sodium_activated_potassium_current__i_K_Na + var_ATP_sensitive_potassium_current__i_K_ATP + var_transient_outward_current__i_to + var_non_specific_calcium_activated_current__i_ns_K + ((-var_sodium_potassium_pump__i_NaK) * 2.0))) * 1.434e-07) * 400955.378068;
00836
00837 rDY[0] = d_dt_membrane__V*1e-3;
00838 rDY[1] = d_dt_fast_sodium_current_m_gate__m*1e-3;
00839 rDY[2] = d_dt_fast_sodium_current_h_gate__h*1e-3;
00840 rDY[3] = d_dt_fast_sodium_current_j_gate__j*1e-3;
00841 rDY[4] = d_dt_L_type_Ca_channel_d_gate__d*1e-3;
00842 rDY[5] = d_dt_L_type_Ca_channel_f_gate__f*1e-3;
00843 rDY[6] = d_dt_T_type_Ca_channel_b_gate__b*1e-3;
00844 rDY[7] = d_dt_T_type_Ca_channel_g_gate__g*1e-3;
00845 rDY[8] = d_dt_rapid_delayed_rectifier_potassium_current_xr_gate__xr*1e-3;
00846 rDY[9] = d_dt_slow_delayed_rectifier_potassium_current_xs1_gate__xs1*1e-3;
00847 rDY[10] = d_dt_slow_delayed_rectifier_potassium_current_xs2_gate__xs2*1e-3;
00848 rDY[11] = d_dt_transient_outward_current_zdv_gate__zdv*1e-3;
00849 rDY[12] = d_dt_transient_outward_current_ydv_gate__ydv*1e-3;
00850 rDY[13] = d_dt_calcium_dynamics__Cai*1e-3;
00851 rDY[14] = d_dt_calcium_dynamics__Ca_JSR*1e-3;
00852 rDY[15] = d_dt_calcium_dynamics__Ca_NSR*1e-3;
00853 rDY[16] = d_dt_calcium_dynamics__APtrack*1e-3;
00854 rDY[17] = d_dt_calcium_dynamics__APtrack2*1e-3;
00855 rDY[18] = d_dt_calcium_dynamics__APtrack3*1e-3;
00856 rDY[19] = d_dt_calcium_dynamics__Cainfluxtrack*1e-3;
00857 rDY[20] = d_dt_calcium_dynamics__OVRLDtrack*1e-3;
00858 rDY[21] = d_dt_calcium_dynamics__OVRLDtrack2*1e-3;
00859 rDY[22] = d_dt_calcium_dynamics__OVRLDtrack3*1e-3;
00860 rDY[23] = d_dt_ionic_concentrations__Nai*1e-3;
00861 rDY[24] = d_dt_ionic_concentrations__Ki*1e-3;
00862 }
00863
00864 };
00865
00866
00867 template<>
00868 void OdeSystemInformation<FaberRudy2000Version3Optimised>::Initialise(void)
00869 {
00870 this->mVariableNames.push_back("V");
00871 this->mVariableUnits.push_back("millivolt");
00872 this->mInitialConditions.push_back(-90);
00873
00874 this->mVariableNames.push_back("m");
00875 this->mVariableUnits.push_back("dimensionless");
00876 this->mInitialConditions.push_back(0.0008);
00877
00878 this->mVariableNames.push_back("h");
00879 this->mVariableUnits.push_back("dimensionless");
00880 this->mInitialConditions.push_back(0.993771);
00881
00882 this->mVariableNames.push_back("j");
00883 this->mVariableUnits.push_back("dimensionless");
00884 this->mInitialConditions.push_back(0.995727);
00885
00886 this->mVariableNames.push_back("d");
00887 this->mVariableUnits.push_back("dimensionless");
00888 this->mInitialConditions.push_back(3.210618e-6);
00889
00890 this->mVariableNames.push_back("f");
00891 this->mVariableUnits.push_back("dimensionless");
00892 this->mInitialConditions.push_back(0.999837);
00893
00894 this->mVariableNames.push_back("b");
00895 this->mVariableUnits.push_back("dimensionless");
00896 this->mInitialConditions.push_back(0.000970231);
00897
00898 this->mVariableNames.push_back("g");
00899 this->mVariableUnits.push_back("dimensionless");
00900 this->mInitialConditions.push_back(0.994305);
00901
00902 this->mVariableNames.push_back("xr");
00903 this->mVariableUnits.push_back("dimensionless");
00904 this->mInitialConditions.push_back(0.000124042);
00905
00906 this->mVariableNames.push_back("xs1");
00907 this->mVariableUnits.push_back("dimensionless");
00908 this->mInitialConditions.push_back(0.00445683);
00909
00910 this->mVariableNames.push_back("xs2");
00911 this->mVariableUnits.push_back("dimensionless");
00912 this->mInitialConditions.push_back(0.00445683);
00913
00914 this->mVariableNames.push_back("zdv");
00915 this->mVariableUnits.push_back("dimensionless");
00916 this->mInitialConditions.push_back(0.5);
00917
00918 this->mVariableNames.push_back("ydv");
00919 this->mVariableUnits.push_back("dimensionless");
00920 this->mInitialConditions.push_back(0.5);
00921
00922 this->mVariableNames.push_back("CaI");
00923 this->mVariableUnits.push_back("millimolar");
00924 this->mInitialConditions.push_back(6e-5);
00925
00926 this->mVariableNames.push_back("Ca_JSR");
00927 this->mVariableUnits.push_back("millimolar");
00928 this->mInitialConditions.push_back(1.8);
00929
00930 this->mVariableNames.push_back("Ca_NSR");
00931 this->mVariableUnits.push_back("millimolar");
00932 this->mInitialConditions.push_back(1.8);
00933
00934 this->mVariableNames.push_back("APtrack");
00935 this->mVariableUnits.push_back("dimensionless");
00936 this->mInitialConditions.push_back(0);
00937
00938 this->mVariableNames.push_back("APtrack2");
00939 this->mVariableUnits.push_back("dimensionless");
00940 this->mInitialConditions.push_back(0);
00941
00942 this->mVariableNames.push_back("APtrack3");
00943 this->mVariableUnits.push_back("dimensionless");
00944 this->mInitialConditions.push_back(0);
00945
00946 this->mVariableNames.push_back("Cainfluxtrack");
00947 this->mVariableUnits.push_back("dimensionless");
00948 this->mInitialConditions.push_back(0);
00949
00950 this->mVariableNames.push_back("OVRLDtrack");
00951 this->mVariableUnits.push_back("dimensionless");
00952 this->mInitialConditions.push_back(0);
00953
00954 this->mVariableNames.push_back("OVRLDtrack2");
00955 this->mVariableUnits.push_back("dimensionless");
00956 this->mInitialConditions.push_back(0);
00957
00958 this->mVariableNames.push_back("OVRLDtrack3");
00959 this->mVariableUnits.push_back("dimensionless");
00960 this->mInitialConditions.push_back(0);
00961
00962 this->mVariableNames.push_back("Nai");
00963 this->mVariableUnits.push_back("millimolar");
00964 this->mInitialConditions.push_back(9);
00965
00966 this->mVariableNames.push_back("Ki");
00967 this->mVariableUnits.push_back("millimolar");
00968 this->mInitialConditions.push_back(141.2);
00969
00970 this->mInitialised = true;
00971 }
00972
00973 #endif