Again I tend to duplicate, despite this is an interpolation and a real 2D curve under consideration.
What I did is using this solution. I like to meet the periodic boundary conditions, but did not really match them.
Use this
xxn = Mean[{#, RotateLeft@#}] &@(Transpose[xydata][[1, All]]);
yyn = Mean[{#, RotateLeft@#}] &@(Transpose[xydata][[2, All]]);
It do in this particular case not really enhance the problems.
Better make use of
xxn7 = MovingAverage[ArrayPad[#, {0, 1}, "Periodic"], 7] &@xxn;
xi1 = ListInterpolation[xxn7, {0, 1}, InterpolationOrder -> 4,
Method -> "Spline"]
Plot[xi1'[x], {x, 0, 1}]
The result is:
That compares to
.
The curvature is defined:
This is not so critical in this particular case because it is inversely dependent on the first derivative at the first look. The second derivative called a in the formular is even oscillating wilder at the problematic points. So smoothing the first derivative and then derive further is a nice selection for controlling and stay close to the real process of oscillations.
There is no general best approximation. For most of the points the Mean
smoothing, neating, even, sleeking is to much, for others fair, for some not enough. The last ones govern the seconde derivative and make it even more jumpy.
On accident or selection, the second derivative from Your interpolation is already limited. 60000
is pretty much. MovingAverage of 7 neighbors reduces the maximum to 20000
. There is a need for a function between neighbors for MovingAverage and the Maximum in x''
.
Better is average different pairs of neighbors repetitive. The resulting curve and maximum value of the second derivative will get smaller and smaller. Stay on the original curve at the points fitting best, showing a little value in the second derivative to keep Your moving curve close to the original process. It is a matter of taste or mathematical authentic perception.
The path of calculation a parametric representation of the data points may be shorter but giving less control and insight into the behavior of the first and second derivative of the original curve.
If You decide for the MovingAverage approach, it might be sense full to transform the center of the curve to the origin of the coordinate system.
So after applying the MovingAverage over 7 neighbors, the second derivative is tamed:
The spikes a smaller about a third but there are more spikes. The distribution broadened a lot. This again contributes to the advice that a selection for better points might be better.
Keep in mind I did not alter the coordinate system nor did I add or remove points to or from the original curve. I worked on approximate curvature.
The resulting curve is a wavy as the given one:
The problem is it needs to be closed again.
A close comparison shows the power of averaging little:
In the upper half the averaging cuts of the spikes in the lower half it tends to move the curve outwards, enlarging the radius. So no symmetry at all. It seems there is more work ahead in dealing with the completion of the curve at the bottom. Again as with all steps it is up to the realism that applies.
Again I remembered not to make too much duplicate. For my introduce problem about the periodic option have a look at this article:
Higher order periodic interpolation (curve fitting). The answer by J. M. is in limbo should do the rest.
Obey the periodic option and stay away from evaluating the curvature but look deep and with care a the first and second derivative of the numerical interpolated representation of the given data.
I am just having problems with the part from 20 minutes past to close before half-past. The rest is comfortable and fine. There should be a rest of the curls in the curve. And the curve must not be as induced by changing to polar coordinate reside inside the very random speedy given one. There is a systematic error from the acquisition at the bottom that is in need to be dealt different with than numeric work.
{xi,yi}
, perhapsOuter
it a good choice for modelling the interpolation correct. Give up the options forListInterpolation
at all, bothSpline
andPeriodicInterpolation
cause interpolation trouble. Than You are easily done. UseTable
andListPlot
withOuter
. An example in theListInterpolation
doc assist my advise to trigonometrics. $\endgroup$