I have a table of data given by Table[{x3,v3},{r,SetPrecision[1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, 100],SetPrecision[1.00000000000000000000000000000000000000000000000000000000000000000000000000000000001,100],10^-87}]
with x=r+Log[-1+r]
and v=(1-1/r)/r^3
. How can I find the best fit (function) of these data? I will be thankful if someone help.
$\begingroup$
$\endgroup$
Add a comment
|
2 Answers
$\begingroup$
$\endgroup$
x[r_] := r + Log[-1 + r];
v[r_] := (1 - 1/r)/r^3;
data = Table[{x[r], v[r]}, {r, 1 + 10^-88, 1 + 10^-83, 10^-87}];
fit = FindFormula[data, x]
0.367879 E^x
Show[ListPlot[data, PlotStyle -> Red],
Plot[fit, {x, -194.26, -190}, PlotRange -> All, PlotStyle -> Green]]
$\begingroup$
$\endgroup$
Data
First your data
data = Table[
{
r + Log[-1 + r],
(1 - 1/r)/r^3
}
, {
r,SetPrecision[1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, 100],
SetPrecision[1.00000000000000000000000000000000000000000000000000000000000000000000000000000000001, 100],
10^-87
}
];
Model
You already have the equations, so there is nothing to guess or fit.
model = FullSimplify[
ReplaceAll[
(1 - 1/r)/r^3,
First@Solve[
x == r + Log[-1 + r]
, r
]
]
]
(* ProductLog[E^(-1 + x)]/(1 + ProductLog[E^(-1 + x)])^4 *)
Or because
FullSimplify@N@Normal@Series[Log[model], {x, -200, 2}]
(* -1. + (1. - 1.27277*10^-87 x) x*)
To very good approximation
modelaprx = Exp[x - 1]
Plot
Show[
ListPlot[
data
, PlotRange -> All
, ScalingFunctions -> "Log"
, PlotTheme -> "Scientific"
, PlotMarkers -> {Blue, Medium}
]
, Plot[
model
, {x, -201, -180}
, PlotStyle -> Red
, ScalingFunctions -> "Log"
]
]