This preview shows page 1. Sign up to view the full content.
Unformatted text preview: rs [1, −1, 0, 1], [5, −2, 3, −1], and [6, −3, 3, 0]. Express the vector [1, 2, 3, −5] with respect to this basis. Enter the vectors.
> > > > > with(LinearAlgebra): v1:=<1101>: v2:=<5231>: v3:=<6330>: vector_space:=<v1,v2,v3>; 1 −1 0 1 vector _space := 5 −2 3 −1 6 −3 3 0 If the vectors are linearly independent, then they form a basis. To test linear independence, set up the equation c1 v1 + c2 v2 + c3 v3 = 0 c1 [1, −1, 0, 1] + c2 [5, −2, 3, −1] + c3 [6, −3, 3, 0] = [0, 0, 0, 0] which is equivalent to c1 + 5c2 + 6c3 = 0 −c1 − 2c2 − 3c3 = 0 3c2 + 3c3 = 0 c1 − c2 = 0 > LinearSolve( Transpose(vector_space), <0,0,0,0> ); 96 • Chapter 4: Maple Organization −_t0 3 −_t0 3 _t0 3 The vectors are linearly dependent since each is a linear product of a variable. Thus, they cannot form a basis. The RowSpace command returns a basis for the vector space.
> b:=RowSpace(vector_space); b := [[1, 0, 1, −1], [0, 1, 1, −2]]
> b1:=b[1]; b2:=b[2]; b1 := [1, 0, 1, −1] b2 := [0, 1, 1, −2]
> basis:=<b1,b2>; basis := 1 0 1 −1 0 1 1 −2 Express [1, 2, 3, −5] in coordinates with respect to this basis.
> LinearSolve( Transpose(basis), <1235> ); 1 2 The Matlab Package
The Matlab package enables you to call selected MATLAB functions from a Maple session, provided you have MATLAB installed on your system.1 MATLAB is an abbreviation of matrix laboratory and is a popular numerical computation package, used extensively by engineers and other computing professionals.
There is also a Symbolic Computation Toolbox available for MATLAB that allows you to call Maple commands from MATLAB.
1 4.2 The Maple Packages • 97 To establish the connection between the two products, enter the command
> with(Matlab): The call to the Matlab library automatically executes the openlink command. To determine the eigenvalues and eigenvectors of a matrix of integers, ﬁrst deﬁne the matrix in Maple syntax.
> A := Matrix([[1,2,3],[1,2,3],[2,5,6]]): Then the following call to eig is made.
> P,W := eig(A, eigenvectors=true): Notice what is to the left of the assignment operator. The (P,W) speciﬁes that two outputs are to be generated and assigned to variables — the eigenvalues to W and the eigenvectors to P. This multiple assignment is available to standard Maple commands is rarely used because existing Maple commands are designed to create a single result. Consider the individual results.
> W; 9.321825 0. 0. 0. −.5612673 10−15 0. 0. 0. −.3218253 > P; −.3940365889964673 −.9486832980505138 −.5567547110202646 −.3940365889964672 −2.758331802155925 10−16 −.5567547110202655 −.8303435030540421 .3162277660168383 .6164806432593667 The commands in this package can also take input in MATLAB format. For more information on acceptable input, refer to the ?Matlab help page. 98 • Chapter 4: Maple Organization The Statistics Package
The stats package has many commands for data analysi...
View
Full
Document
 Spring '12
 NIL
 Math, Division

Click to edit the document details