[PDF] Interpolation En Matlab/Octave on peut





Previous PDF Next PDF



Interpolation

16 sept. 2013 Interpolation is the process of defining a function that takes on ... This polynomial is called the interpolating polynomial because it ...



TP5 : Les fonctions sous MATLAB et linterpolation

9 avr. 2022 TP5 : Les fonctions sous MATLAB et l'interpolation ... En ligne : http://www.math.u-bordeaux1.fr/?yger/analyse1.pdf sections 2.5.3 et ...



Chapitre II Interpolation et Approximation

2 1). FIG. II.2: Fac-similé du calcul de Newton pour le probl`eme de l'interpolation. Dans tous ces calculs 



Interpolation

En Matlab/Octave on peut utiliser la commande polyfit pour calculer les coefficients du polynôme interpolant et polyval pour évaluer un polynôme dont on 



Présentation de Matlab 1. Introduction - Historique 2. Démarrage de

4.2. Méthode de Gauss-Seidel. Polynômes et interpolation polynomiale Résolution des équations non linéaires. 1. Opérations sur les polynômes dans MATLAB.



Travaux Pratiques Méthodes Numériques

La méthode d'interpolation de Newton de Tchebychev. 19. II.5. Mise en œuvre sous Matlab. 20. II.6. TP N°2 : Interpolation et approximation polynômiale.



Module : Méthodes numériques et programmation

6.6 Figures générées par le code Matlab ci-dessous pour = 10 et = 20 128. 6.7 Interpolation par splines linéaires .



MATLAB Examples - Interpolation and Curve Fitting.pdf

Interpolation is used to estimate data points between two known points. The most common interpolation technique is Linear Interpolation. • In MATLAB we can 



Analyse Numérique

INTERPOLATION ET APPROXIMATION POLYNÔMIALE. Démonstration du Théorème 3.1 : Existence : On vérifie directement que le polynôme donné par (3.2) est solution 





Chapter 3 Interpolation - MathWorks

Interpolation is the process of de?ning a function that takes on speci?ed values atspeci?ed points This chapter concentrates on two closely related interpolants: thepiecewise cubic spline and the shape-preserving piecewise cubic named “pchip ” 3 1 The Interpolating Polynomial We all know that two points determine a straight line



Chapter 3 - Interpolation - University of Saskatchewan

Interpolationis the process of de ning a function thatconnects the dots" between speci ed (data) points In this chapter we focus on two closely relatedinterpolants thecubic splineand theshape-preservingcubic splinecalled pchip" Two distinct points uniquely determine a straight line



MATLAB Interpolation - Javatpoint

Lagrange form of the interpolating polynomial using MATLAB Refer to the code below for a very naive O(n3) implementation For a more e cient implementation please refer to the barycentric interpolation method discussed in lecture Our results are plotted in Figure 4 1 n= 50; 2 N= 1001; 4



Interpolation and Curve fitting - Loyola University Maryland

Interpolation in MATLAB interp1 vq = interp1(xvxqmethod) x { sample points v { values f(x) xq { query points on which the polynomial will be evaluated



Chapter 5 Least Squares - MathWorks

The Matlab Optimization and Curve Fitting Toolboxes include functions for one-norm and in?nity-norm problems We will limit ourselves to least squares in this book 5 3 censusgui The NCM program censusgui involves several di?erent linear models The data are the total population of the United States as determined by the U S Census



Searches related to interpolation matlab pdf filetype:pdf

3INTERPOLATION Contents LESSONSUMMARY 1 Keyareasoftheonlinebook 2 INTERPOLATION 3 Theexampleproblem 3 Whatwedonotknow(orpretendto) 3 Plottounderstandtheproblembetter 4

What are the different interpolation methods available in MATLAB?

    The most common interpolation technique is Linear Interpolation. A more exotic interpolation scheme is to link the data points using third degree or cubic polynomials. In MATLAB, we can interpolate our data using splines or Hermite interpolants on a fly.

What are some benefits of interpolation in MATLAB?

    Interpolation is a technique for adding new data points within a range of a set of known data points. You can use interpolation to fill-in missing data, smooth existing data, make predictions, and more. Interpolation in MATLAB ® is divided into techniques for data points on a grid and scattered data points.

How do you perform linear interpolation in MATLAB?

    The function to perform linear interpolation, MATLAB provides the interp1 () function. Here, a sample point is a set of data points, which could be an array or a vector. The value of the unknown function on sample points is also a set that has the same size/length as the sample points.

How do you interpolate data in MATLAB?

    The most common interpolation technique is Linear Interpolation. A more exotic interpolation scheme is to link the data points using third degree or cubic polynomials. In MATLAB, we can interpolate our data using splines or Hermite interpolants on a fly.

InterpolationProf. Alfio Quarteroni

Interpolation - p. 1/51

Exemples et motivationsExemple 1.On consid`ere un test m´ecanique pour ´etablir le lien entre contrainte (MPa= 100N/cm2) et d´eformations relatives (cm/cm) d"un ´echantillon de tissu biologique (disque intervert´ebral, selon P. Komarek, Ch.

