function GHK_IV_cal(T,R,F,dNa,W_i,W_e,A_cap,V_m)
E_Na=50e-3; % unit V
E_K=-77e-3; % unit V
cNao_st = 484; % unit mM
cNai_st=cNao_st/exp(E_Na*F/(R*T));
%cNai_st = 60.7; % unit mM
cKo_st = 20;
cKi_st=cKo_st/exp(E_K*F/(R*T));
%cKi_st = 489.5;
gK_max=36.0; % mS_per_cmsq
gNa_max=120.0;% mS_per_cmsq
G_Na = gNa_max*A_cap; % mS
G_K = gK_max*A_cap; % mS
zNa=1;
zK=1;
dK=dNa/gNa_max*gK_max; % K channel density /cm^2
nNa=dNa*A_cap;%the number of Na channel
nK=dK*A_cap; %the number of K channel
%% calculate and save data
formatSpec={'%.1f','%d','%g','%.2f','%g','%g','%.3e','%.3e'};
M(1,:)={'Ion','$[X_i]$','$[X_o]$','Channels','Channels($fmol$)','$\bar G^X(mS)$','$P(pL/s)$','$k^+$','$k^-$'};

[P,kf_GHK,kr_GHK,X]=GHK_cal(T,R,F,zNa,cNai_st,cNao_st,nNa,W_i,W_e,G_Na);
save(['Na_GHK_paras.mat'],'P','kf_GHK','kr_GHK','X');
M(2,:)=['Na' compose(formatSpec,[cNai_st,cNao_st,nNa,X,G_Na,P,kf_GHK,kr_GHK])];

[P,kf_GHK,kr_GHK,X]=GHK_cal(T,R,F,zK,cKi_st,cKo_st,nK,W_i,W_e,G_K);
save(['K_GHK_paras.mat'],'P','kf_GHK','kr_GHK','X');
M(3,:)=['K' compose(formatSpec,[cKi_st,cKo_st,nK,X,G_K,P,kf_GHK,kr_GHK])];

writecell(M,'kineticGHK.csv','Delimiter',',')

formatSpec={'%g','%g','%g','%g','%g','%g','%g','%g','%g',};
M2(1,:)={'$A_{cap}$','$V_m$','$C_m$','$\bar G^leak$','$q_m$','$q_i^{Na}$','$q_e^{Na}$','$q_i^{K}$','$q_e^{K}$'};
M2(2,:)={'$cm^2$','$mV$','$fF$','$fS$','$fmol$','$fmol$','$fmol$','$fmol$','$fC$'};

Cm_HH=1; %uF/cmsq
C_m=Cm_HH*10^9; %fF
gleak=0.3;% mS_per_cmsq
G_leak=gleak*A_cap*10^12; %fS
q_i_Na=cNai_st*W_i;%fmol
q_e_Na=cNao_st*W_e;%fmol
q_i_K=cKi_st*W_i;%fmol
q_e_K=cKo_st*W_e;%fmol
q_m=V_m/1000*C_m;%fC

M2(3,:)=[compose(formatSpec,[A_cap,V_m,C_m,G_leak,q_m,q_i_Na,q_e_Na,q_i_K,q_e_K])];

writecell(M2,'paraCell.csv','Delimiter',',')

