Fit polynomial to data with prescribed second derivative

18 visualizaciones (últimos 30 días)
Andrea
Andrea el 24 de En. de 2015
Respondida: Unai San Miguel el 15 de Mzo. de 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 :(

Respuestas (3)

Matt J
Matt J el 24 de En. de 2015
Editada: Matt J el 24 de En. de 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 comentario
John D'Errico
John D'Errico el 25 de En. de 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.

Iniciar sesión para comentar.


Andrea
Andrea el 24 de En. de 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 el 15 de Mzo. de 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?

Categorías

Más información sobre Spline Postprocessing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by