Docsity

Practica1 Maple, Ejercicios de Álgebra

Toggle sidebar
bg1
EPSEB - EGT ALGEBRA PRACTICE 1 28/09/10
Te aim of this practice is to introduce the student in the use of the LinearAlgebra Maple's packet,
so he or she can solve the most common Linear Algebra problems in a easier form with the assistant
of calculus of the Maple program.
But let's begin with some general questions about Maple
Maple have two interfaces:
Document Mode vs Worksheet Mode
You can use a Maple document or worksheet to solve mathematical problems. You can insert
images, sketches, plots, spreadsheets, tables, and other objects into both documents and
worksheets. However, Maple documents and worksheets differ:
Document Mode Worksheet Mode
Quick problem-solving and free-form, rich
content composition
•
No prompt (>) displayed•
Math is entered and displayed in 2-D•
Solve math problems with right-click menu
on input and output
•
Command completion is supported•
Traditional Maple problem-solving
environment
•
Enter problems at a prompt (>) •
Math entered and displayed in 2-D or 1-D•
Solve math problems with right-click menu
on output
•
Command completion is supported•
Document mode lets you create rich content,
and enter text and expressions on the same line.
For example, the following solves for x without
any commands: x
K
2
α= 1
solve for x
This command was performed by using the
right-click menu on the input.
The corresponding code to perform the same
calculation in Worksheet mode is in 2-D math:
solve x
K
2
α
=1,xO
OO
O
or in 1-D math:
solve((x-2)/alpha=1,x);O
OO
O
Toggle Math/Text
entry mode
[F5]
on toolbar
Toggle 2-D/1-D Math
entry mode
[F5] 2-D black font, 1
-D red font
Evaluate math
expression and display
result inline
[Ctrl][=] Evaluate math
expression and display
result on new line
[Enter]
Evaluate math
expression and display
result on new line
[Enter] Continue on next line
without executing
[Shift][Enter]
Switch to Worksheet
mode (insert prompt)
on toolbar Switch to Document
mode
Format → Create
Document Block
To start in Document
mode
(by default, Maple
starts in Document
mode)
File
→New→Document
Mode
To start in Worksheet
mode
File→New→Workshe
et Mode
pf3
pf4
pf5
pf8
pf9

Vista previa parcial del texto

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

EPSEB - EGT ALGEBRA PRACTICE 1 28/09/

Te aim of this practice is to introduce the student in the use of the LinearAlgebra Maple's packet, so he or she can solve the most common Linear Algebra problems in a easier form with the assistant of calculus of the Maple program. But let's begin with some general questions about Maple Maple have two interfaces:

Document Mode vs Worksheet Mode

You can use a Maple document or worksheet to solve mathematical problems. You can insert images, sketches, plots, spreadsheets, tables, and other objects into both documents and worksheets. However, Maple documents and worksheets differ:

Document Mode Worksheet Mode

Quick problem-solving and free-form, rich content composition

  • No prompt (>) displayed
  • Math is entered and displayed in 2-D

Solve math problems with right-click menu on input and output

  • Command completion is supported

Traditional Maple problem-solving environment

  • Enter problems at a prompt (>)
  • Math entered and displayed in 2-D or 1-D Solve math problems with right-click menu on output
  • Command completion is supported

Document mode lets you create rich content, and enter text and expressions on the same line. For example, the following solves for x without

any commands: x^ K^2 α

= 1 solve for x

This command was performed by using the right-click menu on the input.

The corresponding code to perform the same calculation in Worksheet mode is in 2-D math: solve xK^2

OOOO =1,x

or in 1-D math: OOOO solve((x-2)/alpha=1,x);

Toggle Math/Text entry mode

[F5]

on toolbar

Toggle 2-D/1-D Math entry mode

[F5] 2-D black font, 1 -D red font

Evaluate math expression and display result inline

[Ctrl][=] (^) Evaluate math expression and display result on new line

[Enter]

Evaluate math expression and display result on new line

[Enter] (^) Continue on next line without executing

[Shift][Enter]

Switch to Worksheet mode (insert prompt)

on toolbar Switch to Document mode

Format → Create Document Block

To start in Document mode (by default, Maple starts in Document mode)

File →New→Document Mode

To start in Worksheet mode

File→New→Workshe et Mode

OOOOOOOO

For details, see Document Mode and 2-D Math. For details, see Worksheet Mode and 2-D Math.

Within a Document block in a Worksheet,

Show hidden commands

View / Expand Document Block

Hide commands. Show only results.

Highlight commands to be hidden. Format → Create Document Block

