Home > HP > Calculator > HP 15c Manual

HP 15c Manual

    Download as PDF Print this page Share this page

    Have a look at the manual HP 15c Manual online for free. It’s possible to download the document as PDF or print. UserManuals.tech offer 1114 HP manuals and user’s guides for free. Share the user manual or guide on Facebook, Twitter or Google+.

    							 Section 12: Calculating with Matrices 141 
     
    Matrix inversion, for example, can be performed on an 8×8 matrix with real 
    elements (or on a 4×4 matrix with complex elements, as described later*). 
    To conserve memory, all matrices are initially dimensioned as 0×0. When a 
    matrix  is  dimensioned  or  redimensioned,  the  proper  number  of  registers  is 
    automatically  allocated  in  memory.  You  may  have  to  increase  the  number 
    of  registers  allocated  to  matrix  memory  before  dimensioning  a  matrix  or 
    before  performing  certain  matrix operations.  Appendix  C  describes  how 
    memory  is  organized,  how  to  determine  the  number  of  registers  currently 
    available  for  storing  matrix  elements,  and  how  to  increase  or  decrease that 
    number. 
    Dimensioning a Matrix 
    To  dimension  a  matrix  to  have y rows  and x columns,  place  those  numbers 
    in  the  Y- and  X-registers,  respectively,  and  then  execute ´ m 
    followed by the letter key specifying the matrix: 
    1. Key the  number of rows (y) into 
    the  display,  then  press v 
    to lift it into the Y-register. 
      
    Y   number of 
    rows 
    2. Key  the  number  of  columns  (x) 
    into the X-register. 
    X number of 
    columns 3. Press ´ m followed  by  a 
    letter  key, A through E, 
    that  specifies  the  name  of  the 
    matrix.†===
                                                              =* The  matrix  functions  described  in  this  section  operate  on  real  matrices  only.  (In  Complex  mode,  the imaginary  stack  is  ignored  during  matrix  operation.)  However,  the  HP-15C  has  four  matrix  functions  that enable you to calculate using real representations of complex matrices, as described on pages 160-173. †=You dont need to press ´ before the letter key. (Refer to Abbreviated Key Sequences on page 78.)  
    						
    							142 Section 12: Calculating with Matrices 
     
    Example: Dimension matrix A to be a 2×3 matrix. 
    Keystrokes Display  
    2 v 2.0000 Keys number of rows into  
    Y-register. 
    3 3 Keys number of columns into X-
    register. 
    ´mA 3.0000 Dimensions matrix A to be 2×3. 
    Displaying Matrix Dimensions 
    There are two ways you can display the dimensions of a matrix: 
     Press l > followed by the letter key specifying the 
    matrix. The calculator displays the name of the matrix at the left, 
    and the number of rows followed by the number of columns at the 
    right. 
     Press l m followed by the letter key specifying the 
    matrix. The calculator places the number of rows in the Y-register 
    and the number of columns in the X-register. 
    Keystrokes Display  
    l > B b     0  0 Matrix B has 0 rows and 0 
    columns, since it has not been 
    dimensioned otherwise. 
    l m A 3.0000 Number of columns in A. 
    ® 2.0000 Number of rows in A. 
    Changing Matrix Dimensions 
    Values  of  matrix  elements  are  stored  in  memory  in  order  from  left  to  right 
    along each row, from the first row to the last. If you redimension a matrix to 
    a  smaller  size, the required  values  are  reassigned  according  to  the  new 
    dimensions  and  the  extra  values  are  lost.  For  example,  if  the  2×3  matrix 
    shown at the left below is redimensioned to 2×2, then 
       
    						
    							 Section 12: Calculating with Matrices 143 
     
    If  you  redimension a  matrix  to  a  larger  size,  elements  with  the  value  0  are 
    added  at  the  end  as  required  by  the  new  dimensions.  For  example,  if  the 
    same 2×3 matrix is re dimensioned, to 2×4, then 
     
    When  you  have  finished  calculating  with  matrices,  youll  probably  want  to 
    redimension  all  five  matrices  to 0×0,  so  that  the  registers  used  for  storing 
    their  elements  will  be  available  for  program  lines  or  for  other  advanced 
    functions.  You  can  redimension  all  five  matrices  to  0×0  at  one  time  by 
    pressing ´ > 0.  (You  can  dimension  a  single  matrix  to  0×0  by 
    pressing 0 ´ m {A through E}.) 
    Storing and Recalling Matrix Elements 
    The  HP-15C  provides  two  ways  of  storing  and  recalling  values  of  matrix 
    elements.  The  first  method  allows  you  to  progress  through  all  of  the 
    elements  in  order.  The  second  method  allows  you  to  access  elements 
    individually. 
    Storing and Recalling All Elements in Order 
    The  HP-15C  normally  uses  storage  registers R0 and 
    R1 to  indicate  the  row  and  column  numbers  of  a 
    matrix  element.  If  the  calculator  is  in  User  mode, 
    the  row  and  column  numbers  are automatically 
    incremented  as  you  store  or  recall  each  matrix 
    element,  from  left  to  right  along  each  row  from  the 
    first row to the last. 
    To  set  the  row  and  column  numbers  in  R0 and  R1 to  row  1,  column  1, 
    press ´ > 1.    
    						
    							144 Section 12: Calculating with Matrices 
     
    To store or recall sequential elements of a matrix: 
    1. Be sure the matrix is properly dimensioned. 
    2. Press ´ >1.  This  stores  1  in  both  storage  registers  R0 and 
    R1, so that elements will be accessed starting at row 1, column 1. 
    3. Activate  User  mode  by  pressing ´ U.  With  the  calculator  in 
    User  mode,  after  each  element  is  stored  or  recalled  the  row  number 
    in R0 or the column number in R1 is automatically incremented by 1, 
    as shown in the example following. 
    4. If  you  are  storing  elements,  key  in  the  value  of  the  element  to  be 
    stored in row 1, column 1. 
    5. Press O or l followed  by  the  letter  key  specifying  the 
    matrix. 
    6. Repeat  steps  4  and  5  for  all  elements  of  the  matrix.  The  row  and 
    column numbers are incremented according to the dimensions of the 
    matrix you specify. 
    While  the  letter  key  specifying  the  matrix  is  held  down  after O or 
    l is pressed, the calculator displays the name of the matrix followed by 
    the  row and column  numbers  of the  element  whose  value  is being stored or 
    recalled.  If  the  letter  key  is  held  down  for  longer  than  about  3  seconds,  the 
    calculator  displays null,  doesnt  store  or  recall  the  element  value,  and 
    doesnt  increment  the  row  and  column  numbers.  (Also,  the  stack  registers 
    arent changed.) 
    After the  last element of the  matrix has been accessed, the row and column 
    numbers both return to 1. 
    Example: Store  the  values  shown  below  in  the  elements  of  the  matrix A 
    dimensioned above. (Be sure matrix A is dimensioned to 2×3.) 
     
    
    
    
    654
    321
    232221
    131211
    aaa
    aaaA   
    						
    							 Section 12: Calculating with Matrices 145 
     
     
    Keystrokes Display  
    ´ > 1  Sets beginning row and column 
    numbers in R0 and R1 to 1. 
    (Display shows the previous 
    result.) 
    ´ U  Activates User mode. 
    1 O A A    1,1 Row 1, column 1 of A. 
    (Displayed momentarily while 
    A key held down.) 
     1.0000 Value of a11. 
    2 O A 2.0000 Value of a12. 
    3 O A 3.0000 Value of a13. 
    4 O A 4.0000 Value of a21. 
    5 O A 5.0000 Value of a22. 
    6 O A 6.0000 Value of a23. 
    lA A    1,1 Recalls element in row 1, 
    column l. (R0 and R1 were reset 
    in preceding step.) 
     1.0000 Value of a11. 
    l A 2.0000 Value of a12. 
    l A 3.0000 Value of a13. 
    l A 4.0000 Value of a21. 
    l A 5.0000 Value of a22. 
    l A 6.0000 Value of a23. 
    ´ U 6.0000 Deactivates User mode. 
    Checking and Changing Matrix Elements Individually 
    The  calculator  provides  two  ways  to  check  (recall)  and  change  (store)  the 
    value of a particular matrix element. The first method uses storage registers 
    R0 and  R1 in  the  same  way  as  described  above – except  that  the  row  and 
    column  numbers  arent  automatically  changed  when  User  mode  is 
    deactivated.  The  second  method  uses  the  stack  to  define  the  row  and 
    column numbers.  
    						
    							146 Section 12: Calculating with Matrices 
     
    Using  R0 and R1. To  access  a  particular  matrix  element,  store  its  row 
    number  in  R0 and  its  column  number  in  R1.  These  numbers  wont  change 
    automatically (unless the calculator is in User mode). 
     To  recall  the  element  value  (after  storing  the  row and  column 
    numbers),  press l followed  by  the  letter  key  specifying  the 
    matrix. 
     To  store  a  value  in  that  element  (after  storing  the  row  and  column 
    numbers),  place  the  value  in  the  X-register  and  press O 
    followed by the letter key specifying the matrix. 
    Example: Store  the  value  9 as the element  in row 2, column 3 of  matrix A 
    from the previous example. 
    Keystrokes Display  
    2 O 0 2.0000 Stores row number in R0. 
    3 O 1 3.0000 Stores column number in R1. 
    9 9 Keys the new element value into 
    the X-register. 
    O A A    2,3 Row 2, column 3 of A. 
     9.0000 Value of a23. 
    Using the Stack. You can use the stack registers to specify a particular matrix 
    element. This eliminates the need to change the numbers in R0 and R1. 
     To  recall  an  element  value,  enter  the  row  number  and  column 
    number  into  the  stack  (in  that  order).  Then  press l | 
    followed by the letter key specifying the matrix. The element value 
    is  placed  in  the  X-register.  (The  row  and  column  numbers  are  lost 
    from the stack.) 
     To  store  an  element  value,  first  enter  the value  into  the  stack 
    followed  by  the  row  number  and  column  number.  Then  press 
    O | followed  by  the  letter  key  specifying  the  matrix.  (The 
    row and column numbers are lost from the stack; the element value 
    is returned to the X-register.) 
    Note  that  these  are the  only operations in  which the  blue | key precedes 
    a gold letter key.  
    						
    							 Section 12: Calculating with Matrices 147 
     
    Example: Recall  the  element  in  row  2,  column  1  of  matrix A from  the 
    previous example. Use the stack registers. 
    Keystrokes Display  
    2 v 1 1 Enters row number into Y-
    register and column number into 
    X-register. 
    l | A 4.0000 Value of a21. 
    Storing a Number in All Elements of a Matrix 
    To  store  a  number  in  all  elements  of  a  matrix,  simply  key  that  number  into 
    the  display, then press O> followed by the letter key specifying 
    the matrix. 
    Matrix Operations 
    In  many  ways,  matrix  operations  are  like  numeric  calculations.  Numeric 
    calculations require you to specify the numbers to be used; often you define 
    a register for storing the result. Similarly, matrix calculations require you to 
    specify  one  or  two  matrices  that  you  want  to  use.  A  matrix descriptor is 
    used  to  specify  a  particular  matrix.  For  many  calculations,  you  also  must 
    specify a matrix for storing the result. This is the result matrix. 
    Because matrix operations usually require many individual calculations, the 
    calculator flashes the running display during most matrix operations. 
    Matrix Descriptors 
    Earlier in this section you saw that when you press l > followed 
    by a letter key specifying a matrix, the name of the matrix appears at the left 
    of  the  display  and  the  number  of  rows  followed  by  the  number  of  columns 
    appears at  the  right.  The  matrix name  is called the descriptor of the  matrix. 
    Matrix descriptors can be moved among the stack and data storage registers 
    just  like  a  number – that  is,  using O, l, v,  etc.  Whenever  a 
    matrix  descriptor  is  displayed  in  the  X-register,  the current dimensions  of 
    that matrix are shown with it. 
    You  use  matrix  descriptors  to  indicate  which  matrices  are  used  in  each 
    matrix operation. The  matrix  operations discussed in the rest of this section  
    						
    							148 Section 12: Calculating with Matrices 
     
    operate  on  the  matrices  whose  descriptors  are  placed  in  the  X-register  and 
    (for some operations) the Y-register. 
    Two  matrix  operations – calculating  a  determinant  and  solving  the  matrix 
    equation AX = B – involve  calculating  an LU decomposition  (also  known 
    as  an LU  factorization)  of  the  matrix  specified  in  the  X-register.* A  matrix 
    that is an LU decomposition is signified by two dashes following the matrix 
    name  in  the  display  of  its  descriptor.  (Refer  to  page  160  for  using  a  matrix 
    in LU form.) 
    The Result Matrix 
    For many operations discussed in this section, you need to define the matrix 
    in  which  the  result  of  the  operation  should  be  stored.  This  matrix  is  called 
    the result matrix. 
    Other matrix operations do not use or affect the result matrix. (This is noted 
    in  the  descriptions  of  these  operations.)  Such  an  operation  either  replaces 
    the  original  matrix  with the  result of  the  operation (if  the result is a  matrix, 
    such  as  a  transpose)  or  returns  a  number  to  the  X-register  (if  the  result  is  a 
    number, such as a row norm). 
    Before  you  perform  an  operation  that  uses  the  result  matrix,  you  must 
    designate  the  result  matrix.  Do  this  by  pressing ´ < followed  by 
    the  letter  key  specifying  the  matrix,  (If  the  descriptor  of  the  intended  result 
    matrix  is  already  in  the  X-register,  you  can  press O< instead.) 
    The designated matrix remains the result matrix until another is designated.†=
    To display the descriptor of the result matrix, press l 
    						
    							 Section 12: Calculating with Matrices 149 
     
    While the key used for any matrix operation that stores a result in the result 
    matrix  is  held  down,  the  descriptor  of  the  result  matrix  is  displayed.  If  the 
    key  is  released  within  about  3  seconds,  the  operation  is  performed,  and  the 
    descriptor  of  the  result  matrix  is  placed  in  the  X-register.  If  the  key  is  held 
    down  longer,  the  operation  is  not  performed  and  the  calculator  displays 
    null. 
    Copying a Matrix 
    To  copy  the  elements  of  a  matrix  into  the  corresponding elements  of 
    another matrix, use the O > sequence: 
    1. Press l > followed  by  the  letter  key  specifying  the 
    matrix  to  be  copied.  This  enters  the  descriptor  of  the  matrix  into 
    the display. 
    2. Press O> followed  by  the  letter  key  specifying  the 
    matrix to be copied into. 
    If the matrix specified after l does not have the same dimensions as the 
    matrix  specified  after O,  the  second  matrix  is  redimensioned  to  agree 
    with  the  first.  The  matrix  specified  after O need  not  already  be 
    dimensioned. 
    Example: Copy matrix A from the previous example into matrix B. 
    Keystrokes Display 
    l> 
    A  
    A 2 3 Displays descriptor of 
    matrix to be copied. 
    O> 
    B  
    A 2 3 Redimensions matrix B and 
    copies A into B. 
    l> 
    B 
    b 2 3 Displays descriptor of new 
    matrix B. 
    One-Matrix Operations 
    The  following  table shows  functions  that  operate  on  only  the  matrix 
    specified  in  the  X-register.  Operations  involving  a  single  matrix  plus  a 
    number  in  another  stack  register  are  described  under  Scalar  Operations 
    (page 151).  
    						
    							150 Section 12: Calculating with Matrices 
     
    One-Matrix Operations: 
    Sign Change, Inverse, Transpose, Norms, Determinant 
    Keystroke(s) Result in  
    X-register 
    Effect on Matrix 
    Specified in  
    X-register 
    Effect on Result 
    Matrix 
    “ No change. Changes sign of 
    all elements. 
    None. ‡ 
    ∕ 
    (´∕ in 
    User Mode) 
    Descriptor of 
    result matrix. 
    None. ‡ Inverse of 
    specified matrix. 
    § 
    ´> 4 Descriptor of 
    transpose. 
    Replaced by 
    transpose. 
    None. ‡ 
    ´> 7 Row norm of 
    specified 
    matrix.* 
    None. None. 
    ´> 8 Frobenius or 
    Euclidean norm 
    of specified 
    matrix. † 
    None. None. 
    ´> 9 Determinant of 
    specified 
    matrix. 
    None.‡ LU decomposi-
    tion of specified 
    matrix.§ 
    * The  row  norm  is  the  largest  sum  of  the  absolute  values  of  the  elements  in 
    each row of the specified matrix. 
    † The  Frobenius  of  Euclidean  norm  is  the  square  root  of  the  sum  of  the 
    squares of all elements in the specified matrix. 
    ‡ Unless the result matrix is the same matrix specified in the X-register. 
    § If the specified matrix is a singular matrix (that is, one that doesn’t have an 
    inverse),  then  the  HP-15C  modifies  the LU form  by  an  amount  that  is 
    usually small compared to round-off error. For ∕, the calculated inverse 
    is the inverse of a matrix close to the original, singular matrix. (Refer to the  
    HP-15C Advanced Functions Handbook for further information.)  
    						
    All HP manuals Comments (0)