Subido por Toni lopera barril

Toni Lopera Mupad

Anuncio
use(linalg): use(plot): use(matrix): use(RGB)
Warning: Identifier 'htranspose' is not exported because it already has a value.
Warning: Identifier 'transpose' is not exported because it already has a value.
Warning: Identifier 'hilbert' is not exported because it already has a value. [u
Warning: Identifier 'Pyramid' is not exported because it seems to be protected.
Warning: Identifier 'hull' is not exported because it already has a value. [use]
Warning: Identifier 'Integral' is not exported because it seems to be protected.
Warning: Identifier 'subs' is not exported because it already has a value. [use]
Warning: Identifier 'subsex' is not exported because it already has a value. [us
Warning: Identifier 'info' is not exported because it already has a value. [use]
Warning: Identifier 'random' is not exported because it already has a value. [us
1)
a)
Matriu augmentada(M):
M:=matrix([[2,6,-2],[2,-4,1],[0,0,1]])
!
$
2 6 −2
"
%
#2 − 4 1 &
0 0 1
Amb coordenades homogènies.
X:=matrix([x1,x2,1])
' (
x1
x2
1
eq:=X=matrix([[2,6,-2],[2,-4,1],[0,0,1]])*matrix([x1,x2,1])
' ( !2 x1 + 6 x2 − 2 $
"
%
x1
#
&
x2 = 2 x1 − 4 x2 + 1
1
1
solve(eq,{x1,x2})
)*
,5+
4+ , x2 = ++
x1 = ++
17
17
b)
T1:= matrix([4,7,1])
. /
4
7
1
M*T1;
'
(
48
− 19
1
M*matrix([48,-19,1])
M*matrix([48,-19,1])
'
(
− 20
173
1
c)
A:=matrix([1,5]); B:= matrix([4,7])
0 1
1
5
0 1
4
7
AB:= B-A;
0 1
3
2
norm(AB,2)
2++
+
13
ABH:=matrix([3,2,0])
' (
3
2
0
segm1:=Curve2d([1+3*t,5+2*t], Color= RGB::Pink, t=0..1);
plot::Curve2d([3 t + 1, 2 t + 5], t = 0 ..1)
vectortrans:= M*ABH
'
(
18
−2
0
MAB:= matrix([18,-2])
.
/
18
−2
norm(MAB,2);
2++
+
2 82
Longitud del vector.
vector:=Arrow2d([0,0],[3,2]);
plot::Arrow2d([0, 0], [3, 2])
vectortrans:=Arrow2d([0,0],[18,-2])
plot::Arrow2d([0, 0], [18, − 2])
plot({vector,Color=Red},{vectortrans,Color=Blue})
plot({vector,Color=Red},{vectortrans,Color=Blue})
y
2
1
0
2
4
6
8
10
12
14
16
18
x
-1
-2
reset()
use(linalg);
Warning: Identifier 'htranspose' is not exported because it already has a value.
Warning: Identifier 'transpose' is not exported because it already has a value.
Warning: Identifier 'hilbert' is not exported because it already has a value. [u
2
a)
eq1:= A*0.025+M*0.025+L*0.025+P*0.025=754;
0.025 A + 0.025 L + 0.025 M + 0.025 P = 754
eq2:= A*0.025+M*0.02+L*0.029+P*0.029=854;
0.025 A + 0.029 L + 0.02 M + 0.029 P = 854
eq3:= A*0.025+M*0.025+L*0.02=546;
0.025 A + 0.02 L + 0.025 M = 546
b)
eq4:= total*0.025=754;
0.025 total = 754
solve(eq4)
{[total = 30160.0]}
c)
sol:=solve([eq1,eq2,eq3],[A,M,L,P]);
{[A = 7.2 z − 24720.0, M = 13280.0 − 3.2 z , L = 41600.0 − 5.0 z , P = z ]}
SCI amb 1 grau de llibertat
d)
solve(7.2*z-24720=0);
{[z = 3433.333333]}
solve(-3.2*z+13280=0);
{[z = 4150.0]}
solve(41600-5*z=0);
{[z = 8320]}
Per tal que tots els diners siguin positius z ha de ser més gran que 8320.
float(solve(41600-5*z=z))
{[z = 6933.333333]}
No seria possible, ja que la z resultant és més petita que 8320.
No seria possible, ja que la z resultant és més petita que 8320.
e) En Pep serà més gran de 8320.
use(linalg)
Warning: Identifier 'htranspose' is not exported because it already has a value.
Warning: Identifier 'transpose' is not exported because it already has a value.
Warning: Identifier 'hilbert' is not exported because it already has a value. [u
1)
A:=matrix([[0.6,0.3,0.18,0.1],[0.1,0.4,0.1,0.2],[0.1,0.1,0.52,0.2],[0.2,0.2,0.2,
!
$
0.6 0.3 0.18 0.1
"0.1 0.4 0.1 0.2 %
#
&
0.1 0.1 0.52 0.2
0.2 0.2 0.2 0.5
2)
veps:=eigenvectors(A);vaps:=eigenvalues(A);
veps:=eigenvectors(A);vaps:=eigenvalues(A);
'
'
'!
$** (
('
(
(
0.6059335404
((
(
(
"
%
+
+
0.3602475035
()1.0, 1, ) #
&,,, (
(
(0.42, 1,
0.4347814698
(
(
(
(
0.5603850055
)
)
'!
$**
0.7071067812
("
%++
− 16
− 24 %
("
++
( " − 6.290905623 10
+ 1.464715605 10
i %++
("
%++,
("
%++
(
%
− 0.7071067812
("
"
%+
++
+
)#
&,,
− 6.77482144 10
− 16
+ 7.210907595 10
− 25
i
'
(
(
(
(0.3 + 0.000000001114214996 i, 1,
(
(
(
)
'!
0.7071067812
$**
("
%++
( " − 0.7071067812 + 0.000000001313114966 i
%++
("
%++
("
%++,
("
%++
− 17
(
"
+ 0.000000006565574828 i %
( " 9.405945997 10
%+
++
+
)#
&,,
− 1.655311036 10
− 16
− 0.000000007878689794 i
'
(
(
(
(0.3 − 0.000000001114214996 i, 1,
(
(
(
)
'!
0.7071067812
$***
("
%+++
( " − 0.7071067812 − 0.000000001313114966 i
%+++
("
%+++
("
%+++
("
%+++
− 17
( " 6.931022274 10
+++
− 0.000000006565574828 i %
("
%+++
)#
&,,,
− 2.060907277 10
− 16
+ 0.000000007878689794 i
{0.42, 1.0, 0.3 − 0.000000001114214996 i, 0.3 + 0.000000001114214996 i}
abs(vaps[1]);abs(vaps[2]);abs(vaps[3]);abs(vaps[4]);
0.42
1.0
0.3
0.3
Vap dominant és 1.
Vap dominant és 1.
3) L'adenina és 4274.
X:=matrix([3313,2800,3500,5000])
!
$
3313
"2800 %
#
&
3500
5000
A*A*X
!
$
4274.964
" 2743.95 %
#
&
3344.706
4249.38
4) Vap dominant=1;
solve(14613=alpha1*(veps[1][3][1][1]+ veps[1][3][1][2]+veps[1][3][1][3]+veps[1][
{[alpha1 = 7450.48996]}
7450.48996*veps[1][3][1][1]; // adenina
4514.501759
7450.48996*veps[1][3][1][2] //timina
2684.020408
7450.48996*veps[1][3][1][3] //citosina
3239.334975
7450.48996*veps[1][3][1][4] //guanina
4175.142857
Descargar