Differences between revisions 1 and 2
Revision 1 as of 2010-12-16 12:27:52
Size: 1173
Editor: 172
Comment: CRAMERS RULE
Revision 2 as of 2010-12-17 12:09:03
Size: 1106
Editor: beesanna
Comment: cramer rule
Deletions are marked like this. Additions are marked like this.
Line 49: Line 49:
   * Shiva Shanker, student,SNIST
   * Vinod Kumar,Student,SNIST
  • Book

    Advanced Engineering Mathematics

    Author

    Erwin Kreyszig

    Edition

    8th Edition

#solutions by using crammers rule
A=matrix([[1,1,1],[-1,2,1],[2,1,-3]])
b=vector([4,8,-9])
C=b.transpose()
print "matrix A is:"
print A
P=A.det()     #det of coefficient matrix
print "print det of A:",p
P=A.augment(C)
print P
P.swap_columns(3,0)  #swap 1st row with 4th column
P1=P[:,:3]
print "matrix P1 is:"
print P1
p1=P1.det()    #det of swapped matrix 
print "print det of P1:"
print p1
P=A.augment(C)
P.swap_columns(3,1)   #swap 2st row with 4th column
P2=P[:,:3]
print "matrix P2 is:",P2
p2=P2.det()     #det of swapped matrix
print "print det of P2:"
print p2
P=A.augment(C)
P.swap_columns(3,2)   #swap 3st row with 4th column
P3=P[:,:3]
print "matrix P3 is:"
print P3
p3=P3.det()
print "print det of P3:",p3
x=p1/p     #to find x value
y=p2/p     #to find x value
z=p3/p     #to find x value
print "values of x,y,z:"
print x,y,z

  • Solution by:

    • Beesanna,student,SNIST

Kreyszig-6.6-3 (last edited 2010-12-17 12:09:03 by beesanna)