Professional Documents
Culture Documents
1. Polinoame Taylor
Comanda "Series" da dezvoltarea in serie Taylor de puteri a unei functii. Polinomul Taylor de grad 4 asociat functiei
f in jurul punctului x0 este:
In[1]:=
Out[2]=
In[3]:=
Clear@"Global`*"D
Series@f@xD, 8x, x0, 4<D
f@x0D + f @x0D Hx - x0L +
1
2
f @x0D Hx - x0L2 +
1
6
1
24
, n>FF
4
tb = 881, s@x, 1D<, 83, s@x, 3D<, 85, s@x, 5D<, 811, s@x, 11D<, 814, s@x, 14D<<;
TableForm@tb, TableHeadings 8None, 8"n", "s@x,nD"<<, TableSpacing 82, 4<D
Out[7]//TableForm=
s@x,nD
1
2
-x
1
2
-x+
2
3
1
2
-x+
2
3
11
1
2
-x+
2
3
14
1
2
-x+
2
3
IIII-
+ xM
+ xM -
+ xM -
+ xM -
2
15
2
15
2
15
III-
+ xM
+ xM +
+ xM +
4
315
4
315
II-
2 I- +xM
+ xM -
+ xM -
2 I- +xM
2835
4
2835
4 I- +xM
4 I- +xM
11
155 925
4 I- +xM
11
155 925
13
6 081 075
In[8]:=
Needs@"PlotLegends`"D
Plot@Evaluate@8s@x, 1D, s@x, 3D, s@x, 5D, s@x, 11D, s@x, 14D, f@xD<D, 8x, 0, 4<,
PlotStyle 88Dashing@80.05, 0.05<D<, 8Dashing@80.03, 0.03<D<, 8Dashing@80.01, 0.01<D<,
8Dashing@80.005, 0.005<D<, 8Dashing@80.003, 0.003<D<, 8Thickness@0.005D<<,
LegendPosition 81.1, - 0.5<, PlotLegend 8"s1 ", "s3 ", "s5 ", "s11 ", "s14 ", "f"<,
ImageSize LargeD
General::obspkg :
PlotLegends` is now obsolete. The legacy version being loaded may conflict with current Mathematica
functionality. See the Compatibility Guide for updating information.
s1
1
s3
Out[9]=
s5
s11
s14
-1
In[11]:=
fTaylor@Sin, Pi 4, 5, 0, PiD
In x =
Jx- N
5
4
120
Jx- N
24
Jx- N
Jx- N
x-
1
2
1.0
0.8
0.6
Out[11]=
0.4
0.2
0.5
1.0
1.5
2.0
2.5
Functia precedenta poate fi inclusa intr-o interfata grafica folosind comanda "Manipulate":
3.0
In[38]:=
sinus
cosinus
In x =
1.0
0.5
Out[38]=
-0.5
-1.0
2. Polinoame Bernstein
In[40]:=
Polinoamele Berstein de ordinul n constituie o baza in spatiul polinoamelor de grad mai mic sau egal cu n si se
definesc astfel :
Bi,n HxL = Cni xi H1 - xLn-i , i = 0, 1, ..., n.
Fiind data functia f : [0,1] R R , polinomul Bn f HxL = ni=0 f I n M Bi,n HxL se numeste polinom Bernstein asociat
i
In[43]:=
1.0
0.9
0.8
Out[44]=
0.7
0.6
0.5
0.4
0.2
0.4
0.6
0.8
1.0
3. Polinoame Fourier
Polinomul Fourier de ordin k asociat pe intervalul [a,b] unei functii f HxL are expresia
sfHxL =
an =
a0
2
2 nx
M + bn
b-a
b
2
2 nx
f HxL cosI b-a M x,
b-a a
bn =
2 nx
MM
, unde
b-a
b
2
2 nx
f HxL sinI b-a M x.
b-a a
sinI
coeficientii
sunt
a0 =
b
2
f HxL x,
b-a a
Comenzile urmatoare construiesc acest polinom si il reprezinta graficpentrun cateva valori ale lui k (1, 2, 10, 50):
In[18]:=
In[19]:=
f@x_D = x ^ 2;
a0 = H2 PiL * Integrate@f@xD, 8x, 0, Pi<D
2 2
Out[19]=
In[20]:=
Out[20]=
1
Out[21]=
n2
In[22]:=
Out[22]=
Out[23]=
In[24]:=
6
Out[25]=
0.5
1.0
1.5
2.0
2.5
3.0
10
6
Out[26]=
0.5
1.0
1.5
2.0
2.5
3.0
0.5
1.0
1.5
2.0
2.5
3.0
0.5
1.0
1.5
2.0
2.5
3.0
10
6
Out[27]=
10
6
Out[28]=
In[29]:=
a = 0; b = Pi;
tb = 881, sf@x, 1D<, 82, sf@x, 2D<, 83, sf@x, 3D<<;
TableForm@tb, TableHeadings 8None, 8"k", "sf"<<, TableSpacing 82, 4<D
Needs@"PlotLegends`"D
Out[31]//TableForm=
sf
2
3
2
3
2
3
+ Cos@2 xD - Sin@2 xD
+ Cos@2 xD +
1
4
Cos@4 xD - Sin@2 xD -
+ Cos@2 xD +
1
4
Cos@4 xD +
1
9
1
2
Sin@4 xD
Cos@6 xD - Sin@2 xD -
1
2
Sin@4 xD -
1
3
Sin@6 xD
10
f
6
sf1
Out[33]=
4
sf2
2
sf3
0.5
1.0
1.5
2.0
2.5
3.0
In[34]:=
Clear@"Global`*"D
In[35]:=
In[36]:=
f@x_D = x ^ 3; seriaFourier@f, - 1, 1, 5D
1.0
0.5
Out[36]=
-1.0
-0.5
0.5
1.0
-0.5
-1.0
In[37]:=
1.0
0.5
Out[37]=
-1.0
-0.5
0.5
-0.5
-1.0
1.0
10