Sponsored links: Algebra eBooks
 

Related

augcoefmatrix-coefmatrix-col-load-matrix-simpsum-sum

load(linearalgebra);

M : matrix ([1, 2], [...

N : matrix ([-1,3], [...

Calculate

augcoefmatrix

eq1: [y + z = 2];

eq2: [2*x + 3*z = 5];

eq3: [x + y +z = 3];

Calculate

augcoefmatrix-locate_matrix_entry-mat_unblocker-min

eq1: [y + z = 2];

eq2: [2*x + 3*z = 5];

eq3: [x + y +z = 3];

Calculate

augcoefmatrix-display-do-mat_unblocker-max-ptriangularize-rowswap

eq[1]: [y + z = 2];

eq[2]: [2*x + 3*z = 5];

eq[3]: [x + y +z = 3];

Calculate

augcoefmatrix-col-mat_unblocker

eq1: [y + z = 2];

eq2: [2*x + 3*z = 5];

eq3: [x + y +z = 3];

Calculate

augcoefmatrix-mat_unblocker-max

eq1: [y + z = 2];

eq2: [2*x + 3*z = 5];

eq3: [x + y +z = 3];

Calculate

augcoefmatrix-coefmatrix-col-load-matrix-simpsum-sum

load(linearalgebra);

M : matrix ([1, 2], [...

N : matrix ([-1,3], [...

Calculate

augcoefmatrix

A: [x+y+2*z=9, 2*x+4*...

augcoefmatrix(A, [x, ...

Calculate

augcoefmatrix-coefmatrix-col-matrix-simpsum

/* We have to load fi...

/* How to define a ma...

N : matrix ([-1,3], [...

Calculate

augcoefmatrix-display-do-eliminate-mat_unblocker-max-ptriangularize-rowswap-solve

eq[1]: [y + z = 2];

eq[2]: [2*x + 3*z = 5];

eq[3]: [x + y +z = 3];

Calculate

augcoefmatrix

Run Example
(%i1)p: c[1]*x+c[0];
(%o1)                              c  x + c
                                    1      0
(%i2) l1: [0,1,2,3];
(%o2)                            [0, 1, 2, 3]
(%i3) l2: [0,1,3,2];
(%o3)                            [0, 1, 3, 2]
(%i4) eqlist: makelist(subst([x=l1[ii]],p)-l2[ii],ii,1,4);
(%o4)           [c , c  + c  - 1, 2 c  + c  - 3, 3 c  + c  - 2]
                  0   1    0         1    0         1    0
(%i5) m: augcoefmatrix(eqlist,[c[0],c[1]]);
                                 [ 1  0   0  ]
                                 [           ]
                                 [ 1  1  - 1 ]
(%o5)                            [           ]
                                 [ 1  2  - 3 ]
                                 [           ]
                                 [ 1  3  - 2 ]
(%i6) m: triangularize(m);
                                 [ 1  0   0  ]
                                 [           ]
                                 [ 0  1  - 1 ]
(%o6)                            [           ]
                                 [ 0  0  - 1 ]
                                 [           ]
                                 [ 0  0   0  ]
(%i7) 
Run Example
/*	Eileen M. Dioquino	2010-36416	exer 8: Gauss Jordan*//*	Given Equations*/	eq[1]: [3*x1 + 4*x2 + 5*x3 - 2*x4 - 4*x5 = 10];
(%o1)              [- 4 x5 - 2 x4 + 5 x3 + 4 x2 + 3 x1 = 10]
(%i2) 	eq[2]: [-2*x1 - 3*x2 + 4*x3 - 3*x4 + 5*x5 = 8];
(%o2)               [5 x5 - 3 x4 + 4 x3 - 3 x2 - 2 x1 = 8]
(%i3) 	eq[3]: [4*x1 + 2*x2 + 6*x3 - 2*x4 - 5*x5 = 6];
(%o3)              [- 5 x5 - 2 x4 + 6 x3 + 2 x2 + 4 x1 = 6]
(%i4) 	eq[4]: [6*x1 + 2*x2 + 8*x3 - x4 - x5 = 9];
(%o4)                [- x5 - x4 + 8 x3 + 2 x2 + 6 x1 = 9]
(%i5) 	eq[5]: [5*x1 + 3*x2 + 7*x3 + 9*x4 + x5 = 0];
(%o5)                [x5 + 9 x4 + 7 x3 + 3 x2 + 5 x1 = 0]
(%i6) /*	Loop for getting the augmented coeffient matrix of each equations*/	for i: 1 step 1 while i <
 6 do(    		display(M[i]: augcoefmatrix (eq[i], [x1, x2, x3, x4, x5]))	);
                       M  = [ 3  4  5  - 2  - 4  - 10 ]
                        1

                       M  = [ - 2  - 3  4  - 3  5  - 8 ]
                        2

                        M  = [ 4  2  6  - 2  - 5  - 6 ]
                         3

                        M  = [ 6  2  8  - 1  - 1  - 9 ]
                         4

                           M  = [ 5  3  7  9  1  0 ]
                            5

(%o6)                                done
(%i7) /*	Combine matrices to form the main one*/	A: matrix ([M[1]], [M[2]], [M[3]], [M[4]], [M[5]]);
                       [ [ 3  4  5  - 2  - 4  - 10 ]  ]
                       [                              ]
                       [ [ - 2  - 3  4  - 3  5  - 8 ] ]
                       [                              ]
(%o7)                  [  [ 4  2  6  - 2  - 5  - 6 ]  ]
                       [                              ]
                       [  [ 6  2  8  - 1  - 1  - 9 ]  ]
                       [                              ]
                       [     [ 5  3  7  9  1  0 ]     ]
(%i8) 	B: mat_unblocker (A);
                        [  3    4   5  - 2  - 4  - 10 ]
                        [                             ]
                        [ - 2  - 3  4  - 3   5   - 8  ]
                        [                             ]
(%o8)                   [  4    2   6  - 2  - 5  - 6  ]
                        [                             ]
                        [  6    2   8  - 1  - 1  - 9  ]
                        [                             ]
                        [  5    3   7   9    1    0   ]
(%i9) /*	Compare first row elements for first pivoting*/	a: B[1][1];
(%o9)                                  3
(%i10) 	b: B[2][1];
(%o10)                                - 2
(%i11) 	c: B[3][1];
(%o11)                                 4
(%i12) 	d: B[4][1];
(%o12)                                 6
(%i13) 	e: B[5][1];
(%o13)                                 5
(%i14) 	PE: max(a,b,c,d,e);
(%o14)                                 6
(%i15) 	/*get the row number of PE*/	C : rowswap (B, 1, 4);
                        [  6    2   8  - 1  - 1  - 9  ]
                        [                             ]
                        [ - 2  - 3  4  - 3   5   - 8  ]
                        [                             ]
(%o15)                  [  4    2   6  - 2  - 5  - 6  ]
                        [                             ]
                        [  3    4   5  - 2  - 4  - 10 ]
                        [                             ]
                        [  5    3   7   9    1    0   ]
(%i16) 	display(C);
                          [  6    2   8  - 1  - 1  - 9  ]
                          [                             ]
                          [ - 2  - 3  4  - 3   5   - 8  ]
                          [                             ]
                      C = [  4    2   6  - 2  - 5  - 6  ]
                          [                             ]
                          [  3    4   5  - 2  - 4  - 10 ]
                          [                             ]
                          [  5    3   7   9    1    0   ]

(%o16)                               done
(%i17) 	/*normalize matrix*/	for i: 1 step 1 while i <
 6 do(	C[1][i]: C[1][i]/PE	);
(%o17)                               done
(%i18) 	display(C);
                          [       1   4    1    1       ]
                          [  1    -   -  - -  - -  - 9  ]
                          [       3   3    6    6       ]
                          [                             ]
                          [ - 2  - 3  4  - 3   5   - 8  ]
                      C = [                             ]
                          [  4    2   6  - 2  - 5  - 6  ]
                          [                             ]
                          [  3    4   5  - 2  - 4  - 10 ]
                          [                             ]
                          [  5    3   7   9    1    0   ]

(%o18)                               done
(%i19) 
Run Example
m: [2*x + 3*y = 4, 5*x + 6*x = 7];
(%o1)                      [3 y + 2 x = 4, 11 x = 7]
(%i2)  augcoefmatrix (m, [x, y]);
                                [ 2   3  - 4 ]
(%o2)                           [            ]
                                [ 11  0  - 7 ]
(%i3) 

Related Help

Help for Augcoefmatrix