No BSD License  

Highlights from
Neurocal

image thumbnail
from Neurocal by Zeng Lertmanorat
Simulation describing the electrical activity of nerve cell (neuron) by solving cable equation

Ex_08_Simple_Neuron_Iext.m
%-------------------------------------------------------------------------------------------
create('axon');
create('soma');
create('dendrite',2)            %create dendrite(1),dendrite(2),dendrite(3)

global axon soma dendrite

axon.nseg		=55;                                    %       change the number of segments
axon.dia		=10;                                    % um    diameter
axon.Lmode		=2;
axon.Linter_D	=100;
axon.L   		=axon.Linter_D*axon.dia*(axon.nseg);    %um     change the length of axon
axon.da_D 		=0.6;
axon.lnodal		=1;
axon.dn_D		=0.33;
axon.xyzi   	=[1 0 0];                                   % unitless
axon.xyzc       =[0 0 0];                                   % um: the coordinate of the node at the center
insert(axon,'schwarz')

soma.vini       =-82;
soma.xyzi   	=[1 0 0];                                   % unitless
soma.xyzc       =[-28000 0 0];                                   % um: the coordinate of the node at the center

dendrite{1}.vini       =-82;
dendrite{1}.L=2100;
dendrite{1}.nseg=21;
dendrite{1}.xyzi   	=[0 1 0];                                   % unitless
dendrite{1}.xyzc    =[-28000 1050 0];                                   % um: the coordinate of the node at the center

dendrite{2}.vini       =-82;
dendrite{2}.L=4200;
dendrite{2}.nseg=21;
dendrite{2}.xyzi   	=[0 0 1];                                   % unitless
dendrite{2}.xyzc    =[-28000 2100 0];                                   % um: the coordinate of the node at the center

connect(soma,0,dendrite{1},0); %[main, position(0-1), branch, position (0 OR 1)]
connect(soma,0,dendrite{2},0); %the branch position is either 0 or 1
connect(axon,0,soma,0);        %the branch position is either 0 or 1

Iexstim([    0 0 200], 300,50,0)  
for i=1:1
    Iexstim([-1000*i 0 200],300,50,0)  
    Iexstim([ 1000*i 0 200],300,50,0)  
    Iexstim([-1000*i+500 0 200],-300,50,0)  
    Iexstim([ 1000*i-500 0 200],-300,50,0)  
end

%-------------------------------------------------------------------------------------------
%The parameters that are used in Neurocal are

%.name			%  	internal use.
%.varnum        %  	internal use.
%.nseg			% 	number of segments for the variable.
%.dia       	%	um	- the outer diameter of the variable.
%.da_D  		%		- axon/Fiber diameter ratio for calculating the axonal resistance 
                %       for myelinated axon. if this value is empty(default), 
%                       .dia will be used instead.
%.dn_D      	%	    - node/Fiber diameter ratio for node of Ranvior for calculating the membrane resistance
                %       and membrane capacitance for myelinated axon. If this value is empty(default), 
                %       .dia will be used instead.
%.Lmode         %   1=fix, 2 = L/D x D x nseg
%.Linter_D      %       - Internodal distance / Diameter                
%.L  		    %	um	- the total length of the variable.
%.lnodal      	%	um	- lengh of node of Ranvior for calculating the membrane resistance
                %       and membrane capacitance for myelinated axon. If this value is empty(default), 
                %       L/nseg will be used instead.
%.cm	       	%	uf/cm2 - for calculating membrane capacitance
%.ra           	%	ohm-cm - for calculating axonal resistance
%.rm           	%	kohm-cm2 - for calculating membrane resistance.
%.vini	    	%	mV
%.vestim		%	mV  -extracellular stimulator
%.xyz			%	um
%.xyzvector		%	um

Contact us at files@mathworks.com