-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstimulate_neuron.m
More file actions
38 lines (31 loc) · 1.15 KB
/
Copy pathstimulate_neuron.m
File metadata and controls
38 lines (31 loc) · 1.15 KB
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
%%%%%Stimulates a single neuron with given parameters
%%%z - Distane from the electrode
%%%del_x - length of nodes of ranvier
%%% I - Stimulation current
%%%dia - diameter of the axon - varying for different neurons
%%%%dur - duation of simulation of neuron
%%%%dt - intervals
function [V_tot,I_ionic] = stimulate_neuron(z, del_x, I,dia,dur,dt)
no_nodes = 101;
nodes = [1:no_nodes];
mid_pt = ((no_nodes-1)/2)+1;
L = 0.00025; %%cm
rho_e = 0.3; %%ohm cm
rho_i = 0.055; %%%ohm cm
%dt = 0.001; %%microsecs
%%%%Generating Ve for all nodes
x_nodes = zeros(1,no_nodes);
x_nodes(nodes(mid_pt:end)) = (nodes(mid_pt:end)-mid_pt) * del_x;
x_nodes(nodes(1:mid_pt)) = -(mid_pt - nodes(1:mid_pt)) * del_x;
x_nodes(mid_pt) = 0;
r_nodes = sqrt(x_nodes.^2 + z^2);
Ve_nodes = (rho_e/(4*pi)).*I./r_nodes;
%figure();plot(Ve_nodes(1058,:));
gl_bar = 3;
gk_bar = 360;
gna_bar = 1200;
cm =1;
dia_const = (dia * del_x)/(4*rho_i*L);
%%%%Calling HH-Rattay model
[V_tot,I_ionic,time] = HH_rattay(dia_const,cm,del_x,Ve_nodes,dt,dur,gk_bar,gna_bar,gl_bar,I);
end