<<

Appendix A Mathematical Fundamentals

In this book, it is assumed that the reader has familiarity with the mathematical definitions from the areas of Linear Algebra, Trigonometry, and other related areas. Some of them that are introduced in this Appendix to make the reader quickly understand the derivations and notations used in different chapters of this book.

A.1 ‘Atan2’

The usual inverse tangent function denoted by Atan(z), where z=y/x, returns an angle in the range (-π/2, π/2). In order to express the full range of angles it is useful to define the so called two- argument arctangent function denoted by Atan2(y,x), which returns angle in the entire range, i.e., (- π, π). This function is defined for all (x,y)≠0, and equals the unique angle θ such that x y cosθ = , and sinθ = …(A.1) x 2 + y 2 x 2 + y 2 The function uses the signs of x and y to select the appropriate quadrant for the angle θ, as explained in Table A.1. Table A.1 Evaluation of ‘Atan2’ function x Atan2(y,x) +ve Atan(z) 0 Sgn(y) π/2 -ve Atan(z)+ Sgn(y) π

In Table A.1, z=y/x, and Sgn(.) denotes the usual function, i.e., its value is -1, 0, or 1 depending on the positive, zero, and negative values of y, respectively. However, if both x and y are zeros, ‘Atan2’ is undefined. Now, using the table, Atan2(-1,1)= -π/4 and Atan2(1,-1)= 3π/4, whereas the Atan(-1) returns -π/4 in both the cases.

A.2 Vectors

Unless otherwise stated, vectors will be defined as column vectors and denoted with lower-case bold letters. Thus, an n-dimensional vector a is defined as

⎡a1 ⎤ ⎢ ⎥ a ≡ ⎢ M ⎥ …(A.2) ⎣⎢an ⎦⎥ where a1, …, an are the elements of vector a. The vector, a, can also be represented as T a ≡ []a1 , L, an …(A.3) in which superscript T denotes transpose. The magnitude or length or norm of the vector, a, denoted with italics letter a, is given by T 2 2 a = a a = a1 + L + an …(A.4)

A.2.1 Unit Vectors

A unit vector is defined as a vector with unit magnitude. Hence, the unit vector along the vector, a, denoted with a can be defined as a a = …(A.5) 5 a

Z a3

A

a

k

Y O j a2 i Coordinate frame

a1

X

Figure A.1 Coordinate frame and unit vectors

where a is given by eq. (A.3), Hencfe, a =1. Now, if i, j, and k, denote the unit vectors along the axes, X, Y, and Z, respectively, of a coordinate frame, as shown in Fig. A.1, any 3-dimensional T Cartesian vector shown in Fig. A.1, say, a ≡ [a1 , a2 , a3 ] , can be expressed as a = a1 i + a2 j + a3 k …(A.6) in which the unit vectors, i, j, and k, have the following representations: ⎡1⎤ ⎡0⎤ ⎡0⎤ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ i ≡ ⎢0⎥ , j ≡ ⎢1⎥ , and k ≡ ⎢0⎥ …(A.7) ⎣⎢0⎦⎥ ⎣⎢0⎦⎥ ⎣⎢1⎦⎥ Note in eq. (A.6) that the magnitudes of the unit vectors using eqs. (A.5) and (A.8) are one.

A.2.2 Scalar and Dot Products

The scalar product of two n-dimensional vectors, a and b, denoted as aTb, is a scalar number defined by T a b = a1b1 + L + anbn …(A.8) The scalar product is commutative, i.e., aT b = bT a B b …(A.9)

θ a O A

Figure A.2 Dot product of two Cartesian vectors

Now, for 2- and 3-dimensional Caretesian vectors representing physical quantities like position of 6 a point or force at a point, etc., the scalar product is also referred as dot product, which is given by

aT b = ab cosθ …(A.10) where θ is the angle between the vectors a and b, as shown in Fig. A.2. Physical interpretation of the dot product is that the vector, b, is projected onto vector a, as indicated by OA in Fig. A.1, and is multiplied by the magnitude of a. Alternatively, it can be interpreted as the projection of a onto vector b whose result is multiplied by the magnitude of the latter. Now, if these two vectors are orthogonal to each other, i.e., if θ = 90o, the dot product vanishes, namely, aT b = 0 .

A.2.3 Vector- or Cross-Product

