LearningGuide

# Within each subpackage the commands are grouped by

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

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. &gt; &gt; &gt; &gt; &gt; with(LinearAlgebra): v1:=&lt;1|-1|0|1&gt;: v2:=&lt;5|-2|3|-1&gt;: v3:=&lt;6|-3|3|0&gt;: vector_space:=&lt;v1,v2,v3&gt;; 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 &gt; LinearSolve( Transpose(vector_space), &lt;0,0,0,0&gt; ); 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. &gt; b:=RowSpace(vector_space); b := [[1, 0, 1, −1], [0, 1, 1, −2]] &gt; b1:=b[1]; b2:=b[2]; b1 := [1, 0, 1, −1] b2 := [0, 1, 1, −2] &gt; basis:=&lt;b1,b2&gt;; basis := 1 0 1 −1 0 1 1 −2 Express [1, 2, 3, −5] in coordinates with respect to this basis. &gt; LinearSolve( Transpose(basis), &lt;1|2|3|-5&gt; ); 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 &gt; 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. &gt; A := Matrix([[1,2,3],[1,2,3],[2,5,6]]): Then the following call to eig is made. &gt; 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. &gt; W; 9.321825 0. 0. 0. −.5612673 10−15 0. 0. 0. −.3218253 &gt; 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

Ask a homework question - tutors are online