Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using Microsoft Excel Built-in Functions and Matrix Operations.

Similar presentations


Presentation on theme: "Using Microsoft Excel Built-in Functions and Matrix Operations."— Presentation transcript:

1 Using Microsoft Excel Built-in Functions and Matrix Operations

2 Excel Embedded Functions Excel has a wide variety of Built-in Functions: Mathematical Financial Statistical Logical Database Conversion User-defined ***

3 Excel Embedded Functions These functions allow us to : Perform more complex operations Combine data for parametric calculations Manipulate the contents of the datasheet Search for values in the datasheet

4 Excel Embedded Functions Example: Open Excel and start from an empty datasheet and enter the following data: txV 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10

5 Excel Embedded Functions Enter the following formula for an oscillating particle position at any time t with a frequency  =0.75 By clicking in the fx button or entering: =sin(0.75*A2) on cell B2 txV 00 0.50.366273 10.681639 1.50.902268 20.997495 2.50.954086 30.778073 3.50.49392 40.14112 4.5-0.23129 5-0.57156 5.5-0.83239 6-0.97753 6.5-0.98681 7-0.85893 7.5-0.61168 8-0.27942 8.50.091686 90.450044 9.50.745853 100.938

6 Excel Embedded Functions Plot the position x(t) as:

7 Excel Embedded Functions Enter the following formula for the particle velocity at any time t with a frequency  =0.75 By clicking in the fx button or entering: =0.75*cos(0.75*A2) on cell C2 txV 000.75 0.50.3662730.697881 10.6816390.548767 1.50.9022680.323382 20.9974950.053053 2.50.954086-0.22465 30.778073-0.47113 3.50.49392-0.65213 40.14112-0.74249 4.5-0.23129-0.72966 5-0.57156-0.61542 5.5-0.83239-0.41564 6-0.97753-0.1581 6.5-0.986810.121421 7-0.858930.384064 7.5-0.611680.593328 8-0.279420.720128 8.50.0916860.746841 90.4500440.669755 9.50.7458530.499583 100.9380.259976

8 Excel Embedded Functions Plot the velocity V(t) as:

9 Excel Embedded Functions We can also perform multi-dimensional calculations: Assume that the temperature of the surface of an electronic 3x3 board is given by the function:

10 Excel Embedded Functions Enter the following data for the position (x,y): x→ yy 00.250.50.7511.251.51.7522.252.52.753 0 0.25 0.5 0.75 1 1.25 1.5 1.75 2 2.25 2.5 2.75 3

11 Excel Embedded Functions Use the formula for the surface temperature on cell B3 as: = EXP(0.1*(B$2+$A3))*SIN(B$2-1)*COS($A3-1)

12 Excel Embedded Functions Use a surface graph to plot T(x,y) as:

13 Matrix Operations A Matrix is a collection of independent values ordered in a row-column format: The above Matrix is said to be (3x5) or 3 by 5 because it has 3 rows and 5 columns. The first number is the first dimension or the number of rows. The second number is the second dimension or the number of columns.

14 When a Matrix has just one (1) column (Nx1) is said to be a vector. The following is a (4x1) vector: Matrices are very useful in the solution of systems of multiple linear equations arising from many problems: Electricity, Heat Transfer, Fluid Mechanics, Optics, etc. Matrix Operations

15 The fundamental Matrix operations are: 1.Addition and Subtraction 2.Multiplication by a Scalar 3.Transpose 4.Multiplication of Two Matrices 5.Determinant 6.Inversion Matrix Operations

16 1.Addition and Subtraction: To add or subtract two matrices they both must have the same exact dimensions. The result contains the addition or subtraction of corresponding elements. In Excel, simply enter the matrices, add or subtract the first element of each matrix into a new cell, and copy the cell to form the new matrix: [A]1222 (3x4)2-342 23-2[C]=[A]+[B]346 (3x4)3-465 [B]-2124 1501 (3x4)123 23-33 Matrix Operations

17 2.Multiplication by a Scalar: The resulting matrix of a scalar-matrix multiplication has the same dimensions as the original matrix with all its elements multiplied by the scalar. In Excel, simply enter the Matrix and the Scalar, multiply the first element of the matrix times the scalar (with absolute address) into a new cell, and copy the cell to form the new matrix: Scalar5 [A]-223 [C]=Scalar x [A]-101015 (4x3)32 (4x3)15-510 4-22 20-1010 520 25100 Matrix Operations

18 3. Transpose: The transpose of a matrix positions the rows on the column locations and the columns on the row locations. The result is a Matrix with the opposite dimensions as the original one ( 5x4 → 4x5). In Excel, use the built- in-function =transpose(). Remember to use [ctrl- shift-enter] when entering the results because the =transpose() function will occupy multiple cells: [A]2-252transpose[A]22102 (5x4)2-233(4x5)-2 134 11 4 53 04 030-4 234 244 Matrix Operations

19 4. Multiplication of two Matrices: To multiply two matrices the number of columns of the first matrix must equal the number of rows of the second. The resulting matrix will have as many rows as the first and as many columns as the second. In Excel, use the built-in-function =mmult(,). Remember to use [ctrl-shift-enter] when entering the results because the =mmult(,) function will occupy multiple cells: [A]-242 (2x3)331 [C]=[A]x[B]8616 (2x4)10-519-2 [B]1-22-3 (3x4)2032 1141 Matrix Operations

20 Another Multiplication example: [A]3-220[c]=[A]x[b]10 (5x5)11-201(5x1)0 2233-4 3 3-3332 18 40-312 5 [b]2 (5x1)1 3 0 3 Matrix Operations

21 5. Determinant: Only the determinants of square matrices can be obtained. The determinant of a singular matrix is zero (0). In Excel, use the built- in-function =mdeterm(). [A]31-2 determinant[ A]-40 (4x4)222-2 1321 120 Matrix Operations

22 6. Inversion: Only the inverse of square matrices can be obtained. The inverse of a matrix has the same dimensions as the original one. In Excel, use the built-in-function =minverse(). Remember to use [ctrl-shift-enter] when entering the results because the =minverse() function will occupy multiple cells: [A]3-220inverse[A]0.190.210.06-0.010.04 (5x5)11-201(5x5)0.131.430.120.13-0.62 2233-4 0.200.900.050.20-0.55 3-3332 -0.31-0.450.060.090.24 40-312 0.081.16-0.080.28-0.52 Matrix Operations

23 Solution of systems of multiple linear equations: If a system of linear equations is well-posed (same number of equations as unknowns and no equation is the combination of one or more of the others) a Matrix-Vector Analogy can be found to facilitate the solution of the system. Given the following system of five (5) equations and five (5) unknowns: Matrix Operations

24 Where the unknowns x 1 …x 5 can represent electric intensity, energy, temperature, flow velocities, etc., depending on the application. An analog Matrix-Vector system can be derived as: Or simplified as: Matrix Operations

25 The solution of the system is given by: In Excel: [A]2-321{b}4 (5x5)2 -2 (5x1)3 1-4 2 31 23 -2 223 0 2 inverse[A]0.24 0.030.220.03{x}=inv[A]x{b}1.28 (5x5)-0.120.16-0.080.120.06(5x1)-0.04 -0.06-0.23-0.06-0.130.18 -0.25 0.030.05-0.130.13-0.14 -0.13 -0.24-0.400.06-0.060.09 -1.93 Matrix Operations


Download ppt "Using Microsoft Excel Built-in Functions and Matrix Operations."

Similar presentations


Ads by Google