Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
0,3
2,7
4,5
5,9
7,8
1,8
1,9
3,1
3,9
3,3
y b0 b1.x
x . y n. ( x . y )
x n. x
y b . x
b1
i
2
b0
2
i
0,3
1,8
0,09
x.y
0,54
3,24
2,7
1,9
7,29
5,13
3,61
4,5
3,1
20,25
13,95
9,61
5,9
3,9
34,81
23,01
15,21
7,8
3,3
60,84
25,74
10,89
21,2
14,0
123,28
68,37
42,56
Calculando os parmetros:
b1
x . y n. ( x . y )
x n. x
i
i
2
b1
b0
2
i
21,2.14,0 5.68,37
0,2698
(21,2) 2 5.123,28
b1. xi
n
14,0 0,2698.21,2
b0
1,6560
5
Esta reta seria representada no grfico de disperso como:
y=1,6560+0,2698.x
y y
1
1
y n . y
y y
ci
2
i
ci
n2
y-y
c
(y-y )
c
0,3
1,8
1,7369
0,0631
0,0040
2,7
1,9
2,3845
-0,4845
0,2347
4,5
3,1
2,8701
0,2299
0,0528
5,9
3,9
3,2478
0,6522
0,4254
7,8
3,3
3,7604
-0,4604
0,2120
21,2
14,0
Resolvendo as equaes:
y y
1
y n . y
2
r2 1
ci
2
i
0,9289
0,7235
1
2
42,56 .14,0
5
2
yi yci
r2 1
n2
0,9289
2
0,3096
52
0,9289
x
x
x .x x .x
x .x x .x
xi1
xi 2
x
ip
i1
i2
i1
i1
i2
i1
i1
i2
i2
i2
i1
.xip
i2
01
60,3
108
234
03
04
05
06
07
08
09
10
.xip
x
x .x
x .x
b0 yi
b
ip i1 1
xi1. yi
b
ip i 2 . 2 xi 2 . yi
02
i1
61,1
60,2
61,2
63,2
63,6
65,0
63,8
66,0
67,9
i2
109
110
112
112
113
115
116
117
119
xi1
xi2
x .x
x .y
i1
i2
i1
x .y
i2
3636,09
11664
6512,4
14110,2
25272
3733,21
11881
6659,9
15824,9
28231
3624,04
12100
6622
15531,6
28380
3745,44
12544
6854,4
17442
31920
3994,24
12544
7078,4
20792,8
36848
4044,96
12769
7186,8
22069,2
39211
4225
13225
7475
23725
41975
4070,44
13456
7400,8
23159,4
42108
4356
13689
7722
26136
46332
4610,41
14161
8080,1
28450,1
49861
259
258
285
329
347
365
363
396
419
11
12
13
14
15
16
xi1
045,2
68,2
120
66,5
443
122
68,7
30212,6
53160
4422,25
14884
8113
29592,5
54290
4719,69
15129
8450,1
33182,1
59409
4844,16
15625
8700
35008,8
62875
4802,49
16384
8870,4
35897,4
66304
4984,36
16900
9178
39183
72150
503
128
70,6
8184
483
125
69,3
14400
445
123
69,6
4651,24
518
130
555
yi
1879
6202
i1
i2
68464,02
221355
xi1.xi2
123087,3
xi1.yi
410317,6
1045,2
1879 b0 6202
16
1045,2 68464,02 123087,3. b 410317,6
Ajuste Polinomial
Um caso particular do ajuste linear mltiplo aquele em que queremos ajustar um
polinmio de grau g. Neste caso, teremos somente uma varivel independente x
relacionada a uma varivel dependente y atravs de um polinmio do tipo:
y=b0+b1.x+b2.x2+...+bg.xg
Para este caso particular, o sistema de equaes anterior se simplifica para:
n
xi
x2
i
xg
i
x
x
x
x
x
x
i
2
3
i
g 1
i
2
i
3
4
i
g 2
i
b0 yi
b1 xi . yi
i
g 2
.b2 x i2 . yi
i
x i2.g bg x ig . yi
x
x
x
g 1
xi2.yi
738326
Dada a tabela abaixo, encontrarei o melhor polinmio de grau 3 que se ajusta aos
dados:
i
xi
yi
01
0,01
0,1000
02
0,10
03
1E-12
0,001
0,01
0,001
0,0001
1E-05
1E-06
0,0316
0,04
0,008
0,0016
0,0003
6,4E-05
0,0894
0,09
0,027
0,0081
0,0024
0,00073
0,1643
0,16
0,064
0,0256
0,0102
0,0041
0,253
0,25
0,125
0,0625
0,0313
0,01563
0,3536
0,36
0,216
0,1296
0,0778
0,04666
0,4648
0,49
0,343
0,2401
0,1681
0,11765
0,5857
0,64
0,512
0,4096
0,3277
0,26214
0,7155
0,81
0,729
0,6561
0,5905
0,53144
0,8538
1,0000
1E-10
0,9487
1,00
x y
1E-08
0,8944
0,90
11
1E-06
0,8367
0,80
10
0,0001
0,7746
0,70
09
xiyi
0,7071
0,60
08
xi
0,6325
0,50
07
xi
0,5477
0,40
06
xi
0,4472
0,30
05
xi
0,3162
0,20
04
xi
x y
i
1E-05
1E-07
0,0032
0,0003
0,0179
0,0036
xi
51
0,0493
0,0148
0,1012
0,0405
0,1768
0,0884
0,2789
0,1673
0,41
0,287
0,5724
0,4579
0,7684
0,6916
1
A tabela com os somatrios :
2
yi
xi
7,2051
xi
3,8501
3,025
xi
2,5333
xi
2,2083
xi
1,97841
xiyi
xi yi
xi yi
4,5127
3,378
2,7514
. 1
y=a.xb ln(y)=ln(a)+b.ln(x)
y=a.bx ln(y)=ln(a)+ln(b).x
y=a.eb.x ln(y)=ln(a)+b.x
y=e(a+b.x1+c.x2) ln(y)=a+b.x1+c.x2
y a.x1b .x2c ln( y ) ln( a) b. ln( x1 ) c. ln( x2 )
y
y
1
1
a b.x1 c.x2
a b.x1 c.x2
y
1
1 e
a b. x1 c. x2
1
ln 1 a b.x1 c.x2
y
Para calcular os valores das matrizes fiz pelo mtodo de gaus j estudado na disciplina,
o mtodo utilizado de Gauss segue abaixo:
//Verificar sempre se a diagonal principal dominante sobre a diagonal secundria
A = []; //coeficientes do sistema
I = eye(A);
n = 3;
b = []; //vetor de termos independentes
eps=10^(-2); //Preciso
x0 = [0;0;0]; //Soluo inicial
p = 10;
x = x0;
x1 = x;
it=0;
i=0; s=0;
for i=1:n
bc(i) = b(i)/A(i, i);
end;
big = 0;
num = 0;
while p > eps & it<=1000
for i=1:n
num = 0;
for j=1:n
if j <> i then
num = num + A(i,j)*x(j);
end;
end;
x(i) = (1/A(i,i))*(b(i)-num);
end;
p = norm((A*x)-b');
it = it+1;
end;
if(it>999) then
printf("No converge nesse intervalo");
abort;
else
printf("Sucesso! Total de iteracoes %f", it);
end;