Fit polynomial to data with prescribed second derivative

7 ビュー (過去 30 日間)
Andrea
Andrea 2015 年 1 月 24 日
回答済み: Unai San Miguel 2017 年 3 月 15 日
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 :(

回答 (3 件)

Matt J
Matt J 2015 年 1 月 24 日
編集済み: Matt J 2015 年 1 月 24 日
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 件のコメント
John D'Errico
John D'Errico 2015 年 1 月 25 日
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.

サインインしてコメントする。


Andrea
Andrea 2015 年 1 月 24 日
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 2017 年 3 月 15 日
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?

カテゴリ

Help Center および File ExchangeSpline Postprocessing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by