We are going to use the worksheet mode and the 1-D math editor because they are more robust. For it, go to tools (herramientas), options (opciones), Display (ver (D)), Input Display (mostrar entrada), and choose Maple notation (notación de Maple). And go to tools (herramientas), options (opciones), interface, Default format for new worksheets (formato por defecto para las nuevas hojas de trabajo), and choose worksheet (hoja de cálculo). In this Editor modality, a Maple sentence is not complete until is ended with a : or a ; If you do "enter" in a sentence ended with a ;, Maple will do the calculations and give the result as a output If you do "enter" in a sentence ended with a :, Maple will do the calculations but won't give any output To open a new line of text you have to click on the "T" symbol in the tool bar To open a new command line you have to click on the "[>" symbol in the tool bar To open a new line in a command group you have to do "shift enter" Pay attention to that Maple is case sensitive, that is, vector is not the same that Vector, for example. From now, you have to click over any sentence ended with a : or a ; and do "enter" so Maple execute them. If a sentence contains ... , it means that you have to complete it and then do "enter" so Maple execute it. To charge the LinearAlgebra Maple's packet, you have to execute the sentence with(LinearAlgebra) If you end this sentence with a ; Maple will give you a list with all the packet's Maple sentences with(LinearAlgebra); &x, Add, Adjoint, BackwardSubstitute, BandMatrix, Basis, BezoutMatrix, BidiagonalForm, BilinearForm, CharacteristicMatrix, CharacteristicPolynomial, Column, ColumnDimension, ColumnOperation, ColumnSpace, CompanionMatrix, ConditionNumber, ConstantMatrix, ConstantVector, Copy, CreatePermutation, CrossProduct, DeleteColumn, DeleteRow, Determinant, Diagonal, DiagonalMatrix, Dimension, Dimensions, DotProduct, EigenConditionNumbers, Eigenvalues, Eigenvectors, Equal, ForwardSubstitute, FrobeniusForm, GaussianElimination, GenerateEquations, GenerateMatrix, Generic, GetResultDataType, GetResultShape, GivensRotationMatrix, GramSchmidt, HankelMatrix, HermiteForm, HermitianTranspose, HessenbergForm, HilbertMatrix, HouseholderMatrix, IdentityMatrix, IntersectionBasis, IsDefinite, IsOrthogonal, IsSimilar, IsUnitary, JordanBlockMatrix, JordanForm, KroneckerProduct, LA_Main, LUDecomposition, LeastSquares, LinearSolve, Map, Map2, MatrixAdd, MatrixExponential, MatrixFunction, MatrixInverse, MatrixMatrixMultiply, MatrixNorm, MatrixPower, MatrixScalarMultiply, MatrixVectorMultiply, MinimalPolynomial, Minor, Modular, Multiply, NoUserValue, Norm, Normalize, NullSpace, OuterProductMatrix, Permanent, Pivot, PopovForm, QRDecomposition, RandomMatrix, RandomVector, Rank, RationalCanonicalForm, ReducedRowEchelonForm, Row, RowDimension, RowOperation, RowSpace, ScalarMatrix, ScalarMultiply, ScalarVector, SchurForm,

OOOOOOOO

OOOOOOOO

OOOOOOOO

OOOOOOOO

OOOOOOOO

OOOOOOOO

OOOOOOOO

OOOOOOOO

We get an element of A by doing A[i,j]:

A[1,2]; 3

You can enter a matrix A with the vectors u, v, w as a rows calculating the transpose

A:=Transpose(A);

A :=

or doing

A:=Matrix([[1,2,3],[2,3,7],[4,1,5]]);

A :=

You can also choose Insert Matrix in the left hand menu

Matrix([[ 1 , 2 , 3 ], [ 2 , 3 , 7 ], [ 4 , 1 , 5 ]]); 1 2 3 2 3 7 4 1 5

To know whether u, v, w are l.i. or l.d., you can reduce A doing

GaussianElimination(A); 1 2 3 0 K 1 1 0 0 K 14

You can also calculate the determinant

Determinant(A); 14

and the inverse

B:=MatrixInverse(A);

B :=

K^1

K^1

K 1

K^5

K 1

or

B:=A^(-1);

OOOOOOOO

OOOOOOOO

OOOOOOOO

B :=

K^1

K^1

K 1

K^5

K 1

Now we will illustrate the operations with vectors and matrices by means of examples Sum of vectors

u+v; u-v; 3 5 10

K 1 K 1 K 4

Product of a scalar times a vector

3v; xv; 6 9 21

2 x 3 x 7 x

Sum of matrices

A+B; A-B; 11 7

OOOOOOOO

OOOOOOOO

OOOOOOOO

C :=

K 2

K 6

K 7

K 5

2 Linear Systems of equations Let's have the linear system 3x+2y+5z = x+5y - z = 4 2x+7y+4z = 9 Maple can solve it in several forms 2.1 solve

solve({3x+2y+5z =5,x+5y - z = 4,2x+7y+4*z = 9},[x,y,z]) ; x = 0, y =^25 27

, z =^17 27

2.2 LinearSolve

A:=Matrix([[3,2,5],[1,5,-1],[2,7,4]]); b:=Vector([5,4,9]); LinearSolve(A,b);

A :=

1 5 K 1

b :=

2.3 LinearSolve

M:=Matrix([[3,2,5,5],[1,5,-1,4],[2,7,4,9]]); LinearSolve(M);

M :=

1 5 K 1 4

OOOOOOOO

OOOOOOOO

OOOOOOOO

OOOOOOOO

or

M:=<A|b>; LinearSolve(M);

M :=

1 5 K 1 4

By means of the inverse matrix

A^(-1).b; 0 25 27 17 27

Now express the vector a=(4,3,1) as a linear combination of the vectors u, v, w. That is, find r, s, t so a = ru + sv + tw

a:=<4,3,1>: u:=<2,5,4>: v:=<3,7,1>: w:=<8,6,0>: A:=<u|v|w>: s:=LinearSolve(A,a);

s :=

K 7

Let's proof

s[1]u+s[2]v+s[3]*w; 4 3 1