A vector- or cross-product between two Cartesian vectors, say, a and b, denoted by , is defined as i j k

c = a × b = a1 a2 a3 = (a2b3 − a3b2 )i + (a3b1 − a1b3 )j + (a1b2 − a2b1 )k …(A.11)

b1 b2 b3 where ‘×’ denotes the symbol for the cross product, whereas ‘| • |’ represents ‘determinant’ of the arguments •. The result of the cross-product is also a vector, i.e., c, which is orthogonal to the original two vectors, i.e., a and b. The magnitude of vector c is denoted as c and can be is given by c = absinθ …(A.13) where θ is the angle between the vectors a and b, as shown in Fig. A.3. In order to obtain the direction of the resultant vector c, the right-hand rule is applied, i.e., if the palm of a right hand is placed along vector a and then turned towards vector b, the thumb points out the direction of vector c.

c b

θ a

Figure A.3 Cross-product of two Cartesian vectors

The cross-product has the following properties: a × b = −b × a ; a × (b × c) = (aT c)b − (aT b)c ; and aT (b × c) = a b c …(A.12)

A.2.4 Cross-Product Matrix

A cross-product matrix is always associated with a three-dimensional Cartesian vector, say, a, which when pre-multiplied with another three-dimensional Cartesian vector, say, b, results in the cross-product between the two vectors, as shown in Subsection A.2.3. If a × 1 denotes the cross- product matrix associated with vector a, then, (a ×1)b = a × b …(A.13a) The 3×3 matrix, (a × 1) , is skew-symmetric and singular. Its representation in terms of the T components of the vector, a ≡ [a1 a2 a3 ] , is given by ⎡ 0 − a3 a2 ⎤ ⎢ ⎥ a ×1 ≡ ⎢ a3 0 − a1⎥ …(A.13b) ⎣⎢− a2 a1 0 ⎦⎥ It is now simple matter to verify eq.(A.15a) from the result of eq. (A.12). 7

A.2.5 Differentiation of Vectors

T If the vector, a ≡ [a1 L an ] , is the n-dimensional vector function of time, then its time derivative, denoted by a& , is defined as T a& ≡ [a&1 L a&n ] …(A.14) The scalar and vector products satisfy the following product rules for differentiation similar to the product rule for differentiation of ordinary functions: d T T T d (a b) = a& b + a b& ; and (a × b) = a& × b + a × b& …(A.15) dt dt Similar statements hold for the integration of vectors also.

A.2.6 Linear Independence

A set of vectors, a1, …, an, is said to be linearly independent if and only if n ∑ αiai = 0 implies αi = 0 for all i …(A.16) i=1

A.3 Matrices

A matrix is defined as an ordered array of real numbers. An m×n matrix, say, A, with m rows and n columns has mn elements denoted as, aij, for i= 1, …, m; and for j = 1, …, n. If each column of the matrix, A, is represented by m-dimensional vector, a ≡ [a a ]T , for j = 1, …, n, then j 1, j L m, j matrix A has the following representation: A ≡ [a1 L an ] …(A.17a) One can similarly define each row as the n-dimensional vector, a ≡ [a a ]T , for i = 1, …, i i,1 L i,n m, and can represent matrix A as ⎡aT ⎤ ⎢ 1 ⎥ A ≡ ⎢ M ⎥ …(A.17b) ⎢aT ⎥ ⎣⎢ m ⎦⎥ where aT ≡ [a a ] . Note that both eqs.(A.19a-b) represent the same matrix. Depending on i i,1 L i,n the requirements one may choose one over the other one.

A.3.1 Determinant of a Matrix

The determinant of a matrix is defined for square matrices only. For an n × n matrix A, its determinant is the scalar denoted by det(A) or |A| and given by a11 a12 L a1n a21 a22 L a2n i+ j det(A) =| A |= = ∑ (−1) aij det(Aij ) …(A.18) M M O M an1 an2 L ann where det(Aij) is the determinant of the (n-1) × (n-1) matrix, Aij, obtained by deleting ith row and jth column of matrix A. As an example, the determinant of the 3 × 3 matrix, A, is calculated bellow: 8

