-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchem_syn.h
55 lines (46 loc) · 1.12 KB
/
chem_syn.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// chemical synapse with boltzman activation
#ifndef CHEM_SYN
#define CHEM_SYN
#include "synapse.h"
#include <cmath>
//inherit conductance class spec
class chem_syn: public synapse {
protected:
double v_half, delta; //half-activation, slope
public:
//constructors - must set gbar!
// gbar only
chem_syn(double g_in, double e_in, double vh_in, double d_in)
{
gbar = g_in;
state_dim = 0;
e_rev = e_in;
v_half = vh_in;
delta = d_in;
}
double activation(double);
double i(void);
int get_state_dim(void);
void integrate(double);
void state2double(double*);
void double2state(double*);
};
double chem_syn::activation(double pre_v)
{
return 1.0/(1.0+exp((v_half-pre_v)/delta));
}
double chem_syn::i(void)
{
return gbar*activation(pre_vm())*(e_rev - post_vm());
}
int chem_syn::get_state_dim(void)
{
return 0;
}
void chem_syn::integrate(double dt)
{
g = gbar*activation(pre_vm());
}
void chem_syn::state2double(double* st) { }
void chem_syn::double2state(double*) { }
#endif