clear all;
clc;
%define global constants or variables
global IStim GK CM EK GNa GL ENa EL WholeTime TTotal V INa IK IL;

%Model constants for producing an AP
IStim=15.0;
GK=36;
CM=1;
EK=-72;
GNa=120;
GL=0.3;
ENa=55;
EL=-50;
WholeTime=60;

SteadyState(1);


    
nablk = input('How many milligrams of sodium-enhancing drug? (0-100)  ');    
if (nablk > 100),
  GNa = 140;
elseif (nablk < 0),       
  GNa = 120;   
else       
GNa = 120 + exp(nablk/12.5);   
end
    
    
kblk = input('How many milligrams of potassium-enhancing drug? (0-100)  ');    
if (kblk > 100),        
    GK = 136;
elseif (kblk < 0)    
    GK = 36;
else        
    GK = 36 + kblk;    
end
    
plot(TTotal,V,'r')
hold on
SteadyState(1);

%'Stimulate? (y/n)'
stimyn = input('Stimulate? (y/n)  ','s');
if strncmp('y',stimyn,1)
     plot(TTotal,V,'g')
     IStim=200;
     SteadyState(1);
end

Title('Diseased neuron (red), with drugs (green), with drugs and stimulation (black)')
hold off


%plotcurs = input('Plot currents? (y/n)','s');
%if strncmp('y',plotcurs,1)
%    figure(2)
%    plotcurrents
%end

