Filter löschen
Filter löschen

using linear interpolation to find coefficients

10 Ansichten (letzte 30 Tage)
WILLBES BANDA
WILLBES BANDA am 28 Mai 2020
Beantwortet: David Hill am 28 Mai 2020
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.

Antworten (2)

Sulaymon Eshkabilov
Sulaymon Eshkabilov am 28 Mai 2020
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.

David Hill
David Hill am 28 Mai 2020
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);

Kategorien

Mehr zu Interpolation finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by