Docsity
Docsity

Prepara tus exámenes
Prepara tus exámenes

Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity


Consigue puntos base para descargar
Consigue puntos base para descargar

Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium


Orientación Universidad
Orientación Universidad


Practica3 Maple, Ejercicios de Álgebra

Asignatura: Algebra, Profesor: Juan Rodriguez Jordana, Carrera: Enginyeria Geomàtica i Topografia, Universidad: UPC

Tipo: Ejercicios

2010/2011

Subido el 21/01/2011

xandry87
xandry87 🇪🇸

4.5

(42)

36 documentos

1 / 6

Toggle sidebar

Esta página no es visible en la vista previa

¡No te pierdas las partes importantes!

bg1
O
OO
O O
OO
O
(1)(1)
(2)(2)
O
OO
O O
OO
O
O
OO
O O
OO
O
EPSEB - EGT ALGEBRA PRACTICE 3 LINEAR SYSTEMS 9 / 11 / 10
1) Enter the packet LinearAlgebra
with(LinearAlgebra):
2) Go to the Maple "Help" and look for how to generate a random matrix or a random vector,
that is, a matrix or a vector with elements generated randomly. Then, generate a square random
matrix A of range 4 and a random vector b of range also 4.
LinearAlgebra[RandomMatrix] - construct a random Matrix
LinearAlgebra[RandomVector] - construct a random Vector
Calling Sequence
RandomMatrix(r, c, den, gen, outopts)
RandomVector[o](d, den, gen, outopts)
Parameters
r - (optional) non-negative integer; row dimension of the resulting Matrix
c - (optional) non-negative integer; column dimension of the resulting Matrix
d - (optional) non-negative integer; dimension of the resulting Vector
den - (optional) equation of the form density = p where p is a numeric value with 0 <= p <= 1;
probability that a generated value is assigned to an entry in the resulting Matrix or Vector
gen - (optional) equation of the form generator = f where f is a generator of values for the
entries
[o] - (optional) use either [row] or [column] to specify the orientation of the resulting Vector
outopts - (optional) equation of the form outputoptions=list; constructor options for the result
object
A:=RandomMatrix(4);
b:=RandomVector(4);
A:=
25 50
K
50
K
38
94 10
K
22
K
18
12
K
16 45 87
K
2
K
9
K
81 33
b:=
31
K
50
K
80
43
3) Solve the linear system AX = b by means LinearSolve
s:=LinearSolve(A,b);
pf3
pf4
pf5

Vista previa parcial del texto

¡Descarga Practica3 Maple y más Ejercicios en PDF de Álgebra solo en Docsity!

OOOOOOOO

OOOOOOOO

OOOOOOOO

EPSEB - EGT ALGEBRA PRACTICE 3 LINEAR SYSTEMS 9 / 11 / 10

  1. Enter the packet LinearAlgebra with(LinearAlgebra):
  2. Go to the Maple "Help" and look for how to generate a random matrix or a random vector, that is, a matrix or a vector with elements generated randomly. Then, generate a square random matrix A of range 4 and a random vector b of range also 4.

LinearAlgebra[RandomMatrix] - construct a random Matrix

LinearAlgebra[RandomVector] - construct a random Vector

Calling Sequence

RandomMatrix(r, c, den, gen, outopts) RandomVector[o](d, den, gen, outopts)

Parameters

r - (optional) non-negative integer; row dimension of the resulting Matrix c - (optional) non-negative integer; column dimension of the resulting Matrix d - (optional) non-negative integer; dimension of the resulting Vector den - (optional) equation of the form density = p where p is a numeric value with 0 <= p <= 1; probability that a generated value is assigned to an entry in the resulting Matrix or Vector gen - (optional) equation of the form generator = f where f is a generator of values for the entries [o] - (optional) use either [row] or [column] to specify the orientation of the resulting Vector outopts - (optional) equation of the form outputoptions=list; constructor options for the result object

A:=RandomMatrix(4); b:=RandomVector(4);

A :=

25 50 K 50 K 38

94 10 K 22 K 18

12 K 16 45 87

K 2 K 9 K 81 33

b :=

K 50

K 80

  1. Solve the linear system AX = b by means LinearSolve s:=LinearSolve(A,b);

OOOOOOOO

s :=

K^3360923

K 148060

K^11994517

K^1131999

  1. Look in the Maple help for how to perform Gaussian elimination of a matrix, do it with the matrix (A|b), and solve the linear system AX = b transformed by the Gaussian elimination.

LinearAlgebra[Generic][GaussianElimination] - perform

Gaussian elimination on a Matrix

LinearAlgebra[Generic][ReducedRowEchelonForm] - compute

the reduced row echelon form of a Matrix

LinearAlgebra[Generic][RREF] - compute the reduced row

echelon form of a Matrix

Calling Sequence

GaussianEliminationF GaussianEliminationF ReducedRowEchelonFormF ReducedRowEchelonFormF ReducedRowEchelonFormF ReducedRowEchelonFormF RREFF RREFF RREFF RREFF

Parameters

F - the domain of computation, a field

A - rectangular Matrix over values in F

r - name

d - name

B:=; C:=GaussianElimination(B); s:=LinearSolve(B);

OOOOOOOO

OOOOOOOO p,L,U:=LUDecomposition(A); d:=LinearSolve(L,b); s:=LinearSolve(U,d);

p, L, U :=

K 2

K^1140

25 50 K 50 K 38

0 K 178 166 3122

d :=

K^4164

K^127828

K^1131999

s :=

K^3360923

K 148060

K^11994517

K^1131999

  1. Generate a random matrix A of 5 rows and 3 columns and a random vector b of range 5 and solve the over-determined system AX = b solving the normal system ATAX = ATb

A:=RandomMatrix(5,3); b:=RandomVector(5); At:=Transpose(A): N:=At.A; T:=At.b; LinearSolve(N,T);

A :=

K 32 72 K 62

K 1 42 K 33

52 18 K 68

K 13 K 59 K 67

OOOOOOOO

b :=

K 82

K 70

N :=

5097 17477 K 2137

192 K 2137 14190

T :=

K 10115

K 6128

K^180354946502

K^124340954901

  1. Look in the Maple help for how to perform QR decomposition of a matrix, do it with the matrix A, and solve the over-determined system AX = b using the QR decomposition

LinearAlgebra[QRDecomposition] - compute QR factorization

of a Matrix

Calling Sequence

QRDecomposition(A, fs, out, c, outopts, ...)

Parameters

A - Matrix fs - (optional) BooleanOpt(fullspan); selects whether a full QR factorization is performed out - (optional) equation of the form output = obj where obj is one of 'Q', R', 'NAG', or 'rank', or a list containing one or more of these names; selects result objects to compute c - (optional) BooleanOpt(conjugate); selects whether conjugations are performed in the Gram-Schmidt process outopts - (optional) equation of the form outputoptions[o] = list where o is one of 'Q', 'R', or 'NAG', and list contains options to pass to the result constructor; constructor options for the result object ... - (optional) additional instances of outputoptions[o] = list

Q,R:=QRDecomposition(A); Qt:=Transpose(Q): Qtb:=Qt.b: LinearSolve(R,Qtb);