Sponsored links: Algebra eBooks
 

Related

identity-kill-matrix-transpose

kill(v1,v2,v2);

v1:[-1,0,1];

v2:[0,1,-1];

Calculate

identity-kill-matrix-transpose

kill(v1,v2,v2);

v1:[-1,0,1];

v2:[0,1,-1];

Calculate

identity

Run Example
(%i1)? mode_identity;

 -- Function: mode_identity (<arg_1>, <arg_2>)
     A special form used with `mode_declare' and `macros' to declare,
     e.g., a list of lists of flonums, or other compound data object.
     The first argument to `mode_identity' is a primitive value mode
     name as given to `mode_declare' (i.e., one of `float', `fixnum',
     `number', `list', or `any'), and the second argument is an
     expression which is evaluated and returned as the value of
     `mode_identity'.  However, if the return value is not allowed by
     the mode declared in the first argument, an error or warning is
     signalled.  The important thing is that the mode of the expression
     as determined by the Maxima to Lisp translator, will be that given
     as the first argument, independent of anything that goes on in the
     second argument.  E.g., `x: 3.3; mode_identity (fixnum, x);'
     yields an error. `mode_identity (flonum, x)' returns 3.3 .  This
     has a number of uses, e.g., if you knew that `first (l)' returned a
     number then you might write `mode_identity (number, first (l))'.
     However, a more efficient way to do it would be to define a new
     primitive,

          firstnumb (x) ::= buildq ([x], mode_identity (number, x));

     and use `firstnumb' every time you take the first of a list of
     numbers.


(%o1)                                true
(%i2) 
Run Example
T:matrix([-lambda, lambda], [mu, -mu]);
                             [ - lambda  lambda ]
(%o1)                        [                  ]
                             [    mu      - mu  ]
(%i2) determinant(T);
(%o2)                                  0
(%i3) %%linsolve_by_lu(T,[0, 0]);
                                 [ - lambda  lambda ]
(%o3)           %%linsolve_by_lu([                  ], [0, 0])
                                 [    mu      - mu  ]
(%i4) A:s*identity(2) - T;
                        [ lambda + 2 s  2 s - lambda ]
(%o4)                   [                            ]
                        [   2 s - mu      2 s + mu   ]
(%i5) Ps: [1, 0].invert(A);
               [                       2 s + mu                        ]
(%o5)  Col 1 = [ ----------------------------------------------------- ]
               [ (2 s + mu) (lambda + 2 s) + (mu - 2 s) (2 s - lambda) ]
                      [                     lambda - 2 s                      ]
              Col 2 = [ ----------------------------------------------------- ]
                      [ (2 s + mu) (lambda + 2 s) + (mu - 2 s) (2 s - lambda) ]
(%i6) M:matrix([-lambda_ac, 0, lambda_ac, 0], [lambda_ba, -(lambda_ba + lambda_bd), 0, lambda_bd], [0, lambda_cb, -lambda_cb, 0], [0, 0, lambda_dc, -lambda_dc]);
      [ - lambda_ac             0              lambda_ac        0      ]
      [                                                                ]
      [  lambda_ba   - lambda_bd - lambda_ba       0        lambda_bd  ]
(%o6) [                                                                ]
      [      0              lambda_cb         - lambda_cb       0      ]
      [                                                                ]
      [      0                  0              lambda_dc   - lambda_dc ]
(%i7) determinant(M);
(%o7) - lambda_ac (lambda_bd lambda_cb lambda_dc
 + (- lambda_bd - lambda_ba) lambda_cb lambda_dc)
 - lambda_ac lambda_ba lambda_cb lambda_dc
(%i8) 
Run Example
kill(v1,v2,v2);
(%o1)                                done
(%i2) v1:[-1,0,1];
(%o2)                             [- 1, 0, 1]
(%i3) v2:[0,1,-1];
(%o3)                             [0, 1, - 1]
(%i4) v3:[4,-2,1];
(%o4)                             [4, - 2, 1]
(%i5) B:[-1,1,2];
(%o5)                             [- 1, 1, 2]
(%i6) MBt:transpose(matrix(v1,v2,v3));
                               [ - 1   0    4  ]
                               [               ]
(%o6)                          [  0    1   - 2 ]
                               [               ]
                               [  1   - 1   1  ]
(%i7) B*identity;
(%o7)                 [- identity, identity, 2 identity]
(%i8) MBinvert:invert(MBt);
                                  [ 1  4  4 ]
                                  [ -  -  - ]
                                  [ 3  3  3 ]
                                  [         ]
                                  [ 2  5  2 ]
(%o8)                             [ -  -  - ]
                                  [ 3  3  3 ]
                                  [         ]
                                  [ 1  1  1 ]
                                  [ -  -  - ]
                                  [ 3  3  3 ]
(%i9) coor:MBinvert*B;
                               [   1    4    4 ]
                               [ - -  - -  - - ]
                               [   3    3    3 ]
                               [               ]
                               [  2    5    2  ]
(%o9)                          [  -    -    -  ]
                               [  3    3    3  ]
                               [               ]
                               [  2    2    2  ]
                               [  -    -    -  ]
                               [  3    3    3  ]
(%i10) 

Related Help

Help for Identity