a11 a12 a13 a22 a23 a21 a23 a21 a22 det(A) = a21 a22 a23 = a11 − a12 + a13 a32 a33 a31 a33 a31 a32 …(A.19) a31 a32 a33 = a11(a22a33 − a23a32 ) − a12 (a21a33 − a23a31) + a13 (a21a32 − a22a31) Regarding the determinant of a matrix A the following properties are useful: • If all the elements of a row or column of the matrix are zero, then det(A) = 0. • Determinants of A and its transpose AT are equal, i.e., det(A) = det(AT). • For two matrices, A and B, det(AB) = det(A)det(B). • If A is an identity matrix, i.e., A = 1, then its determinant is unity, i.e., det(A) = 1. • If two rows or columns are dependent then det(A) = 0. Such matrices are called singular. • If all the rows or columns are independent then det(A) ≠ 0. Such matrices are called non- singular.

A.3.2 Inverse of a Matrix

Inverse of a matrix is again defined for square matrices only. For an n × n matrix A, it is defined as 1 A −1 = Adj(A) …(20a) det(A) where Adj(A) is defined as follows: i+ j T Adj(A) = [(−1) det(Aij )] …(20b) Note here that solving a set of linear algebraic equations, Ax = b, requires the inverse of matrix A, namely, x = A −1b . One can use eq. (22a-b) to obtain x. However, in order to achieve computational efficiency it is suggested to use matrix decomposition, and backward and forward substitutions based solutions (Strang, 1980). Some properties of matrix inverse are as follows: • AA−1 = A−1A = 1 , where 1 is an identity matrix. • (A −1)−1 = A , and (AT )−1 = (A−1)T . • (AB)−1 = B−1A−1 .

A.3.3 Eigenvalues and Eigenvectors

The eigenvalues of a matrix, A, are the solutions in s of the following equation: det(s1 − A) = 0 where 1 being the identity matrix of dimension same as matrix A. The function det(s1 − A) is a polynomial in s called characteristic polynomial of A. If se is an eigenvalue of A, an eigenvector of A corresponding to se is a nonzero vector x satisfying the system of linear equations given by (s1 − A)x = 0 …(A.21)

A.4 Transfer Function

A transfer function (Mohan, 1997; Onwubolu, 2005; Dorf, 1992) algebraically relates a system’s output to its input. This function allows separation of the input, the system, and the output into three separate and distinct parts, as shown in Fig. A.. The ratio of the Laplace transform1 of the output, y(s), divided by the Laplace transform of the input, x(s), gives the transfer function, G(s), i.e.,

9 1 Laplace Transform converts the representation of a physical system using a set of differential equations into a set of algebraic equations.

y(s) G(s) = … (A.22) x(s) where x(s) and y(s) are in general polynomials in the complex variable, s. In eq. (A.), the denominator polynomial, x(s), is called the characteristic polynomial whose roots are called poles, whereas the roots of the numerator polynomial, y(s), are called zeros.

Input Transfer function Output x(s) G(s) y(s)

Figure A,4 Description of input-output of a system

As an example, consider the damped mass-spring system shown in Fig. 10.7. Its equations of motion given by eq. (10.30) is reproduced here as m&x& + bx& + kx = f . . . (A.23) Taking Laplace transform of all the terms of Eq. (A.27), under the assumption of zero initial conditions, one obtains ms 2 x(s) + bsx(s) + kx(s) = f (s) …(A.24) Solving for x(s) from the above equation yields f (s) x(s) = …(A.25) ms 2 + bs + k Therefore, the transfer function, G(s), of the damped mass-spring system is given by x(s) 1 G(s) = = …(A.26a) f (s) ms 2 + bs + k Alternatively, if the differential equation of the form given by eq. (10.30b) is used, then eq. (A.30a) can also be expressed as follows: x(s) 1/ m G(s) = = 2 2 …(A.26b) f (s) s + 2ςωn s + ωn where ωn and ζ are the natural frequency and damping ratio the of the system, respectively, and defined in eq. (10.30c). From eqs. (A.30a-b), the two poles of the damped mass-spring system are then given by

− b ± + b 2 − 4mk s = = −ςω ± ω ς 2 − 1 . . . (A.27) 1,2 2m n n which determine the form of the natural response of the system at hand, whereas the poles and zeros together affect the peaks and amplitudes of both the forced and natural responses.

A.5 Summary

In this appendix, some basics on the linear algebra and control theories are presented which would help the readers to understand the concepts used in this book, mainly, in Chapters 5-10.

10