Adjusting Parameters for Identifying Features of an Action Potential

In summary, the conversation involves finding a formula for an action potential, using it to graph in the Desmos graphics calculator, and exploring different approximations. Various functions are suggested, including a difference of two exponentials, a Crystal Ball function, and a piecewise continuous function. The conversation then shifts to finding a more precise solution, with a formula of 6*exp(-x^2*36)-exp(-(x-0.4)^2) being chosen and modified to fit the desired shape and values. The process involves adjusting parameters and subtracting 70 to get the baseline and peak heights right.
  • #1
TULC
10
0
TL;DR Summary
Can someone help me figure out a formula for an action potential of a neuron? (attached)
I want to find a formula for an action potential (illustrated with the curve in the attachment). I would like to use the formula to graph this in Desmos graphics calculator. I don't have much of a math background, but a sine function comes to mind...I would like to get the precise shape though. See the source of the image here (top figure).
 

Attachments

  • Action Potential with values.png
    Action Potential with values.png
    5.2 KB · Views: 198
Mathematics news on Phys.org
  • #2
It doesn't look like any standard, closed-form, equation to me. What accuracy are you looking for? There are interpolation methods that can give a reasonable approximation, but they are messier than you might want.
 
  • Like
Likes benorin and mfb
  • #3
The difference of two exponentials can look roughly like that. Example: 6*exp(-x^2*36)-exp(-(x-0.4)^2)
To model the tail better a Crystal Ball function can be used.
sin(x)/x could be interesting, too.

But generally you won't get a really good approximations just with random functions unless you add an absurd amount of parameters.
 
  • Like
Likes WWGD, benorin, dextercioby and 1 other person
  • #4
Just eyeballing it, it might be possible to approximate it with the sum of a normal distribution and a piecewise continuous function like
\begin{equation*}
g(x)=\begin{cases}
0 \quad &\text{if} \, x \lt a_1 \\
a_2-(x-a_3)/a_4 \quad &\text{otherwise} \\
\end{cases}
\end{equation*}
Where the parameters ##a_1##, ##a_2##, ##a_3##, and ##a_4## are TBD.
 
  • Like
Likes benorin and sysprog
  • #5
FactChecker said:
It doesn't look like any standard, closed-form, equation to me. What accuracy are you looking for? There are interpolation methods that can give a reasonable approximation, but they are messier than you might want.
Thank you. I would like to be able to at least convey the shape of the function to someone who is visually impaired (Desmos can sonify the functions). However, the higher the precision, the better. The values on the y-axis are of special interest. It would be good to capture the change in voltage from -70 mv to +40 mv (vertical)...
 
  • #6
Thank you all...I will check these out.
 
  • #7
FactChecker said:
Just eyeballing it, it might be possible to approximate it with the sum of a normal distribution and a piecewise continuous function like
\begin{equation*}
g(x)=\begin{cases}
0 \quad &\text{if} \, x \lt a_1 \\
a_2-(x-a_3)/a_4 \quad &\text{otherwise} \\
\end{cases}
\end{equation*}
Where the parameters ##a_1##, ##a_2##, ##a_3##, and ##a_4## are TBD.
Interesting...I'll explore this.
 
  • #8
Desmos is not really the ideal tool for this (and I have no idea if anything more suitable is available on the web) but I think your best chance may be modelling each part of the curve separately something like this:
https://www.desmos.com/calculator/v9hyi8qj0o
 
  • #9
This looks similar to a 2nd order band-pass filter step response, as shown below. The parameter Q will adjust how oscillatory the curve is. The parameter ωo is just a scaling factor for time.

LCR_pulse2.jpg
 
  • Like
Likes Delta2
  • #10
The longer negative tail in your picture is a more nonlinear response. Probably best done in some piecewise approach. For example, the previous function where ωo is larger when the signal goes negative.
 
  • #11
All of the above are very interesting, but it turns out I will need a more precise solution. I have been trying out different variations of mfp's formula 6*exp(-x^2*36)-exp(-(x-0.4)^2). I chose that one because it is easy to use in Excel. (I realize that some of you came up with more precise ones, but they were more difficult to use). So I was trying to modify it, but after many tries I was still unable to get a largely symmetrical curve with a *flat left tail and *an undershoot following the fall of the curve followed by a small rise to the original baseline level. The precise shape is important - if my description above is not clear enough, you can check the shape here. It would be good to to get key values right. That includes - 70 mv for the baseline (i.e., resting potential), +40 mV for the peak (action potential), -80 mV for the undershoot (hyperpolarization), then followed by return to baseline (around - 70 mV). I will continue working on this, though as I mentioned I don't have much of a math background. So this may take a while :) I would be so grateful if someone could kindly help me modify the above formula to get the precise shape and the values: -70 mv, + 40 mv, -80 mV followed by -70 mv. Many thanks!
 
  • #12
