AMATH 301 Lecture Notes - Lecture 8: Matlab, Lead, Lu Decomposition

45 views2 pages
22 Jan 2018
School
Course

Document Summary

% here are some tests to run to check your setup before you attempt to. % if det(a) = 0, solving the solution is basically impossible, probably. % if cond(a) = infinity or large number, problem w equation, likewise. % if rcond(a) = 0, can"t solve system. Basic lu decomposition ax=b a=lu y = l\(p*b) x = u\x. % now, we"re going to learn this method: % where p is a easy to solve matrix, fast to run something like p\b. % we"re going to try to guess x and use the output to see if our guess is. % accurate, which is called the iterative method. % improving our guess based off of the output of the above checks. % if we have the real answer, then x_(k)-x_(k-1) = 0, or x = x_k. % be rounded to an approximation because otherwise would take a very long.