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


Practica con Mathematica, Ejercicios de Álgebra Lineal

Asignatura: Algebra lineal, Profesor: Dolores Martín Barquero, Carrera: Ingeniería en Tecnologías Industriales, Universidad: UMA

Tipo: Ejercicios

2015/2016

Subido el 13/01/2016

jamal_ouchen
jamal_ouchen 🇪🇸

3.7

(3)

1 documento

1 / 11

Toggle sidebar

Esta página no es visible en la vista previa

¡No te pierdas las partes importantes!

bg1
Primera práctica con Mathematica.
Vamos a introducir una matriz e intentar calcular su inversa:
A=881, 2, 3<,81, 0, 1<,80, 1, 1<<
Inverse@AD
123
101
011
Inverse::sing : Matrix
123
101
011
is singular.
123
101
011
-1
InverseB123
101
011F
Inverse::sing : Matrix
123
101
011
is singular.
123
101
011
-1
ã
Como vemos no ha sido posible ya que no es inversible:
0
InverseB123
111
011 F
0 1 -1
-1 1 2
1-1-1
pf3
pf4
pf5
pf8
pf9
pfa

Vista previa parcial del texto

¡Descarga Practica con Mathematica y más Ejercicios en PDF de Álgebra Lineal solo en Docsity!

Primera práctica con Mathematica.

Vamos a introducir una matriz e intentar calcular su inversa:

A = 88 1, 2, 3<, 8 1, 0, 1<, 8 0, 1, 1<<

Inverse@AD

Inverse::sing : Matrix

is singular. á

  • 1

InverseB

F

Inverse::sing : Matrix

is singular. á

  • 1

„ Como vemos no ha sido posible ya que no es inversible:

Det@AD

InverseB

F

1 2 3 1 1 1 0 1 1

.

0 1 - 1

- 1 1 2 1 - 1 - 1 1 0 0 0 1 0 0 0 1

„ Definimos una función de dos variables:

fAx_, y_E := x.y

f@A, Inverse@ADD

Inverse::sing : Matrix

is singular. á

  • 1

fB

1 2 3 1 1 1 0 1 1

, InverseB

1 2 3 1 1 1 0 1 1

FF

„ Representamos gráficamente una función real de variable real:

gAx_E := x^2 - 4 x + 4 Plot@g@xD, 8 x, - 3, 3<D

  • 3 - 2 - 1 1 2 3

5

10

15

20

25

„ Esto quiere decir que 360=2^3 .3^2. Vamos a construir una tabla con los 100 primeros números primos:

Table@Prime@iD, 8 i, 1, 100<D 8 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541<

„ Ejercicio 2. Comparamos expresiones:

for1 =

1 x^2 - 1 1 x^2 - 1

for2 =

1 2

1 x - 1

-

1 x + 1 1 2

x - 1

x + 1

for1 === for False

Ejercicio 7 Calculamos todos los números primos entre 100 y 119.

For@ i = 100, i < 120 , i++, If@ PrimeQ@iD == True , Print@iD DD

101

103

107

109

113

Do@Print@i, " ", PrimeQ@iDD, 8 i, 100, 119<D

100 False

101 True

102 False

103 True

104 False

105 False

106 False

107 True

108 False

109 True

110 False

111 False

112 False

113 True

114 False

115 False

116 False

117 False

118 False

119 False

„ Ejercicio 6 Defina una función que permita saber si una matriz es simétrica o no, devolviendo verdadero o falso. Compruebe con un par de ejemplos, y con la ayuda de la función definida, que si a una matriz cuadrada cualquiera se le suma su traspuesta, el resultado es siempre una matriz simétrica.

f1Ax_E := If@x == Transpose@xD, "Es simétrica", "No es simétrica"D

f1B

1 0 1 1 0 3 1 3 2

F

No es simétrica

f1B

1 0 1 2 0 3 1 3 2

F

No es simétrica

MatrixPower@B, 4D

34 218 180 222 1358 1152 220 1330 1136

Det@BD

  • 2

Inverse@BD

7 - 6 5 1 - 1 1

  • 52 52 - 2

RowReduce@BD

