Homework 15

$24.99 $18.99

LU Factorization (with Partial Pivoting) Algo-rithm Development Rules / Suggestions The following rules apply to ALL of our Algorithm Development Problems. These are helpful when you are testing your function and we will grade you on them. You must use the correct function name. Check number of function inputs and outputs (vector and scalar inputs)…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:
Tags:

Description

5/5 – (2 votes)

LU Factorization (with Partial Pivoting) Algo-rithm Development

Rules / Suggestions

The following rules apply to ALL of our Algorithm Development Problems. These are helpful when you are testing your function and we will grade you on them.

  1. You must use the correct function name.

  1. Check number of function inputs and outputs (vector and scalar inputs)

  1. Clear variables in workspace prior to running tests

  1. If variable names are not given, use appropriate and consistent names

  1. Check function for all possible number of inputs (use nargin during devel-opment to catch errors)

  2. Run algorithm for at least 2 different input values

  1. Check algorithm does not produce extraneous output

  1. Comment code for readability

LU Factorization Algorithm

Develop a MATLAB function that determines the LU Factorization of a square matrix. Your algorithm must use partial pivoting. You must name the function luFactor to recieve credit.

For full credit, you must include appropriate error checking. If you are confused about what would be appropriate or have questions, feel free to come to office hours!

Inputs:

  • A – coefficient matrix Outputs:

  • L – lower triangular matrix

  • U – upper triangular matrix

  • P – the pivot matrix

FOR TESTING PURPOSES ONLY

Perform LU Factorization on the following system of equations 10x1 + 2x2x3 = 27

3x1 − 6x2 + 2x3 = −61.5

x1 + x2 + 5x3 = −21.5

Then, multiply the resulting [L] and [U] matrices to determine that [A] is produced.

2

Homework 15
$24.99 $18.99