Page 816 - Advanced_Engineering_Mathematics o'neil
P. 816
796 APPENDIX A A MAPLE Primer
In an entirely analogous way, we can carry out vector operations in spherical coordinates.
First, change to this coordinate system:
SetCoordinates(‘spherical’[rho,theta,phi]);
For the MAPLE command
∗
Gradient(rho sin(phi)∧2) cos(theta/2));
∗
returns the gradient in spherical coordinates:
1
1 1 2 1 2sin(φ)cos 2 θ cos(φ)
2
sin(φ) cos θ e ρ − sin(φ) sin θ e θ + e φ .
2 2 2 sin(θ)
Some vector operations can also be carried out using the linear algebra package, which is
discussed next. Details are available in the MAPLE Help package.
A.4 Matrix Manipulations
To work with matrices, load the linear algebra package, using
with(linalg);
Again, the semicolon will give a list of the subroutines. To avoid the list, end this command with
a colon.
There are many ways to enter a matrix. One way is to enter the dimension and the rows. For
example,
Matrix(4,2,[[-1,3],[6,1],[6,5],[-1,-2]]);
enters the 4 × 2matrix
⎛ ⎞
−1 3
6 1
⎜ ⎟
⎜ ⎟ .
⎝ 6
5 ⎠
−1 −2
To give this matrix the name K, enter
K:=Matrix(4,2,[[-1,3],[6,1],[6,5],[-1,-2]]);
For the inverse of a nonsingular matrix A which has been entered, use
inverse(A);
For the rank of a matrix L (which need not be square), use
rank(L);
For the determinant of square A, use
det(A);
Multiply a matrix A by a scalar c by
∗
c A;
Add two n × m matrices as we would expect using
A+B;
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
October 14, 2010 15:43 THM/NEIL Page-796 27410_24_appA_p789-800