1 0 0 0 1 0 0 0 1

Transpose@BD

1 1 0

  • 1 3 5 2 4 2

Tr@BD

6

DetBMatrixExpB

1 2 0 0 - 1 1 0 0 3

FF ä ExpBTrB

1 2 0 0 - 1 1 0 0 3

FF

True

DetBMatrixExpB

1 2 0 0 - 1 1 0 0 3

FF ä „

TrB

F

True

Solve@8x + y + z ä 1, x - y - z ä 2, x + y - z ä 1 <D

:: x Æ

, y Æ -

, z Æ 0 >>

RowReduceB

1 1 1 1 1 - 1 - 1 2 1 1 - 1 1

F

Reduce@8x + y + z ä 1, x - y - z ä 2, x + y - z ä 1 <D

z á 0 Ì y á -

2 Ì^ x^ á

F =

2 0 0 0 0 0 2 4 0 0 0 - 4 0 0 3 0 0 0

- 1 0 0 3 0 0 2 0 0 0 4 - 2 0 0 0 0 0 2 2 0 0 0 0 0 2 4 0 0 0 - 4 0 0 3 0 0 0

  • 1 0 0 3 0 0 2 0 0 0 4 - 2 0 0 0 0 0 2

CharacteristicPolynomial@F, xD

x^6 - 18 x^5 + 133 x^4 - 516 x^3 + 1108 x^2 - 1248 x + 576

Eigenvalues@FD

8 4, 4, 3, 3, 2, 2<

H = Eigenvectors@Transpose@FDD

  • 1 - 1 0 0 0 2 1 - 1 0 0 2 0
  • 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0

System` MatrixExp MatrixPlot MatrixQ MatrixForm MatrixPower MatrixRank

MatrixPower@ m , n D gives the n th^ matrix power of the matrix m.

MatrixPower@ m , n , v D gives the n th^ matrix power of the matrix m applied to the vector v. á

? Po System`* Pochhammer PolynomialGCD Point PolynomialLCM Point3DBox PolynomialMod PointBox PolynomialQ PointForm PolynomialQuotient PointSize PolynomialQuotientRemainder PoissonDistribution PolynomialReduce PolarAxes PolynomialRemainder PolarAxesOrigin Polynomials PolarGridLines PopupMenu PolarPlot PopupMenuBox PolarTicks PopupMenuBoxOptions PolyGamma PopupView Polygon PopupWindow Polygon3DBox Position Polygon3DBoxOptions Positive PolygonBox PositiveDefiniteMatrixQ PolygonBoxOptions PossibleZeroQ PolygonHoleScale Postfix PolygonIntersections PostScript PolygonScale Power PolyhedronData PowerExpand PolyLog PowerMod PolynomialExtendedGCD PowerModList PolynomialForm PowersRepresentations

x ^ y gives x to the power y. á

? Inv*

System` Inverse InverseJacobiCD InverseBetaRegularized InverseJacobiCN InverseCDF InverseJacobiCS InverseChiSquareDistribution InverseJacobiDC InverseEllipticNomeQ InverseJacobiDN InverseErf InverseJacobiDS InverseErfc InverseJacobiNC InverseFourier InverseJacobiND InverseFourierCosTransform InverseJacobiNS InverseFourierSequenceTransform InverseJacobiSC InverseFourierSinTransform InverseJacobiSD InverseFourierTransform InverseJacobiSN InverseFunction InverseLaplaceTransform InverseFunctions InverseSeries InverseGammaDistribution InverseWeierstrassP InverseGammaRegularized InverseZTransform InverseGaussianDistribution Invisible InverseGudermannian InvisibleApplication InverseHaversine InvisibleTimes

WebServices` InvokeServiceOperation

InverseFunction@ f D represents the inverse of the function f ,

defined so that InverseFunction@ f D@ y D gives the value of x for which f @ x D is equal to y.

InverseFunction@ f , n , tot D represents the inverse with respect to the n th^ argument when there are tot arguments in all. á

B =

1 0 4 2 - 1 1 6 2 4 1 0 4 2 - 1 1 6 2 4

Det@BD 34