24 virtual int type() {
return 0; }
25 virtual double f(
double v) {
return 1.; }
27 int i;
for (i=0; i <
cnt; ++
i) { val[
i] =
f(v[i]); }
31 double c(
int i) {
return gp_->elem(i); }
32 static double Exp(
double x) {
if (x > 700.) {
return exp(700.);
33 }
else if (x < -700.) {
return exp(-700.);
34 }
else {
return exp(x); } }
39 virtual int type() {
return 1; }
40 virtual double f(
double v) {
return c(0); }
45 virtual int type() {
return 2; }
46 virtual double f(
double v) {
return c(0)*
Exp(
c(1) * (v -
c(2))); }
51 virtual int type() {
return 3; }
52 virtual double f(
double v) {
53 double x =
c(1)*(v -
c(2));
55 return c(0)*x/(1 -
Exp(-x));
57 return c(0)*(1 + x/2.);
64 virtual int type() {
return 4; }
65 virtual double f(
double v) {
66 return c(0) / (1. +
Exp(
c(1) * (v -
c(2))));
72 #define _e_over_k _e_over_k_[_nrnunit_use_legacy_] 74 #define ebykt (_e_over_k/(273.15 + celsius)) 86 virtual int type() {
return 5; }
87 virtual double f(
double v) {
88 double x =
ebykt*
c(2)*(v -
c(1));
89 double ap =
c(0) *
Exp(
c(3)*x);
90 double bp =
c(0) *
Exp((
c(3) - 1.)*x);
92 double inf = ap*tau; tau +=
c(4);
100 virtual int type() {
return 6; }
101 virtual double f(
double v) {
102 double x =
ebykt*
c(2)*(v -
c(1));
103 double ap =
c(0) *
Exp(
c(3)*x);
104 double bp =
c(0) *
Exp((
c(3) - 1.)*x);
105 double tau = 1/(ap + bp);
106 inf = ap*tau; tau +=
c(4);
115 virtual int type() {
return 7; }
116 virtual double f(
double v);
127 void setf(
int direction,
int type,
Vect* vec,
double vmin,
double vmax);
129 double alpha(
double v) {
return type_ == 0 ? f0->f(v) : f0->f(v)/f1->f(v); }
130 double beta(
double v) {
return type_ == 0 ? f1->f(v) : (1. - f0->f(v))/f1->f(v); }
131 double inf(
double v) {
return type_ == 1 ? f0->f(v) : f0->f(v)/(f0->f(v) + f1->f(v)); }
132 double tau(
double v) {
return type_ == 1 ? f1->f(v) : 1./(f0->f(v) + f1->f(v)); }
133 void ab(
double v,
double& a,
double& b);
135 void inftau(
double v,
double& inf,
double& tau);
140 void hh_table_make(
double dt,
int size=200,
double vmin=-100.,
double vmax=50.);
147 inf = inftab_[
i] + (inftab_[i+1] - inftab_[
i])*x;
148 tau = tautab_[
i] + (tautab_[i+1] - tautab_[
i])*x;
152 virtual double beta();
153 void lig2pd(
int pdoff);
178 double conductance(
double* state,
KSState* st);
191 virtual double cur(
double g,
double*
p,
Datum* pd,
double v);
192 virtual double jacob(
double* p,
Datum* pd,
double v);
197 virtual double cur(
double g,
double*
p,
Datum* pd,
double v);
198 virtual double jacob(
double* p,
Datum* pd,
double v);
203 virtual double cur(
double g,
double*
p,
Datum* pd,
double v);
204 virtual double jacob(
double* p,
Datum* pd,
double v);
210 virtual double cur(
double g,
double*
p,
Datum* pd,
double v);
211 virtual double jacob(
double* p,
Datum* pd,
double v);
217 virtual double cur(
double g,
double*
p,
Datum* pd,
double v);
218 virtual double jacob(
double* p,
Datum* pd,
double v);
223 virtual double cur(
double g,
double*
p,
Datum* pd,
double v);
224 virtual double jacob(
double* p,
Datum* pd,
double v);
231 const char*
string() {
return name_.string(); }
243 virtual void alloc(
Prop*);
246 virtual void jacob(
int,
Node**,
double**,
Datum**);
253 void add_channel(
const char**);
256 virtual void map(
int,
double**,
double**,
double*,
Datum*,
double*);
257 virtual void spec(
int,
Node**,
double**,
Datum**);
260 double conductance(
double gmax,
double* state);
263 int state(
const char*
name);
264 const char* state(
int index);
265 int trans_index(
const char* src,
const char* target);
266 int trans_index(
int src,
int target);
267 int gate_index(
int state_index);
270 void set_single(
bool,
bool update =
true);
274 double alpha(
double v,
int,
int) {
return 0.;}
275 double beta(
double v,
int,
int) {
return 0.;}
276 void setstructure(
Vect*);
277 void setname(
const char*);
278 void setsname(
int,
const char*);
279 void setion(
const char*);
280 void setligand(
int i,
const char*);
282 void setivrelation(
int);
284 KSState* add_hhstate(
const char*);
285 KSState* add_ksstate(
int igate,
const char*);
286 void remove_state(
int);
289 KSTransition* add_transition(
int src,
int target,
const char* ligand);
290 void remove_transition(
int);
293 void usetable(
bool,
int size,
double vmin,
double vmax);
295 int usetable(
double* vmin,
double* vmax);
302 void fillmat(
double v,
Datum* pd);
303 void mat_dt(
double dt,
double*
p);
304 void solvemat(
double*);
305 void mulmat(
double*,
double*);
307 void ligand_consist(
int,
int,
Prop*,
Node*);
309 void state_consist(
int shift = 0);
310 void sname_install();
315 void delete_schan_node_data();
316 void alloc_schan_node_data();
319 KSState* state_insert(
int i,
const char* name,
double frac);
320 void state_remove(
int i);
322 void gate_remove(
int i);
324 void trans_remove(
int i);
374 double vmin_, vmax_, dvinv_, dtsav_;
static KSChanFunction * new_function(int type, Vect *, double, double)
virtual double f(double v)
static void * vmin(NrnThread *nt)
static double Exp(double x)
virtual double f(double v)
Represent main neuron object computed by single thread.
virtual ~KSChanFunction()
virtual double f(double v)
virtual double f(double v)
static void update(NrnThread *)
void inftau_hh_table(int i, double x, double &inf, double &tau)
static double map(void *v)
virtual double f(double v)
virtual double f(double v)
#define _e_over_k_codata2018
double alpha(double v, int, int)
void f(int cnt, double *v, double *val)
static double _e_over_k_[2]
void inftau_hh_table(int i, double &inf, double &tau)
virtual double f(double v)
double beta(double v, int, int)