Context
I am carrying out molecular dynamics simulations of trapped ions in a radio-frequency field of amplitude $U_{RF}$ + DC (see details https://arxiv.org/abs/2102.04098). I am studying radio-frequency heating of ions under no cooling. I initialise them at low temperature, crystal state, and run the simulation until temperature raises up to hundreds of K. Phase transition occured to fluid state. I am interested in the duration of the crystal state before temperature suddenly raise to high level. The duration from beginning of simulation to the temperature runaway is $t_0$ and I am studying the value of $t_0$ as a function of the radio-frequency trapping ampitude $U_{RF}$. An example of temperature as a function of time for one given condition $U_{RF}$. Critical timing is when temperature suddenly increases.
I vary $U_{RF}$ and measure $t_0$. I have no analytical expression to compare with, but I would like at least an empirical expression of $t_0$ as a function of $U_{RF}$, retrieved with a fit. Here I present you the data, my question and my attempt using power law. Could you tell me if this seems reasonable to you? Do you have any proposition or see any discrepancy in my work ? Finally, is it a good idea to try a fit without any analytical physical expression?
$t_0$ as a function of $U_{RF}$" />
Question
I would like to know:
is there a principle in order to choose a realistic function for the fit? I mean, is it possible to discuss the choice in advance or is it just some kind of try and error process? (try an expression, see if it gives reasonably good fit ...).
so finally, should I just work the maths and physics and derive a valid analytical expression for my problem and then fit?
what do you think about power law? (see below)
Power law -- Method
General description
I tried to fit the above data ($t_0$ as a function of $U_{RF}$) with a power law. Power law is expressed as $f(x)=ax^{-k}$ or in my case $f(U_{RF})=aU_{RF}^{-k}$. Given the shape of the curve this seems natural to me. Plot in log-log the above mentionned data looks like this
$t_0$ as a function of $U_{RF}$ in horizontal and vertical logarithm." />
I also tried a second method using logarithms to determine the coefficients. Both methods give different results but the first one seems reasonably close to the data.
'homemade' log program (Python example)
I detail here how I used logarithms:
Given $f(U_{RF})=aU_{RF}^{-k}$, I want the coefficient $k$ and $a$.
- I fit $\log(t_0) = A\log(U_{RF})+B$ with a linear expression.
- I compute $a=10^A$ and $k=A$.
- I fit my data with the power law with those coefficients.
With python this is as follows :
def my_power_law(x,a,b):
return a*(x**-b)
linear fit of log data
popt, pcov = curve_fit(my_lin,log(xx),log(yy))
k_fromlog = popt[0]
B_fromlog = popt[1]
ax.plot(xx_fit,my_power_law(array(xx_fit),10**B_fromlog,k_fromlog),label='From log')
Direct power law fit
popt, pcov = curve_fit(my_power_law,xx,yy,p0=[1e23,12.5],maxfev=2500)
ax.plot(xx_fit,my_power_law(array(xx_fit),popt[0],popt[1]),
color='r',ls='--',label='Direct pow. Law fit')
In the direct power law fit (with my_power_law()) the coefficients are $a=5.2e+44$ and $k=24$, this looks quite nice after all. In the logarithm method I have $a=5.6e+64$ and $k=64.7$ and the curve is 37 orders of magnitude above the data ! The data with direct fit is presented below.
The same information under the form of a table is available below.
$U_{RF}$ [V] | $t_0$ [ms] |
---|---|
60.000 | 16.378 |
61.000 | 11.316 |
62.000 | 7.087 |
62.200 | 6.259 |
62.400 | 4.089 |
62.600 | 5.668 |
62.800 | 4.922 |
63.000 | 3.815 |
63.200 | 4.895 |
63.400 | 4.156 |
63.600 | 4.063 |
63.800 | 4.046 |
64.000 | 3.650 |
65.000 | 2.931 |
66.000 | 2.474 |
67.000 | 2.065 |
68.000 | 1.487 |
70.000 | 1.471 |
Another problem is that error bars are not crossing the fit curve (error bars smaller than the crosses).
Conclusion
What do you think about that ? Is the direct power law fitting satisfying to you? Is the power law a good choice ? Do you think this is a valid choice to try to fit data with an analytical expression guessed with no physical argument? In that last question I mean : should I try to determine an analytical form for the formula with analytical physics? My empirical method is due to the fact that I have no expression a priori, but maybe this is not a proper way to do science? Also I just saw the answer from ~fixed point~ https://physics.stackexchange.com/a/115137/248092 about non-least square. Do you think this is the main problem?