function ret = burster_cable()
ff=figure;
N=30000;
M=512;

site=zeros(1,N);

C_d=ones(1,M);
E_L=ones(1,M)*(-80);
g_L=ones(1,M)*8;
g_Na=ones(1,M)*20;
g_K=ones(1,M)*9;
E_Na=ones(1,M)*60;
g_K_s=ones(1,M)*5;
E_K=ones(1,M)*(-90);
E_K_s=ones(1,M)*(-90);
V=ones(1,M)*(-65); 
V_rest=ones(1,M)*(-65); 
I=zeros(1,M);
tau_V=ones(1,M);
nV=ones(1,M)*(-45);
n=n_inf(V);
s=s_inf(V);
I=zeros(1,M);
VV=zeros(N,1);  II=zeros(N,1); nn=zeros(N,1); ss=zeros(N,1);
tau = 200/N; tspan = 0:tau:200;
%S=0.5*sparse([1:M 1:M 2:M 1],[1:M 2:M 1 1:M ],[-2*ones(1,M) ones(1,2*M)
%]); %loop
S=0.5*sparse([1:M 1:(M-1) 2:M ],[1:M 2:M  1:(M-1) ],[-1 -2*ones(1,M-2) -1 ones(1,(2*M-2)) ]);
i=1;

for t=tspan
    I(1,:)=0;
    if (t>1)&&(t<2.5) I(1,(M-20):(M))=500; end; % to ignite any interesting action 
    V = V + tau*((I + (S*V')'- g_L.*(V-E_L)-g_Na.*m_inf(V).*(V-E_Na)-g_K.*n.*(V-E_K)-g_K_s.*s.*(V-E_K_s))./C_d);
    n = n + tau*(n_inf(V) - n)./0.152;    
    s = s + tau*(s_inf(V) - s)./20;    
    if (mod(i,10)==0)
       cla;
       plot(1:M,V,1:M,n*50-100,1:M,s*50-100,1:M,I/15-120,'Linewidth',1);
       axis([1 M -120 10]);
       legend('V','n','s','I');
       drawnow;
       % Uncomment to print frames of the animation:
       % print(ff, '-r150', '-dpng', ['cable_burst', num2str(i),'.png']);
    end;
    site(1,i)=V(1,440);
    i=i+1;
end;
figure;
plot(tspan,site);

function ret = m_inf(v)
   ret=1./(1+exp((-20-v)./15));

function ret = n_inf(v)
   ret=1./(1+exp((-25-v)./5));

function ret = s_inf(v)
   ret=1./(1+exp((-20-v)./5));



