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 151 
     
    Example: Calculate the transpose of matrix B. Matrix B was set in 
    preceding examples to 
     
     
    Keystrokes Display 
    l > B b 2 3 Displays descriptor of 
    2×3 matrix B. 
    ´ > 4  b 3 2 Descriptor of 3×2 
    transpose. 
    Matrix B (which you can view using l B in User mode) is now 
     
    Scalar Operations 
    Scalar  operations  perform  arithmetic  operations  between  a  scalar  (that  is,  a 
    number)  and  each  element  of  a  matrix.  The  scalar  and  the  descriptor  of  the 
    matrix must be placed in the X- and Y-registers – in either order. (Note that 
    the register position will affect the outcome of the - and ÷ functions.) 
    The  resulting  values  are  stored  in  the  corresponding  elements  of  the  result 
    matrix. 
    The possible operations are shown in the following table..954
    321
    
    B .
    93
    52
    41
    
    
    
    
    
    
    B  
    						
    							152 Section 12: Calculating with Matrices 
     
     
    Operation 
    Elements of Result Matrix* 
    Matrix in Y-Register Scalar in Y-Register 
    Scalar in X-Register Matrix in X-Register 
    + Adds scalar value to each matrix element. 
    * Multiplies each matrix element by scalar value. 
    - Subtracts scalar value 
    from each matrix 
    element. 
    Subtracts each matrix 
    element from scalar value. 
    ÷ Divides each matrix 
    element by scalar value. 
    Calculates inverse of matrix 
    and multiplies each element 
    by scalar value. 
    * Result matrix may be the specified matrix. 
    Example: Calculate the matrix B = 2A. then subtract 1 from every element 
    in B. From before, use 
     
    . 
    Keystrokes Display 
    ´ A A 2 3 Displays descriptor of matrix A. 
    2 * b 2 3 Redimensions matrix B to the 
    same dimensions as A, multiplies 
    the elements of A by 2, stores 
    those values in the corresponding 
    elements of B, and displays the 
    descriptor of the result matrix. 
    
    954
    321A  
    						
    							 Section 12: Calculating with Matrices 153 
     
     
    Keystrokes Display 
    1 - b 2 3 Subtracts 1 from the elements of 
    matrix B and stores those values in the 
    same elements of B. 
     
    The result (which you can view using lB in User mode) is 
    . 
    Arithmetic Operations 
    With matrix descriptors in both the X- and Y-registers, pressing + or 
    - calculates the sum or difference of the matrices. 
    Pressing Calculates* 
    + Y + X 
    - Y - X 
    * Result is stored in result matrix. 
    Result matrix may be X or Y 
    Example: Calculate C = B - A, where A and B are defined in the previous 
    example. 
     
    Keystrokes Display 
    ´< C    Designates C as result matrix. 
    l> B b 2 3 Recalls descriptor of matrix B. 
    (This step can be skipped if 
    descriptor is already in X-register.) 
    l> A A 2 3 Recalls descriptor of matrix A into 
    X-register, moving descriptor of 
    matrix B to Y-register. 
    
    
    1797
    531B . and  1797
    531
    954
    321
    
    
    
    
    
    
    
    BA  
    						
    							154 Section 12: Calculating with Matrices 
     
     
    Keystrokes 
     
    Display 
       
    - C 2 3 Calculates B - A and stores 
    values in redimensioned result 
    matrix C. 
    The result is  
    Matrix Multiplication 
    With  matrix  description  in  both  the  X- and  Y-registers,  you  can  calculate 
    three  different  matrix  products.  The  table  below  shows  the  results  of  the 
    three  functions  for  a  matrix X specified  in  the X-register  and  a  matrix Y 
    specified  in  the  Y-register.  The  matrix X-1 is  the  inverse  of X,  and  the 
    matrix YT is the transpose of Y. 
     
    Pressing Calculates* 
    * YX 
    ´ > 5 YTX 
    ÷ X-1Y 
    *  Result  is  stored  in  result  matrix.  For ÷,  the 
    result matrix can be Y but not X. For the others, 
    the result matrix must be other than X or Y. 
    Note: When  you  use  the ÷ function  to  evaluate  the  expression 
    A-1B, you must enter the matrix descriptors in the order B, A rather 
    than in the order that they appear in the expression.* 
    The  value  stored  in  each  element  of  the  result  matrix  is  determined 
    according to the usual rules of matrix multiplication. 
    For > 5, the  matrix  specified  in  the  Y-register  isnt  changed  by  this 
    operation,  even  though  its  transpose  is  used.  The  result  is  identical  to  that 
    obtained using > 4 (transpose) and *. 
                                                               * This is the same order you would use if you were entering b and a for evaluating a-1b = b/a 
    
    843
    210C  
    						
    							 Section 12: Calculating with Matrices 155 
     
    For ÷,  the  matrix  specified  in  the  X-register  is  replaced  by  its LU 
    decomposition.  The ÷ function  calculates X–1Y using  a  more  direct 
    method than does ∕ and *, giving the  result faster and  with improved 
    accuracy. 
    Example: Using  matrices A and B from  the  previous  example,  calculate 
    C = AT B. 
     
    Keystrokes Display 
    l>
    A 
    A 2 3 Recalls descriptor for matrix A. 
    l>
    B 
    b 2 3 Recalls descriptor for matrix B 
    into X-register, moving matrix 
    A descriptor into Y-register. 
    ´< 
    C 
    b 2 3 Designates matrix C as result 
    matrix. 
    ´> 5 C 3 3 Calculates AT B and stores 
    result in matrix C, which is 
    redimensioned to 3×3. 
    The result, matrix C, is 
    . 
     
    
    
    
    
    
    
    1797
    531
    954
    321  and  BA 
    
    
    
    
    
    
    1689066
    955137
    733929
    C  
    						
    							156 Section 12: Calculating with Matrices 
     
    Solving the Equation AX = B 
    The ÷ function is useful for solving 
    matrix  equations  of  the  form AX  =  B, 
    where A is the  coefficient  matrix, B is 
    the  constant  matrix,  and X is  the 
    solution  matrix.  The  descriptor  of  the 
    constant matrix B should be entered in 
    the Y-register and the descriptor of the 
    coefficient matrix A should be entered 
    in  the  X-register  Pressing ÷ then 
    calculates the solution X=A-1B.* 
    Remember  that  the ÷ function  replaces  the  coefficient  matrix  by  its LU 
    decomposition  and  that  this  matrix  must  not  be  specified  as  the  result 
    matrix.  Furthermore,  using ÷ rather  than ∕ and * gives  a  solution 
    faster and with improved accuracy. 
    At  the  beginning  of  this  section,  you  found  the  solution  for  a  system  of 
    linear  equations  in  which  the  constant  matrix  and  the  solution  matrix  each 
    had one column. The following example illustrates that you can use the HP-
    15C  to  find  solutions  for  more  than  one  set  of  constants—that  is,  for  a 
    constant matrix and solution matrix with more than one column. 
     
    Example: Looking at his receipts for his 
    last  three  deliveries  of  cabbage  and 
    broccoli, Silas Farmer sees the following 
    summary. 
                                                               * If A is a singular matrix (that is, one that doesn’t have an inverse), then the HP-15C modifies the LU form of  A  by  an  amount  that  is  usually  small  compared  to  round-off  error.  The  calculated  solution  corresponds to that for a nonsingular coefficient matrix close to the original, singular matrix. 
    Y constant matrix 
    X coefficient 
    matrix 
       
    						
    							 Section 12: Calculating with Matrices 157 
     
     
     Week 
    1 2 3 
    Total Weight (kg) 274 233 331 
    Total Value $120.32 $112.96 $151.36 
    Silas  knows  that  he  received  $0.24 per  kilogram  for  his  cabbage  and  $0.86 
    per  kilogram  for  his  broccoli.  Use  matrix  operations  to  determine  the 
    weights of cabbage and broccoli he delivered each week. 
    Solution: Each  weeks  delivery  represents  two  linear  equations  (one  for 
    weight  and  one  for  value)  with  two  unknown  variables  (the  weights  of 
    cabbage and broccoli). All three weeks can be handled simultaneously using 
    the matrix equation 
      =  
    or     AD = B 
    where the first row of matrix D is the weights of cabbage for the three 
    weeks and the second row is the weights of broccoli. 
    Keystrokes Display  
    2 
    v´mA 
    2.0000 Dimensions A as 2×2 matrix. 
    ´> 1 2.0000 Sets row and column numbers in R0 
    and R1 to 1. 
    ´U 2.0000 Activates User mode. 
    1 OA 1.0000 Stores a11. 
    OA 1.0000 Stores a12. 
    .24 OA 0.2400 Stores a21. 
    .86 OA 0.8600 Stores a22. 
    2 v 3 
    ´mB 
    3.0000 Dimensions B as 2×3 matrix. 
    
    
    0.860.24
    11 
    
    
    232221
    1312
    ddd
    ddd11 
    
    
    151.36112.96120.32
    331233274  
    						
    							158 Section 12: Calculating with Matrices 
     
     
    Keystrokes Display  
    274 OB 274.0000 Stores b11.* 
    233 OB 233.0000 Stores b12. 
    331 OB 331.0000 Stores b13. 
    120.32 OB 120.3200 Stores b21. 
    112.96 OB 112.9600 Stores b22. 
    151.36 OB 151.3600 Stores b23. 
    ´< Á 151.3600 Designates matrix D as result 
    matrix. 
    l> B b 2 3 Recalls descriptor of constant 
    matrix. 
    l> A A 2 2 Recalls descriptor of coefficient 
    matrix A into X-register, moving 
    descriptor of constant matrix B 
    into Y-register. 
    ÷ d 2 3 Calculates A-1B and stores result 
    in matrix D. 
    lÁ 186.0000 Recalls d11, the weight of cabbage 
    for the first week. 
    lÁ 141.0000 Recalls d12 the weight of cabbage 
    for the second week. 
    lÁ 215.0000 Recalls d13. 
    lÁ 88.0000 Recalls d21. 
    lÁ 92.0000 Recalls d22. 
    lÁ 116.0000 Recalls d23. 
    ´U 116.0000 Deactivates User mode. 
                                                               * Note that you did not need to press ´> 1 before beginning to store the elements of matrix B. This is  because  after  you  stored  the  last  element  of  matrix A,  the  row  and  column  numbers  in  R0 and  R1 were automatically reset to 1.  
    						
    							 Section 12: Calculating with Matrices 159 
     
    Silas deliveries were: 
     Week 
     1 2 3 
    Cabbage (kg) 186 141 215 
    Broccoli (kg) 88 92 116 
    Calculating the Residual 
    The HP-15C enables you to calculate the residual, that is, the matrix 
    Residual = R–YX 
    where R is  the  result  matrix  and X and Y are  the  matrices  specified  in  the 
    X- and Y-registers. 
    This  capability  is  useful,  for  example,  in  doing  iterative  refinement  on  the 
    solution  of  a  system  of  equations  and  for  linear  regression  problems.  For 
    example, if C is a possible solution for AX = B, then B – AC indicates how 
    well  this  solution  satisfies  the  equation.  (Refer  to  the HP-15C  Advanced 
    Functions  Handbook for  information  about  iterative  refinement  and  linear 
    regression.) 
    The  residual  function  (> 6)  uses  the  current  contents  of  the  result 
    matrix  and  the  matrices  specified  in  the X- and Y-registers  to  calculate  the 
    residual defined above. The residual is stored in the result matrix, replacing 
    the original result matrix. A matrix specified in the X- or Y-register can not 
    be the result matrix. 
    Using > 6  rather  than * and - gives  a  result  with  improved 
    accuracy, particularly if the residual is small compared to the matrices being 
    subtracted. 
    To calculate the residual: 
    1. Enter the descriptor of the Y matrix into the Y-register. 
    2. Enter the descriptor of the X matrix into the X-register. 
    3. Designate the R matrix as the result matrix. 
    4. Press ´> 6. The residual replaces the original result 
    matrix (R). The descriptor of the result matrix is placed in the X-
    register.  
    						
    							160 Section 12: Calculating with Matrices 
     
    Using Matrices in LU Form 
    As noted  earlier,  two  matrix  operations  (calculating  a  determinant  and 
    solving  the  matrix  equation  (AX  =  B)  create  an LU decomposition  of  the 
    matrix  specified  in  the  X-register.  The  descriptor  of  such  a  matrix  has  two 
    dashes  following  the matrix  name. A matrix  in LU form  has  elements  that 
    differ from the elements of the original matrix. 
    However, the descriptor for a matrix in LU form can be used in place of the 
    descriptor for the original  matrix for operations involving the inverse of the 
    matrix  and  for  the  determinant  operation. That  is,  either  the  original  matrix 
    or its LU decomposition can be used for these operations: 
    ∕  
    ÷ for the matrix in the X-register 
    > 9 
    For  these  three  functions,  using  the LU form  of  the  matrix  to  be  inverted 
    gives a result that is identical to that using the original matrix. 
    As an example, if you solved the  matrix equation AX  = B, matrix A would 
    be changed to its LU form. If you wanted to change  the B matrix and solve 
    the equation again, you could do so without changing the A matrix – the LU 
    matrix will give the correct solution. 
    For all other matrix operations, a  matrix that is an LU decomposition is not 
    recognized  as  representing  its  original  matrix.  Instead,  the  elements  of  the 
    LU matrix  are  used  just  as  they  appear  in  matrix  memory  and  the  result  is 
    not the result you would obtain using the original matrix. 
    Calculations With Complex Matrices 
    The  HP-15C  enables  you  to  perform  matrix  multiplication  and  matrix 
    inversion  with  complex  matrices  (that  is,  matrices  whose  elements  are 
    complex  numbers)  and  to  solve  systems  of  complex  equations  (that  is, 
    equations whose coefficients and variables are complex). 
    However,  the  HP-15C  stores  and  operates  on  only  real  matrices.  The 
    capability  of  doing  calculations  with  complex  matrices  is  completely 
    independent  of  the  capability  of  doing  calculations  with  complex  numbers 
    described  in  the  preceding  section.  You  don’t need  to  activate  Complex 
    mode for calculations with complex matrices.  
    						
    All HP manuals Comments (0)