2 deBiomechanics of Clinical Aspects of Biomedicine, 1993, J. Valenta ed.,

Elsevier).

Interpolation - p. 2/51

testi contrainteσ d´eformation? 1 0.00 0.00 2 0.06 0.08 3 0.14 0.14 4 0.25 0.20 5 0.31 0.23 6 0.47 0.25 7 0.60 0.28 8 0.70 0.29 A partir des ces donn´ees, on veut estimer la d´eformation correspondante `a un effortσ= 0.9 MPa.

Interpolation - p. 3/51

A travers la m´ethode des moindres carr´es on obtient que la droite qui approche mieux ces donn´ees estp(x) = 0.3938x-0.0629. On peut utiliser cette droite (ditede r´egression) pour estimer?lorsqueσ= 0.9 MPa: on trouvep(0.9)?0.4. 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 -0.2

00.20.40.60.8

valeur estim´ee pourσ= 0.9

Interpolation - p. 4/51

Exemple 2.La population de la Suisse dans les ann´ees 1900 `a 2000 est recens´ee comme il suit (en milliers),

ann´ee 1900 1910 1920 1930 1941 1950population 3315 3753 3880 4066 4266 4715ann´ee 1960 1970 1980 1990 2000population 5429 6270 6366 6874 7288

Peut-on estimer le nombre d"habitants de la Suisse pendant les ann´ees o`u il n"y a pas eu de recensement, par exemple en 1945 et en 1975? Peut-on envisager un mod`ele pour pr´edire la population dela Suisse en 2010?

Interpolation - p. 5/51

Le polynˆome de degr´e deux (parabole) qui approche ces donn´ees au sens des moindres carr´es estp(x) = 0.19x2-710.29x+ 657218.92. 1900
1920
1940
1960
1980
2000

3000400050006000700080009000

année population en milliers

Population de la Suisse au cours des années

valeurs mesurées valeurs estimées par interpolation

Interpolation - p. 6/51

Exemple 3.Les points dans la figure suivante repr´esentent les mesuresdu d´ebit du sang dans une section de l"art`ere carotide pendant un battement cardiaque. La fr´equence d"acquisition de donn´ees est constante et ´egale `a

10/T o`u T=1 sec. est la p´eriode du battement.

On veut d´eduire de ce signal discret un signal continu repr´esent´e par une combinaison lin´eaire de fonctions connues (par exemple defonctions trigonom´etriques, cette repr´esentation est adapt´ee a notre probl`eme parce que la fonction obtenue va bien approximer un signal p´eriodique). 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 -50510152025303540

Interpolation - p. 7/51

Soitf(t) le signal dont on connaˆıtN= 10 ´echantillons [f(t0),...,f(tN-1)], avectj=jT/N. On cherche{ck} ?C,k?[0,N-1]?Ntels que: f(tj) =1

NN-1Xk=0c

kω-kj

N, j= 0,...,N-1,(1)

