Franck and Hertz graph function I need a function whom graph is the following (the Frank and Hertz experiment graph):



Currently I wrote the following function:
function comptuteValue (value) {

    var period = 4.9
      , low = 6
      ;

    function addOrSubstract (x) {

        if (x < low) {
            if (x <= period) {
                return Math.pow(x, 3/2);
            } else {
                return Math.pow(period + low - x, 3/2) - x * 1.1;
            }
        }

        return addOrSubstract (x - period);
    }

    return (2 * (Math.floor(value / period + 0.1)) + addOrSubstract(value) * 1.1989).toFixed(2);
}

And the graph looks like:



As you can see there are differences between the two graphs.
What's the function of the Franck and Hertz experiment graph?
$f(x) = ???$
For example:
$f (0) = 0$
$f (4.9) = 12$
$f (5) = 6$
And so on.
 A: If you want a function that has a certain graph, it's easy. First you digitize the graph, or ask the person who made the graph to send you the raw data. Then you define an interpolating function from this data-set. That's it! Now you have your function.
I don't know why you would want to do this, but it is very easy to do.
Usually in physics, we do not want to find any old function that happens to resemble an experimental curve. We would only do that kind of thing in very rare, specialized circumstances.*
Instead, we usually want a function that matches a curve for a deeper reason, i.e. because the function is describing or simulating the same real-world phenomenon which the experiment is measuring. Therefore you would learn about the real world by reading the function definition, and you would learn interesting things about physics by seeing how well the function fits the experimental data.
--
*An example where you might search for a function that happens to match a curve by coincidence, rather than for a deeper reason: If you are creating a large computer simulation, sometimes you want to increase the simulation's speed by replacing a subroutine calculation with a different, faster-to-compute function (or lookup table + interpolation), that happens to give approximately the same answer.
A: See What Really Happens in the Franck-Hertz Experiment with Mercury? The article explains how the curve depends upon the design of the tube.
