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 241 
     
    The  uncertainty  of  the  final  approximation  is  a  number  derived  from  the 
    display format, which specifies the  uncertainty for the  function.* At the end 
    of  each  iteration,  the  algorithm  compares  the  approximation  calculated 
    during that iteration with the approximations calculated during two previous 
    iterations.  If  the  difference  between  any  of  these  three  approximations  and 
    the  other  two  is  less  than  the  uncertainty  tolerable  in  the  final 
    approximation,  the  algorithm  terminates,  placing  the  current  approximation 
    in the X-register and its uncertainty in the Y-register. 
    It  is  extremely  unlikely  that  the  errors  in  each  of  three  successive 
    approximations – that is, the  differences between the actual integral and the 
    approximations – would  all  be  larger  than  the  disparity  among  the 
    approximations  themselves.  Consequently,  the  error  in  the  final 
    approximation will be less than its uncertainty.†=Although we cant know the=
    error  in= the  final  approximation,= the  error  is= extremely  unlikely= to= exceed=
    the  displayed  uncertainty  of= the  approximation.= In= other  words,= the 
    uncertainty estimate in the vJregister is an almost certain ―upper bound‖ on 
    the difference between the approximation and the actual integral. 
    Accuracy, Uncertainty, and Calculation Time 
    The  accuracy  of  an f approximation  does  not  always  change  when  you 
    increase by  just  one the  number  of  digits  specified  in  the  display  format, 
    though  the  uncertainty  will  decrease.  Similarly,  the  time  required  to 
    calculate  an  integral  sometimes  changes  when  you  change  the  display 
    format, but sometimes does not. 
    Example: The  Bessel  function  of  the  first  kind, of  order  four,  can  be 
    expressed as 
     
                                                               * The  relationship  between  the  display  format,  the  uncertainly  in  the  function,  and  the  uncertainty  in  the approximation to its integral are discussed later in this appendix. † Provided  that f(x) does  not  vary  rapidly,  a  consideration  that  will  be  discussed  in  more  detail  later  in  this appendix. πdθθxθxJ04sin4cos1)(  
    						
    							242 Appendix E: A Detailed Look at f 
     
    Calculate the integral in the expression for J4 (1), 
     
    First,  switch to  Program mode and  key  in a  subroutine  that  evaluates  the 
    function f(θ) = cos (4θ – sin θ). 
    Keystrokes Display  
    |¥  000- Program mode. 
    ´ CLEAR  M  000-  
    ´ b 0 001–42,21,  0  
    4 002–        4  
    * 003–       20  
    ® 004–       34  
    [ 005–       23  
    - 006–       30  
    \ 007–       24  
    |n  008–    43 32  
    Now,  switch  to  Run mode  and  key  the  limits  of  integration  into  the  X- and 
    Y-registers.  Be  sure  the  trigonometric  mode  is  set  to  Radians,  and  set  the 
    display format to i 2. Finally, press ´ f0 to calculate the integral. 
    Keystrokes Display  
    |¥  Run mode. 
    0 v  0.0000 Keys lower limit into Y-register. 
    | $  3.1416 Keys upper limit into X-register. 
    | R  3.1416 Sets the trigonometric mode to 
    Radians. 
    ´ i 2 3.14   00 Sets display format to i 2. 
    ´ f 0 7.79  -03 Integral approximated in i 2. 
    ® 1.45  -03 Uncertainty of i 2 
    approximation. 0)sin4cos(d  
    						
    							 Appendix E: A Detailed Look at f 243 
     
    The  uncertainty  indicates  that  the  displayed  digits  of  the  approximation 
    might  not  include  any  digits  that  could  be  considered  accurate.  Actually, 
    this approximation is more accurate than its uncertainty indicates. 
    Keystrokes Display  
    ® 7.79   -03 Return  approximation  to 
    display. 
    ´ CLEAR u    
    (hold) 7785820888 All  10  digits  of i 2  
    approximation. 
    The  actual  value  of  this  integral,  correct  to  five  significant  digits,  is 
    7.7805×10-3.  Therefore,  the  error  in  this  approximation  is  about  
    (7.7858  7.7805)×10-3 =  5.3×10-6. This  error  is  considerably  less  than  the 
    uncertainty,  1.45×10-3 The  uncertainty  is  only  an upper  bound on  the  error 
    in the approximation; the actual error will generally be smaller. 
    Now  calculate  the  integral  in i 3  and  compare the  accuracy  of  the 
    resulting approximation to that of the i 2 approximation. 
    Keystrokes Display  
    ´ i 3 7.786   –03 Changes display format  
    to i 3. 
    ) )  3.142    00 Rolls down stack until 
    upper limit appears in X-
    register. 
    ´ f 0 7.786   –03 Integral approximated in  
    i 3 
    ® 1.448   –04 Uncertainty of i 3 
    approximation. 
    ® 7.786   –03 Returns approximation to 
    display. 
    ´ CLEAR u   
    (hold) 7785820888 All 10 digits of i 
    3 approximation.  
    						
    							244 Appendix E: A Detailed Look at f 
     
    All 10 digits of the approximations in i 2 and i 3 are identical: the 
    accuracy  of  the  approximation  in i 3  is  no  better  than  the  accuracy  in 
    i 2  despite  the  fact  that  the  uncertainty  in i 3  is  less  than  the 
    uncertainty  in i 2.  Why  is  this?  Remember  that  the  accuracy  of  any 
    approximation  depends  primarily  on  the  number  of  sample  points  at  which 
    the  function f(x) has  been  evaluated.  The f algorithm  is  iterated  with 
    increasing  numbers  of  sample  points  until  the  disparity  among  three 
    successive  approximations  is  less  than  the  uncertainty  derived  from  the 
    display  format.  After  a particular  iteration,  the  disparity  among  the 
    approximations  may  already  be  so  much  less  than  the  uncertainty  that  it 
    would  still  be  less  if  the  uncertainty  were  decreased  by  a  factor  of  10.  In 
    such cases, if you decreased the uncertainty by specifying one more digit in 
    the  display  format,  the  algorithm  would  not  have  to  consider  additional 
    sample  points,  and  the  resulting  approximation  would  be  identical  to  the 
    approximation calculated with the larger uncertainty. 
    If  you calculated the  two preceding approximations on  your calculator,  you 
    may  have  noticed  that  it  did  not  take  any  longer  to  calculate  the  integral  in 
    i 3 than in i 2. This is because the time to calculate the integral of 
    a  given  function  depends  on  the  number  of  sample  points  at  which  the 
    function  must  be  evaluated  to  achieve  an  approximation  of  acceptable 
    accuracy.  For  the i 3  approximation,  the  algorithm  did  not  have  to 
    consider  more  sample  points  than  it  did  in i 2,  so  it  did  not  take  any 
    longer to calculate the integral. 
    Often,  however,  increasing  the  number  of  digits  in  the  display  format  will 
    require  evaluating  the  function  at  additional  sample  points,  so  that 
    calculating the integral will take more time. Now calculate the same integral 
    in i 4. 
    Keystrokes Display  
    ´ i 4 7.7858    –03 i 4 display. 
    ) )  3.1416     00 Rolls  down  stack  until  upper 
    limit appears in X-register. 
    ´ f 0 7.7807    –03 Integral approximated in i 4.  
    						
    							 Appendix E: A Detailed Look at f 245 
     
    This approximation took about twice as long as the approximation in i 
    3  or i 2.  In  this  case,  the  algorithm  had  to  evaluate  the  function  at 
    about  twice  as  many  sample  points  as  before  in  order  to  achieve  an 
    approximation  of  acceptable  accuracy.  Note,  however,  that  you  received  a 
    reward  for  your  patience:  the  accuracy  of  this  approximation  is  better,  by 
    almost  two  digits, than  the  accuracy  of  the  approximation  calculated  using 
    half the number of sample points. 
    The  preceding  examples  show  that  repeating  the  approximation  of  an 
    integral  in  a  different  display  format  sometimes  will  give  you  a  more 
    accurate  answer,  but  sometimes  it  will  not.  Whether  or  not  the  accuracy  is 
    changed  depends  on  the  particular  function,  and  generally  can  be 
    determined only by trying it. 
    Furthermore, if  you do get a  more accurate answer, it  will  come at the cost 
    of  about  double  the  calculation  time. This  unavoidable  trade-off  between 
    accuracy  and  calculation  time  is  important  to  keep  in  mind  if  you  are 
    considering  decreasing  the  uncertainty  in  hopes  of  obtaining  a  more 
    accurate answer. 
    The  time  required  to  calculate  the  integral  of  a  given  function  depends  not 
    only  on  the  number  of  digits  specified  in  the  display  format,  but  also,  to  a 
    certain  extent  on  the  limits  of  integration.  When  the  calculation  of  an 
    integral  requires  an  excessive  amount  of  time,  the  width  of  the  interval  of 
    integration  (that  is, the  difference  of  the  limits)  may  be  too  large  compared 
    with  certain  features  of  the  function  being  integrated.  For  most  problems, 
    however,  you  need  not  be  concerned  about  the  effects  of  the  limits  of 
    integration  on  the  calculation  time.  These  conditions, as  well  as  techniques 
    for dealing with such situations, will be discussed later in this appendix. 
    Uncertainty and the Display Format 
    Because  of  round-off  error,  the  subroutine  you  write  for  evaluating f(x) 
    cannot calculate f(x) exactly, but rather calculates 
     
    where  δ1 (x)  is  the  uncertainty  of f(x) caused  by  round-off  error.  If f(x) 
    relates  to  a  physical  situation,  then  the  function  you  would  like  to  integrate 
    is not f(x) but rather ),()()(ˆ1xxfxf  
    						
    							246 Appendix E: A Detailed Look at f 
     
    , 
    where δ2(x)  is  the  uncertainty  associated  with f(x) that  is  caused  by  the 
    approximation to the actual physical situation. 
    Since , the function you want to integrate is 
     
    or , 
    where δ(x) is the net uncertainty associated with f(x). 
    Therefore, the integral you want is 
     
     
     
    where I is  the  approximation  to  and  ∆  is  the  uncertainty 
    associated  with  the  approximation.  The f algorithm places  the  number I 
    in the X-register and the number ∆ in the Y-register. 
    The uncertainty δ(x) of , the  function calculated by your subroutine, is 
    determined  as  follows.  Suppose  you  consider  three  significant  digits  of  the 
    functions  values  to  be  accurate,  so  you  set  the  display  format  to i 2. 
    The  display  would  then  show  only  the  accurate  digits  in  the  mantissa  of  a 
    functions values: for example, 1.23      –04. 
    Since  the  display  format  rounds  the  number  in the X-register  to  the 
    number displayed,  this  implies  that  the  uncertainty  in  the  functions  values 
    is  ±  0.005×10–4 =  ±  0.5×10–2×10–4 = ±  0.5×10-6.  Thus,  setting  the  display)(δ)()(2xxfxF )(δ)(ˆ)(1xxfxf )(δ)(δ)(ˆ)(21xxxfxF )(δ)(ˆ)(xxfxF dxxxfdxxFb
    a
    b
    a)](δ)(ˆ[)( b
    a
    b
    adxxdxxf)()(ˆ I 
    b
    adxxF )( )(ˆxf  
    						
    							 Appendix E: A Detailed Look at f 247 
     
    format  to i n or ^ n, where n is  an  integer,* implies  that  the 
    uncertainty in the function’s values is 
     
     
    In this formula, n is the number of digits specified in the display format and 
    m(x)  is  the  exponent  of  the  functions  value  at x that  would  appear  if  the 
    value were displayed in i display format. 
    The  uncertainty  is proportional  to  the  factor  10m(x),  which  represents  the 
    magnitude  of  the  functions  value  at x. Therefore, i and ^ display 
    formats imply an uncertainty in the function that is relative to the functions 
    magnitude. 
    Similarly,  if  a  function  value  is  display in • n, the  rounding  of  the 
    display implies that the uncertainty in the functions values is 
     
    Since  this  uncertainty  is  independent  of  the  functions  magnitude, • 
    display format implies an uncertainty that is absolute. 
    Each  time  the f algorithm  samples  the  function  at  a  value  of x, it  also 
    derives a sample of δ(x), the  uncertainty of the  functions value at x. This is 
    calculated  using  the  number  of  digits n currently  specified  in  the  display 
    format  and  (if  the  display  format  is  set  to i or ^)  the  magnitude 
    m(x)  of  the  functions  value  at x.  The  number  Δ,  the  uncertainty  of  the 
    approximation to the desired integral, is the integral δ (x): 
     
     
                                                               * Although i 8  or  9  generally  results  in  the same  display as i 7, it will  result  in  a  smaller uncertainty of a calculated integral. (The same is true for the ^ format.) A negative value for n (which can be set by using the Index register) will also affect the uncertainty of an f calculation. The minimum value for n that will affect uncertainty is -6. A number in RI less than -6 will be interpreted as -6. )(10100.5)δ(xmnx )(100.5xmn .100.5)δ(nx  
    						
    							248 Appendix E: A Detailed Look at f 
     
     
    . 
    This  integral  is  calculated  using  the  samples  of δ(x)  in  roughly  the  same 
    ways  that  the  approximation  to  the  integral  of  the  function  is  calculated 
    using the samples of . 
    Because  Δ  is  proportional  to  the  factor  10-n,  the  uncertainty  of  an 
    approximation changes by about a factor of 10 for each digit specified in the 
    display  format.  This  will  generally  not  be exact  in i or ^ display 
    format,  however,  because  changing  the  number  of  digits  specified  may 
    require  that  the  function  be  evaluated  at  different  sample  points,  so  that 
    δ(x) ~ 10m(x) would have different values. 
    Note that when an integral is approximated in • display format, m(x) = 
    0 and so the calculated uncertainty in the approximation turns out to be 
    Δ = 0.5×10-n (b – a). 
    Normally  you  do  not  have  to  determine  precisely  the  uncertainty  in  the 
    function.  (To  do  so  would  frequently  require  a  very  complicated analysis.) 
    Generally,  its  more  convenient to use i or ^ display  format  if the 
    uncertainty  in  the  functions  values  can  be  more  easily  estimated  as  a 
    relative uncertainty.  On  the  other  hand,  it’s  more  convenient  to  use • 
    display format if the uncertainty in the function’s values can be more easily 
    estimated  as  an absolute  uncertainly. • display  format  may  be 
    inappropriate  to use  (leading to peculiar results)  when  you are  integrating a 
    function  whose  magnitude and uncertainty  have  extremely  small  values 
    within  the  interval  of  integration.  Likewise, i display  format  may  be 
    inappropriate to use (also leading to peculiar results) if the magnitude of the 
    function  becomes  much  smaller  than  its  uncertainty.  If  the  results  of 
    calculating an integral seem strange, It may be more appropriate to calculate 
    the integral in the alternate display format. b
    adxx )δ( Δ dxb
    a
    xmn ]10[0.5 )( )(ˆxf  
    						
    							 Appendix E: A Detailed Look at f 249 
     
    Conditions That Could Cause Incorrect Results 
    Although  the f algorithm  in  the  HP-15C  is  one  of  the  best  available,  in 
    certain  situations  it – like  nearly  all  algorithms  for  numerical  integration – 
    might  give  you  an  incorrect  answer. The  possibility  of  this  occurring  is 
    extremely  remote. The f algorithm  has  been  designed  to  give  accurate 
    results  with  almost  any  smooth  function.  Only  for  functions  that  exhibit 
    extremely erratic  behavior  is  there  any  substantial  risk  of  obtaining  an 
    inaccurate answer. Such functions rarely occur in problems related to actual 
    physical  situations;  when they do, they usually can be  recognized and dealt 
    with in a straightforward manner. 
    As  discussed  on  page  240,  the f algorithm  samples  the  function f(x) at 
    various  values  of x within  the  interval  of  integration.  By  calculating  a 
    weighted  average  of  the  functions  values  at  the  sample  points,  the 
    algorithm approximates the integral of f(x). 
    Unfortunately, since all that the algorithm knows about f(x) are its values at 
    the  sample  points, it cannot distinguish between f(x) and any other function 
    that agrees with f(x) at all the sample points. This situation is depicted in the 
    illustration on the  next page,  which shows (over a  portion of the  interval  of 
    integration) three of the infinitely many functions  whose  graphs include the 
    finitely many sample points.  
    						
    							250 Appendix E: A Detailed Look at f 
     
    With  this  number  of  sample  points,  the  algorithm  will  calculate  the  same 
    approximation  for  the  integral  of  any  of  the  functions  shown.  The  actual 
    integrals  of  the  functions  shown  with  solid  lines  are  about  the  same,  so  the 
    approximation  will  be  fairly  accurate  if f(x) is  one  of  these  functions. 
    However,  the  actual  integral  of  the  function  shown  with  a dashed  line  is 
    quite different from those of the others, so the current approximation will be 
    rather inaccurate if f(x) is this function. 
    The f algorithm  comes  to  know  the  general  behavior  of  the  function  by 
    sampling  the  function  at  more  and  more  points.  If  a  fluctuation  of  the 
    function in one region is not unlike the behavior over the rest of the interval 
    of  integration,  at  some  iteration  the  algorithm  will  likely  detect  the 
    fluctuation.  When  this  happens,  the  number  of  sample  points  is  increased 
    until  successive  iterations  yield  approximations  that  take  into  account  the 
    presence of the most rapid, but characteristic, fluctuations. 
    For example, consider the approximation of 
     
    
    0.dxxxe   
    						
    All HP manuals Comments (0)

    Related Manuals for HP 15c Manual