function [U,V]=sample_field3(X,Y)
%sample call
% phase_portrait('sample_field3',-1:0.02:0,-0.2:0.02:1,200,0.02,30)
C_d=1;
E_L=-80;
I=0;
g_L=8;
g_Na=20;
g_K=10;
E_Na=60;
E_K=-90;
X=X*100; % rescaling to fit everything into ~-1..1
U = ((I - g_L*(X-E_L)-g_Na.*m_inf(X).*(X-E_Na)-g_K.*Y.*(X-E_K))./C_d)/100;
V = (n_inf(X) - Y);

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

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