o`u

N=e(-2πi)/N= cos(2π/N)-isin(2π/N),

´etantil"unit´e imaginaire. On peut calculer le vecteur des coefficients c= [c1,...,c10]Tpar l"algorithme F.F.T. (Fast Fourier Transform, Cooley et Tuckey, 1965), impl´ement´e dans Matlab/Octave avec la commandefft.

Interpolation - p. 8/51

A partir de l"expression (1), il y a plusieurs techniques pour reconstruire la valeur defdans chaque pointt?[0,T]. Une fois que l"on a reconstruit la fonction, on peut la repr´esenter sur un graphe comme ceci 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -10-50510152025303540

Interpolation - p. 9/51

Position du problème

(Sec. 3.1 du livre)

Soitn≥0un nombre entier. Etant donnés

n+ 1points distinctsx0,x1,... xn etn+ 1valeursy0,y1,... yn, on cherche un polynômepde degrén , tel que (2) Dans le cas affirmatif, on notep= Πnet on appelleΠnle polynôme d'interpolation aux pointsxj, j= 0,...,n -1 0 1 2 3 4 5 6 -10123456 x0xny 0 y n -1 0 1 2 3 4 5 6 -10123456 x0xny 0 y nΠ n(n= 4)

Interpolation - p. 10/51

Soitf?C0(I)etx0,...,xn?I. Si comme valeursyjon prendyj=f(xj), appelé l' interpolant defaux pointsx0,... xn -1 0 1 2 3 4 5 6 -10123456 x0xnf -1 0 1 2 3 4 5 6 -10123456 x0xnfΠ nf(n= 4)

Interpolation - p. 11/51

Base de Lagrange

(Sec. 3.1.1 du livre) On considère les polynômes?k,k= 0,...,nde degréntels que k(xj) =δjk, k,j= 0,...,n, oùδjk= 1sij=ketδjk= 0sij?=k. Explicitement, on a ?k(x) =nY j=0,j?=k(x-xj) (xk-xj).

Interpolation - p. 12/51

La figure qui suit montre deux polynômes de Lagrange de degrén= 6relatifs aux points d'interpolationsx0=-1,x1=-2/3,...,x5= 2/3, etx6= 1. -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 -0.5

00.511.5

?0(x)?3(x) x 0x 1 x 2x3x 4 x 5x 6

Interpolation - p. 13/51

Exemple 4.Pourn= 2,x0=-1,x1= 0,x2= 1 les polynˆomes de la base de Lagrange sont

0(x) =(x-x1)(x-x2)

(x0-x1)(x0-x2)=1

2x(x-1),

1(x) =(x-x0)(x-x2)

(x1-x0)(x1-x2)=-(x+ 1)(x-1),

2(x) =(x-x0)(x-x1)(x2-x0)(x2-x1)=1

2x(x+ 1).

-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 -0.2

00.20.40.60.811.2

?0?1?2

Interpolation - p. 14/51

Le polynôme d'interpolationΠndes valeursyjaux pointsxj,j= 0,...,n, s'écrit

Πn(x) =nXk=0y

k?k(x), (3) car il vérifieΠn(xj) =Pnk=0yk?k(xj) =yj.

Par conséquent on aura

Πnf(x) =nXk=0f(xk)?k(x).

Interpolation - p. 15/51

On montre maintenant que le polynômeΠnen (3) est le seul polynôme de degréninterpolant les donnéesyiaux noeudsxi. Soit, en effet,Qn(x)un autre polynôme d'interpolation. Alors on a Q n(xj)-Πn(xj) = 0, j= 0,...,n. Donc,Qn(x)-Πn(x)est un polynôme de degrénqui s'annule enn+ 1points distincts; il en suit queQn= Πn, d'où l'unicité du polynôme interpolant.

Interpolation - p. 16/51

Interpolation d'une fonction regulièreTh´eor`eme (Erreur d"interpolation)(voir prop. 3.2 du livre)

Soientx0,x1,...,xn,n+ 1noeudséquirépartisdansI= [a,b]et soit f?Cn+1(I). Alors, on a

4(n+ 1)"

b-a n" n+1 maxx?I|f(n+1)(x)|. (4) On remarque que l'erreur d'interpolation dépend de la dérivéen+1-ième def.

Interpolation - p. 17/51

Exemple 5.Polynˆomes d"interpolation Πifpouri= 1,2,3,6 et f(x) =x+ 1

5sin(x), noeuds ´equir´epartis sur [0,6].

-1 0 1 2 3 4 5 6 7 -1.5-1-0.5 00.51

Π1 fΠ

3 f

2 fΠ

6 f f

Interpolation - p. 18/51

Interp. numérique avec Matlab/OctaveEn Matlab/Octave on peut calculer les polynômes d"interpolation en utilisant

les commandespolyfitetpolyval. Voyons plus en détaille comment peut-on utiliser ces commandes. p = polyfit(x,y,n)calcule les coefficients du polynôme de degrénqui interpole les valeursyaux pointsx.

Interpolation - p. 19/51

Exemple A.On veut interpoler les valeursy= [3.38,3.86,3.85,3.59,3.49] aux pointsx= [0,0.25,0.5,0.75,1] par un polynˆome de degr´e 4. Il suffit d"utiliser les commandes Matlab/Octave suivantes: >> x=[0:0.25:1]; % vecteur des points d"interpolation >> y=[3.38 3.86 3.85 3.59 3.49]; % vecteur des valeurs >> p1=polyfit(x,y,4) p1 =

1.8133 -0.1600 -4.5933 3.0500 3.3800

p1est le vecteur des coefficients du polynˆome interpolant:

4(x) = 1.8133x4-0.16x3-4.5933x2+ 3.05x+ 3.38.

Pour calculer le polynˆome de degr´enqui interpole une fonctionfdonn´ee dansn+ 1 points, il faut d"abord construire le vecteuryen ´evaluantfdans les noeudsx.

Interpolation - p. 20/51

Exemple B.Consid´erons le cas suivant:

>> f="cos(x)"; >> x=[0:0.25:1]; >> y=eval(f); >> p=polyfit(x,y,4) p =

0.0362 0.0063 -0.5025 0.0003 1.0000

Remarque 1.Si la dimensionm+1dexetyestm+1> n+1(n´etant le degr´e du polynˆome d"interpolation), la commandepolyfit(x,y,n)retourne le polynˆome interpolant de degr´enau sens des moindres carr´es (voir sec. 3.4 du livre). Dans le cas o`um+ 1 =n+ 1, alors on trouve le polynˆome d"interpolation "standard", puisque dans ce cas les deux co

¨ıncident.

Interpolation - p. 21/51

y = polyval(p,x)calcule les valeursyd"un polynôme de degrén, dont les n+1coefficients sont memorisés dans le vecteurp, aux pointsx, c"est-à-dire:y =p(1)*x.^n+...+p(n)*x + p(n+1). Exemple C.On veut ´evaluer le polynˆome trouv´e dans l"Exemple A dans le pointx= 0.4 et, ensuite, on veut tracer son graphe. On peut utiliser les commandes suivantes: >> x=0.4; >> y=polyval(p1,x) y =

3.9012

>> x=linspace(0,1,100); >> y=polyval(p1,x); >> plot(x,y)

Interpolation - p. 22/51

Exemple 6.On veut interpoler la fonction sin(x) +xsurn= 2,3,4,5,6 noeuds. En Matlab/Octave on peut utiliser la commandepolyfitpour calculer les coefficients du polynˆome interpolant etpolyvalpour ´evaluer un polynˆome dont on connaˆıt les coefficients dans une suite de points. Voil`a les commandes Matlab/Octave : >> f = "sin(x) + x"; >> x=[0:3*pi/100:3*pi]; x_sample=x; >> plot(x,eval(f),"b"); hold on >> for i=2:6 x=linspace(0,3*pi,i); y=eval(f); c=polyfit(x,y,i-1); plot(x_sample,polyval(c,x_sample),"b--") end

Interpolation - p. 23/51

La figure suivante montre les 5 polynˆomes obtenus. 0 1 2 3 4 5 6 7 8 9 -2024681012

Π1f(x),Π3f(x)

2f(x)Π

4f(x)

5f(x)f(x)

Interpolation - p. 24/51

Remarque 2.Seul le fait que

lim n→∞1

4(n+ 1)"

b-a n" n+1 = 0 n"implique pas queEn(f)tend vers z´ero quandn→ ∞.

Exemple 7. (Runge)Soitf(x) =1

1+x2,x?[-5,5]. Si on l"interpole dans

des points ´equir´epartis, au voisinage des extr´emit´es de l"intervalle, l"interpolant pr´esente des oscillations, comme on peut levoir sur la figure.

Interpolation - p. 25/51

Fonction de Runge et oscillations des polynˆomes interpolants dans des points ´equir´epartis. -5 -2.5 0 2.5 5 -0.5

00.511.52

Π10 f (x)

5 f (x)

f(x)

Interpolation - p. 26/51

Remède :Interpolation par intervalles.

Interpolation - p. 27/51

Interpolation par intervalles

(Sec. 3.2 du livre) Soientx0=a < x1<···< xN=bdes points qui divisent l"intervalleI= [a,b] dans une réunion d"intervallesIi= [xi,xi+1]de longueurHoù H=b-a N. abH x ixi+1xi-1 Sur chaque sous-intervalleIion interpolef|Iipar un polynôme de degré 1. Le polynôme par morceaux qu"on obtient est notéΠH1f(x), et on a: Hquotesdbs_dbs14.pdfusesText_20
[PDF] interpolation par spline cubique matlab

[PDF] interpolation polynomiale matlab pdf

[PDF] interpolation sinus

[PDF] interpolation sous matlab

[PDF] interpolation spline cubique

[PDF] interpolation spline cubique exercice corrigé

[PDF] interpolation spline exercices corrigés

[PDF] interpolation trigonométrique

[PDF] interprétation bilan humique

[PDF] interprétation coefficient de corrélation

[PDF] interprétation coefficient de corrélation excel

[PDF] interprétation coefficient de détermination

[PDF] interprétation courbe de croissance

[PDF] interprétation d'un arbre phylogénétique

[PDF] interprétation dun spectre infrarouge