I have two points stored in data
:
data = {{0.0166667, 2.86927*10^-12}, {0.0333333, 1.12725*10^-11}};
data[[All,1]]
contains the time t
.
data[[All,2]]
contains the first 2 points of the so called mean squared displacement.
To calculate the particle mass m
the 2 points should be fitted with the following function:
k * T / m * t^2 (* fitting function *)
k = 1.3806488*10^-23;
T = 300;
(* m = particle mass in kg, is the fitting parameter *)
Manually I get a good fit if I take m = 4.1 * 10^-13
kg.
dataPlot =
ListLinePlot[data, PlotStyle -> {Blue},
Epilog -> {PointSize[Medium], Point[data]}];
manualFitPlot =
Plot[k*300/(4.1*10^-13)*t^2, {t, 1/60, 2/60}, PlotStyle -> {Green}];
Show[dataPlot, manualFitPlot, PlotRange -> All]
When I try to use NonlinearModelFit
a wrong result for the mass is obtained:
nlm = NonlinearModelFit[data, k*300/m*t^2, {m}, t];
nlm["ParameterTable"]
$\small \begin{array}{l|llll} \text{} & \text{Estimate} & \text{Standard Error} & \text{t-Statistic} & \text{P-Value} \\ \hline m & 0.422029 & 4.36728\times 10^{11} & 9.66343 \times 10^{-13} & 1 \\ \end{array}$
I tried different initial values for m
and also rescaled the small values by multiplying with (*10^10)
. It did not help.
How can I solve this?
m
and the variance about the line) with just two data points? $\endgroup$ – JimB Apr 20 '16 at 16:18