Differences between revisions 1 and 2
Revision 1 as of 2010-12-16 12:23:31
Size: 516
Editor: sree123
Comment:
Revision 2 as of 2010-12-18 10:58:18
Size: 545
Editor: sai kumar
Comment: exception of LU decomposition
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:
we need to interchange the rows and then perform l*u==a

a = matrix([[0,2], [ 3 ,4]])
a.swap_rows(0,1)print a
u = matrix([[1,2], [ 0, 2]])
l = matrix([[1,0], [ 3, 1]])
a==l*u

output

[3 4]
[0 2]
False
A=([[0,2],[3,4]])
Z=matrix(2,2)
var('x,y')
L=matrix([[1,0],[x,1]])
U=matrix([[1,y],[0,1]])
Z=L*U
for i in range(2):
    for j in range (2):
        Z[i][j]==A[i][j]
f = function('f', x)
f = L
print f(3)
g=function('g',y)
g=U
print g(2)
R=f(3)*g(2)
print R
bool(R==A)
Line 26: Line 31:
   * <Shravan sanghishetty>, <Student>, <vignan>
   * <karthik.p>, <Student>, <Vignan>
   * <sridhar.b>,<student>,<Vignan>
   * guna,student,snist
   *sadhana,student,snist
   * sai kumar,student,mriet
  • Book

    Linear Algebra

    Author

    Gilbert Strang

    Edition

A=([[0,2],[3,4]])
Z=matrix(2,2)
var('x,y')
L=matrix([[1,0],[x,1]])
U=matrix([[1,y],[0,1]])
Z=L*U
for i in range(2):
    for j in range (2):
        Z[i][j]==A[i][j]
f = function('f', x)
f = L
print f(3)
g=function('g',y)
g=U
print g(2)
R=f(3)*g(2)
print R
bool(R==A)

  • Solution by:

    • guna,student,snist
    • sadhana,student,snist
    • sai kumar,student,mriet

Strang-1.5-2 (last edited 2010-12-18 10:58:18 by sai kumar)