You can't expect the shortest formulas to give the best approximations. The more complicated the function the better it can be tuned to your specific shape, generally.

Adding a baseline and making the amplitudes free parameters:
a + b*exp(-x^2*36) + c*exp(-(x-0.4)^2).

Far away from the peaks the exponentials evaluate to zero, so you can subtract 70 to get the baseline right: a=-70
The two exponentials have the maximum very close to 0 and the minimum close to 0.4.
At x=0.4 the first exponential term is exp(-5.76), i.e. it's negligible. The second one is just 1. To get the negative peak height right we need a+c = -80, i.e. c=-10.
At x=0 the first exponential term is just 1 and the second one is exp(-0.16). To get the peak height right we need a+b+exp(-0.16)c = 40 which leads to b = 118.

New plot

There is one additional degree of freedom: The offset of the second exponential - or alternatively the width of the first one. That determines how far the second exponential leaks into the first one.

Example with larger separation

-70 and -10 can stay the same, the 113 is the result of the updated calculation following the approach above.
 
  • Like
Likes benorin and TULC
  • #13
Thank you mfb! How should I acknowledge you if I create a working sonification based on the formula you proposed? I would be sharing it in an educational setting.
 
  • #14
Not at all, or in any way you like, I don't mind.
 
  • Like
Likes dlgoff
  • #15
The action potential satisfy a 2nd order ODE according to the Hodgkin-Huxley model. See equation (30) of their seminal paper [1]. This equation has no closed form solution, but can be solved numerically.
equation 30.png


action potential.png


[1]. HODGKIN AL, HUXLEY AF. A quantitative description of membrane current and its application to conduction and excitation in nerve. J Physiol. 1952;117(4):500-544. doi:10.1113/jphysiol.1952.sp004764
 
  • Like
Likes Delta2, WWGD, TULC and 1 other person
  • #17
Am I correct in thinking that what you want is an audible tone with a frequency and/or volume that matches the curve? As we now have a differential equation we can use this to generate the curve, but not in Desmos.

It would be relatively simple to create a web page with controls to vary the parameters for the Hodgkin-Huxley model, numerically integrate the equation and generate corresponding audio (as well as graphical) output. If you are in an educational setting this would make an excellent project for a (bright) computer science high school student (although they might need help with the numerical integration).

I might have a look myself but my schedule is full for the next 10 days.
 
  • Like
Likes TULC
  • #18
mfb said:
...add an absurd amount of parameters.
Please can you give an example of this?
 
  • #19
Approximating it with a polynomial of degree 100, for example. It will look great within the range you approximate, but (a) you have 101 parameters and (b) it will fail miserably outside the approximated range.
 
  • Like
Likes benorin
  • #20
mfb said:
..generally you won't get a really good approximations just with random functions unless you add an absurd amount of parameters.
To build a formula for a curve - no matter how intricate the curve is - I can always create a formula by adding parameters?
How to add parameters?

Thanks.
 
  • #21
pairofstrings said:
To build a formula for a curve - no matter how intricate the curve is - I can always create a formula by adding parameters?
How to add parameters?
What you're really asking about is how to fit a polynomial or other curve to a set of data points. If there are a lot of data points or the curve is very complicated, what people do is to fit different polynomials to different portions of the curve. One technique uses what are called cubic splines.

Here's a wiki article you should look at -- https://en.wikipedia.org/wiki/Curve_fitting

If you have just two points, it's easy to find the equation of the line that contains those points. If you have three points, you can fit them to a quadratic function; i.e., a function of the form ##f(x) = ax^2 + bx + c##. Here the parameters are a, b, and c.

If you have four points, you can fit them to a cubic function; i.e., ##g(x) = ax^3 + bx^2 + cx + d##. If you have N points, a polynomial of degree N + 1 can be found.

Example for you: See if you can find the parameters a, b, and c so that the points (0, -1), (1.5, 1.25), and (2, 3) lie on the parabola ##y = ax^2 + bx + c##.
 
  • #22
