clc;clear all;close all;
% 初始参数
I = 10;
sigma = 0.04;beta = 5;gamma = 140;
a = 0.02;b = 0.2;
c = -65;d = 2;
% 步长,改进欧拉法的相关参数
step = 0.1;
timeConter = 0:step:1000;
v = zeros(1,length(timeConter));
u = zeros(1,length(timeConter));
v(1) = -65;%v(2) = -60;
u(1) = 1;%u(1) = 1;
for i_conter = 2:length(timeConter)
K1_1 = sigma*v(i_conter-1)^2+beta*v(i_conter-1)+gamma-u(i_conter-1)+I;
vpn = v(i_conter-1)+step*(sigma*v(i_conter)^2+beta*v(i_conter)+gamma-u(i_conter)+I);
K2_1 = sigma*vpn^2+beta*vpn+gamma-u(i_conter)+I;
v(i_conter) = v(i_conter-1)+step/2*(K1_1+K2_1);
% K1_1 = sigma*v(i_conter-1)^2+beta*v(i_conter-1)+gamma+I;
% vpn = v(i_conter-1)+step*(sigma*v(i_conter)^2+beta*v(i_conter)+gamma+I);
% K2_1 = sigma*vpn^2+beta*vpn+gamma+I;
% v(i_conter) = v(i_conter-1)+step/2*(K1_1+K2_1);
K2_1 = a*(b*v(i_conter-1)-u(i_conter-1));
upn = u(i_conter-1)+step*(a*(b*v(i_conter)-u(i_conter)));
K2_2 = a*(b*v(i_conter)-upn);
u(i_conter) = u(i_conter-1)+step/2*(K2_1+K2_2);
if(v(i_conter)>30)
v(i_conter) = c;
u(i_conter) = u(i_conter)+d;
end
end
plot(timeConter,v)
% figure(2)
% plot(timeConter,u)
D210
标签:beta,SNN,脉冲,step,K2,神经网络,conter,sigma,gamma From: https://blog.51cto.com/u_15815923/5744382