Engineers-Excel.com

     
Engineering using Spreadsheets

Linear Equation Solver: How it works

Description
How it works









The solution for the system of linear equations Ax = b is given by x = A-1b.

The solution is evaluated in the tool using the in-built Excel functions MMULT and MINVERSE. Note that all formulae are evaluated in memory using Defined Formulae and only the solution is shown on the spreadsheet. The OFFSET formula is used to specify the matrix of the required size. Refer to Excel help for details on usage of these functions.

The names and formulae defined are as follows:

n (Number of Equations to be Solved) =Sheet1!$C$4
A (The coefficient matrix)                 =OFFSET(Sheet1!$A$6,0,0,n,n)
b  (Matrix b)                                     =OFFSET(Sheet1!$V$6,0,0,n,1)
x  (The solution)                               =MMULT(MINVERSE(A),b)

Note the use of the conditional formatting feature to highlight the cells into which the inputs are to be entered. Data validation is used to ensure that the value entered for n is between 1 and 20.

This tool can be expanded to solve a system of upto 73 linear equations. Excel's matrix functions do not work for matrices beyond that size.