// Simulation and analysis of Spatiotemporal Component of Cl- Gradients in a isolated dendrite
// Define spatial properties of dendrite
ANZAHL_NODES = 100
// Determination Parameters GABA
ANZAHL_GABA = 1 //Anzahl der synaptischen Pulse
FAKTOR = 5 // Factor by which the GABAergic current was multiplied
G_GABA = 0.000789 * FAKTOR //This Value was pultiplid for the analysis
P_GABA = 0.0
DECAY_GABA = 37
GABA_SYN_LOCATION = 0.5 // Position GABA Synapse for Pulses
ONSET_PULSE = 50
//----- Define run parameters ---------------------
tstop = 5000 // Duration
v_init = -60 // Initial voltage
dt = 0.05 // Step Interval in ms
lenghtoutputvec = 6000 // Number of Lines for output (< 32000 for Excel-Figures)
//----- Insert synapses -------------------------
// Determination of Synapses
objref gabasyn
dend {
// insert GABA synapse
gabasyn = new gaba(GABA_SYN_LOCATION)
tau1_gaba = 0.1
tau2_gaba = DECAY_GABA
HCO3e_gaba = 22.4
HCO3i_gaba = 14.1
P_gaba = P_GABA
}
// Definition of synaptic Stimuli
objref stimGABApuls //Pulssequenz GABA
stimGABApuls = new NetStim(GABA_SYN_LOCATION)
stimGABApuls.number = ANZAHL_GABA
stimGABApuls.start = ONSET_PULSE
// Linkage of synaptic Inputs
objref synpulsegaba
dend {
synpulsegaba = new NetCon(stimGABApuls, gabasyn, 0, 0, G_GABA)
}
// ------------Procedures and Functions -------------------------------
// --------------------------------------------------------------------
// Function MakeShort ---------------------------------------//
// Inputs: $1 Objref to Inputvector //
// $2 Objref to Outoutvector //
// lenoutvec desired lendth of Outputvector //
// //
// Reduce Inputvec to Outputvev by averaging n elements //
// n (reducing factor) = floor(Inputvec.size() / lenoutvec) //
// ----------------------------------------------------------//
obfunc MakeShort() {local i, n
n = int($o1.size()/$3)
$o2.resize($3)
for i=0, $3-1 {
$o2.x[i] = $o1.mean(i*n, (i+1)*n-1)
}
return $o2
} // End of function
// ---------Definition of Output Vectors and File Output --------------
// --------------------------------------------------------------------
//-- Define ------
objref timevec, shorttimevec
objref voltvec[ANZAHL_NODES], shortvoltvec
objref clivec[ANZAHL_NODES], shortclivec
objref Outmatrix //0=time,1 to ANZAHL_NODES = Cl-, ANZAHL_NODES +1 - 2* ANZAHL_NODES = v
strdef OutFileName // Name of File Output
objref OutFile
//--- Assign -------
timevec = new Vector()
shorttimevec = new Vector()
for i = 0, ANZAHL_NODES-1 {
voltvec[i] = new Vector()
clivec[i] = new Vector()
}
shortclivec = new Vector()
shortvoltvec = new Vector()
Outmatrix = new Matrix()
//-- Link Output Vectors ----------------
timevec.record(&t) // Time vector
for i = 0, ANZAHL_NODES-1 { // Generate Vektor for each node
voltvec[i].record(&dend.v(i/ANZAHL_NODES))
clivec[i].record(&dend.cli(i/ANZAHL_NODES))
}
// Run Simulation --------------------------------------------------------
run()
// Put Data in Output Matrix --------------------------------------------
// ---- => shrink the fectors to output-size before ---------------------
MakeShort(timevec, shorttimevec, lenghtoutputvec)
Outmatrix.resize(shorttimevec.size()+1, 2*ANZAHL_NODES+1)
Outmatrix.setcol(0, shorttimevec)
for i = 1, ANZAHL_NODES { // Put Vektors in Outmatrix
MakeShort(clivec[i-1], shortclivec, lenghtoutputvec)
MakeShort(voltvec[i-1], shortvoltvec, lenghtoutputvec)
Outmatrix.setcol(i, shortclivec)
Outmatrix.setcol(ANZAHL_NODES + i, shortvoltvec)
}
// Save the Data --------------------------------------------------------------------
OutFile = new File()
sprint(OutFileName, "Result_Isolated_Dendrite_Spatiotemp_%g.asc",FAKTOR)
OutFile.wopen(OutFileName)
Outmatrix.fprint(OutFile, "\t%g")
OutFile.close
|