Module (4): Finding Roots of System of Equations using Excel and MATLAB

 














4.   LU Factorization Method

In this method, the coefficient matrix [A] is a multiplication result of its upper matrix [U] and Lower matrix [L] i.e. [A]=[U]*[L]. Since [A]*{x}={b}, then [U]*[L]*{x}={b}.Recall that [U]*{x}={D}, then [L]*{D}={b}, so {D} can be computed. Last step is that since [U]*{x}={D}, then {x} can be computed as well





Using MatLab to determine the roots of a system of linear Equation Using LU Factorization Method

Thanks to (lu) function in MatLab, LU factorization method can be executed quickly with shortcodes as follows:


5.   Gauss-Seidel Method

Gauss-Seidel is the most common iterative method used to find roots of a system if linear equations. If the equations are diagonally non-zero (preferably diagonally predominant), then the first equation can be solved for (x1) and the second equation can be solved for (x2), and the third equation can be solved for the (x3) and so on. To start the iteration, all x’s are zeros. These zeros are substituted to solve (x1), then this (x1) is used to solve (x2), then (x1 and x2) are used to solve the (x3), and so on.

To illustrate this


Note that these equations are not diagonally predominant. In order to get them diagonally dominant, equation 2 should come first, and equation 3 come next.




Using MatLab to determine the roots of linear Equations using Gauss-Seidel.

In order to compute Gauss-Seidel in MatLab, modifications in the equation should be done first








Part (2): System of Nonlinear Equations

In contrast to linear equations, nonlinear equations are curves, and their solution is the intersection of these curves.

System of nonlinear equations can be solved by different methods, but here we will focus on Newton Raphson and Excel Solver Methods.

 

1.   Computing the Nonlinear roots using Newton Raphson Method

For a single nonlinear equation, Newton Raphson Law is


In order to solve this equation by Calculator or MatLab Function, this equation must be simplified 

Manually by Calculator.

The equation can be rearranged to be


 









2. Using Excel Solver to determine the roots of Nonlinear Equations

Excel Solver can be used efficiently to find the roots of a system on the nonlinear equation. But in order to solve two equations at once, we have to choose one equation to be the main equation while adding the other one to as a constraint equation=0




No comments:

Post a Comment

Welcome to Practical Numerical Methods for Scientists and Engineers. This Blog contains modules that cover numerical methods topics Module (...