📄 wilson_n1.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Integration of Wilson model with the Euler method
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear; clf;
% parameters of the model; 1=K,R; 2=Ca,T; 3=KCa,H; 4=Na
%time step
dt=0.01;
%maximal conductance,mS/cm2
g(1)=26; g(2)=0.25; g(3)=0; g(4)=1;
%baterry voltage,100mV
E(1)=-.95; E(2)=1.20; E(3)=E(1); E(4)=.50;
%time constance,ms
tau(1)=dt./1.5; tau(2)=dt./14; tau(3)=dt./45; tau(4)=1;
% initialization of other parameters
I_ext=0; V=-1; x=zeros(1,4); t_rec=0;
%Integration
for t=-100:dt:200
if t==10; I_ext=1; end % turns external current on at t=10
% X0(V)
x0(1)=1.24 + 3.7*V + 3.2*V^2; %R0(V)
x0(2)=4.205 + 11.6*V + 8 *V^2; %T0(V)
x0(3)=3*x(2); %H0(V)=3*T0(V)
x0(4)=17.8 + 47.6*V +33.8*V^2; %gNa(V)
%X
x=x-tau.*(x-x0); %rem x(4)=x0(4) because tau(4)=1
I=g.*x.*(V-E);
V=V+dt*(I_ext-sum(I));
% record
if t>=0;
t_rec=t_rec+1;
x_plot(t_rec)=t;
y_plot(t_rec)=V;
end
end % time loop
plot(x_plot,100*y_plot)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -