Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168740
Image: ubuntu2004
# 9 (LU decomposition using Sage)
A = matrix(QQ,[[3,1,2],[-9,0,-4],[9,9,14]]);A
[ 3 1 2] [-9 0 -4] [ 9 9 14]
P,L,U = A.LU()
# The matrix P is a permutation matrix that records row swaps, which we did not discuss in class. View P as follows: row1 went to row 2 (since [1,0,0] should be in the first row of an identity matrix but is now in the second row), row2 swapped to row3, and row3 was swapped up to row1. P
[0 0 1] [1 0 0] [0 1 0]
L,U
( [ 1 0 0] [ -9 0 -4] [ -1 1 0] [ 0 9 10] [-1/3 1/9 1], [ 0 0 -4/9] )