3
$\begingroup$

I have following data points:

{{0.4, 0.74}, {0.38, 0.7}, {0.36, 0.67}, {0.34, 0.63}, {0.32, 
  0.59}, {0.3, 0.56}, {0.28, 0.52}, {0.26, 0.48}, {0.24, 0.45}, {0.22,
   0.41}, {0.2, 0.38}, {0.18, 0.34}, {0.16, 0.3}, {0.14, 0.26}, {0.12,
   0.23}, {0.1, 0.19}, {0.08, 0.15}, {0.06, 0.11}, {0.05, 
  0.09}, {0.049, 0.08}, {0.048, 0.08}, {0.048, 0.01}, {0.047, 
  0.08 }, {0.047, 0.04}, {0.047, 0.02}, {0.047, 0}, {0.046, 
  0.08}, {0.046, 0.07}, {0.046, 0.06}, {0.046, 0.05}, {0.046, 0.03}}  

which looks like this:

enter image description here

The upper part is the usual fitting, but with the concentrated dots, it seems harder.

Zoom in those very concentrated points, I have following data points:

  {{0.05`, 0.09`}, {0.049`, 0.08`}, {0.048`, 0.08`}, {0.048`, 
  0.01`}, {0.047`, 0.08`}, {0.047`, 0.04`}, {0.047`, 0.02`}, {0.047`, 
  0}, {0.046`, 0.08`}, {0.046`, 0.07`}, {0.046`, 0.06`}, {0.046`, 
  0.05`}, {0.046`, 0.03`}}

enter image description here

What I wish for the fitting for the concentrated dots is something like this(much smoother than the drawing):

enter image description here

Every y value has the accuracy within +-0.01.

I am not sure how to fit those dots. Can anyone help? Thanks in advance!

$\endgroup$
3
  • 2
    $\begingroup$ That seems rather arbitrary. $\endgroup$
    – Feyre
    Sep 6, 2016 at 7:23
  • 1
    $\begingroup$ Are you sure the samples at the beginning of your measurement are even significant? $\endgroup$
    – Sascha
    Sep 6, 2016 at 8:00
  • $\begingroup$ It definitely looks like measurement noise at the end (not the start, they are the higher numbers) of your set of points. What is the accuracy of your x values? Joined->True in the ListPlot would give you a line like the one you have drawn... $\endgroup$
    – SPPearce
    Sep 6, 2016 at 8:14

1 Answer 1

6
$\begingroup$

Inverse function is much more pleasant. Therefore exchange $x$ and $y$, fit, invert.

ptsn = DeleteDuplicates[pts[[All,{2, 1}]], Abs[First[#1]-First[#2]] < 0.001 &];
f = Interpolation[ptsn];
g[1] = ListPlot[ptsn, PlotRange -> All];
g[2] = Plot[f[x], {x, 0.0, 0.74}];
Show[{g[1], g[2]}, Axes -> False, Frame -> True]

Inverse function

enter image description here

Original function

g[4] = Plot[InverseFunction[f][x], {x, 0.045, 0.39}];
g[3] = ListPlot[pts, PlotRange -> All];
Show[{g[3], g[4]}, PlotRange -> {{0.0, 0.4}, All}, Axes -> False,Frame -> True]

enter image description here

$\endgroup$
2
  • $\begingroup$ Very nice solution. I think you may have a small typo. Should be pts[[All, {2, 1}]] with two brackets? $\endgroup$ Sep 6, 2016 at 16:23
  • $\begingroup$ @JackLaVigne thank you, somethings strange happened during copy/paste. I had to remove a lot of backslashes and obviously remove too much. Will correct soon. $\endgroup$
    – yarchik
    Sep 6, 2016 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.