Sponsored links: Algebra eBooks
 

Related

genmatrix-makelist-random-row-sqrt

norm(x):=sqrt(x.x);

v:[1,1,1];

a[i,j]:=random(15);

Calculate

genmatrix-lambda-load

load(gf);

gf_set(2,4,x^4+x+1);

p:x^3+x+1;

Calculate

genmatrix-random

a[i,j]:random(15);

genmatrix(a,3,3);

a[i,j]:random(15);

Calculate

genmatrix-mod-quotient

n:4;

etat:genmatrix(e,2^n,n);

for i:1 thru n do ...

Calculate

genmatrix-numer-permanent-random-row-sqrt

a[i,j]:=random(15);

A:genmatrix(a,3,3);

permanent(A);

Calculate

genmatrix-invert-lambda-random

a:genmatrix(lambda([x...

b:invert(a);

a.(a^^-1);

Calculate

genmatrix-lambda

genmatrix(lambda([x,y...

Calculate

genmatrix-random

h[i,j]:=random(4);

A:genmatrix(h,3,3);

A^3;

Calculate

genmatrix-lambda

genmatrix (lambda (...

Calculate

genmatrix-ident-print-random

h[i,j]:=random(2)-2;

I:ident(3);

for i:1 thru 100 do ...

Calculate

genmatrix

Run Example
(%i1)A[i,j]:=i-j;
(%o1)                           A     := i - j
                                 i, j
(%i2) A:genmatrix(A,6,6);
                        [ 0  - 1  - 2  - 3  - 4  - 5 ]
                        [                            ]
                        [ 1   0   - 1  - 2  - 3  - 4 ]
                        [                            ]
                        [ 2   1    0   - 1  - 2  - 3 ]
(%o2)                   [                            ]
                        [ 3   2    1    0   - 1  - 2 ]
                        [                            ]
                        [ 4   3    2    1    0   - 1 ]
                        [                            ]
                        [ 5   4    3    2    1    0  ]
(%i3) A;
                        [ 0  - 1  - 2  - 3  - 4  - 5 ]
                        [                            ]
                        [ 1   0   - 1  - 2  - 3  - 4 ]
                        [                            ]
                        [ 2   1    0   - 1  - 2  - 3 ]
(%o3)                   [                            ]
                        [ 3   2    1    0   - 1  - 2 ]
                        [                            ]
                        [ 4   3    2    1    0   - 1 ]
                        [                            ]
                        [ 5   4    3    2    1    0  ]
(%i4) B;
(%o4)                                  B
(%i5) C:transpose(A)-A;
                       [  0     2    4    6    8   10 ]
                       [                              ]
                       [ - 2    0    2    4    6   8  ]
                       [                              ]
                       [ - 4   - 2   0    2    4   6  ]
(%o5)                  [                              ]
                       [ - 6   - 4  - 2   0    2   4  ]
                       [                              ]
                       [ - 8   - 6  - 4  - 2   0   2  ]
                       [                              ]
                       [ - 10  - 8  - 6  - 4  - 2  0  ]
(%i6) D;
(%o6)                                  D
(%i7) transpose (A)+A;
                             [ 0  0  0  0  0  0 ]
                             [                  ]
                             [ 0  0  0  0  0  0 ]
                             [                  ]
                             [ 0  0  0  0  0  0 ]
(%o7)                        [                  ]
                             [ 0  0  0  0  0  0 ]
                             [                  ]
                             [ 0  0  0  0  0  0 ]
                             [                  ]
                             [ 0  0  0  0  0  0 ]
(%i8) A:matrix([1,5,-2],[-3,0,2]);
                                [  1   5  - 2 ]
(%o8)                           [             ]
                                [ - 3  0   2  ]
(%i9) B:matrix([-3,0,12],[21,1,0]);
                                [ - 3  0  12 ]
(%o9)                           [            ]
                                [ 21   1  0  ]
(%i10) C:matrix([10,8,5],[-7,-2,1]);
                                [ 10    8   5 ]
(%o10)                          [             ]
                                [ - 7  - 2  1 ]
(%i11) 2*A+(1/3)*B-C;
                                [ - 9  2  - 5 ]
                                [             ]
(%o11)                          [      7      ]
                                [  8   -   3  ]
                                [      3      ]
(%i12) A:matrix([1,2,1],[2,1,2],[1,2,3]);
                                  [ 1  2  1 ]
                                  [         ]
(%o12)                            [ 2  1  2 ]
                                  [         ]
                                  [ 1  2  3 ]
(%i13) B:matrix([4,1,1],[-4,2,0],[1,2,1]);
                                 [  4   1  1 ]
                                 [           ]
(%o13)                           [ - 4  2  0 ]
                                 [           ]
                                 [  1   2  1 ]
(%i14) C:matrix([-1,4,3],[11,2,-4],[4,2,3]);
                                [ - 1  4   3  ]
                                [             ]
(%o14)                          [ 11   2  - 4 ]
                                [             ]
                                [  4   2   3  ]
(%i15) D:A.B;
                                [ - 3  7   2 ]
                                [            ]
(%o15)                          [  6   8   4 ]
                                [            ]
                                [ - 1  11  4 ]
(%i16) E:B.A;
                                 [ 7  11   9 ]
                                 [           ]
(%o16)                           [ 0  - 6  0 ]
                                 [           ]
                                 [ 6   6   8 ]
(%i17) D-E;
                              [ - 10  - 4  - 7 ]
                              [                ]
(%o17)                        [  6    14    4  ]
                              [                ]
                              [ - 7    5   - 4 ]
(%i18) F:A.B;
                                [ - 3  7   2 ]
                                [            ]
(%o18)                          [  6   8   4 ]
                                [            ]
                                [ - 1  11  4 ]
(%i19) G:B.C;
                              [ 11   20    11  ]
                              [                ]
(%o19)                        [ 26  - 12  - 20 ]
                              [                ]
                              [ 25   10   - 2  ]
(%i20) F.C-A.G;
                                  [ 0  0  0 ]
                                  [         ]
(%o20)                            [ 0  0  0 ]
                                  [         ]
                                  [ 0  0  0 ]
(%i21) 
Run Example
for n:1 thru 10 do(kill(h),h[i,j]:=random(5)+1,A:genmatrix(h,3,3),X:[x,y,z],b:[random(5)+1,random(5)+1,random(5)+1],C:list_matrix_entries(A.X),R:linsolve([C[1]=b[1],C[2]=b[2],C[3]=b[3]], [x,y,z]),print(C[1]=b[1],C[2]=b[2],C[3]=b[3],R));
5 z + 3 y + 3 x = 4 2 z + 5 y + x = 1 4 z + y + 5 x = 1 
                                                          23        5       3
                                                   [x = - --, y = - --, z = -] 
                                                          24        24      2
5 z + 2 y + x = 5 5 z + 5 y + x = 4 5 z + 2 y + 3 x = 5 
                                                                    1      17
                                                      [x = 0, y = - -, z = --] 
                                                                    3      15
2 z + 2 y + 2 x = 4 2 z + y + 4 x = 2 5 z + 5 y + 3 x = 1 
                                                          9                27
                                                     [x = -, y = 11, z = - --] 
                                                          2                2
3 z + 4 y + 4 x = 2 2 z + 5 y + 4 x = 1 3 z + y + x = 5 [x = - 2, y = 1, z = 2]
                                                                               
4 z + 3 y + 3 x = 3 2 z + y + 4 x = 5 2 z + 2 y + 3 x = 2 
                                                                            3
                                                       [x = 1, y = - 2, z = -] 
                                                                            2
2 z + 2 y + 5 x = 4 z + 3 y + 4 x = 1 2 z + 3 y + 3 x = 3 
                                                         2         7       24
                                                    [x = --, y = - --, z = --] 
                                                         11        11      11
2 z + 5 y + 5 x = 4 z + 5 y + 2 x = 5 4 z + 4 y + 4 x = 1 
                                                         1       43        11
                                                  [x = - --, y = --, z = - --] 
                                                         36      36        12
3 z + 4 y + 2 x = 1 5 z + y + 4 x = 3 5 z + 5 y + 5 x = 2 
                                                         1         6       17
                                                  [x = - --, y = - --, z = --] 
                                                         25        25      25
z + 2 y + 3 x = 1 5 z + 2 y + 5 x = 2 3 z + y + 4 x = 4 
                                                        23        5        9
                                                   [x = --, y = - -, z = - --] 
                                                        10        2        10
2 z + 3 y + 2 x = 5 4 z + 3 y + 4 x = 4 3 z + 5 y + 2 x = 1 
                                                           15
                                                      [x = --, y = 2, z = - 8] 
                                                           2
(%o1)                                done
(%i2) 
Run Example
r:15;
(%o1)                                 15
(%i2)  n1:5;
(%o2)                                  5
(%i3)  n2:3;
(%o3)                                  3
(%i4) v:[1,1,1];
(%o4)                              [1, 1, 1]
(%i5) norm(x):=sqrt(x.x);
(%o5)                       norm(x) := sqrt(x . x)
(%i6) for i:1 thru n1 do  (a[i,j]:=random(r),   A:genmatrix(a,n2,n2),   c:[row(A,1).v], d:[transpose(col(A,1)).v], kill(a));
(%o6)                                done
(%i7)  c;
(%o7)                                [28]
(%i8) d;
(%o8)                                [21]
(%i9) 
[addcol,addrow,diff,do,ev,genmatrix,invert,kill,load,matrix,plot2d,romberg,sqrt,submatrix] [addcol,addrow,diff,ev,genmatrix,invert,kill,length,lmax,lmin,load,matrix,plot2d,romberg,sqrt,submatrix] [addrow,do,genmatrix,kill,linsolve,print,random] [addrow,genmatrix,linsolve_params,print,random,tex1,true] [addrow,genmatrix,linsolve_params,random,true] [append,block,col,do,genmatrix,if,matrixmap,mod,quotient,transpose] [apply,args,block,col,copymatrix,do,genmatrix,map,mod,quotient,return,transpose] [apply,args,block,copymatrix,do,genmatrix,map,mod,quotient,return,transpose] [apply,draw,draw2d,ematrix,genmatrix,load,makelist] [binomial,block,delta,determinant,do,expand,genmatrix,hipow,kron_delta,lambda,length,makelist,part,return,sum] [binomial,block,delta,determinant,do,expand,genmatrix,hipow,kron_delta,makelist,part,print,return,subst] [binomial,block,delta,determinant,do,expand,genmatrix,hipow,kron_delta,makelist,part,print,return,sum] [binomial,block,delta,determinant,do,expand,genmatrix,kron_delta,return] [binomial,block,delta,determinant,expand,genmatrix,hipow,kron_delta,listofvars,makelist,part,sum] [binomial,block,delta,determinant,expand,genmatrix,kron_delta,lambda,makelist,subst,sum] [binomial,block,delta,determinant,expand,genmatrix,return,subst] [binomial,block,genmatrix,return] [binomial,delta,determinant,genmatrix,kron_delta,lambda,minor] [binomial,delta,genmatrix,kron_delta,subst] [binomial,delta,genmatrix,kron_delta] [binomial,genmatrix,invert] [binomial,genmatrix] [block,do,genmatrix,if,map,matrix,mod,quotient,transpose] [block,do,genmatrix,mod,quotient,return] [block,genmatrix,if,map,matrix,mod,print,quotient,transpose] [ceiling,col,do,endcons,float,genmatrix,kill,makelist,min,permanent,print,random,row,sort,sqrt,transpose] [ceiling,do,float,genmatrix,kill,permanent,print,random,row,sqrt] [col,do,endcons,genmatrix,kill,print,random,row,sqrt,transpose] [col,genmatrix,min,numer,permanent,print,random,row,sort,sqrt,transpose] [col,genmatrix,min,numer,permanent,random,row,sort,sqrt,transpose] [determinant,genmatrix,invert,lambda,log,matrix,plot2d,plot3d,transpose] [diff,genmatrix,integrate] [distrib,genmatrix,load,random_normal] [do,first,genmatrix,kill,makelist,min,ordergreatp,permanent,permutations,print,random,rest,row,sort,sum] [do,genmatrix,kill,linsolve,print,random,tex1] [do,genmatrix,kill,linsolve,print,random] [draw,draw2d,ematrix,genmatrix,load,makelist] [draw,draw2d,genmatrix,load,makelist] [echelon,genmatrix,lambda,random,row] [echelon,genmatrix,lambda,random] [genmatrix,ident,print,random] [genmatrix,if,lambda] [genmatrix,invert,lambda,random] [genmatrix,lambda,load] [genmatrix,lambda,random,sum] [genmatrix,lambda] [genmatrix,numer,permanent,random,row,sqrt] [genmatrix,permanent,random] [genmatrix,random] [genmatrix]

Related Help

Help for Genmatrix