Tensor
MathCad Example: Vectors and Matrices
Vectors
i := 1 .. 3 ORIGIN := 1 P :=
i
Note: Vectors must begin with subscript 0 unless theORIGIN statement is used to define a new initial subscript (also note that ORIGIN must be in all capital letters)
Q :=
i
i =
1 2 3
Note: Type P[i:2,3,4 to enter the values for vector P
2 3 43 −1 5
2 P = 3 4
P =3
2 2
Note: Type P= to display vector P
Note: Type P[2= to display row 2 of vector P Note: Type P[2*Q[3= to multiply element 2 of vector P by element 3 ofvector Q and display the result. Note: Type Ctrl-8 for a cross product (or use X x Y on the Matrix Toolbar). Also note that cross products are only defined for 3-eleme vectors. Note: Standardmultiplication of vectors results in a dot product (or use use X . Y on the Matrix Toolbar) Note: Normal arithmetic operations can be performed on vectors and matrices as long as the dimensions are compatible.P ⋅ Q = 15
3
19 P× Q= 2 −11
P⋅ Q = 23
13 3⋅ Q + 2⋅ P = 3 23
Note: Vectors P and Q above could have also been created as matrices with 3 rows and onecolumn as illustrated below with matrices R and S)
Using Column Matrices in place of Vectors
2 R := 3 4
ORIGIN := 1
3 S := −1 5
Note: Type R:INSERT - MATRIX (or use Ctrl+ M) and then specify the number of rows and columns. Then fill in the values for R. (or try Ctrl + M) Note: Matrices begin with subscript 0 unless the ORIGIN statement is used to define a newinitial subscript (also note that ORIGIN must be in all capital letters)
R =3
2
Note: Type R[2= to display row 2 of column matrix R Note: Type R[2*S[3= to multiply element 2 of column matrix R byelement 3 of column matrix S and display the result. Note: Type Ctrl-8 for a cross product (or use X x Y on the Matrix Toolbar). Also note that cross products are only defined for 3-elemen vectors or...
Regístrate para leer el documento completo.