You are on page 1of 9

Determining the Refraction Further relationships have been developed from

the model to better implement medical devices.


Time Constant from a Neural Knowing that a neuron enters a refractory
Membrane period, a larger stimulus is required to induce an
action potential. This relation described in Fig. 3
James Ingram [1], showing the threshold voltage exponentially
decreasing with pulse width. Creating a new
Introduction stimulus medical device requires the derivation
Nerve stimulation is critical to the role of many of a model that best fits the biological interest.
medical devices used to sustain or improve Using measured data points, the creation of a
quality of life. These electronics such as model to represent and predict neuron
pacemakers, cochlear implants, Transcutaneous stimulation should be feasible.
Electrical Nerve Stimulation (TENS), operate
Methods
using a small stimulus applied to a target area. In
a pacemaker, electrode leads are placed in the Initial Parameters
atrial and ventricular channels for determining
the timing of cardiac depolarization. If the A simulation of the HH model (HH Sim) was
depolarization does not match expected imported into MATLAB R2019a software,
parameters, the pacemaker can inhibit, trigger, compiled, and used to collect datapoints for
or pace in a neighboring chamber. Nerve analysis, no neuron properties were changed
stimulation of the cardiac muscle begins in the from initial loading. The equation;
sinoatrial (SA) node, which proceeds to a rapid 𝑅𝑇 = 𝐴/ 𝐵 − 𝑒 /
potential across the His-Purkinje System (HPS).
where RT is the refractory threshold
While devices such as pacemakers have received
thorough research for optimization, there are 𝜏 is the refractory time constant
emerging medical devices which have yet to
undergo such scrutiny. The original pacemakers IPI is the interpulse interval
would undergo replacements quite often due to and A and B are unknown constants
the power output being used to stimulate the
heart. Having run more tests, engineers and describes the expected relationship of threshold
researchers found longer duration between stimulus required to induce action potential
stimulus pulses requires less output to generate during the refractory period.
an action potential [1]. Implantable pacemakers
Having loaded the simulation, channels {m, h,
begin production and testing in 1958, while
n} were changed to {Na_Leak, K_Leak,
external pacemakers date 1950; both before the
I_Leak} measured in µA. A refractory threshold
Hodgkin-Huxley (HH) model of neuron
(RT) baseline—stimulation required for action
propagation.
potential—was measure, which was found to be
The HH model has become a standard 4 nA for a 1 ms duration. An interpulse interval
consideration for modern medical devices which (IPI) baseline—duration between the start of the
rely on nerve stimulation [2]. The model first pulse and the beginning of the second
produces information on lipid bilayer current in pulse—was then measured, and found to be
addition to ion channels. Through Ohm’s law, it 11.52 ms for two 4 nA pulses.
is possible to derive the potentials of tissue
The baseline IPI was then divided by 30 (n = 30)
given their known impedance values as well.
to decrease each IPI trial by 0.38 ms. Due to the
asymptote nature of the graph, the first and last 5
trials stepped in increments of 0.05 ms to better Microsoft Excel. This process was repeated for
observe end point behavior. To obtain more each incrementally decreasing IPI.
accurate measurements, only the Stim1 button
was used, where IPI and applied stimulus were Data Analysis Process
varied on the second pulse generated. All pulses 𝑓(𝑥) = (56834)𝑥 .
were for a duration of 1 ms only. The simulation
was allowed to return to resting potential and The data recorded into Excel was first plot RT
cleared after each trial. against IPI, and fit with a power trendline to best
fit (above). The Excel spreadsheet was then
Data Collection Process imported into MATLAB R2019a, and fit using
the equation described under Initial Parameters.
Guess values for nlinfit, coefficients {A B tau}
were determined from graphical asymptotes and
the power exponent from Excel; which were
determined as {1 0 4}.
𝐴
𝜏 = −𝐼𝑃𝐼/ ln(𝐵 − )
𝑅𝑇
Once the coefficients were determined, the
values were used in the equation solved for tau.
The functions mean and std were used on the tau
array to solve for the error bounds of the
simulation data, and to see if the coefficient tau
is reasonable.
Functions corrcoef and find were used on the
Fig. 1. An example binary search algorithm of trendline generated values and datapoints—for
determining successful dosage (green) compared to both Excel and MATLAB trendlines—to
ablation dosage (red) in electroporation. calculate R2.
Collection of RT values followed a binary Channel values and membrane voltages were
search algorithm (Fig. 1) for each independent imported as well but only plotted to provide
IPI value designated to be evaluated. Applied visual reference for non-investigated variable.
stimulus was varied in integers until the These values plotted against IPI shows a
difference between integer values caused no relationship between RT and neural membrane
action potential. Between the two integer values, factors other than the refraction time constant.
applied stimulus was then incremented at the
lower value by 0.25 nA until action potential Results
was generated greater than or equal to ~50% of The function nlinfit successfully came to a result
the time. This was determined by running the with the guess parameters designated under
same parameters 4 to 10 times when close to
Methods. The resulting coefficient values are as
determining the corresponding RT for a given
follows:
IPI.
A = -177.971
Once the applied stimulus was determined to
meet the above criteria, IPI, RT, the channels, B = 3.529
and membrane voltages, where recorded into
𝜏 = -3.112
Fig. 2. Graphs of the Excel power fit (left) and nlinfit using MATLAB (right). Collected data points (n = 30) are
black diamonds while the trend lines are red.
____________________________________________________________________________________

