using linear interpolation to find coefficients

10 ビュー (過去 30 日間)
WILLBES BANDA
WILLBES BANDA 2020 年 5 月 28 日
回答済み: David Hill 2020 年 5 月 28 日
Hi, i want to create a function that interpolates linearly to give me the coefficients. As an example, the function must take in AerodynamicData.Cm.BodyFlap (see below) and must use VehicleState to find the interpolated value of CmBodyFlap, which is the contribution that the body flap makes towards the aerodynamic coefficient named, Cm.
AerodynamicData.Cm.BodyFlap =
struct with fields:
deBF: [-11.7000 -5 0 5 10 16.3000 22.5000]
alpha: [-10 -5 0 5 10 15 20 25 30 35 40 45 50]
CmBodyFlap: [7×13 double]
VehicleState =
struct with fields:
alpha: 40
Mach: 5
deBF: 6
deSB: 0
deA: 0
Please help.

回答 (2 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2020 年 5 月 28 日
Hi,
use polyfit(); e.g.
x = alpha; y = deBF; % then
Coeff= polyfit(x, y, N); % N=1 linear fit, N=2 second order polynomial fit, N=3 cubic polynomial, etc.
  1 件のコメント
madhan ravi
madhan ravi 2020 年 5 月 28 日
Please use the code button.

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


David Hill
David Hill 2020 年 5 月 28 日
Make sure your matrix agrees with the meshgrid generated or change it to match.
[d,a]=meshgrid(AerodynamicData.Cm.BodyFlap.deBF,AerodynamicData.Cm.BodyFlap.alpha);
CmBodyFlap_interp=interp2(d,a,AerodynamicData.Cm.BodyFlap.CmBodyFlap,VehicleState.deBF,VehicleState.alpha);

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by