Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
=
n
n
n
x x x x x y converge para
x
y
=
1
1
se
-1<x<1. Determine a srie de potncia para
2
1
1
z
w
+
= .
clear
N=5;
S(1)=1;
t=-1:1;
for x=1:length(t)
for n=2:N
an=x^2*n;
S(n)=S(n-1)+an;
end
end
S
S=1 19 46 82 127
Exerccio 10 A funo exponencial pode ser obtida pela srie de potncias
...
)! 1 (
...
! 3 ! 2
1
)! 1 (
1
1
3 2 1
+
+ + + + + =
=
+
=
n
x x x
x
n
x
e
n
n
n
x
a) Ache uma representao em srie de potncias para a funo
x
e
.
b) Determine o valor da srie para x=1 somando 4, 8 e 16 parcelas.
clear
N = [4 8 16];
S(1) = 1;
a = 1;
for t = 1:3
for n = 2:N(t)
sinal = (-1)^(n-1);
an = (a^(n-1))/factorial(n-1);
S(n) = S(n-1)+an*sinal;
end
S(N(t))
end
ans = 0.3333
ans = 0.3679
ans = 0.3679
c) Determine o valor da srie para x= - 1 somando 4, 8 e 16 parcelas.
clear
N = [4 8 16];
S(1) = 1;
A = -1;
for t = 1:3
for n = 2:N(t)
sinal = (-1)^(n-1);
an = (a^(n-1))/factorial(n-1);
S(n) = S(n-1) + an*sinal;
end
S(N(t))
end
ans = 2.6667
ans = 2.7183
ans = 2.7183
Exerccio 11 Resolva, usando o mtodo Gauss-Jordan, os seguintes sistemas:
= +
= +
= + +
10 4 7 3
1 3 2
8 2
3 2 1
3 2 1
3 2 1
x x x
x x x
x x x
= + +
= + +
= + +
1 4 1 8
1 2 5 2
0 2 2 2
3 2 1
3 2 1
3 2 1
x x x
x x x
x x x
%PRIMEIRO SISTEMA
clear all
A = [1 1 2; -1 -2 3; 3 -7 4];
B = [8; 1; 10];
M = [ A B ];
[a b]=size(M);
% ZERANDO ABAIXO DA DIAGONAL PRINCIPAL
for d=1:a-1
for i=d+1:a
c=-(M(i,d)/M(d,d));
for j=1:b
M(i,j)=M(i,j)+c*M(d,j);
end
end
end
M;
% ZERANDO ACIMA DA DIAGONAL PRINCIPAL
for d=a:-1:2
for i=d-1:-1:1
c=-(M(i,d)/M(d,d));
for j=b:-1:1
M(i,j) = M(i,j) + c*M(d,j);
end
end
end
M
% OBTENO DO VETOR SOLUO
for d=1:a
M(d,b) = M(d,b)/M(d,d);
M(d,d) = 1;
end
M(:,b)
ans =
3
1
2
%SEGUNDO SISTEMA
clear all
A = [2 2 2; -2 5 2; 8 1 4];
B = [0; 1; -1];
M = [A B];
[a b]=size(M);
% ZERANDO ABAIXO DA DIAGONAL PRINCIPAL
for d=1:a-1
for i=d+1:a
c=-(M(i,d)/M(d,d));
for j=1:b
M(i,j)=M(i,j)+c*M(d,j);
end
end
end
M;
% ZERANDO ACIMA DA DIAGONAL PRINCIPAL
for d=a:-1:2
for i=d-1:-1:1
c=-(M(i,d)/M(d,d));
for j=b:-1:1
M(i,j) = M(i,j) + c*M(d,j);
end
end
end
M;
% OBTENO DO VETOR SOLUO
for d=1:a
M(d,b) = M(d,b)/M(d,d);
M(d,d) = 1;
end
M(:,b)
ans =
NaN
NaN
NaN
O sistema no tem soluo.
Exerccio 12 Os sistemas lineares seguintes possuem a mesma matriz A. Resolva pelo mtodo Gauss
Jordan usando uma nica matriz aumentada [A|B1|B2]. Escreva a primeira parte do programa que obtm
esta nova matriz.
= +
= +
= +
1 2 7 3
2 5 2
1 2
3 2 1
3 2 1
3 2 1
x x x
x x x
x x x
= +
= +
= +
2 2 7 3
1 5 2
2 2
3 2 1
3 2 1
3 2 1
x x x
x x x
x x x
clear all
A = [1 -2 1;2 -5 1;3 -7 2];
B = [2;-1;2];
M = [A B];
[a b]=size(M);
% ZERANDO ABAIXO DA DIAGONAL PRINCIPAL
for d=1:a-1
for i=d+1:a
c=-(M(i,d)/M(d,d));
for j=1:b
M(i,j)=M(i,j)+c*M(d,j);
end
end
end
M;
% ZERANDO ACIMA DA DIAGONAL PRINCIPAL
for d=a:-1:2
for i=d-1:-1:1
c=-(M(i,d)/M(d,d));
for j=b:-1:1
M(i,j) = M(i,j) + c*M(d,j);
end
end
end
M;
% OBTENO DO VETOR SOLUO
for d=1:a
M(d,b) = M(d,b)/M(d,d);
M(d,d) = 1;
end
M(:,b)
O sistema no tem soluo.