46 #ifndef Xyce_N_DEV_Neuron3_h
47 #define Xyce_N_DEV_Neuron3_h
68 static const char *
name() {
return "Neuron";}
111 void registerLIDs(
const std::vector<int> & intLIDVecRef,
112 const std::vector<int> & extLIDVecRef );
117 const std::vector< std::vector<int> > &
jacobianStamp()
const;
118 void registerJacLIDs(
const std::vector< std::vector<int> > & jacLIDVec );
128 void varTypes( std::vector<char> & varTypeVec );
155 template <
typename ScalarT>
156 static ScalarT
alphaN(
const ScalarT & Vn1,
const ScalarT & Vrest)
158 ScalarT vDiff = 1000.0 * (Vn1 - Vrest);
167 (100.0 * ( std::exp( (10.0 - vDiff)/10.0 ) - 1.0 ));
173 template <
typename ScalarT>
174 static ScalarT
betaN(
const ScalarT & Vn1,
const ScalarT & Vrest)
176 ScalarT vDiff = 1000.0 * (Vn1 - Vrest);
177 ScalarT r = 0.125 * std::exp( -vDiff/80.0 );
183 template <
typename ScalarT>
184 static ScalarT
alphaM(
const ScalarT & Vn1,
const ScalarT & Vrest)
186 ScalarT vDiff = 1000.0 * (Vn1 - Vrest);
196 (10.0 * ( std::exp( (25.0 - vDiff)/10.0 ) - 1.0 ));
202 template <
typename ScalarT>
203 static ScalarT
betaM(
const ScalarT & Vn1,
const ScalarT & Vrest)
205 ScalarT vDiff = 1000.0 * (Vn1 - Vrest);
206 ScalarT r = 4.0 * std::exp( -vDiff/18.0 );
212 template <
typename ScalarT>
213 static ScalarT
alphaH(
const ScalarT & Vn1,
const ScalarT & Vrest)
215 ScalarT vDiff = 1000.0 * (Vn1 - Vrest);
216 ScalarT r = 0.07 * std::exp( -vDiff/20.0 );
221 template <
typename ScalarT>
222 static ScalarT
betaH(
const ScalarT & Vn1,
const ScalarT & Vrest)
224 ScalarT vDiff = 1000.0 * (Vn1 - Vrest);
225 ScalarT r = 1.0 / ( std::exp( (30.0 - vDiff)/10.0 ) + 1.0 );
244 template <
typename ScalarT>
245 static ScalarT
kcl1EquF(
const ScalarT& VSeg,
const ScalarT& VSegP,
const ScalarT & VSegN,
const ScalarT& n,
const ScalarT& m,
const ScalarT& h,
246 const ScalarT& gPrev,
const ScalarT& gNext,
const ScalarT& memG,
const ScalarT& restV,
const ScalarT& Kg,
const ScalarT& Ke,
const ScalarT& NaG,
const ScalarT& NaE )
248 ScalarT powN = n * n * n * n;
249 ScalarT powM = m * m * m;
251 ScalarT r = memG * (VSeg - restV) + Kg * powN * (VSeg - Ke ) + NaG * powM * h * (VSeg - NaE )
252 - gNext * (VSegN - VSeg) - gPrev * (VSegP - VSeg);
256 template <
typename ScalarT>
257 static ScalarT
kcl1EquQ(
const ScalarT& VSeg,
const ScalarT& memC )
259 ScalarT r = memC * VSeg;
265 template <
typename ScalarT>
266 static ScalarT
kcl2EquF(
const ScalarT& Vn1,
const ScalarT& Vn2,
const ScalarT& n,
const ScalarT& m,
const ScalarT& h,
267 const ScalarT& memG,
const ScalarT& restV,
const ScalarT& Kg,
const ScalarT& Ke,
const ScalarT& NaG,
const ScalarT& NaE )
269 ScalarT powN = n * n * n * n;
270 ScalarT powM = m * m * m;
271 ScalarT r = -1.0*(memG * (Vn1 - Vn2 - restV) + Kg * powN * (Vn1 - Vn2 - Ke ) + NaG * powM * h * (Vn1 - Vn2 - NaE ));
276 template <
typename ScalarT>
277 static ScalarT
kcl2EquQ(
const ScalarT& Vn1,
const ScalarT& Vn2,
const ScalarT& memC )
279 ScalarT r = -1.0 * memC * (Vn1 - Vn2);
285 template <
typename ScalarT>
286 static ScalarT
nEquF(
const ScalarT& Vn1,
const ScalarT& n,
const ScalarT& Vrest )
288 ScalarT r = alphaN<ScalarT>( Vn1, Vrest ) * (1.0 - n ) - betaN<ScalarT>( Vn1, Vrest ) * n;
292 template <
typename ScalarT>
293 static ScalarT
nEquQ(
const ScalarT& n )
300 template <
typename ScalarT>
301 static ScalarT
mEquF(
const ScalarT& Vn1,
const ScalarT& m,
const ScalarT& Vrest )
303 ScalarT r = alphaM<ScalarT>( Vn1, Vrest ) * (1.0 - m ) - betaM<ScalarT>( Vn1, Vrest ) * m;
307 template <
typename ScalarT>
308 static ScalarT
mEquQ(
const ScalarT& m )
315 template <
typename ScalarT>
316 static ScalarT
hEquF(
const ScalarT& Vn1,
const ScalarT& h,
const ScalarT& Vrest )
318 ScalarT r = alphaH<ScalarT>( Vn1, Vrest ) * (1.0 - h ) - betaH<ScalarT>( Vn1, Vrest ) * h;
322 template <
typename ScalarT>
323 static ScalarT
hEquQ(
const ScalarT& h )
std::vector< int > MEquVNodeOffset
std::vector< double > segNEquFvalue
bool updateIntermediateVars()
std::vector< double > segF_dV
static ScalarT hEquF(const ScalarT &Vn1, const ScalarT &h, const ScalarT &Vrest)
std::vector< double > dhF_dh
std::vector< double > segF_dn
std::vector< int > SegVEqnVsegOffset
bool updateTemperature(const double &temp_tmp)
static const char * deviceTypeName()
void registerJacLIDs(const std::vector< std::vector< int > > &jacLIDVec)
std::vector< int > SegVEqnNOffset
std::vector< int > NEquVNodeOffset
std::vector< int > li_mPro
static ScalarT mEquF(const ScalarT &Vn1, const ScalarT &m, const ScalarT &Vrest)
std::vector< double > segQ_dV
std::vector< int > HEquHNodeOffset
std::vector< int > SegVEqnMOffset
Pure virtual class to augment a linear system.
std::vector< std::vector< int > > jacStamp
std::vector< double > dhF_dV
void addInstance(Instance *instance)
std::vector< double > dmF_dV
std::vector< double > dnF_dV
std::vector< Instance * > InstanceVector
std::vector< double > gForward
void registerStateLIDs(const std::vector< int > &staLIDVecRef)
std::vector< double > dnF_dn
static ScalarT mEquQ(const ScalarT &m)
std::vector< double > segF_dVn
std::vector< double > segF_dh
std::vector< double > dmQ_dm
std::vector< int > li_Vol
static bool modelRequired()
std::vector< Instance * > instanceContainer
std::vector< int > MEquMNodeOffset
bool updatePrimaryState()
std::vector< double > segQvalue
std::vector< double > segHEquFvalue
static const char * name()
std::vector< int > SegVEqnHOffset
The FactoryBlock contains parameters needed by the device, instance and model creation functions...
std::vector< double > potassiumCurrent
std::vector< int > li_hPro
static ScalarT betaN(const ScalarT &Vn1, const ScalarT &Vrest)
bool processParams()
processParams
bool updateSecondaryState()
static void loadInstanceParameters(ParametricData< Instance > &instance_parameters)
static Device * factory(const Configuration &configuration, const FactoryBlock &factory_block)
std::vector< int > SegVEqnVpreOffset
int ANegEquLastNodeOffset
std::vector< double > dnQ_dn
static ScalarT kcl1EquF(const ScalarT &VSeg, const ScalarT &VSegP, const ScalarT &VSegN, const ScalarT &n, const ScalarT &m, const ScalarT &h, const ScalarT &gPrev, const ScalarT &gNext, const ScalarT &memG, const ScalarT &restV, const ScalarT &Kg, const ScalarT &Ke, const ScalarT &NaG, const ScalarT &NaE)
The Device class is an interface for device implementations.
static bool isLinearDevice()
Instance(const Configuration &configuration, const InstanceBlock &IB, Model &Miter, const FactoryBlock &factory_block)
static ScalarT alphaN(const ScalarT &Vn1, const ScalarT &Vrest)
std::vector< int > HEquVNodeOffset
static ScalarT betaH(const ScalarT &Vn1, const ScalarT &Vrest)
std::vector< double > segFvalue
void loadNodeSymbols(Util::SymbolTable &symbol_table) const
Populates and returns the store name map.
std::vector< int > NEquNNodeOffset
std::vector< double > segHEquQvalue
const std::vector< std::vector< int > > & jacobianStamp() const
Class Configuration contains device configuration data.
std::vector< double > segNEquQvalue
virtual void forEachInstance(DeviceInstanceOp &op) const
Apply a device instance "op" to all instances associated with this model.
static ScalarT alphaM(const ScalarT &Vn1, const ScalarT &Vrest)
std::vector< double > gBackward
std::vector< int > li_KCurrentState
bool processInstanceParams()
processInstanceParams
std::vector< double > dhQ_dh
std::vector< int > SegVEqnVnexOffset
Instance & operator=(const Instance &)
static ScalarT kcl2EquQ(const ScalarT &Vn1, const ScalarT &Vn2, const ScalarT &memC)
static ScalarT hEquQ(const ScalarT &h)
static ScalarT kcl1EquQ(const ScalarT &VSeg, const ScalarT &memC)
std::vector< double > segF_dVp
static ScalarT nEquQ(const ScalarT &n)
Model & operator=(const Model &)
std::vector< int > li_NaCurrentState
void auxDAECalculations()
static ScalarT nEquF(const ScalarT &Vn1, const ScalarT &n, const ScalarT &Vrest)
int APosEquNextNodeOffset
void registerLIDs(const std::vector< int > &intLIDVecRef, const std::vector< int > &extLIDVecRef)
std::vector< double > segF_dm
std::vector< double > sodiumCurrent
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)
ModelBlock represents a .MODEL line from the netlist.
The DeviceTraits template describes the configuration of a device.
Manages parameter binding for class C.
static ScalarT betaM(const ScalarT &Vn1, const ScalarT &Vrest)
InstanceBlock represent a device instance line from the netlist.
std::vector< double > dmF_dm
void varTypes(std::vector< char > &varTypeVec)
virtual std::ostream & printOutInstances(std::ostream &os) const
std::vector< double > segMEquFvalue
static ScalarT alphaH(const ScalarT &Vn1, const ScalarT &Vrest)
static void loadModelParameters(ParametricData< Model > &model_parameters)
std::vector< int > li_nPro
std::vector< double > segMEquQvalue