Solutions for Chapter 5 Problem 100P
Problem 100P: Use Excel to generate the solution of Eq. 5.31 for m=1 shown...
Use Excel to generate the solution of Eq. 5.31 for m=1 shown in Fig. 5.18 To do so, you need to learn how to perform linear algebra in Excel. For example, for N =4 you will end up with the matrix equation of Eq. 5.37. To solve this equation for the u values, you will have to compute the inverse of the 4 × 4 matrix, and then multiply this inverse into the 4 × 1 matrix on the right of the equation. In Excel, to do array operations, you must use the following rules: Pre-select the cells that will contain the result; use the appropriate Excel array function (look at Excel’s Help for details); press Ctrl + Shift + Enter, not just Enter. For example, to invert the 4 × 4 matrix you would: preselect a blank 4 × 4 array that will contain the inverse matrix; type = minverse([array containing matrix to be inverted]); press Ctrl + Shift + Enter. To multiply a 4 × 4 matrix into a 4 × 1 matrix you would do the following: pre-select a blank 4 × 1 array that will contain the result; type = mmult([array containing 4 × 4 matrix], [array containing 4 × 1 matrix]); press Ctrl + Shift + Enter.
Fig. 5.18 Comparison of the numerical solution obtained on three different grids with the exact solution.