pairofstrings said:
To build a formula for a curve - no matter how intricate the curve is - I can always create a formula by adding parameters?
How to add parameters?

Thanks.
See the post just above yours.

A Fourier transform is another popular option.

For "reasonable" functions (a mathematician can tell you exact requirements, being at least piecewise continuous is a good start) you can always find arbitrary good approximations.
 
  • #23
mfb said:
For "reasonable" functions (a mathematician can tell you exact requirements, being at least piecewise continuous is a good start) you can always find arbitrary good approximations.
So, if I approximate a curve by using the methods, it will suffice?
We don't need precise curve for the data points?
 
  • #24
Suffice for what?
For a good approximation you only need a good approximation.
 
  • Haha
Likes benorin
  • #25
Why do we approximate? Why shouldn't we be precise?
Are we trying to be precise by using the methods?
Band-pass filter comes to my mind.
The filter removes noise.
The other curve is being approximated?
 

Attachments

  • bandpass-filter-fig-1.png
    bandpass-filter-fig-1.png
    12.7 KB · Views: 118
  • Regression_pic_assymetrique.gif
    Regression_pic_assymetrique.gif
    21.1 KB · Views: 133
Last edited:
  • #26
pbuk said:
Desmos is not really the ideal tool for this (and I have no idea if anything more suitable is available on the web) but I think your best chance may be modelling each part of the curve separately something like this:
https://www.desmos.com/calculator/v9hyi8qj0o
suggestion: TI-83 (emulators are available)
 
  • Like
Likes benorin
  • #27
pairofstrings said:
Why do we approximate?
Analytic solutions for real-life problems are rare. You almost always work with some approximation.
 
  • Like
Likes benorin and sysprog
  • #28
Deleted - see next post
 
Last edited:
  • #29
TULC said:
Summary:: Can someone help me figure out a formula for an action potential of a neuron? (attached)

I want to find a formula for an action potential (illustrated with the curve in the attachment). I would like to use the formula to graph this in Desmos graphics calculator. I don't have much of a math background, but a sine function comes to mind...I would like to get the precise shape though. See the source of the image here (top figure).
Just to recap on this thread:
  1. We want to create a frequency modulated audio output following a given curve for presentation to learners with a visual impairment.
  2. The given curve is generated by a system of (4) differential equations (ODEs) without an analytical solution.
  3. The Desmos website is capable of providing audio output, but it cannot solve differential equations.
One way of overcoming this is to find a (probably piecewise) approximation to the curve and input this into Desmos.

I think a better way is to create an application that can numerically solve ODEs, plot the results and produce an audio output. I have put something together to demonstrate this and it is available at https://avplot.com/#/hodgkin-huxley: an image of the graphical output is shown below. If this is useful, let me know and I will make it a bit smarter and add more functionality as time allows (e.g. the ability to enter arbitrary equations similar to Desmos, change the audio parameters etc). If it is not then it will probably die when the domain renewal comes up, although the (open) source will be available at https://github.com/avplot for as long as GitHub works.

newplot (5).png
 
  • Like
Likes TULC and sysprog
  • #30
Amazing input, thank you! I love the idea of using the Hodgkin-Huxley model for generating the visualization in an application that can also generate non-text audio. @pbuk It has been a while, would it be possible to add more functionalities to the application you created?
 
  • #31
William Crawford said:
The action potential satisfy a 2nd order ODE according to the Hodgkin-Huxley model. See equation (30) of their seminal paper [1]. This equation has no closed form solution, but can be solved numerically.
View attachment 287111

View attachment 287110

[1]. HODGKIN AL, HUXLEY AF. A quantitative description of membrane current and its application to conduction and excitation in nerve. J Physiol. 1952;117(4):500-544. doi:10.1113/jphysiol.1952.sp004764
Thank you, William. That's very useful.
 
  • #32
Thank you p
pbuk said:
Just to recap on this thread:
  1. We want to create a frequency modulated audio output following a given curve for presentation to learners with a visual impairment.
  2. The given curve is generated by a system of (4) differential equations (ODEs) without an analytical solution.
  3. The Desmos website is capable of providing audio output, but it cannot solve differential equations.
One way of overcoming this is to find a (probably piecewise) approximation to the curve and input this into Desmos.

