Fit polynomial to data with prescribed second derivative

7 Ansichten (letzte 30 Tage)
Andrea
Andrea am 24 Jan. 2015
Beantwortet: Unai San Miguel am 15 Mär. 2017
Hi!!
In desperate need for help. I have a set of data for the upper surface of an airfoil. I am trying to fit a polynomial to this set so that I can evaluate the second derivative. The current problem is that basic fitting does not produce great accuracy at the end. What I am trying desperately is to prescribe the second derivative at the left end so that this equals -0.001. I have tried csape(x,y,"second") and tried to place -0.001 everywhere but without much success. I keep getting very strange shapes or error saying that the matrices being concatenated is inconsistent.
What I am doing wrong?
Thanks everybody :(

Antworten (3)

Matt J
Matt J am 24 Jan. 2015
Bearbeitet: Matt J am 24 Jan. 2015
It might be worth having a look at this spline fitting tool,
which provides a pretty convenient and flexible interface for constraints on the derivatives. In particular, one of the input option parameters 'xypp' lets you fix the second derivative at arbitrary points.
  1 Kommentar
John D'Errico
John D'Errico am 25 Jan. 2015
Of course, I might be biased in agreeing with this suggestion.
Spline models should be preferred to polynomial models anyway. Lower order polynomials are too inflexible too often, and higher order polynomials blow up too easily due to numerical problems.

Melden Sie sich an, um zu kommentieren.


Andrea
Andrea am 24 Jan. 2015
This is what I was using, the general shape is good. It only needs the second derivative correction at the endpoints and I cant get the command right

Unai San Miguel
Unai San Miguel am 15 Mär. 2017
The help page for csape says that you would have to use csape(x, [-0.001, y, -0.001], 'second') or csape(x, [-0.001, y, -0.001], [2, 2]) to fit a cubic polynomial spline to (x, y) with second derivative of y wrt to x equal to -0.001 at both ends of x.
But, is this really what you want to do? Are the second derivatives the same at both ends of the upper side of your airfoil?

Kategorien

Mehr zu Spline Postprocessing finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by