all rounded to three decimal places. The


following average value for 𝜏 was found to be
-3.092 with a standard deviation of ± 0.047.
The corresponding R2 and p values for the
trendline generated data are as follows:
Excel R2 = 0.998
MATLAB R2 = 0.999
where the non-linear fit shows overall better
confidence.
The program did determine that the coefficient
tau lies within the standard deviation of the
average tau which was calculated at all points
keeping A and B constant.

Discussion
Data Interpretation
Fig. 3. Graph of measured leakages (µA) for sodium The plotted data in Fig. 2 accurately represents
(blue), potassium (red), and current (yellow), for the
the expected curve for refractory threshold
tested IPI (ms) values.
stimulus against interpulse interval. The
trendline generated in MATLAB visually and function properly around this value. It should be
numerically is a closer fit (R2 = 0.999) than the noted that the HH Sim package does not specify
Excel power method (R2 = 0.998). The whether electrode placement is ideal, if
refraction time constant lies within the standard extracellular parameters are considered, if noise
deviation for all calculated tau points, aside from is automatically eliminated, or if glial cells are
the 11-12 ms region. This is likely due to the present and considered. These factors are
constant values—extending beyond the baseline important in the context of investigating a full
values—interfering with the rate of change. Fig. biological system to obtain an accurate model
3 displays the leak experienced by the [2].
simulation. Sodium and potassium leak are
mirrored across the current leak which is Alternative Explanations
expected. The rate of current leak slightly Comparing coefficient and constant values to
changed as IPI decreased (0.001-0.0005 µA), previously derived values shows large numerical
but is not visually significant. Considering the differences that raises questions. For example,
accuracy of the trendline, the associated the refraction time constant found to be 0.7 ms
constants, including refraction time constant, are for an exponential model [2]. The argument here
an accurate representation of the data and model. relies on the implication that methods, nerves,
Explanations and Limitations and model, are the same. While the ideas are
similar and nature, being that the same
The relationship of channel leakage (Fig. 3) exponential model is used, there are vast
resembles that of the RT against IPI curve (Fig. differences in parameters and biological
2) but more sporadic in nature. Assuming that investigation. The methodology is not a
HH Sim is accounting for ion permeability derivation of the refraction coefficient of a said
during action potential, as leak is proportional nerve type, rather it is a method for determining
the conductance, due to Ohm’s law it is expected them using an arbitrary simulation.
that leak will change as the membrane retains
greater capacitance with decreasing IPI. Larger The HH Sim package lacks information
stimuli and shorter IPI duration can lead to regarding parameters clearly outlined in other
factors such as electric field consideration. It is research, a direct limitation. However, the
unknown whether HH Sim models a single investigated question only asks whether it is
neuron, nerves, or surface (for the application of possible to derive a function for prediction
Stokes’ theorem). The interference caused by purposes. According to the R2 value obtained,
electromagnetic fields or extracellular potentials the fit is proper. Using the determine coefficient
will directly affect ion flow, which is shown by values to model at extremes, as discussed in
Fig. 2, but not as consistent of a non-linear curve Explanations and Limitations, neuron behavior
[2]. is a close representation to what would be
expected in vivo conditions. The hypothesis
Considering the accuracy of the fit, the should be taken as a ‘proof of concept’ as
coefficients found were imported back into the opposed to accounting for all factors.
RT equation defined in Methods. Solving for the
max and indexing, further information regarding Implications
neuron stimulation is derived. The max Showing that refraction time constants for
extrapolated value for RT is found to be 0.0199 neuron models can be derived, provides hope for
A, at an IPI of 3.925 ms. Due to the HH Sim implementation of new medical devices. Given
package having an upper limit of 100 nA for data for a specific region of the body and neural
stimulus, data beyond this value cannot be tested network, it is possible to model an accurate
for accuracy. However, comparing this value to representation of biological limitations for cost
previously experimented stimulus, 0.0199 A is engineering current devices more effectively.
0.5% differing from the theoretical 0.020 A, at For developing devices, such as current research
which muscle paralysis is experienced [3]. With into vagus nerve stimulation, a proper model can
this context, it is expected for the neuron to stop
be derived to increase benefits (preventing
seizures, inducing immune response, etc.) while
preventing overstimulation which can lead to
detrimental side effects (headaches, arrythmias,
etc.).
Before proceeding into using the model for
medical device parameters, the discussed
limitations should be investigated thoroughly.
Electromagnetic interference with the ion
channels is an important consideration as total
ion flow directly relates to the induced
membrane potential change. Action potential
may be generated, but as the total membrane
potential change is weaker, neurotransmitter
concentrations can be affected. This becomes
more important when working with a system
rather than individual neuron, and should be
investigated accordingly.
Concluding Statement
Nerve stimulation is an effective form of
treatment for a variety of conditions and proves
promising for current research. Optimizing these
medical devices relies on consideration for
neuron and neural network properties. It is
possible to collect data on a neural system of
interest and derive a refraction time constant in
order to engineer a medical device to fit system
parameters. Further research will be needed in
order to determine the best computer model
before implementation to uninvestigated
biological systems.
MATLAB R2019a Code:
% BME 301 Lab 1 DE Script
% jcingra2@ncsu.edu - 8/23/20
% James Ingram

