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 13: Finding the Roots of an Equation 181 
     
    The basic rules for using _ are: 
    1. In  Program  mode,  key  in  a  subroutine  that  evaluates  the  function 
    f(x) that  is to be  equated to zero. This subroutine  must begin  with a 
    label instruction (´b label) and end up with a result for f(x) in 
    the X-register. 
     In Run mode: 
    2. Key two initial estimates of the  desired root,  separated by v, 
    into  the  X- and  Y-registers.  These  estimates  merely  indicate  to  the 
    calculator  the  approximate  range  of x in  which  it  should  initially 
    seek a root of f(x) = 0. 
    3. Press ´ _ followed  by  the  label  of  your  subroutine.  The 
    calculator  then  searches  for  the  desired  zero  of  your  function  and 
    displays the result. If the function that you are analyzing equals zero 
    at  more than  one  value  of x, the  routine  will  stop  when  it  finds  any 
    one  of  those  values.  To  find  additional  values,  you  can  key  in 
    different initial estimates and use _ again. 
    Immediately before _ addresses your subroutine it places a value of x 
    in the X-, Y-, Z-, and T-registers. This value is then used by your subroutine 
    to  calculate f(x). Because  the  entire  stack  is  filled  with  the x-value,  this 
    number  is  continually  available  to  your  subroutine.  (The  use  of  this 
    technique is described on page 41). 
    Example: Use _ to find the values of x for which 
    f(x) = x2 –3x – 10 = 0. 
    Using  Horners  method  (refer  to  page  79),  you  can  rewrite f(x) so  that  it  is 
    programmed more efficiently: 
    f(x) = (x – 3)x – 10. 
    In Program mode, key in the following subroutine to evaluate f(x). 
    Keystrokes Display  
    |¥ 000- Program mode. 
    ´ CLEAR M 000- Clear program memory.  
    						
    							182 Section 13: Finding the Roots of an Equation 
     
    Keystrokes Display  
    ´ b 0 001–42,21, 0 Begin with b instruction. 
    Subroutine assumes stack 
    loaded with x. 
    3 002–       3  
    - 003–      30 Calculate x – 3. 
    * 004–      20 Calculate (x – 3)x. 
    1 005–       1  
    0 006–       0  
    - 007–      30 Calculate (x – 3)x – 10. 
    | n 008–   43 32  
    In  Run  mode,  key  two  initial  estimates  into  the  X- and  Y-registers. 
    Try estimates of 0 and 10 to look for a positive root. 
    Keystrokes Display*  
    | ¥  Run mode. 
    0 v 0.0000 Initial estimates. 10 10 
    You can now find the desired root by pressing ´_ 0. When you do 
    this, the calculator will not display the answer right away. The HP-15C uses 
    an  iterative  algorithm†=to= estimate= the  root.  The  algorithm= analyzes= your=
    function by sampling it many times, perhaps a dozen times or more. It does=
    this= by= repeatedly= executing  your= subroutine.  Finding  a  root= will= usually 
    require  about 2  to= 10= seconds;  but  sometimes  the  process  will= require  even=
    more time.=
    Press ´_ 0  and  sit  back  while  your  HP-15C  exhibits  one  of  its 
    powerful  capabilities.  The  display  flashes running while _ is 
    operating. 
                                                               * Press ´• 4  to  obtain  the  displays  shown  here.  The  display  setting  does  not  influence  the  operation of _. †=An=algorithm is a step-by-step procedure for solving a mathematical problem. An iterative algorithm is one containing a portion that is executed a number of times in the process of solving the problem.  
    						
    							 Section 13: Finding the Roots of an Equation 183 
     
     
    Keystrokes Display  
    ´_ 0 5.0000 The desired root. 
    After  the  routine  finds  and  displays  the  root,  you  can  ensure  that the 
    displayed number is indeed a root of f(x) = 0 by checking the stack. You have 
    seen  that  the  display  (X-register)  contains  the desired  root.  The  Y-register 
    contains a previous estimate of the root, which should be very close to the 
    displayed  root.  The Z-register  contains  the  value  of  your  function 
    evaluated at the displayed root. 
    Keystrokes Display  
    ) 5.0000 A previous estimate of the root. 
    ) 0.0000 Value of the function at the 
    root showing that f(x) = 0. 
    Quadratic  equations,  such as  the  one  you  are  solving,  can  have  two roots. If 
    you  specify  two  new  initial  estimates,  you  can  check  for  a second  root.  Try 
    estimates of 0 and -10 to look for a negative root. 
    Keystrokes Display  
    0 v  0.0000 Initial estimates. 10 “ –10 
    ´ _ 0 –2.0000 The second root. 
    ) –2.0000 A previous estimate of the 
    root. 
    )  0.0000 Value of f(x) at second root.  
    						
    							184 Section 13: Finding the Roots of an Equation 
     
    You  have  now  found  the  two  roots  of f(x) 
    =  0.  Note  that  this  quadratic  equation 
    could have been solved algebraically – and 
    you  would  have  obtained  the  same  roots 
    that you found using _. 
    GGr 
    The  convenience  and  power  of  the _ key  become  more  apparent 
    when  you  solve  an  equation  for  a  root  that  cannot  be  determined 
    algebraically. 
    Example: Champion  ridget  hurler  Chuck 
    Fahr  throws  a  ridget  with  an  upward 
    velocity  of  50  meters/second.  If  the  height 
    of the ridget is expressed as 
    h = 5000(1 – e–t/20) – 200t, 
    how  long  does  it  take  for  it  to  reach  the 
    ground  again?  In  this  equation, h is  the 
    height in meters and t is the time in seconds. 
    Solution: The desired solution is the positive value of t at which h = 0. 
    Use the following subroutine to calculate the height. 
    Keystrokes Display  
    | ¥ 000–  
    ´ bA 001–42,21,11 Begin with label. 
    2 002–       2 Subroutine assumes t is 
    loaded in X-and Y-registers. 
    0 003–       0  
    ÷ 004–      10  
     
     
        
    						
    							 Section 13: Finding the Roots of an Equation 185 
     
    Keystrokes Display  
    “ 005–       16 – t / 20. 
     006–       12  
    “ 007–       16 – e– t / 20. 
    1 008–        1  
    + 009–       40 1 – e– t / 20. 
    5 010–        5  
    0 011–        0  
    0 012–        0  
    0 013–        0  
    * 014–       20 5000 (1 – e– t / 20). 
    ® 015–       34 Brings another t-value 
      into X-register. 
    2 016–        2  
    0 017–        0  
    0 018–        0  
    * 019–       20 200t. 
    - 020–       30 5000(1 – e– t / 20) – 200t. 
    | n 021–    43 32  
    Switch to Run mode, key in two initial estimates of the time (for example, 5 
    and 6 seconds) and execute _. 
    Keystrokes Display  
    |¥  Run mode. 
    5 v 5.0000 Initial estimates. 6 6 
    ´_A 9.2843 The desired root. 
    Verify the root by reviewing the Y- and Z-registers. 
     
    Keystrokes Display  
    ) 9.2843 A previous estimate of the root. 
    ) 0.0000 Value of the function at the root 
    showing that h = 0.  
    						
    							186 Section 13: Finding the Roots of an Equation 
     
    Fahrs  ridget  falls  to  the  ground 
    9.2843  seconds  after  he  hurls  it—a 
    remarkable toss. 
    When No Root Is Found 
    You  have  seen  how  the _ key  estimates  and  displays  a  root of  an 
    equation of the form f(x) = 0. However, it is possible that an equation has no 
    real roots (that is, there is no  real value  of x for  which  the  equality is true). 
    Of  course,  you  would  not  expect  the  calculator  to  find  a  root  in  this  case. 
    Instead, it displays Error 8. 
    Example: Consider the equation 
    |x| = – 1. 
    which  has  no  solution  since  the  absolute 
    value  function  is  never  negative.  Express 
    this equation in the required form 
    |x| + 1 = 0 
    and  attempt  to  use _ to  find  a 
    solution. 
    G
    r
    G 
    Keystrokes Display  
    | ¥ 000– Program mode. 
    ´b 1 001–42,21, 1  
    | a 002–   43 16  
    1 003–       1  
    + 004–      40  
    | n 005–   43 32     
    						
    							 Section 13: Finding the Roots of an Equation 187 
     
    Because  the  absolute-value  function  is  minimum  near  an  argument  of  zero, 
    specify  the  initial  estimates  in  that  region,  for  instance  1  and -1.  Then 
    attempt to find a root. 
    Keystrokes Display  
    | ¥  Run mode. 
    1 v  1.0000 Initial estimates. 1 “ –1 
    ´ _ 1  Error 8 This display indicates that no 
    root was found. 
    −  0.0000 Clear error display. 
    As  you  can  see,  the  HP-15C  stopped  seeking  a  root  of f(x) = 0  when  it 
    decided that none existed – at least not in the  general range of x to  which it 
    was initially directed. The Error 8 display does not indicate that an ―illegal‖ 
    operation has been attempted; it merely states that no root was found where 
    _ presumed one might exist (based on your initial estimates). 
    If  the  HP-15C  stops  seeking  a  root  and  displays  an  error  message,  one  of 
    these three types of conditions has occurred: 
     If  repeated  iterations  all  produce  a  constant  nonzero  value  for  the 
    specified function, execution stops with the display Error 8. 
     If  numerous  samples  indicate  that  the magnitude of  the  function 
    appears  to  have  a  nonzero  minimum  value  in  the  area being 
    searched, execution stops with the display Error 8. 
     If an improper argument is used in a mathematical operation as part 
    of your subroutine, execution stops with the display Error 0. 
    In the case of a constant function value, the routine can see no indication of 
    a tendency for the value to move toward zero. This can occur for a function 
    whose  first  10  significant  digits  are  constant  (such  as  when  its  graph  levels 
    off  at  a  nonzero  horizontal  asymptote)  or  for  a  function  with  a  relatively 
    broad, local ―flat‖ region in comparison to the range of x-values being tried. 
    In the case where the functions magnitude reaches a nonzero minimum, the 
    routine  has  logically  pursued  a  sequence  of  samples  for  which  the 
    magnitude  has  been  getting  smaller.  However,  it has  not  found  a  value  of 
    x at which the functions graph touches or crosses the x-axis.  
    						
    							188 Section 13: Finding the Roots of an Equation 
     
    The final case points out a potential deficiency in the subroutine rather than 
    a limitation of the root-finding routine. Improper operations may sometimes 
    be  avoided  by  specifying  initial  estimates  that  focus  the  search  in  a  region 
    where such an outcome will not occur. However, the _ routine is very 
    aggressive  and  may  sample  the  function  over  a  wide  range.  It  is  a  good 
    practice  to  have  your  subroutine  test  or  adjust  potentially  improper 
    arguments prior to performing an operation (for instance, use a prior to 
    ¤). Rescaling variables to avoid large numbers can also be helpful. 
    The  success  of  the _ routine  in  locating  a  root  depends  primarily 
    upon  the  nature  of  the  function it  is  analyzing  and  the  initial  estimates  at 
    which it begins searching. The mere existence of a root does not ensure that 
    the  casual  use  of  the _ key  will  find  it.  If  the  function f(x) has  a 
    nonzero  horizontal  asymptote  or  a  local  minimum  of  its  magnitude,  the 
    routine can be expected to find a root of f(x) = 0 only if the initial estimates 
    do not concentrate the search in one of these unproductive regions—and, of 
    course, if a root actually exists. 
    Choosing Initial Estimates 
    When  you  use _ to  find  the  root of  an  equation,  the  two  initial 
    estimates  that  you  provide  determine  the  values  of  the  variable x at  which 
    the routine begins its search. In general, the likelihood that you will find the 
    particular root you are seeking increases with the level of understanding that 
    you  have  about  the  function  you  are  analyzing.  Realistic,  intelligent 
    estimates greatly facilitate the determination of a root. 
    The initial estimates that you use may be chosen in a number of ways: 
    If  the  variable x has  a  limited  range  in  which it  is  conceptually  meaningful 
    as  a  solution,  it  is  reasonable  to  choose  initial  estimates  within  this  range. 
    Frequently  an  equation  that  is  applicable  to  a  real  problem  has,  in  addition 
    to  the  desired  solution,  other  roots  that  are  physically  meaningless. These 
    usually  occur  because  the  equation  being  analyzed  is  appropriate  only 
    between certain limits of the  variable. You should recognize  this restriction 
    and interpret the results accordingly.  
    						
    							 Section 13: Finding the Roots of an Equation 189 
     
    If you have some knowledge of the behavior of the function f(x) as it varies 
    with different values of x, you are in a position to specify initial estimates in 
    the  general  vicinity  of  a  zero  of  the  function.  You  can  also  avoid  the  more 
    troublesome  ranges  of x such  as  those  producing  a  relatively  constant 
    function value or a minimum of the functions magnitude. 
    Example: Using  a  rectangular  piece 
    of  sheet  metal  4  decimeters  by  8 
    decimeters,  an  open-top  box  having  a 
    volume  of  7.5  cubic  decimeters  is  to 
    be  formed.  How  should  the  metal  be 
    folded?  (A  taller  box  is  preferred to  a 
    shorter one.) 
    Solution: You  need  to  find  the  height 
    of  the  box  (that  is,  the  amount  to  be 
    folded up along each of the four sides) 
    that gives the specified volume. If x is 
    the  height  (or  amount  folded  up),  the 
    length  of  the  box  is  (8 – 2x)  and  the  width  is  (4 – 2x).  The  volume V is 
    given by 
    V = (8 – 2x)(4 – 2x) x. 
    By expanding the expression and then using Horners method (page 79), this 
    equation can be rewritten as 
    V = 4 ((x –  6) x + 8) x. 
    To get V= 7.5, find the values of x for which 
    f(x) = 4 ((x – 6) x + 8) x – 7.5 = 0. 
    The following subroutine calculates f(x): 
    Keystrokes Display  
    | ¥ 000– Program mode. 
    ´b 3 001–42,21, 3 Label. 
    6 002–       6 Assumes stack loaded with x. 
       
    						
    							190 Section 13: Finding the Roots of an Equation 
     
     
    Keystrokes Display  
    - 003– 30  
    * 004– 20 (x –=6)=x. 
    8 005– 8  
    + 005– 40  
    * 007– 20 ((x –=6)=x + 8) x. 
    4 008– 4  
    * 009– 20 4 ((x –=6)=x + 8) x. 
    7 010– 7  
    . 011– 48  
    5 012– 5  
    - 013– 30  
    |n 014– 43 32  
    It  seems  reasonable  that  either  a  tall,  narrow  box  or  a  short,  flat  box  could 
    be  formed  having  the  desired  volume. Because  the  taller  box  is  preferred, 
    larger  initial  estimates  of  the  height  are  reasonable.  However,  heights 
    greater  than  2  decimeters  are  not  physically  possible  (because  the  metal  is 
    only  4  decimeters  wide).  Initial  estimates  of  1  and  2  decimeters  are 
    therefore appropriate. 
    Find the desired height: 
    Keystrokes Display  
    | ¥  Run mode. 
    1 v 1.0000 Initial estimates. 2 2 
    ´ _ 3 1.5000 The desired height. 
    ) 1.5000 Previous estimate. 
    ) 0.0000 f(x) at root.  
    						
    All HP manuals Comments (0)