Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_Neuron_CommonEquations.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // Copyright Notice
3 //
4 // Copyright 2002 Sandia Corporation. Under the terms
5 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
6 // Government retains certain rights in this software.
7 //
8 // Xyce(TM) Parallel Electrical Simulator
9 // Copyright (C) 2002-2011 Sandia Corporation
10 //
11 // This program is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //-----------------------------------------------------------------------------
24 
25 //-----------------------------------------------------------------------------
26 // Filename : $RCSfile: N_DEV_Neuron_CommonEquations.h,v $
27 //
28 // Purpose : Common, template based, equations for neuron devices
29 // Keeping them here to avoid duplication in various
30 // device files
31 //
32 // Special Notes :
33 //
34 // Creator : Richard Schiek, SNL, Electrical and Microsystem Modeling
35 //
36 // Creation Date : 01/02/08
37 //
38 // Revision Information:
39 // ---------------------
40 //
41 // Revision Number: $Revision: 1.10 $
42 //
43 // Revision Date : $Date: 2014/03/19 17:23:28 $
44 //
45 // Current Owner : $Author: tvrusso $
46 //-----------------------------------------------------------------------------
47 
48 #ifndef Xyce_N_DEV_Neuron_CommonEquations_h
49 #define Xyce_N_DEV_Neuron_CommonEquations_h
50 
51 #include <Sacado.hpp>
52 
53 namespace Xyce {
54 namespace Device {
55 namespace Neuron {
56 
57 // These functions represents the equations that need to be solved
58 // for this device. Since Xyce loads an F and Q contribution, the
59 // equations are broken up into their F and Q components. Thus there
60 // is a kcl1EquF() and kcl1EquQ(). Automatic differentiation will
61 // be used to generate all the derivatives of these equations for the
62 // dF/dX and dQ/dX loads
63 
64 
65 //
66 // from membrane patch formulation (V1 - inner membrane, v2 - outer membrane)
67 //
68 
69 // first we list some utility functions for calculating coefficients
70 //
71 // These functions expect V to be in milli-volts and then return values that
72 // are in 1/ms. Thus the extra factor's of 1000 here and there
73 
74 // cew 2/18/2011
75 // Commenting out the Connor Stevens alphaN, betaN, alphaM, betaM, alphaH, betaH
76 // and replacing them with Hodgkin-Huxley version, which is different.
77 // Right now, the Connor Stevens membrane model isn't even
78 // implemented, so those equations aren't needed yet.
79 // Copied the HH equations from N_Dev_Neuron.h, but modified them and corresponding
80 // code in N_DEV_MembraneHH.C to handle subtraction of Vrest in calling code.
81 // At some point, we have to re-evaluate whether it's possible to have a set
82 // of common equations multiple devices can use.
83 
84 // equations from Hodgkin-Huxley model
85 
86 // potassium current, functions for activator equation
87 template <typename ScalarT>
88 static ScalarT alphaN( const ScalarT & Vn1)
89 {
90  ScalarT vDiff = 1000.0 * Vn1; // convert voltage to milli-volts
91  ScalarT r;
92  if ((vDiff > 9.99) && (vDiff < 10.01) )
93  {
94  r = 1.0/(10.0 * ( std::exp( (10.0 - vDiff)/10.0 )));
95  }
96  else
97  {
98  r = (10.0 - vDiff) /
99  (100.0 * ( std::exp( (10.0 - vDiff)/10.0 ) - 1.0 ));
100  }
101  r *= 1000.0; // change from 1/ms to 1/s
102  return r;
103 }
104 
105 template <typename ScalarT>
106 static ScalarT betaN( const ScalarT & Vn1)
107 {
108  ScalarT vDiff = 1000.0 * Vn1;
109  ScalarT r = 0.125 * std::exp( -vDiff/80.0 );
110  r *= 1000.0; // change from 1/ms to 1/s
111  return r;
112 }
113 
114 // sodium current, functions for activator equation
115 template <typename ScalarT>
116 static ScalarT alphaM( const ScalarT & Vn1)
117 {
118  ScalarT vDiff = 1000.0 * Vn1;
119  ScalarT r;
120  if ((vDiff > 24.99) && (vDiff < 25.01) )
121  {
122  r = (1.0) /
123  (( std::exp( (25.0 - vDiff)/10.0 )));
124  }
125  else
126  {
127  r = (25.0 - vDiff) /
128  (10.0 * ( std::exp( (25.0 - vDiff)/10.0 ) - 1.0 ));
129  }
130  r *= 1000.0; // change from 1/ms to 1/s
131  return r;
132 }
133 
134 template <typename ScalarT>
135 static ScalarT betaM( const ScalarT & Vn1)
136 {
137  ScalarT vDiff = 1000.0 * Vn1;
138  ScalarT r = 4.0 * std::exp( -vDiff/18.0 );
139  r *= 1000.0; // change from 1/ms to 1/s
140 
141  return r;
142 }
143 
144 template <typename ScalarT>
145 static ScalarT alphaH( const ScalarT & Vn1)
146 {
147  ScalarT vDiff = 1000.0 * Vn1;
148  ScalarT r = 0.07 * std::exp( -vDiff/20.0 );
149  r *= 1000.0; // change from 1/ms to 1/s
150  return r;
151 }
152 
153 template <typename ScalarT>
154 static ScalarT betaH( const ScalarT & Vn1)
155 {
156  ScalarT vDiff = 1000.0 * Vn1;
157  ScalarT r = 1.0 / ( std::exp( (30.0 - vDiff)/10.0 ) + 1.0 );
158  r *= 1000.0; // change from 1/ms to 1/s
159  return r;
160 }
161 
162 
163 
164 // equations from the ConnorStevens Model
165 /*
166 // potassium current, functions for activator equation
167 template <typename ScalarT>
168 static ScalarT alphaN( const ScalarT Vin)
169 {
170 ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
171 ScalarT r = 1000.0 * (0.02 * (vScaled + 45.7)) / (1.0 - std::exp(-0.1*(vScaled+45.7)));
172 // result. the 1000 factor is to change from 1/ms to 1/s
173 return r;
174 }
175 
176 template <typename ScalarT>
177 static ScalarT betaN( const ScalarT Vin)
178 {
179 ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
180 ScalarT r = 1000.0 * 0.25 * std::exp( -0.0125 * (vScaled + 55.7));
181 // result. the 1000 factor is to change from 1/ms to 1/s
182 return r;
183 }
184 
185 // sodium current, functions for activator equation
186 template <typename ScalarT>
187 static ScalarT alphaM( const ScalarT Vin)
188 {
189 ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
190 ScalarT r = 1000.0 * (0.38 * (vScaled + 29.7)) / (1.0 - std::exp(-0.1*(vScaled+29.7)));
191 // result. the 1000 factor is to change from 1/ms to 1/s
192 return r;
193 }
194 
195 template <typename ScalarT>
196 static ScalarT betaM( const ScalarT Vin)
197 {
198 ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
199 ScalarT r = 1000.0 * 15.2 * std::exp( -0.0556 * (vScaled + 54.7));
200 // result. the 1000 factor is to change from 1/ms to 1/s
201 return r;
202 }
203 
204 template <typename ScalarT>
205 static ScalarT alphaH( const ScalarT Vin)
206 {
207 ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
208 ScalarT r = 1000.0 * 0.266 * std::exp( -0.05 * (vScaled + 48.0));
209 // result. the 1000 factor is to change from 1/ms to 1/s
210 return r;
211 }
212 
213 template <typename ScalarT>
214 static ScalarT betaH( const ScalarT Vin)
215 {
216 ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
217 ScalarT r = 1000.0 * 3.8 / (1.0 + std::exp(-0.1*(vScaled+18.0)));
218 // result. the 1000 factor is to change from 1/ms to 1/s
219 return r;
220 }
221 */
222 // a-current functions
223 template <typename ScalarT>
224 static ScalarT aInf( const ScalarT Vin)
225 {
226  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
227  ScalarT r = std::pow( ((0.0761 * std::exp(0.0314 * (vScaled+94.22))) / (1.0+std::exp(0.0346*(vScaled+1.17)))), 1.0/3.0);
228  return r;
229 }
230 
231 template <typename ScalarT>
232 static ScalarT aTau( const ScalarT Vin)
233 {
234  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
235  ScalarT r = (0.3632 + 1.158 / (1.0 + std::exp(0.0497 * (vScaled + 55.96)))) / 1000.0;
236  // the 1000.0 factor is to change ms to s.
237  return r;
238 }
239 
240 template <typename ScalarT>
241 static ScalarT bInf( const ScalarT Vin)
242 {
243  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
244  ScalarT r = std::pow( (1.0 / (1.0 + std::exp(0.0688*(vScaled+53.3)))), 4.0);
245  return r;
246 }
247 
248 template <typename ScalarT>
249 static ScalarT bTau( const ScalarT Vin)
250 {
251  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
252  ScalarT r = (1.24 + 2.678 / (1.0 + std::exp(0.0624 * (vScaled + 50.0)))) / 1000.0;
253  return r;
254 }
255 
256 // transient calcium functions
257 template <typename ScalarT>
258 static ScalarT M_Inf( const ScalarT Vin)
259 {
260  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
261  ScalarT r = 1.0/(1.0 + std::exp(-(vScaled+57)/6.2));
262  return r;
263 }
264 
265 template <typename ScalarT>
266 static ScalarT M_Tau( const ScalarT Vin)
267 {
268  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
269  ScalarT r = (0.612 + 1.0/(std::exp(-(vScaled+132)/16.7) + std::exp((vScaled+16.8)/18.2)) ) / 1000.0;
270  return r;
271 }
272 
273 template <typename ScalarT>
274 static ScalarT H_Inf( const ScalarT Vin)
275 {
276  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
277  ScalarT r = 1.0 / (1.0 + std::exp((vScaled+81)/4.0));
278  return r;
279 }
280 
281 template <typename ScalarT>
282 static ScalarT H_Tau( const ScalarT Vin)
283 {
284  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
285  ScalarT r;
286  if( vScaled < -80.0 )
287  {
288  r = std::exp( (vScaled + 467)/66.6 ) / 1000.0;
289  }
290  else
291  {
292  r = ( 28.0 + std::exp(-(vScaled+22.0)/10.5)) / 1000.0;
293  }
294  return r;
295 }
296 
297 // Calcium dependent Potassium conductances
298 template <typename ScalarT>
299 static ScalarT C_Inf( const ScalarT Vin, const ScalarT CaConc)
300 {
301  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
302  ScalarT r = (CaConc / (CaConc + 3.0)) * (1.0 / (1.0 + std::exp(-(vScaled+28.3)/12.6 )));
303  return r;
304 }
305 
306 template <typename ScalarT>
307 static ScalarT C_Tau( const ScalarT Vin)
308 {
309  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
310  ScalarT r = (90.3 - 75.1/(1.0 + std::exp(-(vScaled+46)/22.7))) / 1000.0;
311  return r;
312 }
313 
314 // now the device equations
315 // KCL equation 1
316 template <typename ScalarT>
317 static ScalarT kcl1EquF( const ScalarT& Vn1, const ScalarT& Vn2, const ScalarT& n, const ScalarT& m, const ScalarT& h,
318  const ScalarT& a, const ScalarT& b, const ScalarT& MC, const ScalarT& HC, const ScalarT& CC,
319  const ScalarT& memG, const ScalarT& restV, const ScalarT& Kg, const ScalarT& Ke, const ScalarT& NaG, const ScalarT& NaE,
320  const ScalarT& Ag, const ScalarT& Ae, const ScalarT& CaTg, const ScalarT& CaE, const ScalarT& KCaG)
321 {
322  ScalarT powN = n * n * n * n;
323  ScalarT powM = m * m * m;
324  ScalarT powA = a * a * a;
325  ScalarT powMC = MC * MC;
326  ScalarT powCC = CC * CC * CC * CC;
327  ScalarT r = memG * (Vn1 - Vn2 - restV) + Kg * powN * (Vn1 - Vn2 - Ke ) + NaG * powM * h * (Vn1 - Vn2 - NaE )
328  + Ag * powA * b * (Vn1 - Vn2 - Ae) + CaTg * powMC * HC * (Vn1 - Vn2 - CaE) + KCaG * powCC * (Vn1 - Vn2 - Ke);
329  return r;
330 }
331 
332 template <typename ScalarT>
333 static ScalarT kcl1EquQ( const ScalarT& Vn1, const ScalarT& Vn2, const ScalarT& memC )
334 {
335  ScalarT r = memC * (Vn1 - Vn2);
336  return r;
337 }
338 
339 // KCL equation 2 -- -1 * equation 1 because of device symmetry
340 template <typename ScalarT>
341 static ScalarT kcl2EquF( const ScalarT& Vn1, const ScalarT& Vn2, const ScalarT& n, const ScalarT& m, const ScalarT& h,
342  const ScalarT& a, const ScalarT& b, const ScalarT& MC, const ScalarT& HC, const ScalarT& CC,
343  const ScalarT& memG, const ScalarT& restV, const ScalarT& Kg, const ScalarT& Ke, const ScalarT& NaG, const ScalarT& NaE,
344  const ScalarT& Ag, const ScalarT& Ae, const ScalarT& CaTg, const ScalarT& CaE, const ScalarT& KCaG)
345 {
346  ScalarT powN = n * n * n * n;
347  ScalarT powM = m * m * m;
348  ScalarT powA = a * a * a;
349  ScalarT powMC = MC * MC;
350  ScalarT powCC = CC * CC * CC * CC;
351  ScalarT r = -1.0 * (memG * (Vn1 - Vn2 - restV) + Kg * powN * (Vn1 - Vn2 - Ke ) + NaG * powM * h * (Vn1 - Vn2 - NaE )
352  + Ag * powA * b * (Vn1 - Vn2 - Ae) + CaTg * powMC * HC * (Vn1 - Vn2 - CaE) + KCaG * powCC * (Vn1 - Vn2 - Ke) );
353  return r;
354 }
355 
356 template <typename ScalarT>
357 static ScalarT kcl2EquQ( const ScalarT& Vn1, const ScalarT& Vn2, const ScalarT& memC )
358 {
359  ScalarT r = -1.0 * memC * (Vn1 - Vn2);
360  return r;
361 }
362 
363 // Hodgkin Huxley Voltage equation for a membrane segment
364 // KCL equation 1
365 template <typename ScalarT>
366 static ScalarT HH_Vseg_F( const ScalarT& Vseg,const ScalarT& n, const ScalarT& m, const ScalarT& h,
367  const ScalarT& memG, const ScalarT& restV, const ScalarT& Kg, const ScalarT& Ke, const ScalarT& NaG, const ScalarT& NaE )
368 {
369  ScalarT n4 = n * n * n * n;
370  ScalarT m3 = m * m * m;
371  ScalarT r = memG * (Vseg - restV) + Kg * n4 * (Vseg - Ke ) + NaG * m3 * h * (Vseg - NaE );
372  return r;
373 }
374 
375 #if 0
376 template <typename ScalarT>
377 static ScalarT HH_Vseg_Q( const ScalarT& Vseg, const ScalarT& memC )
378 {
379  ScalarT r = memC * Vn1;
380  return r;
381 }
382 #endif
383 
384 // n conservation equation
385 template <typename ScalarT>
386 static ScalarT nEquF( const ScalarT& Vn, const ScalarT& n)
387 {
388  ScalarT alpha = alphaN<ScalarT>(Vn);
389  ScalarT beta = betaN<ScalarT>(Vn);
390  ScalarT r = (alpha + beta) * n - alpha;
391  return r;
392 }
393 
394 template <typename ScalarT>
395 static ScalarT nEquQ( const ScalarT& n )
396 {
397  ScalarT r = n;
398  return r;
399 }
400 
401 // m conservation equation
402 template <typename ScalarT>
403 static ScalarT mEquF( const ScalarT& Vn, const ScalarT& m )
404 {
405  ScalarT alpha = alphaM<ScalarT>(Vn);
406  ScalarT beta = betaM<ScalarT>(Vn);
407  ScalarT r = (alpha + beta) * m - alpha;
408  return r;
409 }
410 
411 template <typename ScalarT>
412 static ScalarT mEquQ( const ScalarT& m )
413 {
414  ScalarT r = m;
415  return r;
416 }
417 
418 // h conservation equation
419 template <typename ScalarT>
420 static ScalarT hEquF( const ScalarT& Vn, const ScalarT& h )
421 {
422  ScalarT alpha = alphaH<ScalarT>(Vn);
423  ScalarT beta = betaH<ScalarT>(Vn);
424  ScalarT r = (alpha + beta) * h - alpha;
425  return r;
426 }
427 
428 template <typename ScalarT>
429 static ScalarT hEquQ( const ScalarT& h )
430 {
431  ScalarT r = h;
432  return r;
433 }
434 
435 // a conservation equation
436 template <typename ScalarT>
437 static ScalarT aEquF( const ScalarT& Vn1, const ScalarT& a, const ScalarT& Vrest )
438 {
439  ScalarT vDiff = Vn1; // - Vrest
440  ScalarT Inf = aInf<ScalarT>(vDiff);
441  ScalarT Tau = aTau<ScalarT>(vDiff);
442  ScalarT r = (a - Inf)/Tau;
443  return r;
444 }
445 
446 template <typename ScalarT>
447 static ScalarT aEquQ( const ScalarT& a )
448 {
449  ScalarT r = a;
450  return r;
451 }
452 
453 // b conservation equation
454 template <typename ScalarT>
455 static ScalarT bEquF( const ScalarT& Vn1, const ScalarT& b, const ScalarT& Vrest )
456 {
457  ScalarT vDiff = Vn1; // - Vrest
458  ScalarT Inf = bInf<ScalarT>(vDiff);
459  ScalarT Tau = bTau<ScalarT>(vDiff);
460  ScalarT r = (b - Inf)/Tau;
461  return r;
462 }
463 
464 template <typename ScalarT>
465 static ScalarT bEquQ( const ScalarT& b )
466 {
467  ScalarT r = b;
468  return r;
469 }
470 
471 // M conservation equation
472 template <typename ScalarT>
473 static ScalarT M_EquF( const ScalarT& Vn1, const ScalarT& M, const ScalarT& Vrest )
474 {
475  ScalarT vDiff = Vn1; // - Vrest
476  ScalarT Inf = M_Inf<ScalarT>(vDiff);
477  ScalarT Tau = M_Tau<ScalarT>(vDiff);
478  ScalarT r = (M - Inf)/Tau;
479  return r;
480 }
481 
482 template <typename ScalarT>
483 static ScalarT M_EquQ( const ScalarT& M )
484 {
485  ScalarT r = M;
486  return r;
487 }
488 
489 // H conservation equation
490 template <typename ScalarT>
491 static ScalarT H_EquF( const ScalarT& Vn1, const ScalarT& H, const ScalarT& Vrest )
492 {
493  ScalarT vDiff = Vn1; // - Vrest
494  ScalarT Inf = H_Inf<ScalarT>(vDiff);
495  ScalarT Tau = H_Tau<ScalarT>(vDiff);
496  ScalarT r = (H - Inf)/Tau;
497  return r;
498 }
499 
500 template <typename ScalarT>
501 static ScalarT H_EquQ( const ScalarT& H )
502 {
503  ScalarT r = H;
504  return r;
505 }
506 
507 // C conservation equation
508 template <typename ScalarT>
509 static ScalarT C_EquF( const ScalarT& Vn1, const ScalarT& C, const ScalarT& CaConc, const ScalarT& Vrest )
510 {
511  ScalarT vDiff = Vn1; // - Vrest
512  ScalarT Inf = C_Inf<ScalarT>(vDiff, CaConc);
513  ScalarT Tau = C_Tau<ScalarT>(vDiff);
514  ScalarT r = (C - Inf)/Tau;
515  return r;
516 }
517 
518 template <typename ScalarT>
519 static ScalarT C_EquQ( const ScalarT& C )
520 {
521  ScalarT r = C;
522  return r;
523 }
524 
525 // Calcium conservation equation
526 template <typename ScalarT>
527 static ScalarT Ca_EquF( const ScalarT& Vn1, const ScalarT& Vn2, const ScalarT& MC, const ScalarT& HC, const ScalarT& Ca,
528  const ScalarT& CaTg, const ScalarT& CaE, const ScalarT& CaGamma, const ScalarT& CaTau )
529 {
530  ScalarT r = CaGamma * CaTg * MC * MC * HC * (Vn1 - Vn2 - CaE) + Ca / CaTau;
531  return r;
532 }
533 
534 template <typename ScalarT>
535 static ScalarT Ca_EquQ( const ScalarT& Ca)
536 {
537  ScalarT r = Ca;
538  return r;
539 }
540 
541 //
542 // from membrane cable formulation (Vin - inner membrane outer membrane is considered to be zero)
543 //
544 // equations from the ConnorStevens Model
545 
546 
547 // now the device equations
548 // KCL equation 1
549 template <typename ScalarT>
550 static ScalarT kcl1EquF( const ScalarT& VSeg, const ScalarT& VSegP, const ScalarT & VSegN, const ScalarT& n, const ScalarT& m, const ScalarT& h,
551  const ScalarT& a, const ScalarT& b, const ScalarT& MC, const ScalarT& HC, const ScalarT& CC,
552  const ScalarT& gPrev, const ScalarT& gNext,
553  const ScalarT& memG, const ScalarT& restV, const ScalarT& Kg, const ScalarT& Ke, const ScalarT& NaG, const ScalarT& NaE,
554  const ScalarT& Ag, const ScalarT& Ae, const ScalarT& CaTg, const ScalarT& CaE, const ScalarT& KCaG)
555 {
556  ScalarT powN = n * n * n * n;
557  ScalarT powM = m * m * m;
558  ScalarT powA = a * a * a;
559  ScalarT powMC = MC * MC;
560  ScalarT powCC = CC * CC * CC * CC;
561  ScalarT r = memG * (VSeg - restV) - gNext * (VSegN - VSeg) - gPrev * (VSegP - VSeg);
562  //ScalarT r = memG * (VSeg - restV) + Kg * powN * (VSeg - Ke ) + NaG * powM * h * (VSeg - NaE )
563  // + Ag * powA * b * (VSeg - Ae) + CaTg * powMC * HC * (VSeg - CaE) + KCaG * powCC * (VSeg - Ke) - gNext * (VSegN - VSeg) - gPrev * (VSegP - VSeg);
564  return r;
565 }
566 
567 template <typename ScalarT>
568 static ScalarT kcl1EquQ( const ScalarT& VSeg, const ScalarT& memC )
569 {
570  ScalarT r = memC * VSeg;
571  return r;
572 }
573 
574 
575 // Calcium conservation equation
576 template <typename ScalarT>
577 static ScalarT Ca_EquF( const ScalarT& Vn1, const ScalarT& MC, const ScalarT& HC, const ScalarT& Ca,
578  const ScalarT& CaTg, const ScalarT& CaE, const ScalarT& CaGamma, const ScalarT& CaTau )
579 {
580  ScalarT r = CaGamma * CaTg * MC * MC * HC * (Vn1 - CaE) + Ca / CaTau;
581  return r;
582 }
583 
584 } // namespace Neuron
585 } // namespace Device
586 } // namespace Xyce
587 
588 #endif