% Plots the taken data points and preforms statistical analysis. Solves for
% the threshold constant as well.

clc
clear
close all

%% Init
HHData = xlsread('HHReadMATLAB.xlsx');

% Load HH Model data into specific arrays for analysis


IPI = HHData(:,1)';
RT = HHData(:,2)';
NaLeak = HHData(:,3)';
KLeak = HHData(:,4)';
ILeak = HHData(:,5)';
InitMemVolt = HHData(:,6)';
SecondMemVolt = HHData(:,7)';
PercentDiffofVolt = HHData(:,8)'*100;

trendLineEQ = @(x) 56834*x.^(-3.869); % Power trendline with a confidence of R = 0.998 from


excel
trendLineExcel = trendLineEQ(IPI);

% Refractory Threshold EQ
% RT = A/(B-e^(-IPI/tau)) where tau is the refractory time constant
% A/B are unknown constants which need to be estimated for
refractory_threshold = @(coeffs,x) coeffs(1)./(coeffs(2)-exp(-x./coeffs(3)));

% Solved EQ for tau


tau = @(refracT, InterPI, coeffs) -InterPI./(log(coeffs(2) - (coeffs(1)./refracT)));

beta0 = [1, 0, 4]; % guess values found by using desmos for 2


hours
coeffsNL = nlinfit(IPI,RT,refractory_threshold,beta0); % non-linear fit (regression)
trendLineNL = refractory_threshold(coeffsNL,IPI); % evaluation of coeffs found to plot trendline

%% Plotting
% Excel generated trendline plot
hold on
subplot(1,2,1)
plot(IPI,RT,'kd',IPI,trendLineExcel,'r')
axis([4 13 0 110])
xlabel('IPI (ms)')
ylabel('RT (nA)')
title('RT v IPI (Excel)')
legend('Data points','Excel generated trendline')
hold off

% MATLAB generated trendline plot


hold on
subplot(1,2,2)
plot(IPI,RT,'kd',IPI,trendLineNL,'r')
axis([4 13 0 110])
xlabel('IPI (ms)')
ylabel('RT (nA)')
title('RT v IPI (MATLAB)')
legend('Data points','nlinfit')
hold off

