Adding Axon and Dendrites to the Hodgkin Huxley Equation
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am very new to Matlab, and I need some help:
In my neural engineering course we are modeling a neuron using the Hodgkin Huxley equation.
My code so far is as follows:
function [t,S] = HHModel_Synapse_Multiple(Tmax,InputCurrent)
Yinit=[-78.87 0.034 0.716 0.26 0 0]; % Initial V, m, h, n, slow, fst
Tsyn=Tmax/4; %Time of the Synaptic Input
StimInt=10; %Stimulation Interval
N=10;
[t,S]=ode15s(@HH_Equations,[0 Tsyn],Yinit,[],InputCurrent);
for i=1:N
Sinit=S(end,:);
Sinit(5)=Sinit(5)+1;
Sinit(6)=Sinit(6)+1;
[t2,S2]=ode15s(@HH_Equations,[Tsyn+(i-1)*StimInt Tsyn+i*StimInt],Sinit,[],InputCurrent);
t=[t;t2];
S=[S;S2];
end
Sinit=S(end,:);
[t2,S2]=ode15s(@HH_Equations,[Tsyn+N*StimInt Tmax],Sinit,[],InputCurrent);
t=[t;t2]; S=[S;S2];
plot(t,S(:,1));
title('Membrane Voltage During an Action Potential');
legend('Voltage');
xlabel('Time (ms)');
ylabel('Voltage (mV)');
plot(t,S(:,2:4));
title('State Change During an Action Potential');
legend('m','h','n');
xlabel('Time (ms)');
ylabel('Voltage (mV)');
figure,plot(t,S(:,5:6));
legend('slow','fast');
xlabel('Time (ms)');
ylabel('Voltage (mV)');
function dSdt=HH_Equations(t,S,InputCurrent)
V=S(1);
m=S(2);
h=S(3);
n=S(4);
slow=S(5);
fst=S(6);
%Constants
Cm=1;
gNa=120;
gK=36;
gL=0.3;
gsyn=0.3;
ENa=78.2;
EK=-107.1;
EL=-49.0;
ESyn=0;
slow_tau=6;
fst_tau=2;
IL=gL*(V-EL);
IK=gK*n^4*(V-EK);
INa=gNa*m^3*h*(V-ENa);
Isyn=gsyn*(slow-fst)*(V-ESyn);
dVdt=(-1./Cm)*(IL+IK+INa+Isyn-InputCurrent);
% Alpha Equations
am=-0.1*((V+35)/(exp(-0.1*(V+35))-1));
ah=0.07*exp(-0.05*(V+60));
an=(-0.01*(V+50))/(exp(-0.1*(V+50))-1);
% Beta Equations
bm=4.0*exp((-V-60)/18);
bh=1./(1+exp(-0.1*(V+30)));
bn=0.125*exp(0.0125*(-V-60));
minf=am./(am+bm);
hinf=ah./(ah+bh);
ninf=an./(an+bn);
mtau=1./(am+bm);
htau=1./(ah+bh);
ntau=1./(an+bn);
dmdt=(minf-m)/mtau;
dhdt=(hinf-h)/htau;
dndt=(ninf-n)/ntau;
dslowdt=-slow/slow_tau;
dfstdt=-fst/fst_tau;
dSdt=[dVdt; dmdt; dhdt; dndt; dslowdt; dfstdt];
end
end
This models a neuron with multiple synaptic inputs.
I need to add in axonal and dendritic inputs, but have no idea where to start.
Any help would be greatly appreciated!
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Neural Simulation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!