Xyce  6.1
N_DEV_Neuron2.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-2015 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_Neuron2.h,v $
27 //
28 // Purpose : Neuron classes.
29 //
30 // Special Notes :
31 //
32 // Creator : Richard Schiek, SNL, Electrical and Microsystem Modeling
33 //
34 // Creation Date : 01/02/08
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.30.2.1 $
40 //
41 // Revision Date : $Date: 2015/04/02 18:29:37 $
42 //
43 // Current Owner : $Author: tvrusso $
44 //-----------------------------------------------------------------------------
45 
46 #ifndef Xyce_N_DEV_Neuron2_h
47 #define Xyce_N_DEV_Neuron2_h
48 
49 #include <Sacado.hpp>
50 
51 #include <N_DEV_Configuration.h>
52 #include <N_DEV_DeviceBlock.h>
53 #include <N_DEV_DeviceInstance.h>
54 #include <N_DEV_DeviceModel.h>
55 
56 #include <N_DEV_Neuron.h>
57 
58 namespace Xyce {
59 namespace Device {
60 namespace Neuron2 {
61 
62 class Model;
63 class Instance;
64 
65 struct Traits : public DeviceTraits<Model, Instance, Neuron::Traits>
66 {
67  static const char *name() {return "Neuron";}
68  static const char *deviceTypeName() {return "YNEURON level 2";}
69  static int numNodes() {return 2;}
70  static bool modelRequired() {return true;}
71  static bool isLinearDevice() {return true;}
72 
73  static Device *factory(const Configuration &configuration, const FactoryBlock &factory_block);
74  static void loadModelParameters(ParametricData<Model> &model_parameters);
75  static void loadInstanceParameters(ParametricData<Instance> &instance_parameters);
76 };
77 
78 //-----------------------------------------------------------------------------
79 // Class : Instance
80 // Purpose : This is class refers to a single instance of the
81 // Neuron device. It has two nodes associated with it, a
82 // positive and a negative node. See the NeuronInstance
83 // class for a more detailed explanation.
84 // Special Notes :
85 // Creator : Richard Schiek, SNL, Electrical and Microsystem Modeling
86 // Creation Date : 01/02/08
87 //-----------------------------------------------------------------------------
88 class Instance : public DeviceInstance
89 {
90  friend class ParametricData<Instance>;
91  friend class Model;
92  friend class Traits;
93 
94 public:
95  static std::vector< std::vector<int> > jacStamp;
96 
97  Instance(
98  const Configuration & configuration,
99  const InstanceBlock & IB,
100  Model & Miter,
101  const FactoryBlock & factory_block);
102 
103  ~Instance();
104 
105 private:
106  Instance(const Instance &right);
107  Instance &operator=(const Instance &);
108 
109 public:
110  void registerLIDs( const std::vector<int> & intLIDVecRef,
111  const std::vector<int> & extLIDVecRef );
112  void registerStateLIDs( const std::vector<int> & staLIDVecRef );
113 
114  void loadNodeSymbols(Util::SymbolTable &symbol_table) const; // override
115 
116  const std::vector< std::vector<int> > & jacobianStamp() const;
117  void registerJacLIDs( const std::vector< std::vector<int> > & jacLIDVec );
118 
119  bool processParams ();
120  bool updateTemperature(const double & temp_tmp);
121 
122  bool updateIntermediateVars ();
123  bool updatePrimaryState ();
124  bool updateSecondaryState ();
125  bool setIC ();
126 
127  void varTypes( std::vector<char> & varTypeVec );
128 
129  // load functions, residual:
130  bool loadDAEQVector ();
131  bool loadDAEFVector ();
132 
133  void auxDAECalculations ();
134 
135  // load functions, Jacobian:
136  bool loadDAEdQdx ();
137  bool loadDAEdFdx ();
138 
139 protected:
140 private:
141  // These functions represents the equations that need to be solved
142  // for this device. Since Xyce loads an F and Q contribution, the
143  // equations are broken up into their F and Q components. Thus there
144  // is a kcl1EquF() and kcl1EquQ(). Automatic differentiation will
145  // be used to generate all the derivatives of these equations for the
146  // dF/dX and dQ/dX loads
147 
148  // first we list some utility functions for calculating coefficients
149  //
150  // These functions expect V to be in milli-volts and then return values that
151  // are in 1/ms. Thus the extra factor's of 1000 here and there
152 
153  // potassium current, functions for activator equation
154  template <typename ScalarT>
155  static ScalarT alphaN( const ScalarT Vin)
156  {
157  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
158  ScalarT r = 1000.0 * (0.02 * (vScaled + 45.7)) / (1.0 - std::exp(-0.1*(vScaled+45.7)));
159  // result. the 1000 factor is to change from 1/ms to 1/s
160  return r;
161  }
162 
163  template <typename ScalarT>
164  static ScalarT betaN( const ScalarT Vin)
165  {
166  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
167  ScalarT r = 1000.0 * 0.25 * std::exp( -0.0125 * (vScaled + 55.7));
168  // result. the 1000 factor is to change from 1/ms to 1/s
169  return r;
170  }
171 
172  // sodium current, functions for activator equation
173  template <typename ScalarT>
174  static ScalarT alphaM( const ScalarT Vin)
175  {
176  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
177  ScalarT r = 1000.0 * (0.38 * (vScaled + 29.7)) / (1.0 - std::exp(-0.1*(vScaled+29.7)));
178  // result. the 1000 factor is to change from 1/ms to 1/s
179  return r;
180  }
181 
182  template <typename ScalarT>
183  static ScalarT betaM( const ScalarT Vin)
184  {
185  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
186  ScalarT r = 1000.0 * 15.2 * std::exp( -0.0556 * (vScaled + 54.7));
187  // result. the 1000 factor is to change from 1/ms to 1/s
188  return r;
189  }
190 
191  template <typename ScalarT>
192  static ScalarT alphaH( const ScalarT Vin)
193  {
194  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
195  ScalarT r = 1000.0 * 0.266 * std::exp( -0.05 * (vScaled + 48.0));
196  // result. the 1000 factor is to change from 1/ms to 1/s
197  return r;
198  }
199 
200  template <typename ScalarT>
201  static ScalarT betaH( const ScalarT Vin)
202  {
203  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
204  ScalarT r = 1000.0 * 3.8 / (1.0 + std::exp(-0.1*(vScaled+18.0)));
205  // result. the 1000 factor is to change from 1/ms to 1/s
206  return r;
207  }
208 
209  // a-current functions
210  template <typename ScalarT>
211  static ScalarT aInf( const ScalarT Vin)
212  {
213  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
214  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);
215  return r;
216  }
217 
218  template <typename ScalarT>
219  static ScalarT aTau( const ScalarT Vin)
220  {
221  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
222  ScalarT r = (0.3632 + 1.158 / (1.0 + std::exp(0.0497 * (vScaled + 55.96)))) / 1000.0;
223  // the 1000.0 factor is to change ms to s.
224  return r;
225  }
226 
227  template <typename ScalarT>
228  static ScalarT bInf( const ScalarT Vin)
229  {
230  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
231  ScalarT r = std::pow( (1.0 / (1.0 + std::exp(0.0688*(vScaled+53.3)))), 4.0);
232  return r;
233  }
234 
235  template <typename ScalarT>
236  static ScalarT bTau( const ScalarT Vin)
237  {
238  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
239  ScalarT r = (1.24 + 2.678 / (1.0 + std::exp(0.0624 * (vScaled + 50.0)))) / 1000.0;
240  return r;
241  }
242 
243  // transient calcium functions
244  template <typename ScalarT>
245  static ScalarT M_Inf( const ScalarT Vin)
246  {
247  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
248  ScalarT r = 1.0/(1.0 + std::exp(-(vScaled+57)/6.2));
249  return r;
250  }
251 
252  template <typename ScalarT>
253  static ScalarT M_Tau( const ScalarT Vin)
254  {
255  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
256  ScalarT r = (0.612 + 1.0/(std::exp(-(vScaled+132)/16.7) + std::exp((vScaled+16.8)/18.2)) ) / 1000.0;
257  return r;
258  }
259 
260  template <typename ScalarT>
261  static ScalarT H_Inf( const ScalarT Vin)
262  {
263  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
264  ScalarT r = 1.0 / (1.0 + std::exp((vScaled+81)/4.0));
265  return r;
266  }
267 
268  template <typename ScalarT>
269  static ScalarT H_Tau( const ScalarT Vin)
270  {
271  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
272  ScalarT r;
273  if( vScaled < -80.0 )
274  {
275  r = std::exp( (vScaled + 467)/66.6 ) / 1000.0;
276  }
277  else
278  {
279  r = ( 28.0 + std::exp(-(vScaled+22.0)/10.5)) / 1000.0;
280  }
281  return r;
282  }
283 
284  // Calcium dependent Potassium conductances
285  template <typename ScalarT>
286  static ScalarT C_Inf( const ScalarT Vin, const ScalarT CaConc)
287  {
288  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
289  ScalarT r = (CaConc / (CaConc + 3.0)) * (1.0 / (1.0 + std::exp(-(vScaled+28.3)/12.6 )));
290  return r;
291  }
292 
293  template <typename ScalarT>
294  static ScalarT C_Tau( const ScalarT Vin)
295  {
296  ScalarT vScaled = 1000.0 * Vin; // convert voltage to milli-volts
297  ScalarT r = (90.3 - 75.1/(1.0 + std::exp(-(vScaled+46)/22.7))) / 1000.0;
298  return r;
299  }
300 
301 
302  // now the device equations
303  // KCL equation 1
304  template <typename ScalarT>
305  static ScalarT kcl1EquF( const ScalarT& Vn1, const ScalarT& Vn2, const ScalarT& n, const ScalarT& m, const ScalarT& h,
306  const ScalarT& a, const ScalarT& b, const ScalarT& MC, const ScalarT& HC, const ScalarT& CC,
307  const ScalarT& memG, const ScalarT& restV, const ScalarT& Kg, const ScalarT& Ke, const ScalarT& NaG, const ScalarT& NaE,
308  const ScalarT& Ag, const ScalarT& Ae, const ScalarT& CaTg, const ScalarT& CaE, const ScalarT& KCaG)
309  {
310  ScalarT powN = n * n * n * n;
311  ScalarT powM = m * m * m;
312  ScalarT powA = a * a * a;
313  ScalarT powMC = MC * MC;
314  ScalarT powCC = CC * CC * CC * CC;
315  ScalarT r = memG * (Vn1 - Vn2 - restV) + Kg * powN * (Vn1 - Vn2 - Ke ) + NaG * powM * h * (Vn1 - Vn2 - NaE )
316  + Ag * powA * b * (Vn1 - Vn2 - Ae) + CaTg * powMC * HC * (Vn1 - Vn2 - CaE) + KCaG * powCC * (Vn1 - Vn2 - Ke);
317  return r;
318  }
319 
320  template <typename ScalarT>
321  static ScalarT kcl1EquQ( const ScalarT& Vn1, const ScalarT& Vn2, const ScalarT& memC )
322  {
323  ScalarT r = memC * (Vn1 - Vn2);
324  return r;
325  }
326 
327  // KCL equation 2 -- -1 * equation 1 because of device symmetry
328  template <typename ScalarT>
329  static ScalarT kcl2EquF( const ScalarT& Vn1, const ScalarT& Vn2, const ScalarT& n, const ScalarT& m, const ScalarT& h,
330  const ScalarT& a, const ScalarT& b, const ScalarT& MC, const ScalarT& HC, const ScalarT& CC,
331  const ScalarT& memG, const ScalarT& restV, const ScalarT& Kg, const ScalarT& Ke, const ScalarT& NaG, const ScalarT& NaE,
332  const ScalarT& Ag, const ScalarT& Ae, const ScalarT& CaTg, const ScalarT& CaE, const ScalarT& KCaG)
333  {
334  ScalarT powN = n * n * n * n;
335  ScalarT powM = m * m * m;
336  ScalarT powA = a * a * a;
337  ScalarT powMC = MC * MC;
338  ScalarT powCC = CC * CC * CC * CC;
339  ScalarT r = -1.0 * (memG * (Vn1 - Vn2 - restV) + Kg * powN * (Vn1 - Vn2 - Ke ) + NaG * powM * h * (Vn1 - Vn2 - NaE )
340  + Ag * powA * b * (Vn1 - Vn2 - Ae) + CaTg * powMC * HC * (Vn1 - Vn2 - CaE) + KCaG * powCC * (Vn1 - Vn2 - Ke) );
341  return r;
342  }
343 
344  template <typename ScalarT>
345  static ScalarT kcl2EquQ( const ScalarT& Vn1, const ScalarT& Vn2, const ScalarT& memC )
346  {
347  ScalarT r = -1.0 * memC * (Vn1 - Vn2);
348  return r;
349  }
350 
351  // n conservation equation
352  template <typename ScalarT>
353  static ScalarT nEquF( const ScalarT& Vn1, const ScalarT& n, const ScalarT& Vrest )
354  {
355  ScalarT vDiff = Vn1; // - Vrest
356  ScalarT alpha = alphaN<ScalarT>(vDiff);
357  ScalarT beta = betaN<ScalarT>(vDiff);
358  ScalarT r = (alpha + beta) * n - alpha;
359  return r;
360  }
361 
362  template <typename ScalarT>
363  static ScalarT nEquQ( const ScalarT& n )
364  {
365  ScalarT r = n;
366  return r;
367  }
368 
369  // m conservation equation
370  template <typename ScalarT>
371  static ScalarT mEquF( const ScalarT& Vn1, const ScalarT& m, const ScalarT& Vrest )
372  {
373  ScalarT vDiff = Vn1; // - Vrest
374  ScalarT alpha = alphaM<ScalarT>(vDiff);
375  ScalarT beta = betaM<ScalarT>(vDiff);
376  ScalarT r = (alpha + beta) * m - alpha;
377  return r;
378  }
379 
380  template <typename ScalarT>
381  static ScalarT mEquQ( const ScalarT& m )
382  {
383  ScalarT r = m;
384  return r;
385  }
386 
387  // h conservation equation
388  template <typename ScalarT>
389  static ScalarT hEquF( const ScalarT& Vn1, const ScalarT& h, const ScalarT& Vrest )
390  {
391  ScalarT vDiff = Vn1; // - Vrest
392  ScalarT alpha = alphaH<ScalarT>(vDiff);
393  ScalarT beta = betaH<ScalarT>(vDiff);
394  ScalarT r = (alpha + beta) * h - alpha;
395  return r;
396  }
397 
398  template <typename ScalarT>
399  static ScalarT hEquQ( const ScalarT& h )
400  {
401  ScalarT r = h;
402  return r;
403  }
404 
405  // a conservation equation
406  template <typename ScalarT>
407  static ScalarT aEquF( const ScalarT& Vn1, const ScalarT& a, const ScalarT& Vrest )
408  {
409  ScalarT vDiff = Vn1; // - Vrest
410  ScalarT Inf = aInf<ScalarT>(vDiff);
411  ScalarT Tau = aTau<ScalarT>(vDiff);
412  ScalarT r = (a - Inf)/Tau;
413  return r;
414  }
415 
416  template <typename ScalarT>
417  static ScalarT aEquQ( const ScalarT& a )
418  {
419  ScalarT r = a;
420  return r;
421  }
422 
423  // b conservation equation
424  template <typename ScalarT>
425  static ScalarT bEquF( const ScalarT& Vn1, const ScalarT& b, const ScalarT& Vrest )
426  {
427  ScalarT vDiff = Vn1; // - Vrest
428  ScalarT Inf = bInf<ScalarT>(vDiff);
429  ScalarT Tau = bTau<ScalarT>(vDiff);
430  ScalarT r = (b - Inf)/Tau;
431  return r;
432  }
433 
434  template <typename ScalarT>
435  static ScalarT bEquQ( const ScalarT& b )
436  {
437  ScalarT r = b;
438  return r;
439  }
440 
441  // M conservation equation
442  template <typename ScalarT>
443  static ScalarT M_EquF( const ScalarT& Vn1, const ScalarT& M, const ScalarT& Vrest )
444  {
445  ScalarT vDiff = Vn1; // - Vrest
446  ScalarT Inf = M_Inf<ScalarT>(vDiff);
447  ScalarT Tau = M_Tau<ScalarT>(vDiff);
448  ScalarT r = (M - Inf)/Tau;
449  return r;
450  }
451 
452  template <typename ScalarT>
453  static ScalarT M_EquQ( const ScalarT& M )
454  {
455  ScalarT r = M;
456  return r;
457  }
458 
459  // H conservation equation
460  template <typename ScalarT>
461  static ScalarT H_EquF( const ScalarT& Vn1, const ScalarT& H, const ScalarT& Vrest )
462  {
463  ScalarT vDiff = Vn1; // - Vrest
464  ScalarT Inf = H_Inf<ScalarT>(vDiff);
465  ScalarT Tau = H_Tau<ScalarT>(vDiff);
466  ScalarT r = (H - Inf)/Tau;
467  return r;
468  }
469 
470  template <typename ScalarT>
471  static ScalarT H_EquQ( const ScalarT& H )
472  {
473  ScalarT r = H;
474  return r;
475  }
476 
477  // C conservation equation
478  template <typename ScalarT>
479  static ScalarT C_EquF( const ScalarT& Vn1, const ScalarT& C, const ScalarT& CaConc, const ScalarT& Vrest )
480  {
481  ScalarT vDiff = Vn1; // - Vrest
482  ScalarT Inf = C_Inf<ScalarT>(vDiff, CaConc);
483  ScalarT Tau = C_Tau<ScalarT>(vDiff);
484  ScalarT r = (C - Inf)/Tau;
485  return r;
486  }
487 
488  template <typename ScalarT>
489  static ScalarT C_EquQ( const ScalarT& C )
490  {
491  ScalarT r = C;
492  return r;
493  }
494 
495  // Calcium conservation equation
496  template <typename ScalarT>
497  static ScalarT Ca_EquF( const ScalarT& Vn1, const ScalarT& Vn2, const ScalarT& MC, const ScalarT& HC, const ScalarT& Ca,
498  const ScalarT& CaTg, const ScalarT& CaE, const ScalarT& CaGamma, const ScalarT& CaTau )
499  {
500  ScalarT r = CaGamma * CaTg * MC * MC * HC * (Vn1 - Vn2 - CaE) + Ca / CaTau;
501  return r;
502  }
503 
504  template <typename ScalarT>
505  static ScalarT Ca_EquQ( const ScalarT& Ca)
506  {
507  ScalarT r = Ca;
508  return r;
509  }
510 
511 public:
512  // iterator reference to the Neuron model which owns this instance.
513  // Getters and setters
515  {
516  return model_;
517  }
518 
519 private:
520 
521  Model & model_; //< Owning model
522 
523  // derrived quantities computed in updateIntermediateVars
524  // and used in the load functions
536 
550 
551  // state variables
554 
555  // local state indices (offsets)
558 
559  // local solution indices (offsets)
560  int li_Pos; // local index to positive node on this device
561  int li_Neg; // local index to negative node on this device
562  int li_nPro; // local index to n promoter value (Na current)
563  int li_mPro; // local index to m promoter value (K current)
564  int li_hPro; // local index to h promoter value (K current)
565  int li_aPro; // local index to
566  int li_bPro; // local index
567  int li_M_Pro; // local index
568  int li_H_Pro; // local index
569  int li_cPro; // local index
570  int li_CaPro; // local index
571 
572  // Matrix equation index variables:
573 
574  // Offset variables corresponding to the above declared indices.
585 
596 
599 
602 
605 
608 
611 
614 
617 
621 
627 };
628 
629 //-----------------------------------------------------------------------------
630 // Class : Model
631 // Purpose :
632 // Special Notes :
633 // Creator : Richard Schiek, SNL, Electrical and Microsystem Modeling
634 // Creation Date : 01/02/08
635 //-----------------------------------------------------------------------------
636 class Model : public DeviceModel
637 {
638  typedef std::vector<Instance *> InstanceVector;
639 
640  friend class ParametricData<Model>;
641  friend class Instance;
642  friend class Traits;
643 
644 public:
645  Model(
646  const Configuration & configuration,
647  const ModelBlock & MB,
648  const FactoryBlock & factory_block);
649  ~Model();
650 
651 private:
652  Model();
653  Model(const Model &);
654  Model &operator=(const Model &);
655 
656 public:
657  virtual void forEachInstance(DeviceInstanceOp &op) const /* override */;
658 
659  virtual std::ostream &printOutInstances(std::ostream &os) const;
660 
661  bool processParams ();
662  bool processInstanceParams ();
663 
664 private:
665 
666  // parameter variables
667  double cMem; // membrane capacitance
668  double gMem; // membrane conductance
669  double vRest; // resting potential
670  double eNa; // sodium rest potential
671  double gNa; // sodium base conductance
672  double eK; // potassium rest potential
673  double gK; // potassium base conductance
674  double eA; // a-current rest potential
675  double gA; // a-current base conductance
676  double eCa; // Calcium rest potential
677  double gCa; // Calcium base conductance
678  double eKCa; // potassium-calcium rest potential
679  double gKCa; // potassium-calcium base conductance
680  double CaInit; // initial intra-cellular calcium concentration
681  double CaGamma; // calcium current to concentration multiplier
682  double CaTau; // calcium removal time constant
683 
684  // flags that parameters were given
685  bool cMemGiven;
686  bool gMemGiven;
688  bool eNaGiven;
689  bool gNaGiven;
690  bool eKGiven;
691  bool gKGiven;
692  bool eAGiven;
693  bool gAGiven;
694  bool eCaGiven;
695  bool gCaGiven;
696  bool eKCaGiven;
697  bool gKCaGiven;
701 
702 public:
703  void addInstance(Instance *instance)
704  {
705  instanceContainer.push_back(instance);
706  }
707 
708 private:
709  std::vector<Instance*> instanceContainer;
710 };
711 
712 void registerDevice();
713 
714 } // namespace Neuron2
715 } // namespace Device
716 } // namespace Xyce
717 
718 #endif
void registerLIDs(const std::vector< int > &intLIDVecRef, const std::vector< int > &extLIDVecRef)
Model & operator=(const Model &)
static ScalarT C_EquF(const ScalarT &Vn1, const ScalarT &C, const ScalarT &CaConc, const ScalarT &Vrest)
static ScalarT bEquQ(const ScalarT &b)
static ScalarT H_EquF(const ScalarT &Vn1, const ScalarT &H, const ScalarT &Vrest)
static ScalarT M_Inf(const ScalarT Vin)
static Device * factory(const Configuration &configuration, const FactoryBlock &factory_block)
void registerStateLIDs(const std::vector< int > &staLIDVecRef)
Pure virtual class to augment a linear system.
#define MC
static ScalarT H_EquQ(const ScalarT &H)
static ScalarT alphaN(const ScalarT Vin)
static const char * name()
Definition: N_DEV_Neuron2.h:67
static ScalarT kcl2EquF(const ScalarT &Vn1, const ScalarT &Vn2, const ScalarT &n, const ScalarT &m, const ScalarT &h, const ScalarT &a, const ScalarT &b, const ScalarT &MC, const ScalarT &HC, const ScalarT &CC, const ScalarT &memG, const ScalarT &restV, const ScalarT &Kg, const ScalarT &Ke, const ScalarT &NaG, const ScalarT &NaE, const ScalarT &Ag, const ScalarT &Ae, const ScalarT &CaTg, const ScalarT &CaE, const ScalarT &KCaG)
static void loadModelParameters(ParametricData< Model > &model_parameters)
Definition: N_DEV_Neuron2.C:75
static ScalarT mEquF(const ScalarT &Vn1, const ScalarT &m, const ScalarT &Vrest)
bool processInstanceParams()
processInstanceParams
static ScalarT nEquQ(const ScalarT &n)
static ScalarT M_EquQ(const ScalarT &M)
static ScalarT hEquQ(const ScalarT &h)
void loadNodeSymbols(Util::SymbolTable &symbol_table) const
Populates and returns the store name map.
static ScalarT aEquF(const ScalarT &Vn1, const ScalarT &a, const ScalarT &Vrest)
static ScalarT aInf(const ScalarT Vin)
static void loadInstanceParameters(ParametricData< Instance > &instance_parameters)
Definition: N_DEV_Neuron2.C:71
static ScalarT aEquQ(const ScalarT &a)
bool processParams()
processParams
static ScalarT Ca_EquQ(const ScalarT &Ca)
The FactoryBlock contains parameters needed by the device, instance and model creation functions...
static ScalarT alphaH(const ScalarT Vin)
static ScalarT H_Inf(const ScalarT Vin)
void addInstance(Instance *instance)
static ScalarT kcl1EquQ(const ScalarT &Vn1, const ScalarT &Vn2, const ScalarT &memC)
static ScalarT kcl1EquF(const ScalarT &Vn1, const ScalarT &Vn2, const ScalarT &n, const ScalarT &m, const ScalarT &h, const ScalarT &a, const ScalarT &b, const ScalarT &MC, const ScalarT &HC, const ScalarT &CC, const ScalarT &memG, const ScalarT &restV, const ScalarT &Kg, const ScalarT &Ke, const ScalarT &NaG, const ScalarT &NaE, const ScalarT &Ag, const ScalarT &Ae, const ScalarT &CaTg, const ScalarT &CaE, const ScalarT &KCaG)
static ScalarT bInf(const ScalarT Vin)
static ScalarT M_EquF(const ScalarT &Vn1, const ScalarT &M, const ScalarT &Vrest)
bool updateTemperature(const double &temp_tmp)
static ScalarT betaH(const ScalarT Vin)
static ScalarT bEquF(const ScalarT &Vn1, const ScalarT &b, const ScalarT &Vrest)
virtual void forEachInstance(DeviceInstanceOp &op) const
Apply a device instance "op" to all instances associated with this model.
The Device class is an interface for device implementations.
Definition: N_DEV_Device.h:101
static ScalarT alphaM(const ScalarT Vin)
static ScalarT bTau(const ScalarT Vin)
static ScalarT nEquF(const ScalarT &Vn1, const ScalarT &n, const ScalarT &Vrest)
static ScalarT betaM(const ScalarT Vin)
Class Configuration contains device configuration data.
Instance(const Configuration &configuration, const InstanceBlock &IB, Model &Miter, const FactoryBlock &factory_block)
static ScalarT H_Tau(const ScalarT Vin)
#define M
static ScalarT aTau(const ScalarT Vin)
static ScalarT C_Inf(const ScalarT Vin, const ScalarT CaConc)
static ScalarT Ca_EquF(const ScalarT &Vn1, const ScalarT &Vn2, const ScalarT &MC, const ScalarT &HC, const ScalarT &Ca, const ScalarT &CaTg, const ScalarT &CaE, const ScalarT &CaGamma, const ScalarT &CaTau)
static ScalarT C_EquQ(const ScalarT &C)
void registerJacLIDs(const std::vector< std::vector< int > > &jacLIDVec)
static ScalarT mEquQ(const ScalarT &m)
std::vector< Instance * > instanceContainer
static std::vector< std::vector< int > > jacStamp
Definition: N_DEV_Neuron2.h:95
virtual std::ostream & printOutInstances(std::ostream &os) const
static ScalarT betaN(const ScalarT Vin)
ModelBlock represents a .MODEL line from the netlist.
static ScalarT C_Tau(const ScalarT Vin)
The DeviceTraits template describes the configuration of a device.
Manages parameter binding for class C.
Definition: N_DEV_Pars.h:214
InstanceBlock represent a device instance line from the netlist.
static const char * deviceTypeName()
Definition: N_DEV_Neuron2.h:68
static ScalarT M_Tau(const ScalarT Vin)
Instance & operator=(const Instance &)
const std::vector< std::vector< int > > & jacobianStamp() const
void varTypes(std::vector< char > &varTypeVec)
static ScalarT kcl2EquQ(const ScalarT &Vn1, const ScalarT &Vn2, const ScalarT &memC)
std::vector< Instance * > InstanceVector
static ScalarT hEquF(const ScalarT &Vn1, const ScalarT &h, const ScalarT &Vrest)