%% Tau output and stats


% refraction time constant evaluations
tauArray = tau(RT,IPI,coeffsNL);
tau_avg = mean(tauArray);
tau_std = std(tauArray);
stdArray = ones(1,30)*tau_std;
figure;
hold on
errorbar(IPI,tauArray,stdArray,'kd')
plot([IPI(1)+0.5 IPI(end)-0.5], [coeffsNL(3) coeffsNL(3)],'r','linewidth',2)
axis([5 12 -3.2 -2.9])
title('Tau values calculated at IPI')
xlabel('IPI (ms)')
ylabel('Tau')
legend('Calculated Taus','Coefficient Tau','location','best')
hold off

% calculate the associated R^2 values and p values with comparison of the
% trendline to data points (are the trendlines generated statistically
% significant and a good indicator/approximation
[R_excel, p_excel] = corrcoef(RT', trendLineExcel');
[R_nlinfit,p_nlinfit] = corrcoef(RT',trendLineNL');
[pNLr, pNLc] = find(p_nlinfit<0.05);
[pExr, pExc] = find(p_excel<0.05);
rNL = R_nlinfit(2,1);
rEx = R_excel(2,1);

% print R and p vals to command window


fprintf('Excel trendline R%c = %.3f\n',178,rEx)
fprintf('Non-Linear Fit trendline R%c = %.3f\n',178,rNL)
fprintf('\nCoeffs A = %f , B = %f , tau = %f \n',coeffsNL(1),coeffsNL(2),coeffsNL(3))
fprintf('Average tau = %f , Std of tau = %f \n',tau_avg,tau_std)

% test to see if coeff determined tau lies within the std for tau at all
% points
if tau_avg -tau_std > coeffsNL(3) > tau_avg + tau_std
fprintf('\nTau lies within the standard deviation.\n')
else
fprintf('\nTau is outside the standard deviation.\n')
end

%% Application of Data

% Section reserved for using the found coeffs to generate expected


% stimulus values that would need to be applied for a certain IPI

newIPI = linspace(0,10,1e6);
newRT = refractory_threshold(coeffsNL,newIPI);
[limitRT,indxRT] = max(newRT);
absRP = newIPI(indxRT); % any IPI before this at a higher RT value will be in hyperpolarization
limitRT_amps = limitRT*(10^-9); % value is close to the maximum current without going into
respiratory paralysis

fprintf('\nMaximum refractory threshold as generated by the trendline %.4f A\n',limitRT_amps)


fprintf('Minimum interpulse interval as generated by the trendline %.3f ms\n',absRP)

figure;

subplot(1,2,1)
plot(IPI,NaLeak,IPI,KLeak,IPI,ILeak)
title('Leakage Measured for Ions and Current')
xlabel('IPI (ms)')
ylabel('uA')
legend('Sodium','Potassium','Current','Location','best')

subplot(1,2,2)
plot(IPI,InitMemVolt,IPI,SecondMemVolt)
title('Measured Membrane Voltage for Action Potential')
xlabel('IPI (ms)')
ylabel('Voltage (mV)')
legend('First Action Potential','Second Action Potential','location','southeast')
axis([5 12 -8 40])
References
[1] S. K. Mulpuru, M. Madhavan, C. J. McLeod,
Y.-M. Cha, and P. A. Friedman,
“Cardiac Pacemakers: Function,
Troubleshooting, and Management: Part
1 of a 2-Part Series,” Journal of the
American College of Cardiology, vol.
69, no. 2, pp. 189–210, Jan. 2017, doi:
10.1016/j.jacc.2016.10.061.
[2] L. A. Cartee, C. van den Honert, C. C.
Finley, and R. L. Miller, “Evaluation of
a model of the cochlear neural
membrane. I. Physiological
measurement of membrane
characteristics in response to intrameatal
electrical stimulation,” Hearing
Research, vol. 146, no. 1, pp. 143–152,
Aug. 2000, doi: 10.1016/S0378-
5955(00)00109-X.
[3] “Controlling Electrical Hazards.”
https://www.osha.gov/Publications/3075
.html (accessed Aug. 28, 2020).

You might also like