%FHN_quiverplot.m
%vector field for FHN equations
%Sitabhra Sinha

%PARAMETERS
th=0.1; %threshold
k=1;
silon=0.01;
I=0.05; %external current

%Defining the phase plane
x=[-0.5:0.1:1.2];
y=[-0.1:0.05:0.45];
[U,V]=meshgrid(x,y);

%Computing the u and v vectors
del_U=U.*(1-U).*(U-th)-V+I;
del_V=silon*(k*U-V);

figure, quiver(U,V,del_U,del_V)
hold on, plot(x,x.*(1-x).*(x-th)+I,'r--'),
plot(x,k*x,'k--')
axis([min(x) max(x) min(y) max(y)])