-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'stuart-knock-dendrite-differential'
+ This branch solves #43: -> Implements a differential form for dendritic dynamics (preexisting RK4) -> Leaves the integral form as legacy code. -> DendriteIntrgral should be used only for steady state dynamics and uniform parameters (alpha and beta)
- Loading branch information
Showing
28 changed files
with
274 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
Example configuration file for the Robinson et. al. corticothalamic model | ||
|
||
Connection 1 - Excitatory -> Excitatory | ||
Connection 2 - Inhibitory -> Excitatory | ||
Connection 3 - Relay -> Excitatory | ||
Connection 4 - Excitatory -> Inhibitory | ||
Connection 5 - Inhibitory -> Inhibitory | ||
Connection 6 - Relay -> Inhibitory | ||
Connection 7 - Excitatory -> Reticular | ||
Connection 8 - Relay -> Reticular | ||
Connection 9 - Excitatory -> Relay | ||
Connection 10 - Reticular -> Relay | ||
Connection 11 - Stimulus -> Relay | ||
|
||
Time: 15 Deltat: 0.0001 | ||
Nodes: 144 | ||
|
||
Connection matrix: | ||
From: 1 2 3 4 5 | ||
To 1: 1 2 0 3 0 | ||
To 2: 4 5 0 6 0 | ||
To 3: 7 0 0 8 0 | ||
To 4: 9 0 10 0 11 | ||
To 5: 0 0 0 0 0 | ||
|
||
Population 1: Excitatory | ||
Length: 0.5 | ||
Q: 5.248361515 | ||
Firing: Sigmoid - Theta: 0.01292 Sigma: 0.0038 Qmax: 340 | ||
Dendrite 1: Integral - alpha: 83.33333333 beta: 769.2307692 | ||
Dendrite 2: Integral - alpha: 83.33333333 beta: 769.2307692 | ||
Dendrite 3: Integral - alpha: 83.33333333 beta: 769.2307692 | ||
|
||
Population 2: Inhibitory | ||
Length: 0.5 | ||
Q: 5.248361515 | ||
Firing: Sigmoid - Theta: 0.01292 Sigma: 0.0038 Qmax: 340 | ||
Dendrite 4: Integral - alpha: 83.33333333 beta: 769.2307692 | ||
Dendrite 5: Integral - alpha: 83.33333333 beta: 769.2307692 | ||
Dendrite 6: Integral - alpha: 83.33333333 beta: 769.2307692 | ||
|
||
Population 3: Reticular | ||
Length: 0.5 | ||
Q: 15.39601978 | ||
Firing: Sigmoid - Theta: 0.01292 Sigma: 0.0038 Qmax: 340 | ||
Dendrite 7: Integral - alpha: 83.33333333 beta: 769.2307692 | ||
Dendrite 8: Integral - alpha: 83.33333333 beta: 769.2307692 | ||
|
||
Population 4: Relay | ||
Length: 0.5 | ||
Q: 8.789733431 | ||
Firing: Sigmoid - Theta: 0.01292 Sigma: 0.0038 Qmax: 340 | ||
Dendrite 9: Integral - alpha: 83.33333333 beta: 769.2307692 | ||
Dendrite 10: Integral - alpha: 83.33333333 beta: 769.2307692 | ||
Dendrite 11: Integral - alpha: 83.33333333 beta: 769.2307692 | ||
|
||
Population 5: Stimulation | ||
Length: 0.5 | ||
Stimulus: White - Onset: 0 Mean: 1 Psd: 1e-05 | ||
|
||
Propagator 1: Wave - Tau: 0 Range: 0.086 gamma: 116 | ||
Propagator 2: Map - Tau: 0 | ||
Propagator 3: Map - Tau: 0.0425 | ||
Propagator 4: Wave - Tau: 0 Range: 0.086 gamma: 116 | ||
Propagator 5: Map - Tau: 0 | ||
Propagator 6: Map - Tau: 0.0425 | ||
Propagator 7: Wave - Tau: 0.0425 Range: 0.086 gamma: 116 | ||
Propagator 8: Map - Tau: 0 | ||
Propagator 9: Wave - Tau: 0.0425 Range: 0.086 gamma: 116 | ||
Propagator 10: Map - Tau: 0 | ||
Propagator 11: Map - Tau: 0 | ||
|
||
Coupling 1: Map - nu: 0.001525377176 | ||
Coupling 2: Map - nu: -0.003022754434 | ||
Coupling 3: Map - nu: 0.0005674779589 | ||
Coupling 4: Map - nu: 0.001525377176 | ||
Coupling 5: Map - nu: -0.003022754434 | ||
Coupling 6: Map - nu: 0.0005674779589 | ||
Coupling 7: Map - nu: 0.0001695899041 | ||
Coupling 8: Map - nu: 5.070036187e-05 | ||
Coupling 9: Map - nu: 0.003447358203 | ||
Coupling 10: Map - nu: -0.001465128967 | ||
Coupling 11: Map - nu: 0.003593330094 | ||
|
||
Output: Node: All Start: 5 Interval: 0.5e-2 | ||
Population: 1 | ||
Dendrite: | ||
Propagator: 1 | ||
Coupling: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** @file dendrite_integral.cpp | ||
@brief DendriteIntegral handles the dendritic response of the postsynaptic | ||
population using the integral form for the step() member-function. | ||
A more detailed multiline description... | ||
@author Peter Drysdale, Felix Fung, | ||
*/ | ||
|
||
#include "dendrite_integral.h" | ||
|
||
|
||
void DendriteIntegral::init( Configf& configf ) { | ||
Dendrite::init(configf); | ||
|
||
oldnp = v; | ||
|
||
// Initialize constant factors to speed up computation. | ||
aminusb = alpha - beta; | ||
expa = exp(-alpha*deltat); | ||
expb = exp(-beta*deltat); | ||
factorab = 1./alpha + 1./beta; | ||
} | ||
|
||
DendriteIntegral::DendriteIntegral( size_type nodes, double deltat, size_type index, | ||
const Propagator& prepropag, const Coupling& precouple ) | ||
: Dendrite(nodes, deltat, index, prepropag, precouple), dvdt(nodes,0), oldnp(nodes) { | ||
} | ||
|
||
DendriteIntegral::~DendriteIntegral() = default; | ||
|
||
void DendriteIntegral::step() { | ||
// assume that alpha, beta are constant and nu*phi is linear for the time step | ||
if(alpha!=beta) { | ||
for(size_type i=0; i<nodes; i++) { | ||
dpdt = ( precouple[i] -oldnp[i] )/deltat; | ||
adjustednp = oldnp[i] -factorab*dpdt -v[i]; | ||
C1 = ( adjustednp*beta -dvdt[i] +dpdt )/aminusb; | ||
C1expa = C1*expa; | ||
C2expb = expb*(-C1-adjustednp); | ||
v[i] = C1expa+C2expb+precouple[i] -factorab*dpdt; | ||
dvdt[i] = C1expa*(-alpha) +C2expb*(-beta)+dpdt; | ||
oldnp[i]=precouple[i]; //Save current pulse density for next step | ||
} | ||
} else { // alpha==beta | ||
for(size_type i=0; i<nodes; i++) { | ||
dpdt = ( precouple[i] -oldnp[i] )/deltat; | ||
adjustednp = oldnp[i] -factorab*dpdt -v[i]; | ||
C1 = dvdt[i] -alpha*adjustednp -dpdt; | ||
C1dtplusC2 = C1*deltat -adjustednp; | ||
v[i] = C1dtplusC2*expa +precouple[i] -factorab*dpdt; | ||
dvdt[i] = (C1-alpha*C1dtplusC2)*expa +dpdt; | ||
oldnp[i]=precouple[i]; //Save current pulse density for next step | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** @file dendrite_integral.h | ||
@brief Defines the DendriteIntegral class, which handles the response of the | ||
postsynaptic population using the integral form for the step() | ||
member-function. | ||
A more detailed multiline description... | ||
@author Peter Drysdale, Felix Fung, | ||
*/ | ||
|
||
#ifndef NEUROFIELD_SRC_DENDRITE_INTEGRAL_H | ||
#define NEUROFIELD_SRC_DENDRITE_INTEGRAL_H | ||
|
||
#include "dendrite.h" | ||
|
||
class DendriteIntegral : public Dendrite { | ||
DendriteIntegral(void); // default constructor | ||
DendriteIntegral(DendriteIntegral& ); // no copy constructor | ||
|
||
// variables that are intialized once to speed up computation | ||
double aminusb; ///< == alpha - beta | ||
double expa; ///< == exp(-alpha*deltat) | ||
double expb; ///< == exp(-beta*deltat) | ||
double factorab; ///< == 1./alpha + 1./beta; | ||
|
||
// variables that are used every timestep | ||
double adjustednp; | ||
double deltaPdeltat; //NOTE: doesn't seem to be used anywhere (???maybe replaced by current dpdt???). | ||
double C1; | ||
double dpdt; // Temporal derivative of pulse density. | ||
double C1expa; | ||
double C2expb; | ||
double C1dtplusC2; | ||
|
||
protected: | ||
vector<double> dvdt; ///< Temporal derivative of the membrane potential. | ||
//vector<double> np; ///< Pulse density (nu*phi). | ||
vector<double> oldnp; ///< Pulse density (nu*phi) of the previous time-step. | ||
|
||
void init( Configf& configf ) override; | ||
|
||
public: | ||
|
||
DendriteIntegral( size_type nodes, double deltat, size_type index, | ||
const Propagator& prepropag, const Coupling& precouple ); | ||
~DendriteIntegral(void) override; | ||
void step(void) override; | ||
}; | ||
|
||
#endif //NEUROFIELD_SRC_DENDRITE_INTEGRAL_H |
Oops, something went wrong.