Académique Documents
Professionnel Documents
Culture Documents
matemtica
MATLAB: Series y graficacin.
Junio 2012
1
Matlab
Series
Ejemplo:
>> syms x k n;
>> s1 = symsum(k)
s1=
k^2/2 - k/2
>> s2 = symsum(k, 1, n)
s2 =
(n*(n + 1))/2
>> s3 = symsum(1/k^2, 1, inf)
s3 =
pi^2/6
>> s4 = symsum(x^k, k, 0, inf)
s4 =
piecewise([1 <= x, Inf], [abs(x) < 1, -1/(x - 1)])
3
Matlab
Series
4
Matlab
Series de McLaurin y de Taylor
5
Matlab
Series de McLaurin y de Taylor
6
Matlab
Series de McLaurin y de Taylor
7
Matlab
Series de McLaurin y de Taylor
Ejemplo:
>> ssyms x
>> f = 1/(5 + 4*cos(x));
>> T = taylor(f, 8)
T=
(49*x^6)/131220 + (5*x^4)/1458 + (2*x^2)/81 + 1/9
>> pretty(T)
6 4 2
49 x 5x 2x 1
---------- + ------- + ---- + --
131220 1458 81 9
>> g = exp(x*sin(x)), t = taylor(g, 12, 2);
ans= ... Output truncated. Text exceeds maximum line
length of 25,000 characters for Command Window display.
8
Matlab
Series de McLaurin y de Taylor
Ejemplo:
>> ssyms x t;
>> taylor(exp(-x))
ans=
x^4/24 - x^5/120 - x^3/6 + x^2/2 - x + 1
>> taylor(log(x),6,1)
ans=
x - (x - 1)^2/2 + (x - 1)^3/3 - (x - 1)^4/4 + (x - 1)^5/5 1
>> taylor(sin(x),pi/2,6)
ans=
(pi/2 - x)^4/24 - (pi/2 - x)^2/2 + 1
>> taylor(x^t,3,t) returns
ans=
(t^2*log(x)^2)/2 + t*log(x) + 1
9
Matlab
Graficacin simblica
10
Matlab
Garficacin polinomio de McLaurin
Ejemplo:taylor.m
syms x;
y=x*cos(x);
Y=ezplot(y,[-1, 1]); set(Y,'color','k');
hold on
pause(1);
t1=taylor(y,1);
T1=ezplot(t1,[-1, 1]); set(T1,'color','c','lineStyle',':');
pause(1);
t3=taylor(y,2);
T3=ezplot(t3,[-1, 1]); set(T3,'color','r','lineStyle',':');
pause(1);
t5=taylor(y,5);
T5=ezplot(t5,[-1, 1]); set(T5,'color','g','lineStyle',':');
pause(1);
t7=taylor(y,7);
T7=ezplot(t7,[-1, 1]); set(T7,'color','b','lineStyle',':');
hold off
11