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 E: A Detailed Look at f 251 
     
    Since  you’re  evaluating  this  integral  numerically,  you  might  think (naively 
    in  this  case,  as  youll  see)  that  you  should  represent  the  upper  limit  of 
    integration by 1099 – which is virtually the largest number you can key into 
    the calculator. Try it and see what happens. 
    Key in a subroutine that evaluates the function f(x) = xe-x 
    Keystrokes Display  
    |¥  000- Program mode. 
    ´ b 1 001-42,21,  1  
    “  002-    1   6  
     003-       12  
    * 004-       20  
    | n 005-   43  32  
    Set the  calculator to Run  mode. Then set  the  display  format to i 3 and 
    key the limits of integration into the X- and Y-registers. 
    Keystrokes Display  
    |¥  Run mode. 
    ´i 3  Sets display format to i 3. 
    0 v 0.000  00 Keys lower limit into Y-
    register. 
    ‛ 99 1      99 Keys upper limit into X-
    register. 
    ´ f 1 0.000  00 Approximation of integral. 
    The  answer  returned  by  the  calculator  is  clearly  incorrect,  since  the  actual 
    integral  of f(x) = xe-x from  0  to  is  exactly  1.  But  the  problem  is not that 
    you represented  by 1099 since the actual integral of this function from 0 to 
    1099 is  very  close  to  1.  The  reason  you  got  an  incorrect  answer  becomes 
    apparent if you look at the graph of f(x) over the interval of integration:  
    						
    							252 Appendix E: A Detailed Look at f 
     
    The  graph is a  spike  very close  to the origin. (Actually, to illustrate f(x) the 
    width of the spike has been considerably exaggerated. Shown in actual scale 
    over  the  interval  of  integration,  the  spike  would  be  indistinguishable  from 
    the  vertical  axis  of  the  graph.)  Because  no  sample  point  happened  to 
    discover  the  spike,  the  algorithm  assumed  that f(x) was  identically  equal  to 
    zero  throughout the  interval  of  integration.  Even  if  you  increased  the 
    number of sample points by calculating the integral in i 9, none of the 
    additional  sample  points  would  discover  the  spike  when  this  particular 
    function  is  integrated  over  this  particular  interval.  (Better  approaches  to 
    problems such as this are mentioned at the end of the next topic, Conditions 
    That Prolong Calculation Time.) 
    Youve seen how the f algorithm can give you an incorrect answer when 
    f(x) has  a  fluctuation  somewhere  that  is  very  uncharacteristic  of  the 
    behavior  of  the  function  elsewhere.  Fortunately,  functions  exhibiting  such 
    aberrations  are  unusual  enough  that  you  are  unlikely  to  have  to  integrate 
    one unknowingly. 
    Functions  that  could  lead  to  incorrect  results  can  be  identified  in  simple 
    terms  by  how  rapidly  it  and  its  low-order  derivatives  vary  across  the 
    interval  of  integration.  Basically,  the  more  rapid the  variation  in  the 
    function  or  its  derivatives,  and  the  lower  the  order  of  such  rapidly varying 
    derivatives,  the  less  quickly  will  the f algorithm  terminate,  and  the  less 
    reliable will the resulting approximation be.   
    						
    							 Appendix E: A Detailed Look at f 253 
     
    Note  that  the  rapidity  of  variation  in  the  function  (or  its  low-order 
    derivatives)  must be  determined  with respect to  the  width of the  interval  of 
    integration.  With  a  given  number  of  sample  points,  a  function f(x) that  has 
    three  fluctuations  can  be  better  characterized  by  its  samples  when  these 
    variations are spread out over most of the interval of integration than if they 
    are  confined  to  only  a  small  fraction  of  the  interval. (These  two  situations 
    are  shown  in  the  next  two  illustrations.)  Considering  the  variations  or 
    fluctuations  as  a  type  of  oscillation  in  the  function,  the  criterion  of  interest 
    is  the  ratio  of  the  period  of  the  oscillations  to  the  width  of  the  interval  of 
    integration:  the  larger  this  ratio,  the  more  quickly  the  algorithm  will 
    terminate, and the more reliable will be the resulting approximation. 
     
     
       
    						
    							254 Appendix E: A Detailed Look at f 
     
    In  many  cases  you  will  be  familiar  enough  with  the  function  you  want  to 
    integrate  that  you’ll  know  whether  the function  has  any  quick  wiggles 
    relative  to  the  interval  of  integration.  If  youre  not  familiar  with  the 
    function,  and  you  have  reason  to  suspect  that  it  may  cause  problems,  you 
    can  quickly  plot  a  few  points  by  evaluating  the  function  using  the 
    subroutine you wrote for that purpose. 
    If  for any reason, after obtaining an approximation  to an integral,  you  have 
    reason to suspect its validity, theres a very simple procedure you can use to 
    verify  it: subdivide  the  interval  of  integration  into  two  or  more  adjacent 
    subintervals,  integrate  the  function  over  each  subinterval,  then  add  the 
    resulting approximations. This causes the  function to be sampled at a brand 
    new  set  of  sample  points,  thereby  more  likely  revealing  any  previously 
    hidden spikes. If the initial approximation was valid, it will equal the sum of 
    the approximations over the subintervals. 
    Conditions That Prolong Calculation Time 
    In  the  preceding  example  (page  251),  you  saw  that  the  algorithm  gave  an 
    incorrect  answer  because  it  never  detected  the  spike  in  the  function.  This 
    happened because the variation in the  function was too quick relative  to the 
    width of the interval of integration. If the width of the interval were smaller, 
    you  would  get  the  correct  answer;  but  it  would  take  a  very  long  time  if  the 
    interval were still too wide. 
    For certain integrals such as the one in that example, calculating the integral 
    may be unduly prolonged because  the  width of the  interval  of integration is 
    too  large  relative  to  certain  features  of  the  functions  being  integrated. 
    Consider  an  integral  where  the  interval  of  integration  is  wide  enough  to 
    require  excessive  calculation  time  but  not  so  wide  that  it  would  be 
    calculated  incorrectly.  Note  that  because f(x) = xe-x approaches  zero  very 
    quickly as x approaches , the contribution to the integral of the function at 
    large  values  of x is  negligible.  Therefore,  you  can  evaluate  the  integral  by 
    replacing , the upper limit of integration, by a number not so large as 1099, 
    say 103. 
     
     
      
    						
    							 Appendix E: A Detailed Look at f 255 
     
    Keystrokes Display  
    0 v  0.000    00 Keys lower limit into  
    Y-register. 
    ‛ 3 1        03 Keys upper limit into  
    X-register. 
    ´ f 1 1.000    00 Approximation to integral. 
    ®  1.824   -04 Uncertainty of 
    approximation. 
    This  is  the  correct  answer,  but  it  took almost  60  seconds.  To  understand 
    why,  compare  the  graph  of  the  function  over  the  interval  of  integration, 
    which  looks  about  identical  to  that  shown  on  page  252,  to  the  graph  of  the 
    function between x = 0 and x = 10. 
    By comparing the  two  graphs,  you can see that  the  function is interesting 
    only  at  small  values  of x.  At  greater  values  of x,  the  function  is 
    uninteresting,  since  it  decreases  smoothly  and  gradually  in  a  very 
    predictable manner. 
    As  discussed  earlier,  the f algorithm  will  sample  the  function  with 
    higher  densities  of  sample  points  until  the  disparity  between  successive 
    approximations  becomes  sufficiently  small.  In  other  words,  the  algorithm 
    samples  the  function  at  increasing  numbers  of  sample  points  until  it  has 
    sufficient  information  about  the  function  to  provide  an  approximation  that 
    changes insignificantly when further samples are considered.   
    						
    							256 Appendix E: A Detailed Look at f 
     
    If  the  interval  of  integration  were  (0,  10)  so  that  the  algorithm  needed  to 
    sample  the  function  only  at  values  where  it  was  interesting  but  relatively 
    smooth,  the  sample  points  after  the  first  few  iterations  would  contribute  no 
    new  information  about  the  behavior  of  the  function.  Therefore,  only  a  few 
    iterations  would  be  necessary  before  the  disparity  between  successive 
    approximations  became  sufficiently  small  that  the  algorithm  could 
    terminate with an approximation of a given accuracy. 
    On  the  other  hand,  if  the  interval  of  integration  were  more  like  the  one 
    shown  in  the  graph  on  page  252,  most  of  the  sample  points  would  capture 
    the  function  in  the  region  where  its  slope  is  not  varying  much.  The  few 
    sample  points  at  small  values  of x would  find  that  values  of  the  function 
    changed  appreciably  from  one  iteration  to  the  next.  Consequently  the 
    function  would  have  to  be  evaluated  at  additional  sample  points  before  the 
    disparity  between  successive  approximations  would  become  sufficiently 
    small. 
    In  order  for  the  integral  to  be  approximated  with  the  same  accuracy  over 
    the  larger  interval  as  over  the  smaller  interval,  the  density  of  the  sample 
    points  must  be  the  same  in  the  region  where  the  function  is  interesting. To 
    achieve  the  same  density  of  sample  points,  the  total  number  of  sample 
    points  required  over  the  larger  interval  is  much  greater  than  the  number 
    required over the smaller interval. Consequently, several more iterations are 
    required over the larger interval to achieve an approximation with the same 
    accuracy,  and  therefore  calculating  the  integral  requires  considerably  more 
    time. 
    Because  the  calculation  time  depends  on  how  soon  a  certain  density  of 
    sample points is achieved in the region where the function is interesting, the 
    calculation  of  the  integral  of  any  function  will  be  prolonged  if  the  interval 
    of integration includes  mostly regions  where  the function  is not interesting. 
    Fortunately,  if  you  must  calculate  such  an  integral,  you  can  modify  the 
    problem  so  that  the  calculation  time  is  considerably  reduced.  Two  such 
    techniques  are  subdividing  the  interval  of  integration  and  transformation  of 
    variables. These methods enable  you to change the function or the  limits of 
    integration  so  that  the  integrand is  better  behaved  over  the  interval(s)  of 
    integration.  (These  techniques  are  described  in  the HP-15C  Advanced 
    Functions Handbook.)  
    						
    							 Appendix E: A Detailed Look at f 257 
     
    Obtaining the Current Approximation  
    to an Integral 
    When the  calculation of an integral  is requiring  more  time than  you care to 
    wait, you may  want to stop and display the current approximation. You can 
    obtain the current approximation, but not its uncertainty. 
    Pressing ¦ while  the  HP-15C  is  calculating  an  integral  halts  the 
    calculation,  just  as  it  halts  the  execution  of  a  running  program.  When  you 
    do so, the  calculator stops at  the  current program line  in the subroutine  you 
    wrote  for  evaluating  the  function,  and  displays  the  result  of  executing  the 
    preceding program  line.  Note  that  after  you  halt the calculation, the current 
    approximation  to  the  integral  is not the  number  in  the  X-register  nor  the 
    number  in  any  other  stack  register.  Just  as  with  any  program,  pressing 
    ¦ again  starts  the  calculation  from  the  program  line  at  which  it  was 
    stopped. 
    The f algorithm  updates  the  current approximation  and  stores  it  in  the 
    LAST X register after evaluating the function at each new sample point. To 
    obtain  the  current  approximation,  therefore,  simply  halt  the  calculator, 
    single-step if necessary through your function subroutine until the calculator 
    has  finished  evaluating  the  function  and  updating  the  current 
    approximation.  Then  recall  the  contents  of  the  LAST  X  register,  which  are 
    updated when the n instruction in the function subroutine is executed. 
    While  the  calculator  is  updating  the  current  approximation,  the  display  is 
    blank  and  does  not  show running.  (While  the  calculator  is  executing  your 
    function  subroutine, running is  displayed.)  Therefore,  you  might  avoid 
    having  to  single-step  through  your  subroutine  by  halting  the  calculator  at  a 
    moment when the display is blank. 
    In  summary,  to  obtain  the  current  approximation  to  an  integral,  follow  the 
    steps below. 
    1. Press ¦ to  halt  the  calculator,  preferably  while  the  display  is 
    blank. 
    2. When  the  calculator  halts,  switch  to  Program  mode  to  check  the 
    current program line. 
     If  that  line  contains  the  subroutine  label,  return  to  Run 
    mode and view the LAST X register (step 3).  
    						
    							258 Appendix E: A Detailed Look at f 
     
     If any other program line is displayed, return to Run mode 
    and  single-step  (Â)  through  the  program  until  you 
    reach  a n instruction  (keycode  43  32)  or  line  000  (if 
    there is no n). (Be sure  to  hold  the  key  down 
    long  enough  to  view  the  program  line  numbers  and 
    keycodes.) 
    3. Press | K to view the current approximation. If you want to 
    continue  calculating  the  final  approximation,  press − + 
    ¦.  This  refills  the  stack  with  the  current x-value  and  restarts 
    the calculator. 
     
    For Advanced Information 
    The HP-15C Advanced Functions Handbook explores more esoteric aspects 
    of f and its applications. These topics include: 
     Accuracy of the function to be integrated. 
     Shortening calculation time. 
     Calculating difficult integrals. 
     Using f in Complex mode.  
    						
    							 
    259 
    Appendix F 
    Batteries  
    Batteries  
    The HP-15C is shipped  with two 3 Volt CR2032 Lithium batteries.  Battery 
    life depends on how the calculator is used. If the calculator is being used to 
    perform operations other than running programs, it uses much less power. 
    Low-Power Indication 
    A  battery  symbol  ()  shown  in  the  upper-left  corner  of  the  display  when 
    the calculator is on signifies that the available battery power is running low. 
    When  the  battery  symbol  begins  flashing,  replace  the  battery  as  soon  as 
    possible to avoid losing data. 
    Use only a fresh battery. Do not use rechargeable batteries. 
    Warning 
     
    There  is  the  danger  of  explosion  if  the  battery  is 
    incorrectly  replaced.  Replace  only  with  the  same  or 
    equivalent  type  recommended  by  the  manufacturer. 
    Dispose  of  used  batteries  according  to  the  manufacturer’s 
    instructions.  Do  not  mutilate,  puncture,  or  dispose  of 
    batteries  in  fire.  The  batteries  can  burst  or  explode, 
    releasing  hazardous  chemicals.  Replacement  battery  is  a 
    Lithium 3V Coin Type CR2032. 
    Installing New Batteries  
    To  prevent  memory  loss,  never  remove  two  old  batteries  at  the  same  time. 
    Be sure to remove and replace the batteries one at a time.   
    						
    							260 Appendix F: Batteries 
     
    To install new batteries, use the following procedure:  
     
     
    1. With the calculator turned off, slide the battery cover off. 
    2. Remove the old battery.  
    3. Insert a new CR2032 lithium battery, making sure that the positive 
    sign (+) is facing outward. 
    4. Remove and insert the other battery as in steps 2 through 3. Make sure 
    that the positive sign (+) on each battery is facing outward. 
    5. Replace the battery cover. 
    Note: Be  careful  not  to  press  any  keys  while  the  battery  is 
    out of the calculator. If you do so, the contents of Continuous 
    Memory  may  be  lost  and  keyboard  control  may  be  lost  (that 
    is, the calculator may not respond to keystrokes). 
    6. Press  = to turn on the power. If for any reason Continuous Memory 
    has been reset (that is, if its contents have been lost), the display will 
    show Pr Error. Pressing any key will clear this message.  
    						
    All HP manuals Comments (0)

    Related Manuals for HP 15c Manual