I think a better way is to create an application that can numerically solve ODEs, plot the results and produce an audio output. I have put something together to demonstrate this and it is available at https://avplot.com/#/hodgkin-huxley: an image of the graphical output is shown below. If this is useful, let me know and I will make it a bit smarter and add more functionality as time allows (e.g. the ability to enter arbitrary equations similar to Desmos, change the audio parameters etc). If it is not then it will probably die when the domain renewal comes up, although the (open) source will be available at https://github.com/avplot for as long as GitHub works.

View attachment 288064
This is excellent, thank you pbuk! Is it still possible to add the functionalities you mention in your post?
 
  • #33
TULC said:
This is excellent, thank you pbuk! Is it still possible to add the functionalities you mention in your post?
Yes in theory: in practice I have very little free time at the moment. What would be the most desireable feature?
 
  • #34
pairofstrings said:
To build a formula for a curve - no matter how intricate the curve is - I can always create a formula by adding parameters?
How to add parameters?

Thanks.
Maybe something like Lagrange interpolation. Edit: But then this is likely overfitting, if you want a general model.
I was thinking the curve looked like one of the periods of the Topologist's Sine Curve: f(x)=Sin(1/x); f(0)=0.
 
Last edited:
  • #35
I understand and appreciate any input. You suggested a couple of things in a previous post including (1) enabling users to enter arbitrary equations similar to Desmos, and (2) changing audio parameters...Both of these suggestions are great, though I would like to learn more. Which audio parameters could we actually adjust in this application?
Regarding this particular sonification: It could be useful to adjust the function such that the users can more easily identify specific features of an action potential. Specifically, it would be helpful to make the undershoot following the fall of the curve a bit more pronounced, e.g., by increasing its amplitude. It would be good to experiment with that particular feature of the curve. Currently, without any visual input, I would not be able to identify that there is an undershoot following the fall of the curve.
 
<h2>1. What is an action potential?</h2><p>An action potential is a rapid change in the electrical potential of a cell, particularly in neurons or muscle cells. It is the basis for nerve impulse transmission and muscle contraction.</p><h2>2. Why is it important to adjust parameters for identifying features of an action potential?</h2><p>Adjusting parameters allows for a more accurate and precise identification of the various characteristics of an action potential, such as the threshold, amplitude, and duration. This can help in understanding the underlying mechanisms of nerve and muscle function.</p><h2>3. What are some common parameters that are adjusted for identifying features of an action potential?</h2><p>Some common parameters include the stimulus intensity, duration, and frequency, as well as the recording electrode placement and filtering settings.</p><h2>4. How do scientists determine the optimal parameters for identifying features of an action potential?</h2><p>Scientists often use a trial and error approach, systematically adjusting parameters until they obtain a clear and consistent action potential waveform. They may also refer to established protocols or consult with other researchers in the field.</p><h2>5. Can adjusting parameters affect the results of an experiment on action potentials?</h2><p>Yes, adjusting parameters can significantly impact the results of an experiment. It is important to carefully select and document the parameters used to ensure the validity and reproducibility of the findings.</p>

1. What is an action potential?

An action potential is a rapid change in the electrical potential of a cell, particularly in neurons or muscle cells. It is the basis for nerve impulse transmission and muscle contraction.

2. Why is it important to adjust parameters for identifying features of an action potential?

Adjusting parameters allows for a more accurate and precise identification of the various characteristics of an action potential, such as the threshold, amplitude, and duration. This can help in understanding the underlying mechanisms of nerve and muscle function.

3. What are some common parameters that are adjusted for identifying features of an action potential?

Some common parameters include the stimulus intensity, duration, and frequency, as well as the recording electrode placement and filtering settings.

4. How do scientists determine the optimal parameters for identifying features of an action potential?

Scientists often use a trial and error approach, systematically adjusting parameters until they obtain a clear and consistent action potential waveform. They may also refer to established protocols or consult with other researchers in the field.

5. Can adjusting parameters affect the results of an experiment on action potentials?

Yes, adjusting parameters can significantly impact the results of an experiment. It is important to carefully select and document the parameters used to ensure the validity and reproducibility of the findings.

Similar threads

Replies
7
Views
1K
Replies
1
Views
3K
  • Sci-Fi Writing and World Building
Replies
10
Views
2K
  • Introductory Physics Homework Help
Replies
1
Views
2K
  • Astronomy and Astrophysics
Replies
1
Views
839
Replies
5
Views
2K
Replies
1
Views
2K
  • Mechanical Engineering
Replies
1
Views
3K
  • General Engineering
Replies
17
Views
2K
  • Differential Equations
Replies
1
Views
5K
Back
Top