Escolar Documentos
Profissional Documentos
Cultura Documentos
Vector
Vector
1, 0, 1, 1, 0, 1, 1, 0, 1 ;
1, 1, 1, 0, 0, 0, 1, 1, 1 ;
#X Vector
#Y Vector
#X
Vector
1, 1 ;
Vector
1, 0, 1 ;
Dimension X ;
# n ns
# tipo=1 unidimensional
# tipo=2 bidimensional
# m=2 unidimensional linear
# m=3 unidimensional quadrtico
# m=3 bidimensional linear
# m=6 bidimensional quadratico
m
3;
tipo
1;
pp
beta
1;
# parmetro de correlao
corr
#corr
1
X :=
0
1
n := 3
m := 3
tipo := 1
pp := 2
:= 1
corr := "G"
(1)
Matrix n, m, 0 :
for i1 from 1 to n do
for i2 from 1 to m do
P i1, i2
subs x = X i1 , y = Y i1 , p i2 ;
end;
end;
print P ;
> R
1 1
0 0
1 1
(2)
Matrix n, n, 0 :
Rauxil
Matrix n, n, 0 :
maior
0:
for i from 1 to n do
for j from 1 to n do
if tipo = 2 then
r i, j
evalf sqrt X i
elif tipo = 1 then
evalf sqrt X i
r i, j
fi:
if r i, j
maior then
maior
r i, j :
# print maior :
fi:
d
maior :
X j
X j
2
2
Y i
:
Y j
end:
end:
for i from 1 to n do
for j from 1 to n do
if corr = "G" then
R i, j
beta r i, j
d
evalf exp
pp
3 auxiliar4;
fi:
end:
end:
print evalf R ;
1.00000000 0.77880078 0.36787944
0.77880078 1.00000000 0.77880078
0.36787944 0.77880078 1.00000000
> # constituio da matriz G
G
Matrix n
G 1 ..n, 1 ..n
m, n
m, 0 :
R:
for i from 1 to n do
for j from 1 to m do
G i, j n
G j n, i
end:
end:
print G ;
subs x = X i , y = Y i , p j
G i, j n :
(3)
1
1
1
> g
Vector m
n :
# =================
x0
0 : # ponto de teste
y0
0:
# =================
for i1 from 1 to n do
if tipo = 2
xy0r i1
elif tipo = 1
xy0r i1
fi:
then
evalf x0
then
evalf sqrt
X i1
x0
X i1
y0
2
Y i1
evalf exp
beta xy0r i1
d
pp
1 1
'x':
0:
conta
for i1 from n 1 to m do
conta 1 :
conta
(4)
g i1
end;
if tipo = 1 then
if m = 2 then
g n 1
subs
g n 2
subs
elif m = 3 then
g n 1
subs
g n 2
subs
g n 3
subs
fi:
x = x0, p 1
x = x0, p 2
:
:
x = x0, p 1
x = x0, p 2
x = x0, p 3
:
:
:
m = 3 then
n 1
subs x = x0, y = y0 , p 1
n 2
subs x = x0, y = y0 , p 2
n 3
subs x = x0, y = y0 , p 3
elif m = 6 then
g n 1
subs
g n 2
subs
g n 3
subs
g n 4
subs
g n 5
subs
g n 6
subs
x = x0, y = y0
x = x0, y = y0
x = x0, y = y0
x = x0, y = y0
x = x0, y = y0
x = x0, y = y0
,p
,p
,p
,p
,p
,p
1
2
3
4
5
6
:
:
:
:
:
:
:
:
:
fi:
fi:
print G, g ;
pesos0
LinearSolve G, g ;
# com estes pesos poder-se- depois obter o valor estimado num outro ponto
1.00000000 0.77880078 0.36787944 1
1 1
1
1
1
0.77880078
1.00000000
,
0.77880078
1.00000000 10-16
1.00000000
1.00000000 10-16
peso0 :=
(5)
5.57601566 10-17
1.00000000 10-16
5.26124474 10-17
IdentityMatrix n ;
repete
MatrixInverse Multiply Transpose P , P
A
Multiply repete, Transpose P ;
B
phi
Ident
Multiply Transpose p , A
Multiply R 1, , B ;
1 0 0
Ident :=
0 1 0
0 0 1
0
1
2
A :=
1
2
1
2
1
2
0 0 0
B :=
0 0 0
0 0 0
:=
1
x
2
1 2
x 1
2
x2
1
x
2
1 2
x
2
1
x
2
1 2
x
2
(6)
1
1
x
2
> if tipo = 1 then
plot phi, x = 1 ..1 ;
x2
1 2
x
2
(7)
0.8
0.6
0.4
0.2
0.5
0.5
x
> soma
0:
pontox
1; pontoy
1;
for i from 1 to n do
soma
soma subs x = pontox, y = pontoy , phi i ;
end:
print soma ;
pontox := 1
pontoy := 1
1
> dphi
map diff, phi, x ;
for i from 1 to n do
print dphi i ;
end:
dphi :=
1
2
2x
1
2
(8)
1
2
x
2x
1
2
>
(9)