Sunteți pe pagina 1din 4

> with linalg :

Lucrare de laborator nr.2

Tema: Oprați cu matrici și determinanți. Soluționarea sistemelor de ecuații liniare.

Subiectul 1. Se consideră definite matricele A și B. Efectuați în Maple operațiile: A+B, A-B, A*B,
A*B+B*A, A*E, transpusa matricii B, inversa matricii A, determinantul matricii B.

> A d matrix 3, 4, 11 C3, 1 , K2, 3,K4, 2 , 11, 5,K3, 1 , 1, 2, 1, 0


3 4 14 1
K2 3 K4 2
A := (1)
11 5 K3 1
1 2 1 0
> B d matrix 1, 2, 4, 3 , K1, 2, 11 K5, 1 , 11, 4, 11 C2, 2 , K1, 2,K3, 4
1 2 4 3
K1 2 6 1
B := (2)
11 4 13 2
K1 2 K3 4

1 0 0
> Cd 0 1 0
0 0 1
1 0 0
C := 0 1 0 (3)
0 0 1
>
> multiply A, B
152 72 215 45
K51 K10 K48 K3
(4)
K28 22 32 36
10 10 29 7
> transpose B
1 K1 11 K1
2 2 4 2
(5)
4 6 13 K3
3 1 2 4
> inverse A
11 7 59 117
K K
635 127 635 635
26 5 24 392
K K
635 127 635 635
(6)
41 3 11 32
K K K
635 127 635 635
132 43 73 769
K
635 127 635 635
> det B
K300 (7)
1
> evalm
A
11 7 59 117
K K
635 127 635 635
26 5 24 392
K K
635 127 635 635
(8)
41 3 11 32
K K K
635 127 635 635
132 43 73 769
K
635 127 635 635
>
Subiectul 2. Calculaţi determinantul de ordinul 4 utilizând regula minorilor. Verificaţi rezultatul cu
comanda det. unde a- numărul variantei, b=a-3; c=b+2; d=c-8.

> a d 11; b d a K3; c d b C2; d d c K8


a := 11
b := 8
c := 10
d := 2 (9)
> Z d matrix 11, 2, 11, 5 , 1, b, 5, c , 2,K3, a, 2 , 1,K3, d, 4
11 2 11 5
1 8 5 10
Z := (10)
2 K3 11 2
1 K3 2 4
> det Z
5676 (11)
>
>
>
Subiectul 3. Să se soluționeze sistemul de ecuații liniare
>

> S d matrix 2, 1, 4, 1 , 2,K1,K1,K3 , 3, 4,K5, 1 , 1,K2,K3,K2


2 1 4 1
2 K1 K1 K3
Sd (12)
3 4 K5 1
1 K2 K3 K2
> P d K2, 5, 11, 4
P d K2, 5, 11, 4 (13)
> V d augment S, P
2 1 4 1 K2
2 K1 K1 K3 5
Vd (14)
3 4 K5 1 11
1 K2 K3 K2 4
> gaussjord V
1 0 0 0 1
0 1 0 0 1
(15)
0 0 1 0 K1
0 0 0 1 K1
> backsub %
1 1 K1 K1 (16)
1
> Z d evalm
S
47 3 2 51
K
145 29 29 145
31 10 3 83
K K
145 29 29 145
Zd (17)
11 3 2 22
K K
145 29 29 145
38 16 1 69
K
145 29 29 145
> M d evalm Z&*P
Md 1 1 K1 K1 (18)
> linsolve S, P
1 1 K1 K1 (19)
>

S-ar putea să vă placă și