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+.

    							 Appendix D: A Detailed Look at _ 231 
     
    If Error 8 is displayed as a result of a search that 
    is  concentrated  in  a  local  ―flat‖  region  of  the 
    function, the estimates in the  X- and Y-registers 
    will  be  relatively  close  together  or  extremely 
    small.  Execute _ again  using  for  initial 
    estimates  the  numbers  from  the  X- and  Y-
    registers  (or  perhaps  two  numbers  somewhat 
    further apart). If the magnitude of the function is 
    neither  a  minimum  nor  constant,  the  algorithm 
    will  eventually  expand  its  search  and  find  a 
    more significant result.  
    Example: Investigate the behavior of the function 
     
    as evaluated in the following subroutine. 
    Keystrokes Display  
    |¥ 000– Program mode. 
    ´ b .0 001–42,21,.0  
    | a 002–   43 16  
    “  003–      16 . 
     004–      12  
    ® 005–      34 Bring x-value into X-register. 
    | x 006–   43 11 . 
    * 007–      20  
     008–      12  
    2 009–       2  
    * 010–      20 . 
    “  011–      16  
    ® 012–      34 Bring x-value into X-register. 
    | a 013–   43 16  
    “  014–      16  
    1 015–       1  
    0 016–       0  xexxeexf223)(10/ xe xex2 xexe22   
    						
    							232 Appendix D: A Detailed Look at _ 
     
    Keystrokes Display  
    ÷ 017–      10  
     018–      12  
    + 019–      40 . 
    3 020–       3  
    +  021–      40 . 
    |n 022–   43 32  
    Use _ with the following single initial estimates: 10, 1, and 10-20. 
    Keystrokes Display  
    |¥  Run mode. 
    10 v 10.0000 Single estimate. 
    ´ _ .0 Error 8  
    − 455.335 Best x-value. 
    )  48,026,721.85 Previous value. 
    ) 1.0000 Function value. 
    | (| ( 455.4335 Restore the stack. 
    ´ _.0 Error 8  
    − 48,026,721.85 Another x-value 
    )) 1.0000 Same function value 
    (an asymptote). 
    1 v 1.0000 Single estimate. 
    ´ _.0 Error 8  
    − 2.1213 Best x-value. 
    )  2.1471 Previous value. 
    ) 0.3788 Function value. 
    | (| (   2.1213 Restore the stack. 
    ´ _.0 Error 8  
    −  2.1213 Same x-value. 
    ) )  0.3788 Same function value 
    (a minimum). 
    ‛ “ 20 
    v 
    1.0000    –20 Single estimate. 
       .10/x xexexe2210/ xexexe2210/3  
    						
    							 Appendix D: A Detailed Look at _ 233 
     
    Keystrokes Display  
    ´ _.0 Error 8  
    − 1.0000    –20 Best x-value. 
    )  1.1250    –20 Previous value. 
    ) 2.0000 Function value. 
    | (| (   1.0000    –20 Restore the stack. 
    ´ _ .0 Error 8  
    − 1.1250    –20 Another x-value. 
    )  1.5626    –16 Previous value. 
    )  2.0000 Same function value. 
    In  each  of  the  three  cases, _ initially 
    searched for a root in a direction suggested by 
    the  graph  around  the  initial  estimate.  Using 
    10  as  the  initial  estimate, _ found  the 
    horizontal  asymptote  (value  of  1.0000). 
    Using 1 as the initial estimate, a  minimum of 
    0.3788  at x =  2.1213  was  found.  Using  10–20 
    as  the  initial  estimate,  the  function  was 
    essentially  constant  (at  a  value  of  2.0000)  for 
    the small range of x that was sampled. 
    Finding Several Roots 
    Many  equations  that  you  encounter  have  more  than  one  root.  For  this 
    reason,  you  will  find  it  helpful  to  understand  some  techniques  for  finding 
    several roots of an equation. 
    The  simplest  method for finding several  roots is to direct the  root search in 
    different  ranges  of x where  roots  may  exist.  Your  initial  estimates  specify 
    the  range  that  is  initially  searched.  This  method  was  used  for  all  examples 
    in section 13. You can often find the roots of an equation in this manner. 
    Another method is known as deflation. Deflation is a method by which roots are 
    eliminated from an equation. This involves modifying the equation so that the 
    first roots found are no longer roots, but the rest of the roots remain roots. 
    If  a  function f(x) has  a  value  of  zero  at x = a,  then  the  new  function      
    f(x)/(x – a)  will  not  approach  zero  in  this  region  (if a is  a  simple  root  of 
    f(x) =  0).  You  can  use  this  information  to  eliminate  a  known  root.  Simply   
    						
    							234 Appendix D: A Detailed Look at _ 
     
    add a few program lines at  the end of your function subroutine. These lines 
    should  subtract  the  known  root  (to 10 significant  digits)  from  the x-value 
    and  divide  this  difference  into  the  function  value.  In  many  cases  the  root 
    will  be  a  simple  one,  and  the  new  function  will  direct _ away  from 
    the  known  root. On  the  other  hand,  the  root  may  be  a multiple  root. A 
    multiple  root  is  one  that  appears  to  be  present  repeatedly,  in  the  following 
    sense: at such a root, not only does the graph of f(x) cross the x-axis, but its 
    slope  (and  perhaps  the  next  few  higher-order  derivatives)  also  equals  zero. 
    If  the  known  root  of  your equation  is  a  multiple  root,  the  root  is  not 
    eliminated  by  merely  dividing  by  the  factor  described  above.  For  example, 
    the equation 
    f(x) = x(x – a)3 = 0 
    has  a  multiple  root  at x = a (with  a  multiplicity  of  3).  This  root  is  not 
    eliminated  by  dividing f(x) by (x – a).  But  it  can  be  eliminated  by  dividing 
    by (x – a)3. 
    Example: Use deflation to help find the roots of 
    60x4 – 944x3 + 3003x2 + 6171x – 2890 = 0. 
    Using Horners method, this equation can be rewritten in the form 
    (((60x – 944)x + 3003)x + 6171)x – 2890 = 0. 
    Program a subroutine that evaluates the polynomial. 
    Keystrokes Display  
    |¥ 000- Program mode. 
    ´ CLEAR 
    M 
    000-  
    ´b2 001-42,21, 2  
    6 002–       6  
    0 003–       0  
    * 004–      20  
    9 005–       9  
    4 006–       4  
    4 007–       4   
    						
    							 Appendix D: A Detailed Look at _ 235 
     
       
    Keystrokes Display  
    - 008–      30  
    * 009–      20  
    3 010–       3  
    0 011–       0  
    0 012–       0 
    3 013–       3 
    + 014–      40 
    * 015–      20 
    6 016–       6 
    1 017–       1 
    7 018–       7 
    1 019–       1 
    + 020–      40 
    *  021–      20 
    2 022–       2 
    8 023–       8 
    9 024–       9 
    0 025–       0 
    - 026–      30 
    |n 027–   43 32 
    In  Run  mode,  key  in  two  large,  negative  initial  estimates  (such  as -10  and  
    -20) and use _ to find the most negative root. 
    Keystrokes Display  
    |¥  Run mode. 
    10 “ v –10.0000 Initial estimates. 20 “ –20 
    ´ _ 2 –1.6667 First root. 
    O 0 –1.6667 Stores root for deflation. 
    ) )  4.0000  –06 Function value near zero. 
      
    						
    							236 Appendix D: A Detailed Look at _ 
     
    Return  to  Program  mode  and  add  instructions  to  your  subroutine  to 
    eliminate the root just found. 
    Keystrokes Display   
    |¥ 000-  Program mode. 
    | ‚ | 
    ‚ 
    026– 30  Line before n. 
    ® 027– 34  Brings x into X-register. 
    l 0 028– 45  0  Divides by (x –=a), where 
    a is known root. - 029– 30 
    ÷ 030– 10 
    Now use the same initial estimates to find the next root. 
    Keystrokes Display   
    |¥  4.0000 -06  Run mode. 
    10 “ v –10.0000  Same initial estimates. 20 “ –20 
    ´ _ 2  0.4000  Second root. 
    O 1  0.4000  Stores root for deflation. 
    ) )  0.0000  Deflated function value. 
    Now modify your subroutine to eliminate the second root. 
    Keystrokes Display  
    |¥ 000- Program mode. 
    | ‚ | 
    ‚ 
    030–     10 Line before n. 
    ® 031–     34 Brings x into X-register. 
    l 1 032–  45  1  
    - 033–     30 Deflation for second root. 
    ÷ 034–     10  
     
      
    						
    							 Appendix D: A Detailed Look at _ 237 
     
    Again, use the same initial estimates to find the next root. 
    Keystrokes Display  
    |¥  0.0000 Run mode. 
    10 “ v –10.0000 Same initial estimates. 20 “ –20 
    ´ _ 2  8.4999 Third root. 
    O 2  8.4999 Stores root for deflation. 
    ) ) –1.0929  –07 Deflated  function  value  near 
    zero. 
    Now change your subroutine to eliminate the third root. 
    Keystrokes Display   
    |¥ 000–  Program mode. 
    | ‚ | 
    ‚ 
    034– 10 Line before n. 
    ® 035– 34 Brings x into X-register. 
    l 2 036- 45  2  
    - 037– 30 Deflation for third root. 
    ÷ 038– 10  
    Find the fourth root. 
    Keystrokes Display   
    |¥ –1.0929  –07   
    10 “ v –10.0000  Same initial estimates. 20 “ –20 
    ´ _ 2  8.5001  Fourth root. 
    O 3  8.5001  Stores root for reference. 
    ) ) –0.0009  Deflated  function  value 
    near zero.  
    						
    							238 Appendix D: A Detailed Look at _ 
     
    Using  the  same  initial  estimates  each 
    time, you have found four roots for this 
    equation  involving  a  fourth-degree 
    polynomial.  However,  the  last  two 
    roots  are  quite  close  to  each  other  and 
    are  actually  one  root  (with  a 
    multiplicity  of  2).  That  is  why  the  root 
    was  not  eliminated  when  you  tried 
    deflation  once  at  this  root.  (Round-off 
    error  causes  the  original  function  to 
    have small positive and negative  values 
    for  values  of x between  8.4999  and 
    8.5001;  for x =  8.5  the  function  is 
    exactly zero.)  
    In general, you will not know in advance the multiplicity of the root you are 
    trying to eliminate. If, after you have attempted to eliminate a root, _ 
    finds that same root again, you can proceed in a number of ways: 
     Use  different  initial  estimates  with  the  deflated  function  in  an 
    attempt to search for a different root. 
     Use  deflation  again  in  an  attempt  to  eliminate  a  multiple  root.  If 
    you  do  not  know  the  multiplicity  of  the  root,  you  may  need  to 
    repeat this a number of times. 
     Examine  the  behavior  of  the  deflated  function  at x-values  near  the 
    known  root.  If  the  functions  calculated  values  cross  the x-axis 
    smoothly, either another root or a greater multiplicity is indicated. 
     Analyze  the  original  function  and  its  derivatives  algebraically.  It 
    may  be  possible  to  determine  its  behavior  for x-values  near  the 
    known  root.  (A  Taylor  series  representation,  for  example,  may 
    indicate the multiplicity of a root.) 
    Limiting the Estimation Time 
    Occasionally,  you  may  desire  to  limit  the  time  used  by _ to  find  a 
    root.  You  can  use  two possible  techniques  to  do  this – counting  iterations 
    and specifying a tolerance.   
    						
    							 Appendix D: A Detailed Look at _ 239 
     
    Counting Iterations 
    While searching  for a root, _ typically  samples  your function at least 
    a  dozen  times.  Occasionally, _ may  need  to  sample  it  one  hundred 
    times or more. (However, _ will always stop by itself.) Because  your 
    function  subroutine  is executed  once  for  each  estimate  that  is  tried,  it  can 
    count  and  limit  the  number  of  iterations.  An easy  way  to  do  this  is  with  an 
    I instruction to accumulate  the  number  of  iterations  in  the  Index 
    register (or other storage register). 
    If you store an appropriate number in the register before using _, your 
    subroutine can interrupt the _ algorithm when the limit is exceeded. 
    Specifying a Tolerance 
    You  can  shorten  the  time  required  to  find  a  root  by  specifying  a  tolerable 
    inaccuracy  for  your  function.  Your  subroutine  should  return  a  function 
    value  of  zero  if  the  calculated  function  value  is  less  than  the  specified 
    tolerance. This tolerance that  you  specify  should correspond to a  value that 
    is  negligible  for  practical  purposes  or  should  correspond  to  the  accuracy  of 
    the  computation.  This  technique  eliminates  the  time  required  to  define  the 
    estimate  more  accurately  than  is  justify  by  the  problem.  The  example  on 
    page 224 uses this method.) 
    For Advanced Information 
    In  the HP-15C  Advanced  Functions  Handbook, additional,  advanced 
    techniques  and  applications  for  using _ are  presented.  These  topics 
    include: 
     Using _ with polynomials. 
     Solving a system of equations. 
     Finding local extremes of a function. 
     Using _ for financial problems. 
     Using _ in Complex mode. 
     Solving an equation for its complex roots.  
    						
    							 
    240 
    Appendix E 
    A Detailed Look at f 
    Section 14, Numerical Integration, presented the basic information you need 
    to  use f This  appendix  discusses  more  intricate  aspects  of f that  are 
    of interest if you use f often. 
    How f Works 
    The f algorithm calculates the integral of a  function f(x) by computing a 
    weighted  average  of  the  functions  values  at  many  values  of x (known  as 
    sample points)  within the  interval  of integration. The  accuracy of the  result 
    of  any  such  sampling  process  depends on  the  number  of  sample  points 
    considered: generally,  the  more  sample  points,  the  greater  the  accuracy.  If 
    f(x) could be evaluated at an infinite number of sample points, the algorithm 
    could – neglecting  the  limitation  imposed  by  the  inaccuracy  in  the 
    calculated function f(x) – provide an exact answer. 
    Evaluating the  function at an infinite number of sample points would take a 
    very  long  time  (namely,  forever).  However,  this  is  not  necessary,  since  the 
    maximum  accuracy  of  the  calculated  integral  is  limited by  the  accuracy  of 
    the calculated function values. Using only a finite number of sample points, 
    the  algorithm  can  calculate  an  integral  that  is  as  accurate  as  is  justified 
    considering the inherent uncertainty in f(x). 
    The f algorithm  at  first  considers  only  a  few  sample  points,  yielding 
    relatively inaccurate  approximations. If these approximations are  not  yet as 
    accurate as the accuracy of f(x) would permit, the algorithm is iterated (that 
    is,  repeated)  with  a  larger  number  of  sample  points.  These  iterations 
    continue,  using  about  twice  as  many  sample  points  each  time,  until  the 
    resulting  approximation  is  as  accurate  as  is  justified  considering  the 
    inherent uncertainty in f(x).  
    						
    All HP manuals Comments (0)

    Related Manuals for HP 15c Manual