MATLAB Handbook with Applications to Mathematics, Science, Engineering, and Finance

Total Page:16

File Type:pdf, Size:1020Kb

MATLAB Handbook with Applications to Mathematics, Science, Engineering, and Finance This article was downloaded by: 10.3.98.104 On: 26 Sep 2021 Access details: subscription number Publisher: CRC Press Informa Ltd Registered in England and Wales Registered Number: 1072954 Registered office: 5 Howick Place, London SW1P 1WG, UK MATLAB Handbook with Applications to Mathematics, Science, Engineering, and Finance José Miguel, David Báez-López, David Alfredo Báez Villegas Matrices and Linear Algebra Publication details https://www.routledgehandbooks.com/doi/10.1201/9781315228457-4 José Miguel, David Báez-López, David Alfredo Báez Villegas Published online on: 15 Jan 2019 How to cite :- José Miguel, David Báez-López, David Alfredo Báez Villegas. 15 Jan 2019, Matrices and Linear Algebra from: MATLAB Handbook with Applications to Mathematics, Science, Engineering, and Finance CRC Press Accessed on: 26 Sep 2021 https://www.routledgehandbooks.com/doi/10.1201/9781315228457-4 PLEASE SCROLL DOWN FOR DOCUMENT Full terms and conditions of use: https://www.routledgehandbooks.com/legal-notices/terms This Document PDF may be used for research, teaching and private study purposes. Any substantial or systematic reproductions, re-distribution, re-selling, loan or sub-licensing, systematic supply or distribution in any form to anyone is expressly forbidden. The publisher does not give any warranty express or implied or make any representation that the contents will be complete or accurate or up to date. The publisher shall not be liable for an loss, actions, claims, proceedings, demand or costs or damages whatsoever or howsoever caused arising directly or indirectly in connection with or arising out of the use of this material. Chapter 4 Matrices and Linear Algebra 4.1 Introduction ...................................................... 91 4.2 Matrices .......................................................... 92 4.3 Basic Operations with Matrices ................................. 96 4.3.1 The Dot Operator ....................................... 98 4.4 The Characteristic Polynomial ................................... 98 4.5 Vectors ........................................................... 99 4.5.1 Norm of a Vector ........................................ 103 4.5.2 Vector Generation ....................................... 104 4.6 Dot and Cross Products ......................................... 105 4.6.1 Dot Product ............................................. 105 4.6.2 Cross Product ........................................... 106 4.7 Matrix and Vector Functions .................................... 106 4.8 Systems of Simultaneous Linear Equations ...................... 107 4.8.1 LU Factorization ......................................... 109 4.9 Eigenvalues and Eigenvectors .................................... 110 4.10 Cell Arrays ....................................................... 112 4.11 Structures ........................................................ 113 4.12 Concluding Remarks ............................................. 114 4.1 Introduction As mentioned in Chapter 1, MATLAB was originally designed to carry out operations with matrices, and received the name of Matrix Laboratory that subsequently was reduced to MATLAB. Thus, it deserves special attention to learn the way in which MATLAB works with them. Matrices are practically found in all the areas of knowledge. In this manner, it is possible to find applications of matrices not only in the mathematics areas, but also in a great deal of applications in engineering, in physics, in finance, in accounting, in the arts, music, in anthropology, chemistry and biology, to mention a few. Another important application of matrices is given in the solution of sys- tems of simultaneous equations because the equations’ coefficients are ar- ranged in a matrix. Simultaneous equations systems appear in many problems in engineering such as in optimization of systems, automatic control, food en- 91 Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 R 92 MATLAB HANDBOOK with Applications gineering, chemical engineering, etc. Chapters 9 to 14 present several matrix applications in the solution of problems. A matrix is defined as an array of numbers (or entities). From this defini- tion of a matrix, we also refer to a matrix as an array. Both terms are used indistinctly. MATLAB has an array editor that allows users to introduce the elements of a matrix or to modify the elements of a matrix given previously and already stored as a MATLAB variable. This array editor will be described later in the chapter. Additionally to the basic operations with matrices and vectors, MATLAB has the potential to handle arrays by means of indexing. In this manner car- rying out calculations using arrays becomes very efficient and fast. Finally, the chapter covers cell and structure arrays. Cell arrays are also matrices, but the fundamental difference is that they can handle combinations of different variable types such as names of people or things and numbers. These arrays allow us to handle data in a more efficient and more practical way. A structure is similar to a cell but each element is identified by a name. The chapter begins with a description of matrices and the basic opera- tions that can be performed with them. It continues with vectors and how to compute dot and vector products. A section is dedicated to matrix and vec- tor functions. A section is presented to solve simultaneous equations systems, and for LU factorization of a matrix. The chapter ends with cells arrays and structures. 4.2 Matrices MATLAB handles in matrix form all the variables defined in a MATLAB session, whether they are user-defined or they are in the predefined functions inside MATLAB. It is then convenient to consider the concept of a matrix that any book of linear algebra defines as: A Matrix is an array of numbers or objects. In this way, a matrix can be an array of numbers, letters, objects, or any thing. The only condition that a matrix should satisfy to be a matrix is for it to be an ordered array. For example, a table of numbers is a matrix. The pixels of an image also form a matrix. These two matrices are ordered in a plane. If an image changes with time, as is the case of television images or motion pictures, then we are adding another dimension to the definition of such matrices and thus we are talking about multidimensional matrices. The objects that form the matrix are called elements of the matrix. An example of a matrix is Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 Matrices and Linear Algebra 93 1 3 0 8 −6 4 A = 2− 7 5 4 9 5 − which has 4 rows and 3 columns. We say that matrix A is of dimension 4 3. If a matrix has n rows and m columns, it is a n m matrix. The quantity n× m is called the dimension of the matrix. In MATLAB,× the matrix A is defined× by A = [ 1 -3 0 ; 8 -6 4 ; 2 7 5 ; -4 9 5 ] That is, we have separated the elements of the same row by a space (they can be also separated with a comma) and the rows are separated with a semicolon. Matrix A is shown in Figure 4.1. Each element from the matrix A has a position i, j which corresponds to its position in the ith row and in the jth column. The numbers i and j are called the indices of the (i, j) element. For example, in matrix A the element 8 has the position 2, 1 while the element 7 has the position 3, 2. The command A(i, j) defines the element of row i and column j. If the number of rows is equal to the number of columns, that is, if n = m we say that matrix A is a square matrix of dimension n. Other commands are given in Table 4.1. TABLE 4.1: Matrix commands Matrix command Description A (a:b, c:d) Submatrix consisting of rows a to b and columns c to d. :)A(k, Vector formed by the elements in the k-th row. :,A( j) Vector formed by the elements in the j-th column. MATLAB has an array editor. To illustrate its use we consider matrix A given above. We write again matrix A in the Command Window. This is shown in Figure 4.2 where we have also displayed the Workspace window. In this window we see matrix A and in the Workspace we see the icon for the variable A specified as a 4 3 array. If we double click on this icon the Array Editor will open as a new× window attached to MATLAB as shown in Figure 4.2. There we can clearly see the element values which now can be either modified or deleted. We can even add new elements to matrix A. In this example we add a fifth row to A. The elements that are going to be added are 5 10 -7 Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 R 94 MATLAB HANDBOOK with Applications FIGURE 4.1: MATLAB main window. FIGURE 4.2: MATLAB array editor window. Downloaded By: 10.3.98.104 At: 20:04 26 Sep 2021; For: 9781315228457, chapter4, 10.1201/9781315228457-4 Matrices and Linear Algebra 95 FIGURE 4.3: MATLAB and array editor with new elements. TABLE 4.2: Special matrices Matrix name Description ones(m, n) Matrix of m n dimension where each element has unity value.× ones(n) Square matrix of order n where each element has unity value. zeros(m, n) Matrix with every element having zero value. zeros(n) Square matrix of order n where each element has zero value. eye(n) Square identity matrix of order n eye(m, n) Matrix of m n dimension with 1’s in the main diagonal. The× remaining elements are zeros. We see in Figure 4.3 the elements added. If in the Command Window we write A, the matrix will be displayed as shown in Figure 4.3. Another way to open the array editor is by writing >> open name_of_the_matrix The array editor is then open showing the elements of the variable selected.
Recommended publications
  • Vectors, Matrices and Coordinate Transformations
    S. Widnall 16.07 Dynamics Fall 2009 Lecture notes based on J. Peraire Version 2.0 Lecture L3 - Vectors, Matrices and Coordinate Transformations By using vectors and defining appropriate operations between them, physical laws can often be written in a simple form. Since we will making extensive use of vectors in Dynamics, we will summarize some of their important properties. Vectors For our purposes we will think of a vector as a mathematical representation of a physical entity which has both magnitude and direction in a 3D space. Examples of physical vectors are forces, moments, and velocities. Geometrically, a vector can be represented as arrows. The length of the arrow represents its magnitude. Unless indicated otherwise, we shall assume that parallel translation does not change a vector, and we shall call the vectors satisfying this property, free vectors. Thus, two vectors are equal if and only if they are parallel, point in the same direction, and have equal length. Vectors are usually typed in boldface and scalar quantities appear in lightface italic type, e.g. the vector quantity A has magnitude, or modulus, A = |A|. In handwritten text, vectors are often expressed using the −→ arrow, or underbar notation, e.g. A , A. Vector Algebra Here, we introduce a few useful operations which are defined for free vectors. Multiplication by a scalar If we multiply a vector A by a scalar α, the result is a vector B = αA, which has magnitude B = |α|A. The vector B, is parallel to A and points in the same direction if α > 0.
    [Show full text]
  • Vector Analysis
    DOING PHYSICS WITH MATLAB VECTOR ANANYSIS Ian Cooper School of Physics, University of Sydney [email protected] DOWNLOAD DIRECTORY FOR MATLAB SCRIPTS cemVectorsA.m Inputs: Cartesian components of the vector V Outputs: cylindrical and spherical components and [3D] plot of vector cemVectorsB.m Inputs: Cartesian components of the vectors A B C Outputs: dot products, cross products and triple products cemVectorsC.m Rotation of XY axes around Z axis to give new of reference X’Y’Z’. Inputs: rotation angle and vector (Cartesian components) in XYZ frame Outputs: Cartesian components of vector in X’Y’Z’ frame mscript can be modified to calculate the rotation matrix for a [3D] rotation and give the Cartesian components of the vector in the X’Y’Z’ frame of reference. Doing Physics with Matlab 1 SPECIFYING a [3D] VECTOR A scalar is completely characterised by its magnitude, and has no associated direction (mass, time, direction, work). A scalar is given by a simple number. A vector has both a magnitude and direction (force, electric field, magnetic field). A vector can be specified in terms of its Cartesian or cylindrical (polar in [2D]) or spherical coordinates. Cartesian coordinate system (XYZ right-handed rectangular: if we curl our fingers on the right hand so they rotate from the X axis to the Y axis then the Z axis is in the direction of the thumb). A vector V in specified in terms of its X, Y and Z Cartesian components ˆˆˆ VVVV x,, y z VViVjVk x y z where iˆˆ,, j kˆ are unit vectors parallel to the X, Y and Z axes respectively.
    [Show full text]
  • Cross Product Review
    12.4 Cross Product Review: The dot product of uuuu123, , and v vvv 123, , is u v uvuvuv 112233 uv u u u u v u v cos or cos uv u and v are orthogonal if and only if u v 0 u uv uv compvu projvuv v v vv projvu cross product u v uv23 uv 32 i uv 13 uv 31 j uv 12 uv 21 k u v is orthogonal to both u and v. u v u v sin Geometric description of the cross product of the vectors u and v The cross product of two vectors is a vector! • u x v is perpendicular to u and v • The length of u x v is u v u v sin • The direction is given by the right hand side rule Right hand rule Place your 4 fingers in the direction of the first vector, curl them in the direction of the second vector, Your thumb will point in the direction of the cross product Algebraic description of the cross product of the vectors u and v The cross product of uu1, u 2 , u 3 and v v 1, v 2 , v 3 is uv uv23 uvuv 3231,, uvuv 1312 uv 21 check (u v ) u 0 and ( u v ) v 0 (u v ) u uv23 uvuv 3231 , uvuv 1312 , uv 21 uuu 123 , , uvu231 uvu 321 uvu 312 uvu 132 uvu 123 uvu 213 0 similary: (u v ) v 0 length u v u v sin is a little messier : 2 2 2 2 2 2 2 2uv 2 2 2 uvuv sin22 uv 1 cos uv 1 uvuv 22 uv now need to show that u v2 u 2 v 2 u v2 (try it..) An easier way to remember the formula for the cross products is in terms of determinants: ab 12 2x2 determinant: ad bc 4 6 2 cd 34 3x3 determinants: An example Copy 1st 2 columns 1 6 2 sum of sum of 1 6 2 1 6 forward backward 3 1 3 3 1 3 3 1 diagonal diagonal 4 5 2 4 5 2 4 5 products products determinant = 2 72 30 8 15 36 40 59 19 recall: uv uv23 uvuv 3231, uvuv 1312 , uv 21 i j k i j k i j u1 u 2 u 3 u 1 u 2 now we claim that uvu1 u 2 u 3 v1 v 2 v 3 v 1 v 2 v1 v 2 v 3 iuv23 j uv 31 k uv 12 k uv 21 i uv 32 j uv 13 u v uv23 uv 32 i uv 13 uv 31 j uv 12 uv 21 k uv uv23 uvuv 3231,, uvuv 1312 uv 21 Example: Let u1, 2,1 and v 3,1, 2 Find u v.
    [Show full text]
  • When Does a Cross Product on R^{N} Exist?
    WHEN DOES A CROSS PRODUCT ON Rn EXIST? PETER F. MCLOUGHLIN It is probably safe to say that just about everyone reading this article is familiar with the cross product and the dot product. However, what many readers may not be aware of is that the familiar properties of the cross product in three space can only be extended to R7. Students are usually first exposed to the cross and dot products in a multivariable calculus or linear algebra course. Let u = 0, v = 0, v, 3 6 6 e and we be vectors in R and let a, b, c, and d be real numbers. For review, here are some of the basic properties of the dot and cross products: (i) (u·v) = cosθ (where θ is the angle formed by the vectors) √(u·u)(v·v) (ii) ||(u×v)|| = sinθ √(u·u)(v·v) (iii) u (u v) = 0 and v (u v)=0. (perpendicularproperty) (iv) (u· v×) (u v) + (u · v)2×= (u u)(v v) (Pythagorean property) (v) ((au×+ bu· ) ×(cv + dv))· = ac(u · v)+·ad(u v)+ bc(u v)+ bd(u v) e × e × × e e × e × e We will refer to property (v) as the bilinear property. The reader should note that properties (i) and (ii) imply the Pythagorean property. Recall, if A is a square matrix then A denotes the determinant of A. If we let u = (x , x , x ) and | | 1 2 3 v = (y1,y2,y3) then we have: e1 e2 e3 u v = x1y1 + x2y2 + x3y3 and (u v) = x1 x2 x3 · × y1 y2 y3 It should be clear that the dot product can easily be extended to Rn, however, arXiv:1212.3515v7 [math.HO] 30 Oct 2013 it is not so obvious how the cross product could be extended.
    [Show full text]
  • Ε and Cross Products in 3-D Euclidean Space
    Last Latexed: September 8, 2005 at 10:14 1 Last Latexed: September 8, 2005 at 10:14 2 It is easy to evaluate the 27 coefficients kij, because the cross product of two ijk and cross products in 3-D orthogonal unit vectors is a unit vector orthogonal to both of them. Thus Euclidean space eˆ1 eˆ2 =ˆe3,so312 =1andk12 =0ifk = 1 or 2. Applying the same argument× toe ˆ eˆ ande ˆ eˆ , and using the antisymmetry of the cross 2 × 3 3 × 1 These are some notes on the use of the antisymmetric symbol for ex- product, A~ B~ = B~ A~,weseethat ijk × − × pressing cross products. This is an extremely powerful tool for manipulating = = =1; = = = 1, cross products and their generalizations in higher dimensions, and although 123 231 312 132 213 321 − many low level courses avoid the use of ,IthinkthisisamistakeandIwant and = 0 for all other values of the indices, i.e. = 0 whenever any you to become proficient with it. ijk ijk two of the indices are equal. Note that changes sign not only when the last In a cartesian coordinate system a vector ~ has components along each V Vi two indices are interchanged (a consequence of the antisymmetry of the cross of the three orthonormal basis vectorse ˆ ,orV~ = V eˆ . The dot product i Pi i i product), but whenever any two of its indices are interchanged. Thus is of two vectors, A~ B~ , is bilinear and can therefore be written as ijk · zero unless (1, 2, 3) (i, j, k) is a permutation, and is equal to the sign of the permutation if it→ exists.
    [Show full text]
  • Tutorial 3 Using MATLAB in Linear Algebra
    Edward Neuman Department of Mathematics Southern Illinois University at Carbondale [email protected] One of the nice features of MATLAB is its ease of computations with vectors and matrices. In this tutorial the following topics are discussed: vectors and matrices in MATLAB, solving systems of linear equations, the inverse of a matrix, determinants, vectors in n-dimensional Euclidean space, linear transformations, real vector spaces and the matrix eigenvalue problem. Applications of linear algebra to the curve fitting, message coding and computer graphics are also included. For the reader's convenience we include lists of special characters and MATLAB functions that are used in this tutorial. Special characters ; Semicolon operator ' Conjugated transpose .' Transpose * Times . Dot operator ^ Power operator [ ] Emty vector operator : Colon operator = Assignment == Equality \ Backslash or left division / Right division i, j Imaginary unit ~ Logical not ~= Logical not equal & Logical and | Logical or { } Cell 2 Function Description acos Inverse cosine axis Control axis scaling and appearance char Create character array chol Cholesky factorization cos Cosine function cross Vector cross product det Determinant diag Diagonal matrices and diagonals of a matrix double Convert to double precision eig Eigenvalues and eigenvectors eye Identity matrix fill Filled 2-D polygons fix Round towards zero fliplr Flip matrix in left/right direction flops Floating point operation count grid Grid lines hadamard Hadamard matrix hilb Hilbert
    [Show full text]
  • Clifford Algebra with Mathematica
    Clifford Algebra with Mathematica J.L. ARAGON´ G. ARAGON-CAMARASA Universidad Nacional Aut´onoma de M´exico University of Glasgow Centro de F´ısica Aplicada School of Computing Science y Tecnolog´ıa Avanzada Sir Alwyn William Building, Apartado Postal 1-1010, 76000 Quer´etaro Glasgow, G12 8QQ Scotland MEXICO UNITED KINGDOM [email protected] [email protected] G. ARAGON-GONZ´ ALEZ´ M.A. RODRIGUEZ-ANDRADE´ Universidad Aut´onoma Metropolitana Instituto Polit´ecnico Nacional Unidad Azcapotzalco Departamento de Matem´aticas, ESFM San Pablo 180, Colonia Reynosa-Tamaulipas, UP Adolfo L´opez Mateos, 02200 D.F. M´exico Edificio 9. 07300 D.F. M´exico MEXICO MEXICO [email protected] [email protected] Abstract: The Clifford algebra of a n-dimensional Euclidean vector space provides a general language comprising vectors, complex numbers, quaternions, Grassman algebra, Pauli and Dirac matrices. In this work, we present an introduction to the main ideas of Clifford algebra, with the main goal to develop a package for Clifford algebra calculations for the computer algebra program Mathematica.∗ The Clifford algebra package is thus a powerful tool since it allows the manipulation of all Clifford mathematical objects. The package also provides a visualization tool for elements of Clifford Algebra in the 3-dimensional space. clifford.m is available from https://github.com/jlaragonvera/Geometric-Algebra Key–Words: Clifford Algebras, Geometric Algebra, Mathematica Software. 1 Introduction Mathematica, resulting in a package for doing Clif- ford algebra computations. There exists some other The importance of Clifford algebra was recognized packages and specialized programs for doing Clif- for the first time in quantum field theory.
    [Show full text]
  • Spacetime Algebra As a Powerful Tool for Electromagnetism
    Spacetime algebra as a powerful tool for electromagnetism Justin Dressela,b, Konstantin Y. Bliokhb,c, Franco Norib,d aDepartment of Electrical and Computer Engineering, University of California, Riverside, CA 92521, USA bCenter for Emergent Matter Science (CEMS), RIKEN, Wako-shi, Saitama, 351-0198, Japan cInterdisciplinary Theoretical Science Research Group (iTHES), RIKEN, Wako-shi, Saitama, 351-0198, Japan dPhysics Department, University of Michigan, Ann Arbor, MI 48109-1040, USA Abstract We present a comprehensive introduction to spacetime algebra that emphasizes its prac- ticality and power as a tool for the study of electromagnetism. We carefully develop this natural (Clifford) algebra of the Minkowski spacetime geometry, with a particular focus on its intrinsic (and often overlooked) complex structure. Notably, the scalar imaginary that appears throughout the electromagnetic theory properly corresponds to the unit 4-volume of spacetime itself, and thus has physical meaning. The electric and magnetic fields are combined into a single complex and frame-independent bivector field, which generalizes the Riemann-Silberstein complex vector that has recently resurfaced in stud- ies of the single photon wavefunction. The complex structure of spacetime also underpins the emergence of electromagnetic waves, circular polarizations, the normal variables for canonical quantization, the distinction between electric and magnetic charge, complex spinor representations of Lorentz transformations, and the dual (electric-magnetic field exchange) symmetry that produces helicity conservation in vacuum fields. This latter symmetry manifests as an arbitrary global phase of the complex field, motivating the use of a complex vector potential, along with an associated transverse and gauge-invariant bivector potential, as well as complex (bivector and scalar) Hertz potentials.
    [Show full text]
  • Second 340 Matlab Assignment Vector Operations
    Second 340 Matlab assignment Vector operations with Matlab You can take the dot and cross product as follows: >>P0 = [ 1, 3, 6] >>P1 = [0 -2 8] >>a = dot(P0,P1) >>B = cross(P0,P1) Then a will be 42, the dot product of P0 and P1, and B will be the vector (36, −8, −2) which is the cross product. >>dot(P0,B) gives the answer 0 as it should. You can find the length of a vector by >>sqrt(dot(P0,P0)) or you can use the built-in function norm >>norm(P0) Besides these vector functions, Matlab has many functions which work on scalar quantities. Some useful functions are abs, cos, sin, tan, sqrt, log. exp, acos, asin, atan. Type help exp for example to find out about exp. Note that in Matlab, log(x) computes the natural logarithm ln(x). |a·b| Example: The length of the projection of b to a is kak so to find the length of the projection of (0, 1, 3) to (1, 1, 5) you could type the following (since abs is the absolute value.). >> b = [0 1 3] >> a = [1 1 5] >> abs(dot(a,b))/norm(a) Example: Let P0 and P1 be as above and let P 2 = (0, 1, 2). Find an equation of the plane through P0, P1, and P2. >>P2 = [0 1 2] >>N=cross(P1-P0,P2-P0) Matlab gives the answer N = (24, −6, −3) so you know the equation is 24(x − 1) − 6(y − 3) − 3(z − 6) = 0. Example: Find the distance from P1 to the line through P0 with direction (1, −1, 3) >>L=[1 -1 3] >>dist = norm(cross(P1-P0,L))/norm(L) I should point out that Matlab does not understand the i, j, k vector notation.√ Try typing in 3*i+2*j and see what happens.
    [Show full text]
  • 2.4 the Cross Product (9.4)
    Course: Accelerated Engineering Calculus II Instructor: Michael Medvinsky 2.4 The Cross Product (9.4) ⎛ ⎞ a11 a12 Def: A 2x2 matrix is an entity of the following form A = ⎜ ⎟ . Similarly a 3x3 matrix has ⎜ ⎟ ⎝ a21 a22 ⎠ ⎛ ⎞ a11 a12 a13 ⎜ ⎟ a form A = ⎜ a21 a22 a23 ⎟ . ⎜ ⎟ ⎝ a31 a32 a33 ⎠ Def: Every matrix is associated with a special number called determinant. The determinant of a11 a12 2x2 matrix is given by det A = A = = a11a22 − a 12a21 . The determinant of 3x3 matrix is a21 a22 given in terms of determinants of 2x2 matrices as following a11 a12 a13 a22 a23 a11 a13 a21 a22 det A = A = a21 a22 a23 = a11 − a12 + a13 = a32 a33 a31 a33 a31 a32 a31 a32 a33 = a11 (a22a33 − a23a32 ) + a12 (a11a33 − a13a31 ) + a13 (a21a32 − a22a 31 ) 1 2 Ex 7. = 4 − 6 = −2 3 4 1 2 3 5 6 4 6 4 5 4 5 6 = 1⋅ − 2 ⋅ + 3⋅ = 8 9 7 9 7 8 Ex 8. 7 8 9 = (5 ⋅9 − 6 ⋅8) − 2(4 ⋅9 − 6 ⋅ 7) + 3(4 ⋅8 − 5 ⋅ 7) = = (45 − 48) − 2(36 − 42) + 3(32 − 35) = −3− 2 ⋅(−6) + 3⋅(−3) = −3+12 − 9 = 0 Def: The cross product between vectors a = a ,a ,a and b = b ,b ,b is given by 1 2 3 1 2 3 i j k a × b = a1 a2 a3 = (a2b3 − a 3b2 )i − (a1b3 − a3b1 ) j + (a1b2 − a2b1 )k = b1 b2 b3 = a b − a b ,a b − a b ,a b − a b 2 3 3 2 3 1 1 3 1 2 2 1 Ex 9.
    [Show full text]
  • MATLAB Linear Algebra Tutorial
    Introduction to Linear Algebra using MATLAB Tutorial on Material Covered in ENG EK 127 Relevant to Linear Algebra By Stormy Attaway Reference: Stormy Attaway, MATLAB: A Practical Introduction to Programming and Problem Solving, pp.452+x, Burlington, MA, Elsevier Inc., 2009. MATLAB Basics Windows and Prompt Variables and Assignment Statements Constants Operators and Precedence Built-in functions, Help Types Vectors and Matrices in MATLAB Creating Vector and Matrix Variables . Row Vectors . Column Vectors . Matrices Special Matrix Functions Referring to Elements Dimensions Vectors and Matrices as Function Arguments Matrix Definitions Matrix Operations . Array Operations (term-by-term) . Matrix Multiplication . Inverse . Matrix Augmentation Vector Operations: Dot Product and Cross Product Introduction to Linear Algebra Systems of Equations . Matrix Form 2 x 2 Systems . Elementary Row Operations . Gauss Elimination . Gauss-Jordan Elimination . Reduced Row Echelon Form (RREF) RREF to solve Ax=b for x RREF to find inverse The solve Function in the Symbolic Math Toolbox © Copyright August 2010 by Stormy Attaway Page 1 MATLAB Basics ............................................................................................................ 3 Windows and Prompt.................................................................................................. 3 Variables and Assignment Statements........................................................................ 3 Constants....................................................................................................................
    [Show full text]
  • Vector Calculus: Understanding the Cross Product
    University of Babylon Subject : Mathematics III College of Engineering nd Class : 2 year - first semester Mechanical Engineering Dept. Date: / 10 / 2016 2016 \ 2017 Vector Calculus: Understanding the Cross Product The cross product accumulates interactions between different dimensions. Taking two vectors, we can write every combination of components in a grid: This completed grid is the outer product, which can be separated into the: Dot product, the interactions between similar dimensions (x*x, y*y, z*z) Cross product, the interactions between different dimensions (x*y, y*z, z*x, etc.) The dot product (a⃗ ⋅b⃗ ) measures similarity because it only accumulates interactions in matching dimensions. It’s a simple calculation with 3 components. Lecturer : Baseem A. altwajre The cross product (written a⃗ ×b⃗) has to measure a half-dozen “cross interactions”. The calculation looks complex but the concept is simple: accumulate 6 individual differences for the total. Instead of thinking “When do I need the cross product?” think “When do I need interactions between different dimensions?”. Area, for example, is formed by vectors pointing in different directions (the more orthogonal, the better). Indeed, the cross product measures the area spanned by two 3d vectors: (The “cross product” assumes 3d vectors, but the concept extends to higher dimensions.) Defining the Cross Product The dot product represents vector similarity with a single number: (Remember that trig functions are percentages.) Should the cross product (difference between interacting vectors) be a single number too? Let’s try. Sine is the percentage difference, so we could use: Instead, let’s express these unique differences as a vector: The size of the cross product is the numeric “amount of difference” (with sin(θ) as the percentage) The direction of the cross product is based on both inputs: it’s the direction orthogonal to both (i.e., favoring neither) Lecturer : Baseem A.
    [Show full text]