HP-15C Owner’s Handbook HP Part Number: 00015-90001 Edition 2.
Legal Notice This manual and any examples contained herein are provided “as is” and are subject to change without notice. Hewlett-Packard Company makes no warranty of any kind with regard to this manual, including, but not limited to, the implied warranties of merchantability noninfringement and fitness for a particular purpose. In this regard, HP shall not be liable for technical or editorial errors or omissions contained in the manual.
Introduction Congratulations! Whether you are new to HP calculators or an experienced user, you will find the HP-15C a powerful and valuable calculating tool. The HP-15C provides: 448 bytes of program memory (one or two bytes per instruction) and sophisticated programming capability, including conditional and unconditional branching, subroutines, flags, and editing. Four advanced mathematics capabilities: complex number calculations, matrix calculations, solving for roots, and numerical integration.
Contents The HP-15C: A Problem Solver .................................... A Quick Look at v ................................................. Manual Solutions ............................................................ Programmed Solutions ..................................................... 12 12 13 14 Part I: HP-15C Fundamentals ................................ 17 Section 1: Getting Started .......................................... 18 18 18 18 19 19 19 20 21 22 22 22 Power On and Off ...........
Contents 5 The Automatic Memory Stack and Stack Manipulation ........ Stack Manipulation Functions ........................................ The LAST X Register and K ....................................... Calculator Functions and the Stack ................................. Order of Entry and the v Key ............................... Nested Calculations ..................................................... Arithmetic Calculations With Constants ........................... Storage Register Operations .....
Contents Resetting Continuous Memory ........................................ 63 Part II: HP-15C Programming ............................... 65 Section 6: Programming Basics .................................. 66 66 66 66 68 68 69 70 74 74 74 75 77 78 78 79 79 80 81 The Mechanics ............................................................... Creating a Program ..................................................... Loading a Program ......................................................
Contents 7 Flags .......................................................................... Examples ....................................................................... Example: Branching and Looping ................................... Example: Flags ............................................................ Further Information .......................................................... GoTo .......................................................................... Looping ...........................
Contents I and e .......................................................... Indirect Display Control ........................................... 116 116 Part III: HP-15C Advanced Functions .................... 119 Section 11: Calculating With Complex Numbers .......... 120 120 120 121 121 121 124 124 124 125 128 129 130 130 131 131 131 132 133 133 135 137 The Complex Stack and Complex Mode ............................ Creating the Complex Stack ..........................................
Contents Copying a Matrix ....................................................... One-Matrix Operations ................................................ Scalar Operations ....................................................... Arithmetic Operations .................................................. Matrix Multiplication ................................................... Solving the Equation AX = B .......................................... Calculating the Residual ..........................................
Contents Appendix A: Error Conditions .................................... 205 Appendix B: Stack Lift and the LAST X Register ............... 209 209 209 210 210 211 212 Digit Entry Termination .................................................... Stack Lift ........................................................................ Disabling Operations ................................................... Enabling Operations .................................................... Neutral Operations .......
Contents Appendix F: Batteries ............................................. Low-Power Indication ....................................................... Installing New Batteries ................................................ Verifying Proper Operation (Self-Tests) ............................... Function Summary and Index ..................................... 11 259 259 259 261 Complex Functions .......................................................... Conversions ..................................
The HP-15C: A Problem Solver The HP-15C Advanced Programmable Scientific Calculator is a powerful problem solver, convenient to carry and easy to hold. Its continuous memory retains data and program instructions indefinitely until you choose to reset it. Though sophisticated, it requires no prior programming experience or knowledge of programming languages to use it. The new HP-15C is a modern re-release of the original HP-15C introduced in 1982.
The HP-15C: A Problem Solver 13 The display format used in this handbook is • 4 (the decimal point is ―fixed‖ to show four decimal places) unless otherwise mentioned. If your calculator does not show four decimal places, you may want to press ´• 4 to match the displays in the examples. Manual Solutions Run through the following two-number calculations. It is not necessary to clear the calculator between problems.
The HP-15C: A Problem Solver The time an object takes to fall to the ground (ignoring air friction) is given by the formula t 2h , g where t = time in seconds, h = height in meters, g = the acceleration due to gravity, 9.8 m/s2. Example: Compute the time taken by a stone falling from the top of the Eiffel Tower (300.51 meters high) to the earth. Keystrokes 300.51 v 2* 9.8 ÷ ¤ Display 300.5100 601.0200 61.3286 7.8313 Enter h. Calculates 2h. (2h) /g. Falling time, seconds.
The HP-15C: A Problem Solver Keystrokes 15 Display |¥ 000- ´ CLEAR M 000- ´bA 001-42,21,11 2 * 9 002003004- . 8 ÷ ¤ |n 005006007008009- |¥ 7.8313 Sets HP-15C to Program mode. (PRGM annunciator on.) Clears program memory. (This step is optional here.) Label "A" defines the beginning of the program. 2 20 9 48 8 10 11 43 32 The same keys you pressed to solve the problem manually. ―Return‖ defines the end of the program. Switches to Run mode. (No PRGM annunciator.) Running the Program.
The HP-15C: A Problem Solver With this program loaded, you can quickly calculate the time of descent of an object from different heights. Simply key in the height and press ´A. Find the time of descent for objects released from heights of 100 m, 2 m, 275 m, and 2,000 m. The answers are: 4.5175 s; 0.6389 s; 7.4915 s; and 20.2031 s. That program was relatively easy. You will see many more aspects and details of programming in part II.
Part l HP-15C Fundamentals
Section 1 Getting Started Power On and Off The = key turns the HP-15C on and off.* To conserve power, the calculator automatically turns itself off after a few minutes of inactivity. Keyboard Operation Primary and Alternate Functions Most keys on your HP-15C perform one primary and two alternate, shifted functions. The primary function of any key is indicated by the character(s) on the face of the key.
Section 1: Getting Started Notice that when you press the ´ or | prefix key, an f or g annunciator appears and remains in the display until a function key is pressed to complete the sequence. 19 0.0000 f Prefix Keys A prefix key is any key which must precede another key to complete the key sequence for a function. Certain functions require two parts: a prefix key and a digit or other key.
Section 1: Getting Started Keystrokes 6.6262 ‛ 3 4 “ v 50 * Display 6.6262 6.6262 00 6.6262 6.6262 6.6262 6.6262 3.3131 03 34 -34 -34 -32 The 00 prompts you to key in the exponent. (6.6262×103). (6.6262×1034). (6.6262×10-34). Enters number. Joule-seconds. Note: Decimal digits from the mantissa that spill into the exponent field will disappear from the display when you press ―, but will be retained internally.
Section 1: Getting Started Clearing Sequence ´ CLEAR M In Run mode: In Program mode: ´ CLEAR Q ´ CLEAR u* 21 Effect Repositions program memory to line 000. Deletes all program memory. Clears all data storage registers. Clears any prefix from a partially entered key sequence. * Also temporarily displays the mantissa. Display Clearing: ` and − The HP-15C has two types of display clearing operations: ` (clear X) and − (back arrow). In Run mode: ` clears the display to zero.
Section 1: Getting Started Calculations One-Number Functions A one-number function performs an operation using only the number in the display. To use any one-number function, press the function key after the number has been placed in the display. Keystrokes 45 |o Display 45 1.6532 Two-Number Functions and v A two-number function must have two numbers present in the calculator before executing the function. +, -, * and ÷ are examples of two-number functions. Terminating Digit Entry.
Section 1: Getting Started 23 Example: Calculate (9 + 17 4) ÷ 4. Keystrokes 9v 17 + 44÷ Display 9.0000 26.0000 22.0000 5.5000 Digit entry terminated. (9 + 17). (9 + 17 – 4). (9 + 17 – 4) ÷ 4. Even more complicated problems are solved in the same manner-using automatic storage and retrieval of intermediate results. It is easiest to work from the inside of parentheses outwards, just as you would with calculations on paper. Example: Calculate (6 + 7) × (9 3) Keystrokes 6v Display 6.0000 7+ 9v 13.
Section 2 Numeric Functions This section discusses the numeric functions of the HP-15C (excluding statistics and advanced functions). The nonnumeric functions are discussed separately (digit entry in section 1, stack manipulation in section 3, and display control in section 5). The numeric functions of the HP-15C are used in the same way whether executed from the keyboard or in a program. Some of the functions (such as a) are, in fact, primarily of interest for programming.
Section 2: Numeric Functions Keystrokes Display 123.0000 123.4567 |‘ -123.0000 |K “ |‘ |K ´q 1.23456789 “ |& ´ CLEAR u (release) |a 25 Reversing the sign does not alter digits. -0.4567 -1.2346 1234600000 Temporarily displays all -1.2346 digits in the mantissa. 1.2346 One-Number Functions One-number math functions in the HP-15C operate only upon the number in the display (X-register). General Functions Reciprocal. Pressing ∕ calculates the reciprocal of the number in the display. Factorial and Gamma.
Section 2: Numeric Functions Trigonometric Operations Trigonometric Modes. The trigonometric functions operate in the trigonometric mode you select. Specifying a trigonometric mode does not convert any number already in the calculator to that mode; it merely tells the calculator what unit of measure (degrees, radians, or grads) to assign a number for a trigonometric function. Pressing | D sets Degrees mode. No annunciator appears in the display. Degrees are in decimal, not minutes-seconds form.
Section 2: Numeric Functions 27 Hours.Decimal Hours Hours.Minutes Seconds Decimal Seconds (H.h) (H.MMSSs) Degrees.Decimal Hours Degrees.Minutes Seconds Decimal Seconds (D.d) (D.MMSSs) Hours/Degrees-Minutes-Seconds Conversion. Pressing ´ h converts the number in the display from a decimal hours/degrees format to an hours/degree-minutes-seconds-decimal seconds format. For example, press ´ h to convert 1.2 3 4 5 1.
Section 2: Numeric Functions Logarithmic Functions Natural Logarithm. Pressing |Z calculates the natural logarithm of the number in the display; that is, the logarithm to the base e. Natural Antilogarithm. Pressing ' calculates the natural antilogarithm of the number in the display; that is, raises e to the power of that number. Common Logarithm. Pressing | o calculates the common logarithm of the number in the display; that is, the logarithm to the base 10. Common Antilogarithm.
Section 2: Numeric Functions 29 Two-Number Functions The HP-15C performs two-number math functions using two values entered sequentially into the display. If you are keying in both numbers, remember that they must be separated by v or any other function – like | ‘ or ∕ – that terminates digit entry. For a two-number function, the first value entered is considered the y-value because it is placed into the Y-register for memory storage.
Section 2: Numeric Functions For example, to find the sales tax at 3% and total cost of a $15.76 item: Keystrokes 15.76 v 3 |k + Display 15.7600 0.4728 16.2328 Enters the base number (the price). Calculates 3% of $15.76 (the tax). Total cost of item ($15.76 + $0.47). Percent Difference. The ∆ function calculates the percent difference between two numbers.
Section 2: Numeric Functions 31 Rectangular Conversion. Pressing ´; (rectangular) converts a set of polar coordinates (magnitude r angle θ) into rectangular coordinates (x, y). θ must be entered first then r. Upon executing ´;, x will be displayed first; press ® to display y. Keystrokes |D Display Set to Degrees mode (no annunciator). 5v 10 |: ® 5.0000 10 11.1803 26.5651 30 v 12 ´; ® 30.0000 12 10.3923 6.0000 y-value. x-value. r. θ; rectangular coordinates converted to polar coordinates. θ. r.
Section 3 The Automatic Memory Stack, LAST X, and Data Storage The Automatic Memory Stack and Stack Manipulation HP operating logic is based on a mathematical logic known as ―Polish Notation,‖ developed by the noted Polish logician Jan Łukasiewicz (Wookashye'veech) (1878-1956). Conventional algebraic notation places the algebraic operators between the relevant numbers or variables when evaluating algebraic expressions. Łukasiewicz’s notation specifies the operators before the variables.
Section 3: The Memory Stack, LAST X, and Data Storage 33 Any number that is keyed in or results from the execution of a numeric function is placed into the display (X-register). This action will cause numbers already in the stack to lift, remain in the same register, or drop, depending upon both the immediately preceding and the current operation. Numbers in the stack are stored on a last-in, first-out basis. The three stacks drawn below illustrate the three types of stack movement.
Section 3: The Memory Stack, LAST X, and Data Storage shading indicates that the contents of that register will be written over when the next number is keyed in or recalled.) T t Z z Y y X x Keys: lost lost z y x 1 y x 1 1 v 1 lost y x 1 2 x 1 2 2 v 2 lost T Z Y X x 1 2 2 Keys: x 1 2 3 1 2 3 3 v 3 1 2 3 4 4 ) (roll down), ( (roll up), and ® (X exchange Y). ) and ( roll the contents of the stack registers up or down one register (one value moves between the X- and the T-register).
Section 3: The Memory Stack, LAST X, and Data Storage 35 The LAST X Register and K The LAST X register, a separate memory register, preserves the value that was last in the display before execution of a numeric operation.* Pressing |K (LAST X) places a copy of the contents of the LAST X register into the display (X-register).
Section 3: The Memory Stack, LAST X, and Data Storage Keystrokes * Display 287.0000 13.9 + 20.6475 Reverses the function that produced the wrong answer. The correct answer. Calculator Functions and the Stack When you want to key in two numbers, one after the other, you press v between entries of the numbers. However, when you want to key in a number immediately following any function (including manipulations like )), you do not need to use v.
Section 3: The Memory Stack, LAST X, and Data Storage 37 lost T Z Y X z z y z z y z z y z z y 7 0 6 y |` Keys: 6 Y 6 Order of Entry and the v Key An important aspect of two-number functions is the positioning of the numbers in the stack. To execute an arithmetic function, the numbers should be positioned in the stack in the same way that you would vertically position them on paper.
Section 3: The Memory Stack, LAST X, and Data Storage Nested Calculations The automatic stack lift and stack drop make it possible to do nested calculations without using parentheses or storing intermediate results. A nested calculation is solved simply as a series of one- and two-number operations. Almost every nested calculation you are likely to encounter can be done using just the four stack registers.
Section 3: The Memory Stack, LAST X, and Data Storage T y y y y Z y x y x Y x 13 x 65 X 13 5 65 4 Keys: * 5 4 T y y y y Z x y x y Y 65 x 69 x X 4 69 3 207 Keys: + 39 3 * Arithmetic Calculations With Constants There are three ways (without using a storage register) to manipulate the memory stack to perform repeated calculations with a constant: 1. Use the LAST X register. 2. Load the stack with a constant and operate upon different numbers.
Section 3: The Memory Stack, LAST X, and Data Storage Example: Two close stellar neighbors of Earth are Rigel Centaurus (4.3 light-years away) and Sirius (8.7 light-years away). Use the speed of light, c (3.0×108 meters/second, or 9.5×1015 meters/year), to figure the distances to these stars in meters. (The stack diagrams show only one decimal place.) T t z y y Z z y x x 4.3 4.3 Y y x X Keys: LAST X: x 4.3 v 4.3 4.3 9.5 15 9.5 ‛ 15 / / / / T y y y x Z x y x 4.1 16 4.
Section 3: The Memory Stack, LAST X, and Data Storage 41 Loading the Stack with a Constant. Because the number in the T-register is replicated when the stack drops, this number can be used as a constant in arithmetic operations. T c c Z c c Y c c X x cx Keys: New constant generation. Drops to interact with X-register. * Fill the stack with a constant by keying it into the display and pressing v three times. Key in your initial argument and perform the arithmetic operation.
Section 3: The Memory Stack, LAST X, and Data Storage Keystrokes * * * * Display 1,150.0000 1,322.5000 1,520.8750 1,749.0063 Population at the end of day 1. Day 2. Day 3. Day 4. Storage Register Operations When numbers are stored or recalled, they are copied between the display (X-register) and the data storage registers. At ―power-up‖ (initial turn-on or Continuous Memory reset) the HP-15C has 21 directly accessible storage registers: R0 through R9, R.0 through R.
Section 3: The Memory Stack, LAST X, and Data Storage 43 The above are stack lift-enabling operations, so the number remaining in the X-register can be used for subsequent calculations. If you address a nonexistent register, the display will show Error 3. Example: Springtime is coming and you want to keep track of 24 crocuses planted in your garden. Store the number of crocuses blooming the first day and add to this the number of new blooms the second day. Keystrokes 3O0 Display 3.
Section 3: The Memory Stack, LAST X, and Data Storage The number in the register is determined as follows: For storage arithmetic, new contents of register R0 = r × old contents of register T t Z R0 number in display T t z Z z Y y Y y X x X x r-x O-0 Keys: Recall Arithmetic. Recall arithmetic allows you to perform arithmetic with the displayed value and a stored value without lifting the stack, that is, without losing any values from the Y-, Z, and T-registers.
Section 3: The Memory Stack, LAST X, and Data Storage 45 Example: Keep a running count of your newly blooming crocuses for two more days. Keystrokes 8O0 Display 8.0000 4O+0 4.0000 3O+0 24 l - 0 3.0000 9.0000 l0 15.0000 Places the total number of blooms as of day 2 in R0. Day 3: adds four new blooms to those already blooming. Day 4: adds three new blooms. Subtracts total number of blooms summed in R0(15) from the total number of plants (24); 9 crocuses have not bloomed.
Section 3: The Memory Stack, LAST X, and Data Storage 2. Use arithmetic with constants to calculate the remaining balance of a $1000 loan after six payments of $100 each and an interest rate of 1% (0.01) per payment period. Procedure: Load the stack with (1 + i), where i = interest rate, and key in the initial loan balance. Use the following formula to find the new balance after each payment. New Balance = ((Old Balance)×(1 + i)) - Payment The first part of the key sequence would be: 1.
Section 4 Statistics Functions A word about the statistics functions: their use is based on an understanding of memory stack operation (Section 3). You will find that order of entry is important for most statistics calculations. Probability Calculations The input for permutation and combination calculations is restricted to nonnegative integers. Enter the y-value before the x-value. These functions, like the arithmetic operators, cause the stack to drop as the result is placed in the X-register.
Section 4: Statistics Functions How many different four-card hands can be dealt from a deck of 52 cards? Keystrokes 52 v 4 |c Display 4 Fifty-two (y) cards dealt four (x) at a time. 270,725.0000 Number of different hands possible. The maximum size of x or y is 9,999,999,999. Random Number Generator Pressing ´# (random number) will generate a random number (part of a uniformly distributed pseudo-random number sequence) in the range 0 ≤ r <1.
Section 4: Statistics Functions Keystrokes l´ # Display 0.2809 49 Recall last random number generated, which is the new seed. (The ´ may be omitted.) Accumulating Statistics The HP-15C performs one- and two-variable statistical calculations. The data is first entered into the Y- and X-registers. Then the z function automatically calculates and stores statistics of the data in storage registers R2 through R7. These registers are therefore referred to as the statistics registers.
Section 4: Statistics Functions In some cases involving x or y data values that differ by a relatively small amount, the calculator cannot compute s, r, linear regression, or ŷ, and will display Error 2. This will not happen, however, if you normalize the data by keying in only the difference between each value and the mean or approximate mean of the values. This difference must be added back to the calculations of x, ŷ, and the y-intercept (L).
Section 4: Statistics Functions X Y NITROGEN APPLIED 0.00 (kg per hectare *), x GRAIN YIELD 4.63 (metric tons per hectare), y 51 20.00 40.00 60.00 80.00 4.78 6.61 7.21 7.78 *A hectare equals 2.47 acres. Keystrokes ´ CLEAR ∑ Display 0.0000 ´•2 0.00 4.63 v 4.63 0z 1.00 4.78 v 4.78 20 z 2.00 6.61v 6.16 40 z 3.00 7.21 v 7.21 60 z 4.00 7.78 v 7.78 80 z l3 5.00 l4 12.000.00 l5 31.01 l6 200.49 l7 1,415.00 200.
Section 4: Statistics Functions Correcting Accumulated Statistics If you discover that you have entered data incorrectly, the accumulated statistics can be easily corrected. Even if only one value of an (x, y) data pair is incorrect, you must delete and re-enter both values. 1. 2. 3. 4. Key the incorrect data pair into the Y- and X-register. Press |w to delete the incorrect data. Key in the correct values for x and y. Press z.
Section 4: Statistics Functions 53 Mean The ’ function computes the arithmetic mean (average) of the x-and yvalues using the formulas shown in appendix A and the statistics accumulated in the relevant registers. When you press |’ the contents of the stack lift (two registers if stack lift is enabled, one if not); the mean of x (x) is copied into the X-register as the mean of y (y) is copied simultaneously into the Y-register. Press ® to view y.
Section 4: Statistics Functions Example: Calculate the standard deviation about the mean calculated above. Keystrokes |S Display 31.62 1.24 ® Standard deviation about the mean nitrogen application, x. Standard deviation about the mean grain yield, y. Linear Regression Linear regression is a statistical method for finding a straight line that best fits a set of two or more data pairs, thus providing a relationship between two or more data pairs, thus providing a relationship between two variables.
Section 4: Statistics Functions 55 Example: Find the y-intercept and slope of the linear approximation of the data and compare to the plotted data on the graph below. Keystrokes ´L ® Display 4.86 0.04 y-intercept of the line. Slope of the line. Linear Estimation and Correlation Coefficient When you press ´j the linear estimate, ŷ, is placed in the X-register and the correlation coefficient, r, is placed in the Y-register. To display r, press ®.
Section 4: Statistics Functions Linear Estimation. With the statistics accumulated, an estimated value for y, denoted ŷ, can be calculated by keying in a proposed value for x and pressing ´j. An Estimated value for x (denoted x̂ ) can be calculated as follows: 1. 2. 3. Press ´L. Key in the known y-value. Press ® - ® ÷. Correlation Coefficient. Both linear regression and linear estimation presume that the relationship between the x and y data values can be approximated by a linear function.
Section 4: Statistics Functions Keystrokes 70 ´j ® Display 7.56 0.99 57 Predicted grain yield in tons/hectare. The original data closely approximates a straight line. Other Applications Interpolation. Linear interpolation of tabular values, such as in thermodynamics and statistics tables, can be carried out very simply on the HP-15C by using the j function.
Section 5 The Display and Continuous Memory Display Control The HP-15C has three display formats – •, i, and ^ – that use a given number (0 through 9) to specify display format. The illustration below shows how the number 123,456 would be displayed specified to four places in each possible mode. ´•4 : 123,456.0000 ´i4 : 1.2346 05 ´^4 : 123.46 03 Owing to Continuous Memory, any change you make in the display format will be preserved until Continuous Memory is reset.
Section 5: The Display and Continuous Memory 59 Scientific Notation Display i (scientific) format displays a number in scientific notation. The sequence ´i n specifies the number of decimal places to be shown. Up to six decimal places can be shown since the exponent display takes three spaces.
Section 5: The Display and Continuous Memory Mantissa Display Regardless of the display format, the HP-15C always internally holds each number as a 10-digit mantissa and a two-digit exponent of 10. For example, π is always represented internally as 3.141592654×1000, regardless of what is in the display. When you want to view the full 10-digit mantissa of a number in the Xregister, press ´ CLEAR u. To keep the mantissa in the display, hold the u key down. Keystrokes Display 3.
Section 5: The Display and Continuous Memory 61 Digit Separators The HP-15C is set at power-up so that it separates integral and fractional portions of a number with a period (a decimal point), and separates groups of three digits in the integer portion with a comma. You can reverse this setting to conform to the numerical convention used in many countries. To do so, turn off the calculator. Press and hold =, press and hold ., release =, then release . (= / .).
Section 5: The Display and Continuous Memory Low-Power Indication When a flashing asterisk, which indicates low battery power, appears in the lower left-hand side of the display, there is no reason to panic. You still have plenty of calculator time remaining: at least 10 minutes if you continuously run programs, and at least an hour if you do calculations manually. Refer to appendix F (page 259) for information on replacing the batteries. 0.
Section 5: The Display and Continuous Memory 63 Resetting Continuous Memory If at any time you want to reset (entirely clear) the HP-15C Continuous Memory: 1. Turn the calculator off. 2. Press and hold the = key, then press and hold the key. 3. Release the = key, then the - key. (This convention is represented as = / -.) When Continuous Memory is reset, Pr Error (power error) will be displayed. Press any key to clear the display.
Part ll HP-15C Programming
Section 6 Programming Basics The next five sections are dedicated to explaining aspects of programming the HP-15C. Each of these programming sections will first discuss basic techniques (The Mechanics), then give examples for the implementation of these techniques (Examples), and lastly discuss finer points of operation in greater detail (Further Information). Read only as far as you need to support your use of the HP-15C.
Section 6: Programming Basics 67 Location in Program Memory. Program memory – and therefore the calculator's position in program memory – is demarcated by line numbers. Line 000 marks the beginning of program memory and cannot be used to store an instruction. The first line that contains an instruction is line 001. Program lines other than 000 do not exist until instructions are written for them.
Section 6: Programming Basics Keystrokes 2 * 9 . 8 ÷ ¤ Display 002003004005006007008- 2 20 9 48 8 10 11 Given h in the X-register, lines 002 to 008 calculate 2h . 9.8 Program End. There are three possible endings for a program: | n (return) will end a program, return to line 000, and halt. ¦ will stop a program without moving to line 000. The end of program memory contains an automatic n. Keystrokes |n Display 009- 43 32 Optional if this is the last program in memory.
Section 6: Programming Basics Keystrokes |¥ 69 Display Run mode; no PRGM annunciator displayed. (The display will depend on any previous result.) The position in program memory does not change when modes are switched. Should the calculator be shut off, it always ―wakes up‖ in Run mode. Executing a Program. In Run mode, press ´ letter label or G digit (or letter) label. This addresses a program and starts its execution. The display will flash running. Keystrokes 300.51 ´A Display 300.51 7.
Section 6: Programming Basics This is the method used above, where h was placed in the X-register before running the program. No v instruction is necessary because program execution (here: ´A) both terminates digit entry and enables the stack lift. The above program then multiplied the contents of the X-register (h) by 2. The presence of the stack even makes it possible to load more than one variable prior to running a program.
Section 6: Programming Basics 71 The program to calculate this information uses these formulas and data: base area = r2. volume = base area × height = r2h. surface area = 2 base areas + side area = 2r2 + 2rh. Radius, r 2.5cm 4.0 4.5 Height, h Base Area Volume Surface Area ? ? ? ? ? ? ? ? ? ? ? ? 8.0 cm 10.5 4.0 TOTALS Method: 1. Enter an r value into the calculator and save it for other calculations.
Section 6: Programming Basics Keystrokes ´bA Display 001-42,21,11 O0 002- 44 0 |x 003- 43 11 |$ * O4 O+1 00443 26 00520 00644 4 007-44,40, 1 ¦ 008- 31 * 009- 20 ´© 010- 42 31 O+2 011-44,40, 2 l0 ÷ 2 * l4 012013014015016- 2 * 017018- 45 0 10 2 20 45 4 2 20 Assigns this program the label ―A‖. Stores the contents of X-register into R0. r must be in the Xregister before running the program. Squares the contents of the Xregister (which will be r). r2, the BASE AREA of a can.
Section 6: Programming Basics Keystrokes + Display 019– 40 O+3 020–44,40, 3 |n 021– 43 32 73 SIDE AREA + BASE AREA = SURFACE AREA. Keeps a sum of all SURFACE AREAS in R3. Ends the program and returns program memory to line 000. Now, let's run the program: Keystrokes |¥ Display ´ CLEAR Q 2.5 ´A (or: G A) 2.5 19.6350 8 8 ¦ 157.0796 164.9336 4 50.2655 10.5 527.7876 364.4247 4 ¦ 10.5 ¦ 4.5 ¦ 4.5 63.6173 Sets calculator to Run mode. (PRGM cleared.) Clears all storage registers.
Section 6: Programming Basics Keystrokes 4 ¦ l1 l2 l3 Display 4 254.4690 240.3318 133.5177 939.3362 769.6902 Enter h of third can. VOLUME of third can. SURFACE AREA of third can. Sum of BASE AREAS. Sum of VOLUMES. Sum of SURFACE AREAS. The preceding program illustrates the basic techniques of programming. It also shows how data can be manipulated in Program and Run modes by entering, storing, and recalling data (input and output) using v, O, l, storage register arithmetic, and programmed stops.
Section 6: Programming Basics 75 Keycode 25: second row, fifth key. Memory Configuration Understanding memory configuration is not essential to your use of the HP-15C. It is essential, however, for obtaining maximum efficiency in memory and programming use. The more you program, the more useful this knowledge will be. Memory configuration and allocation is thoroughly explained in appendix C, Memory Allocation. Should you ever get an Error 10, you have run up against limitations of the HP-15C memory.
Section 6: Programming Basics Initial Memory Configuration Memory is reallocated by telling the calculator which data storage register shall be the highest data register; all other registers are left for programming and advanced functions. Keystrokes * 60 ´ m % * Display 60.0000 R60 and below allocated to data storage; five (R61 to R65) remain for programming. The optional omission of the ´ keystroke after another prefix key is explained on page 78, Abbreviated Key Sequences.
Section 6: Programming Basics Keystrokes 1´m% Display 1.0000 19 ´ m% 19.0000 lm% 19.0000 77 R1 and R0 allocated for data storage; R2 to R65 available for programming and advanced functions. Original allocation: R19 (R.9) and below for data storage; R20, to R65 for programming and advanced functions.* Displays the current highest data register. The m and W (memory status) functions are described in detail in appendix C.
Section 6: Programming Basics corresponding label. If need be, the search will wrap around at the end of program memory and continue at line 000. When it encounters an appropriate label, the search stops and execution begins. If a label is encountered as part of a running program, it has no effect, that is, execution simply continues. Therefore, you can label a subordinate routine within a program (more on subroutines in section 9).
Section 6: Programming Basics 79 For example, ´b´A becomes ´bA, ´m´% becomes ´m%, and O´# becomes O#. The removal of the ´ is not ambiguous because the ´-shifted function is the only logical one in these cases. The keycodes for such instructions do not include the extraneous ´ even if you do key it in. User Mode User mode is a convenience to save keystrokes when addressing (calling up) programs for execution.
Section 6: Programming Basics Example: Write a program for 5x4 + 2x3 as (((5x + 2)x)x)x, then evaluate for x = 7 Keystrokes |¥ ´bB 5 * 2 + * * * |n Display 000- Assumes position in memory is line 000. If it is not, clear program memory. 001-42,21,12 0025 00320 0042 00540 00620 00720 00820 00943 32 5x. 5x + 2. (5x + 2)x. (5x + 2)x2. (5x + 2)x3. Returns to Run mode, Prior result remains in display. |¥ 7vv v 7.0000 ´B 12,691.0000 Loads the stack (X-, Y-, Z-, and T-registers) with 7.
Section 6: Programming Basics 81 Problems 1. The village of Sonance has installed a 12-o'clock whistle in the firehouse steeple. The sound level at the firehouse door, 3.2 meters from the whistle, is 138 decibels. Write a program to find the sound level at various distances from the whistle. Use the equation L = L0 – 20 log (r/r0), where: L0 is the known sound level (138 db) at a point near the source, r0 is the distance of that point from the source (3.
Section 7 Program Editing There are many reasons to modify a program after you've already stored it: you might want to add or delete an instruction (like O, ©, or ¦), or you might even find some errors! The HP-15C is equipped with several editing features to make this process as easy as possible. The Mechanics Making a program modification of any kind involves two steps: moving to the proper line (the location of the needed change) and making the deletion(s) and/or insertion(s).
Section 7: Program Editing 83 The Back Step (‚) Instruction. To move one line backwards in program memory, press ‚ (back step) in Program or Run mode. This function is not programmable. ‚ will scroll (with the key held down) in Program mode. Program instructions are not executed. Deleting Program Lines Deletions of program instructions are made with − (back arrow) in Program mode. Move to the line you want to delete, then press −. Any remaining following lines will be renumbered to stay in sequence.
Section 7: Program Editing Let's start at the end of the program and work backwards. In this way, deletions will not change the line numbers of the preceding lines in the program. Keystrokes |¥ t “ 020 (or use Â) Display 000020-44,40, 3 Program mode. (Assumes position is at line 000.) Moves position to line 020 (instruction O + 3.
Section 7: Program Editing Keystrokes Display − 019| ‚ (hold) 016- 45 − l2 t “ 011 (or hold ‚) − | ‚ (hold) 01520 01645 2 011-44,40, 2 42 31 31 − l1 |‚ − 007-44,40, 00845 007-44,40, 00644 − O2 005006- 010008- 44 40 4 1 1 1 4 20 2 85 Line 020 deleted. The next line to edit is line 016 (l 4). Line 016 deleted. Line 016 changed to l 2. Moves to line 011 (O+ 2). Line 011 deleted. Stop! (Single-stepping backwards to line 008: ¦.) ¦ deleted. Line 008 changed to l 1. Back-step to line 007.
Section 7: Program Editing you can check the program by executing it stepwise. This is done by pressing  in Run mode. Keystrokes Display |¥ ´ CLEAR Q tA 8O1 2.5  (hold) (release)     8.0000 2.5 00142,21,11 2.5000 002 44 2.5000 0 003 43 11 6.2500 004 43 26 3.1416 005 19.6350 20 Run mode. Clear storage registers. Move to first line of program A. Store a can height. Enter a can radius. Keycode for line 001 (label). Result of executing line 001. t 0. Result. | x. Result. | $. Result.
Section 7: Program Editing 87 Insertions and Deletions After an insertion, the display will show the instruction you just added. After a deletion, the display will show the line prior to the deleted (now nonexistent) one. If all space available in memory is occupied, the calculator will not accept any program instruction insertions and Error 4 will be displayed.
Section 7: Program Editing Keystrokes ´b.1 ´ •2 1 . 0 7 5 ® y * |n Display 001-42,21,.1 002-42, 7, 2 0031 00448 0050 0067 0075 00834 00914 01020 01143 32 Interest. (1 + i)n PV (1 + i)n Load the program and find the future value of $1,000 invested for 5 years; of $2,300 invested for 4 years. Remember to use G to run a program with a digit label. (Answers: $1,435.63; $3,071.58.) Alter the program to make the annual interest rate 8.0%.
Section 7: Program Editing 89 Make any necessary modifications in the program to also find and display s, the length of the circular arc cut by θ (in radians), according to the equation s = r θ. Complete the following table: θ 45° 90° 270° r 50 100 100 ℓ ? ? ? s ? ? ? (Answers: 38.2683 and 39.2699; 141.4214 and 157.0796; 141.4214 and 471.2389. A possible new sequence is: ´bA |D ´•4 O0 2* ® O1 2÷ [ * ´© ´© l0 l1 ´r * |n).
Section 8 Program Branching and Controls Although the instructions in a program are normally executed sequentially, it is often desirable to transfer execution to a part of the program other than the next line. Branching in the HP-15C may be simple, or it may depend on a certain condition. By branching to a previous line, it is possible to execute part of a program more than once – a process called looping. The Mechanics Branching The Go To (t) Instruction.
Section 8: Program Branching and Controls 91 of this loop can be controlled by a conditional branch, an ¦ instruction (written into the loop), or simply by pressing any key during execution (which stops the program). Conditional Tests Another way to alter the sequence of program execution is by a conditional test, a true/false test which compares the number in the X-register either to zero or to the number in the Y-register.
Section 8: Program Branching and Controls Following a conditional test, program execution follows the "Do if True" Rule: it proceeds sequentially if the condition is true, and it skips one instruction if the condition is false. A t instruction is often placed right after a conditional test, making it a conditional branch; that is, the t branch is executed only if the test condition is met. Flags Another conditional test for programming is a flag test.
Section 8: Program Branching and Controls 93 Examples Example: Branching and Looping A radiobiology lab wants to predict the diminishing radioactivity of a test amount of 131 I, a radioisotope. Write a program to figure the radioactivity at 3-day intervals until a given limit is reached. The formula for Nt, the amount of radioisotope remaining after t days, is Nt = No (2-t/k), where k = 8 days, the half-life of 131I, and N0 is the initial amount.
Section 8: Program Branching and Controls Keystrokes Display l*1 010-45,20, 1 ´© l2 |T9 01142 31 01245 2 013-43,30, 9 |n 3 O+ 0 tA 01443 32 0153 016-44,40, 0 01722 11 Recall multiplication with the contents of R1 (N0), yielding Nt, the mci of 131I remaining after t days Pauses to display Nt. Recalls limit value to X-register. x ≥ y ? Tests whether limit value (in X) meets or exceeds Nt (in Y). If so, program ends. If not, program continues. Adds 3 days to t in R0.
Section 8: Program Branching and Controls 95 Example: Flags Calculations on debts or investments can be calculated in two ways: for payments made in advance (at the beginning of a given period) and for payments made in arrears (at the end of a given period).
Section 8: Program Branching and Controls Keystrokes |¥ ´ bB Display 000001-42,21,12 |"0 002-43, 5, 0 t1 ´bE 00322 1 004-42,21,15 |F0 005-43, 4, 0 ´b1 O1 1 + ® “ y “ 1 + l÷1 006-42,21, 1 00744 1 0081 00940 01034 01116 01214 01316 0141 01540 016-45,10, 1 * |?0 |n 01720 018-43, 6, 0 01943 32 l1 1 + * 020021022023- 45 |n 024- 43 32 1 1 40 20 Program mode. Start at "B" if payments to be made at the beginning. Flag 0 clear (false); indicates advance payments. Go to main routine.
Section 8: Program Branching and Controls 97 Now run the program to find the total amount needed in an account from which you want to take $250/month for 48 months. Enter the periodic interest rate as a decimal fraction, that is, 0.005 per month. First find the sum needed if payments will be made at the beginning of the month (payments in advance), then calculate the sum needed if payments will be made at the end of the month (in arrears). Keystrokes |¥ 250 v 48 v .005 ´B (Repeat stack entries.
Section 8: Program Branching and Controls Looping Looping is an application of branching which uses a t instruction to repeat a portion of the program. A loop can continue indefinitely, or may be conditional. A loop is frequently used to repeat a calculation with different variables. At the same time, a counter, which increments with each loop, may be included to keep track of loop iterations. This counter can then be checked with a conditional test to determine when to exit the loop.
Section 8: Program Branching and Controls 99 In this way, a program can accommodate two different modes of input, such as degrees and radians, and make the correct calculation for the mode chosen. You set a flag if a conversion needs to be made, for instance, and clear it if no conversion is needed. Suppose you had an equation requiring temperature input in degrees Kelvin, although sometimes your data might be in degrees Celsius.
Section 8: Program Branching and Controls Flag 9. An overflow condition (described on page 61) automatically sets flag 9. Flag 9 causes the display to blink or, if a program is running, waits until execution is complete and then starts blinking the display. Flag 9 may be cleared in three ways: Press | " 9 (the common procedure for clearing flags). Press −. This will only clear flag 9 and stop the blinking—it will not clear the display. Turn the calculator off.
Section 9 Subroutines When the same set of instructions needs to be used at more than one point in a program, memory space can be conserved by storing those instructions as a single subroutine. The Mechanics Go To Subroutine and Return The G (go to subroutine) instruction is executed in the same way as the t branch, with one major difference: it establishes a pending return condition. G label, like t label,* transfers program execution to the line with the corresponding label (A to E, 0 to 9 or .0 to .9).
Section 9: Subroutines Subroutine Limits A subroutine can call up another subroutine, and that subroutine can call up yet another subroutine. This ―subroutine nesting‖—the execution of a subroutine within a subroutine—is limited to stack of subroutines seven levels deep (this does not count the main program level).
Section 9: Subroutines MAIN PROGRAM |¥ ´ CLEAR M 000001- ´ b 9 002- | R 003- O 0 004- ® 005- O - 0 006- G .3 103 (Not programmable.) Start main program. Radians mode. Stores x2 in R0. Brings x1 into X; x2 into Y. (x2 - x1) in R0. Transfer to subroutine ―.3‖ with x1. Return from subroutine ―.3‖. 007- “ 008- ® 009- G .3 - y1. Brings x2 into X-register. Transfer to subroutine with x2. Return from subroutine ―.3‖. 010- + 011- l ÷ 0 012- | n SUBROUTINE 013- ´ b .
Section 9: Subroutines Example: Nesting. The following subroutine, labeled ―.4‖, calculates the value of the expression x 2 y 2 z 2 t 2 as part of a larger calculation in a larger program. The subroutine calls upon another subroutine (a nested subroutine), labeled ―.5‖, to do the repetitive squaring. The program is executed after placing the variables t, z, y, and x into the T-, Z-, Y-, and X-registers. Keystrokes ´ b.4 |x G.5 G.5 G.5 ¤ Start of main subroutine. x2.
Section 9: Subroutines 105 Further Information The Subroutine Return The pending return condition means that the n instruction occurring subsequent to a G instruction causes a return to the line following the G rather than a return to line 000. This is what makes a subroutine useful and reuseable in different parts of a program: it will always return execution to where it branched from, even as that point changes.
Section 10 The Index Register and Loop Control The Index register (RI) is a powerful tool in advanced programming of the HP-15C. In addition to storage and recall of data the Index register can use an index number to: Count and control loops. Indirectly address storage registers, including those beyond R.9 (R19). Indirectly branch to program line numbers, as well as to labels. Indirectly control the display format. Indirectly control flag operations.
Section 10: The Index Register and Loop Control 107 Indirect Program Control With the Index Register The V key is used for all forms of indirect program control other than indirect register addressing. Hence, V (not %) is used for indirect program branching, indirect display format control, and indirect flag control. Program Loop Control Program loop counting and control can be carried out in the HP-15C by any storage register: R0 through R9, R.0 through R.9, or the Index register (V).
Section 10: The Index Register and Loop Control Indirect Addressing If RI contains: 21 22 23 24 ⋮ 65 % will address: R21 R22 R23 R24 ⋮ R65 t V or GV will transfer to:* ´bB " " C " " Á " " E — — *For RI 0 only. Index Register Arithmetic Direct. O or l { + , -, *, ÷ } V. Storage or recall arithmetic operates with the Index register in the same manner as upon other data storage registers (page 43). Indirect.
Section 10: The Index Register and Loop Control 109 To Labels. If the RI value is positive, t V and G V will transfer execution to the label which corresponds to the number in the Index register (see the above table). For instance, if the Index register contains 20.00500, then a tV instruction will transfer program execution to ´b A. See the chart on page 107. To Line numbers.
Section 10: The Index Register and Loop Control For example, the number 0.05002 in a storage register represents: nnnnn x x x y y 0.0 5 0 0 2 Start count at zero. Count by twos. Count up to 50. I and e Operation. Each time a program encounters I or e it increments or decrements nnnnn (the integer portion of the loop control number), thereby keeping count of the loop iterations.
Section 10: The Index Register and Loop Control 111 True (nnnnn xxx) False (nnnnn > xxx) instruction ´sV t. 1 loop Instruction exit loop For e: given nnnnn.xxxyy, decrement nnnnn to nnnnn - yy, compare it to xxx, and skip the next program line if the new value satisfies nnnnn ≤ xxx. This allows you to exit a loop at this point when nnnnn becomes less than or equal to xxx. For example, loop iterations will alter these control numbers as follows: Iterations Operation I 0 0.00602 1 2.00602 2 4.
Section 10: The Index Register and Loop Control Keystrokes l% ´ X .2 Display 2.6458 2.6458 Indirectly recalls contents of R.2. Check: same contents recalled by directly addressing R.2. Exchanging the X-Register Keystrokes ´XV Display 12.3456 lV ´ X% 2.6458 0.0000 l% ´X2 2.6458 2.6458 Exchanges contents of RI and Xregister. Present contents of RI. Exchanges contents of R2 (which is zero) with X. Check: directly address R2. Storage Register Arithmetic Keystrokes Display 10.0000 10 O + V 12.
Section 10: The Index Register and Loop Control 113 Here is a revision of the original radioisotope decay program. This time, we will limit the program to three executions of the loop rather than setting a specific limit value. This example uses e with a loop control number in R2 of 3.0 0 0 0 1. initial loop counter decrement value test (goal) value Make the following changes to the program (assuming it is in memory). A loop counter will be stored in R2 and a line number in the Index register.
Section 10: The Index Register and Loop Control Keystrokes Display 15 “ O -15.0000 V´A 2.0000 84.0896 5.0000 64.8420 8.0000 50.0000 50.0000 Branch line number. Running program loop = 3. counter Loop counter = 2. Loop counter = 1. Loop counter = 0; program ends. Example: Display Format Control The following program pauses and displays an example of • display format for each possible decimal place. It utilizes a loop containing a s instruction to automatically change the number of decimal places.
Section 10: The Index Register and Loop Control 115 To display fixed point notation for all possible decimal places on the HP-15C: Keystrokes |¥ ´B Display Run mode. 9.000000000 8.00000000 7.0000000 6.000000 5.00000 4.0000 3.000 2.00 1.0 0. 0. Display at ´©instruction. Display when program halts. Further Information Index Register Contents Any value stored in the Index register can be referenced in three different ways: Using V like any other storage register.
Section 10: The Index Register and Loop Control I and e For the purpose of loop control, the integer portion (the counter value) of the stored control number can be up to five digits long (nnnnn.xxxyy). The counter value (nnnnn) is zero if not specified otherwise. xxx, in the decimal portion of the control number, must be specified as a three-digit number. (For example, ―5‖ must be ―005‖.) xxx is zero if not specified otherwise.
Section 10: The Index Register and Loop Control 117 An exception is in the case of f where the display format number in R I may range from -6 to +9. (This is discussed in appendix E on page 247.) A number less than zero will not affect the display format, but will affect accuracy with this function.
Part lll HP-15C Advanced Functions
Section 11 Calculating With Complex Numbers The HP-15C enables you to calculate with complex numbers, that is, numbers of the form a + ib, where a is the real part of the complex number, b is the imaginary part of the complex number, and i 1. As you will see, the beauty of calculating with the HP-15C in Complex mode is that once the complex numbers are keyed in, most operations are executed in the same manner as with real numbers.
Section 11: Calculating With Complex Numbers 121 Complex mode is activated 1) automatically, when executing ´ V or ´ }; or 2) by setting flag 8, the Complex mode flag (|F 8). When the calculator is in Complex mode, the C annunciator in the display is lit. This tells you that flag 8 is set and the complex stack exists. In or out of Complex mode, the number appearing in the display is the number in the real X-register.
Section 11: Calculating With Complex Numbers Example: Add 2 + 3i and 4 + 5i. (The operations are illustrated in the stack diagrams following the keystroke listing.) Keystrokes ´•4 2v Display 2.0000 3 3 ´V 2.0000 4v 4.0000 5 5 ´V 4.0000 + ´ % (hold) (release) 6.0000 8.0000 6.0000 Keys real part of first number into (real) Y-register. Keys imaginary part of first number into (real) X-register.
Section 11: Calculating With Complex Numbers Re Im Re Im Re Im Re Im 123 Re Im T 9 8 7 7 7 0 Z 8 7 6 6 7 0 Y 7 6 2 2 6 0 X 6 2 3 2 Keys: 2 3 v 2 ´V 3 The execution of ´ V causes the entire stack to drop, the T contents to duplicate, and the real X contents to move to the imaginary X-register. When the second complex number is entered, the stacks operate as shown below. Note that v lifts both stacks.
Section 11: Calculating With Complex Numbers Stack Lift in Complex Mode Stack lift operates on the imaginary stack as it does on the real stack (the real stack behaves identically in and out of Complex mode). The same functions that enable, disable, or are neutral to lifting of the real stack will enable, disable, or be neutral to lifting of the imaginary stack. (These processes are explained in detail in section 3 and appendix B.
Section 11: Calculating With Complex Numbers 125 of Complex mode. Instead, you can do either of the following: Multiply by -1. If you don't want to disturb the rest of the stack, press “ ´ } “ ´ }. To find the negative of only one part of a complex number in the X-register: Press “ to negate the real part only. Press ´ } “ ´ } to negate the imaginary part only, forming the complex conjugate. Clearing a Complex Number Inevitably you will need to clear a complex number.
Section 11: Calculating With Complex Numbers Clearing the Imaginary X-Register. To clear the number in the imaginary X-register, press ´ }, then press −. Press ´ } again to return the zero, or any new number keyed in, to the imaginary X-register. Example: Replace -1 -8i by -1 + 5i.
Section 11: Calculating With Complex Numbers 127 Entering Complex Numbers with −. The clearing functions − and ` can also be used with } as an alternative method of entering (and clearing) complex numbers. Using this method, you can enter a complex number using only the X-register, without affecting the rest of the stack. (This is possible because − and ` disable stack lift.) Executing } will also create an imaginary stack if one is not already present.
Section 11: Calculating With Complex Numbers Re Im Re Im Re Im Re Im T a b a b a b a b Z c d c d c d c d Y e f e f e f e f X 7 8 0 8 9 8 17 144 − Keys: |x 9 Entering a Real Number You have already seen two ways of entering a complex number. There is a shorter way to enter a real number: simply key it (or recall it) into the display just as you would if the calculator were not in Complex mode.
Section 11: Calculating With Complex Numbers 129 Entering a Pure Imaginary Number There is a shortcut for entering a pure imaginary number into the X-register when you are already in Complex mode: key in the (imaginary) number and press ´ } Example: Enter 0 + 10i (assuming the last function executed was not − or `. Keystrokes 10 Display 10 Keys 10 into the displayed real X-register and zero into the imaginary X-register. Exchanges numbers in real and imaginary X-registers.
Section 11: Calculating With Complex Numbers Storing and Recalling Complex Numbers The O and l functions act on the real X-register only; therefore, the imaginary part of a complex number must be stored or recalled separately. The keystrokes to do this can be entered as part of a program and executed automatically.* To store a + ib from the complex X-register to R1 and R2, you can use the sequence O 1 ´} O 2 You can follow this by ´ } to return the stack to its original condition if desired.
Section 11: Calculating With Complex Numbers 131 One-Number Functions The following functions operate on both the real and imaginary parts of the number in the X-register, and place the real and imaginary parts of the answer back into those registers. ¤xNo∕@'a:; All trigonometric and hyperbolic functions and their inverses also belong to this group.
Section 11: Calculating With Complex Numbers Conditional Tests For programming, the four conditional tests below will work in the complex sense: ~ and T 0 compare the complex number in the (real and imaginary) X-registers to 0 + 0i, while T 5 and T 6 compare the complex numbers in the (real and imaginary) X- and Y-registers. All other conditional tests besides those listed below ignore the imaginary stack. ~ T 0 (x ≠ 0) T 5 (x = y) T 6 (x ≠ y) Example: Complex Arithmetic.
Section 11: Calculating With Complex Numbers 133 Complex Results from Real Numbers In the preceding examples, the entry of complex numbers had ensured the (automatic) activation of Complex mode. There will be times, however, when you will need Complex mode to perform certain operations on real numbers, such as 5 . (Without Complex mode, such as operation would result in an Error 0 – improper math function.
Section 11: Calculating With Complex Numbers r (cos θ + i sin θ) = reiθ (polar) a + ib = rθ (phasor) ; and : can be used to interconvert the rectangular and polar forms of a complex number. They operate in Complex mode as follows: ´ ; converts the polar (or phasor) form of a complex number to its rectangular form by replacing the magnitude r in the real Xregister with a, and replacing the angle θ in the imaginary Xregister with b.
Section 11: Calculating With Complex Numbers 135 Example: Find the sum 2(cos 65° + i sin 65°) + 3(cos 40° + i sin 40°) and express the result in polar form, (In phasor form, evaluate 2 65° + 3 40°.) Keystrokes |D Display Sets Degrees mode for any polarrectangular conversions. 2v 65 ´ V 2.0000 2.0000 ´; 0.8452 3v 40 ´ V ´; 3.0000 3.0000 2.2981 + |: 3.1434 4.8863 ´% (hold) (release) 49.9612 4.8863 C annunciator displayed; Complex mode activated.
Section 11: Calculating With Complex Numbers Keystrokes 2´} 8“v 6´V 3Y * 4v 5¤ 2“* ´V Display 0.0000 -8.0000 -8.0000 352.0000 -1.872.0000 4.0000 2.2361 -4.4721 4.0000 -295.4551 ÷ 2i. Display shows real part. -8 + 6i. (-8 + 6i)3. 2 i (-8 + 6i)3. 2 5 . 4 2 5i . 2i(-8 6i )3 4 - 2 5i 2v5¤ 4“* . 2.2361 -8.9443 ´V 2.0000 ÷ ´% 9.3982 -35.1344 9.3982 2 4 5i . Real part of result. Answer: 9.3982 -35.1344i. 2.
Section 11: Calculating With Complex Numbers 137 For Further Information The HP-15C Advanced Functions Handbook presents more detailed and technical aspects of using complex numbers in various functions with the HP-15C. Applications are included. The topics include: Accuracy considerations. Principal branches of multi-valued functions. Complex contour integrals. Complex potentials. Storing and recalling complex numbers using a matrix. Calculating the nth roots of a complex number.
Section 12 Calculating With Matrices The HP-15C enables you to perform matrix calculations, giving you the capability to handle advanced problems with ease. The calculator can work with up to five matrices, which are named A through E since they are accessed using the corresponding A through E keys. The HP-15C lets you specify the size of each matrix, store and recall the values of matrix elements, and perform matrix operations – for matrices with real or complex elements.
Section 12: Calculating with Matrices Keystrokes |"8 2v´mA ´>1 ´U 3.8 O A 7.2 O A 1.3 O A .9 “ O A 2v1´m B 16.5 O B 22.1 “ O B ´
Section 12: Calculating with Matrices Keystrokes Display b 2 l>B l>A A 2 running ÷ C 2 1 Enters descriptor for B, the 2×1 constant matrix. 2 Enters descriptor for A, the 2×2 coefficient matrix, into the Xregister, moving the descriptor for B into the Y-register. Temporary display while A-1B is being calculated and stored in matrix C. 1 Descriptor for the result matrix, C, a 2×1 matrix. Now recall the elements of matrix C – the solution to the matrix equation.
Section 12: Calculating with Matrices 141 Matrix inversion, for example, can be performed on an 8×8 matrix with real elements (or on a 4×4 matrix with complex elements, as described later*). To conserve memory, all matrices are initially dimensioned as 0×0. When a matrix is dimensioned or redimensioned, the proper number of registers is automatically allocated in memory.
Section 12: Calculating with Matrices Example: Dimension matrix A to be a 2×3 matrix. Keystrokes 2v Display 2.0000 3 3 ´mA 3.0000 Keys number of rows into Y-register. Keys number of columns into Xregister. Dimensions matrix A to be 2×3. Displaying Matrix Dimensions There are two ways you can display the dimensions of a matrix: Press l > followed by the letter key specifying the matrix.
Section 12: Calculating with Matrices 143 If you redimension a matrix to a larger size, elements with the value 0 are added at the end as required by the new dimensions. For example, if the same 2×3 matrix is re dimensioned, to 2×4, then When you have finished calculating with matrices, you'll probably want to redimension all five matrices to 0×0, so that the registers used for storing their elements will be available for program lines or for other advanced functions.
Section 12: Calculating with Matrices To store or recall sequential elements of a matrix: 1. Be sure the matrix is properly dimensioned. 2. Press ´ >1. This stores 1 in both storage registers R0 and R1, so that elements will be accessed starting at row 1, column 1. 3. Activate User mode by pressing ´ U. With the calculator in User mode, after each element is stored or recalled the row number in R0 or the column number in R1 is automatically incremented by 1, as shown in the example following. 4.
Section 12: Calculating with Matrices Keystrokes ´>1 Display ´U 1OA A 2OA 3OA 4OA 5OA 6OA lA 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 A 1,1 lA lA lA lA lA ´U 145 1,1 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 6.0000 Sets beginning row and column numbers in R0 and R1 to 1. (Display shows the previous result.) Activates User mode. Row 1, column 1 of A. (Displayed momentarily while A key held down.) Value of a11. Value of a12. Value of a13. Value of a21. Value of a22. Value of a23.
Section 12: Calculating with Matrices Using R0 and R1. To access a particular matrix element, store its row number in R0 and its column number in R1. These numbers won't change automatically (unless the calculator is in User mode). To recall the element value (after storing the row and column numbers), press l followed by the letter key specifying the matrix.
Section 12: Calculating with Matrices 147 Example: Recall the element in row 2, column 1 of matrix A from the previous example. Use the stack registers. Keystrokes 2v1 l|A Display 1 4.0000 Enters row number into Yregister and column number into X-register. Value of a21. Storing a Number in All Elements of a Matrix To store a number in all elements of a matrix, simply key that number into the display, then press O> followed by the letter key specifying the matrix.
Section 12: Calculating with Matrices operate on the matrices whose descriptors are placed in the X-register and (for some operations) the Y-register. Two matrix operations – calculating a determinant and solving the matrix equation AX = B – involve calculating an LU decomposition (also known as an LU factorization) of the matrix specified in the X-register.* A matrix that is an LU decomposition is signified by two dashes following the matrix name in the display of its descriptor.
Section 12: Calculating with Matrices 149 While the key used for any matrix operation that stores a result in the result matrix is held down, the descriptor of the result matrix is displayed. If the key is released within about 3 seconds, the operation is performed, and the descriptor of the result matrix is placed in the X-register. If the key is held down longer, the operation is not performed and the calculator displays null.
Section 12: Calculating with Matrices One-Matrix Operations: Sign Change, Inverse, Transpose, Norms, Determinant Keystroke(s) Result in X-register “ No change. ∕ (´∕ in User Mode) ´> 4 Descriptor of result matrix. ´> 7 ´> 8 ´> 9 Descriptor of transpose. Row norm of specified matrix.* Frobenius or Euclidean norm of specified matrix. † Determinant of specified matrix. Effect on Matrix Effect on Result Specified in Matrix X-register Changes sign of all elements. None. ‡ None.
Section 12: Calculating with Matrices 151 Example: Calculate the transpose of matrix B. Matrix B was set in preceding examples to 1 2 3 B . 4 5 9 Keystrokes l>B ´>4 Display b 2 b 3 3 2 Displays descriptor of 2×3 matrix B. Descriptor of 3×2 transpose. Matrix B (which you can view using l B in User mode) is now 1 4 B 2 5. 3 9 Scalar Operations Scalar operations perform arithmetic operations between a scalar (that is, a number) and each element of a matrix.
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 Subtracts each matrix from each matrix element from scalar value. element. Divides each matrix Calculates inverse of matrix element by scalar value. and multiplies each element by scalar value.
Section 12: Calculating with Matrices Keystrokes 1- Display b 2 3 153 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 1 B 7 3 5 . 9 17 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.
Section 12: Calculating with Matrices Keystrokes - Display C 2 3 Calculates B - A and stores values in redimensioned result matrix C. 0 1 2 3 4 8 The result is C 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.
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. A Keystrokes l> A l> B ´< C ´> 5 1 2 3 4 5 9 Display A and B 1 3 5 7 9 17 2 3 Recalls descriptor for matrix A.
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.
Section 12: Calculating with Matrices 1 Total Weight (kg) Total Value 274 $120.32 Week 2 233 $112.96 157 3 331 $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 week's delivery represents two linear equations (one for weight and one for value) with two unknown variables (the weights of cabbage and broccoli).
Section 12: Calculating with Matrices Keystrokes 274 OB 233 OB 331 OB 120.32 OB 112.96 OB 151.36 OB ´< Á Display 274.0000 233.0000 331.0000 120.3200 112.9600 151.3600 151.3600 l> B b2 3 l> A A2 2 ÷ d2 3 lÁ 186.0000 lÁ 141.0000 lÁ lÁ lÁ lÁ ´U 215.0000 88.0000 92.0000 116.0000 116.0000 * Stores b11.* Stores b12. Stores b13. Stores b21. Stores b22. Stores b23. Designates matrix D as result matrix. Recalls descriptor of constant matrix.
Section 12: Calculating with Matrices 159 Silas' deliveries were: Cabbage (kg) Broccoli (kg) 1 186 88 Week 2 141 92 3 215 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.
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.
Section 12: Calculating with Matrices 161 Instead, calculations with complex matrices are performed by using real matrices derived from the original complex matrices – in a manner to be described below – and performing certain transformations in addition to the regular matrix operations. These transformations are performed by four calculator functions. This section will describe how to do these calculations.
Section 12: Calculating with Matrices Suppose you need to do a calculation with a complex matrix that is not written as the sum of a real matrix and an imaginary matrix – as was the matrix Z in the example above – but rather written with an entire complex number in each element, such as x iy11 x12 iy12 Z 11 . x21 iy21 x22 iy22 This matrix can be represented in the calculator by a real matrix that looks very similar – one that is derived simply by ignoring the i and the + sign.
Section 12: Calculating with Matrices 163 Example: Store the complex matrix 4 3i 7 2i Z 1 5i 3 8i in the form ZC, since it is written in a form that shows ZC. Then transform ZC into the form ZP. You can do this by storing the elements of ZC in matrix A and then using the p function, where c AZ Keystrokes ´> 0 2v4 ´mA ´> 1 ´U 4 OA 3 OA 7 OA 2 “ OA 1 OA 5 OA 3 OA 8 OA ´U l> A ´p 4 3 7 2 . 1 5 3 8 Display 4.0000 4.0000 4.0000 4.0000 3.0000 7.0000 -2.0000 1.0000 5.0000 3.
Section 12: Calculating with Matrices Matrix A now represents the complex matrix Z in ZP form: 7 4 1 3 A ZP . 3 2 8 5 } } Real P art Imaginary P art The Complex Transformations Between ZP and Z An additional transformation must be done when you want to calculate the product of two complex matrices, and still another when you want to calculate the inverse of a complex matrix.
Section 12: Calculating with Matrices 165 Inverting a Complex Matrix You can calculate the inverse of a complex matrix by using the fact that ( )-1 = ( -1). To calculate inverse, Z-1, of a complex matrix Z: 1. Store the elements of Z in memory, in the form either of ZP or of ZC 2. Recall the descriptor of the matrix representing Z into the display. 3. If the elements of Z were entered in the form ZC, press ´p to transform ZC into ZP 4. Press ´ > 2 to transform ZP into . 5.
Section 12: Calculating with Matrices Keystrokes ´< B ∕ ´> 3 Display A 4 4 b 4 4 b 4 2 Designates B as the result matrix. Calculates ( )-1 = ( -1) and places the result in matrix B. Transforms ( -1) into ( -1)P. The representation of Z-1 in partitioned form is contained in matrix B. 0.0254 0.2420 0.0122 0.1017 B 0.2829 0.0022 0.1691 0.
Section 12: Calculating with Matrices 167 8. Press * to calculate XP = (YX)P. The values of these matrix elements are placed in the result matrix, and the descriptor of the result matrix is placed in the X-register. 9. If you want the product in the form (YX)C, press |c Note that you don't transform XP into . You can derive the complex elements of the matrix product YX by recalling the elements of (XY)P or (YX)C and combining them according to the conventions described earlier.
Section 12: Calculating with Matrices Writing down the elements of C, 1.0000 4.0000 1011 C 1.0000 1011 11 1.0000 10 2.8500 1010 1.0000 ZZ 1 3.8000 1010 1.0500 1010 P , where the upper half of matrix C is the real part of ZZ-1 and the lower half is the imaginary part. Therefore, by inspection of matrix C, 1.0000 2.85001010 ZZ 1 11 1.0000 4.000010 1.00001011 3.80001011 i 11 1.05001010 1.
Section 12: Calculating with Matrices 169 4. Recall the descriptor of the matrix representing A into the display. 5. If the elements of A were entered in the form of AC, press ´ p to transform AC into AP. 6. Press ´> 2 to transform AP into Ã. 7. Designate the result matrix; it must not be the same as the matrix representing A. 8. Press ÷; this calculates XP. The values of these matrix elements are placed in the result matrix, and the descriptor of the result matrix is placed in the X-register. 9.
Section 12: Calculating with Matrices In partitioned form, 0 10 5 0 0 and B 0 , A 200 200 0 200 170 0 where the zero elements correspond to real and imaginary parts with zero value. Keystrokes Display 4 v2´mA 2.0000 ´> 1 ´U 10 OA 0OA OA OA 200 OA “OA OA 170 OA 4 v 1´m B 0 O>B 2.0000 2.0000 10.0000 0.0000 0.0000 0.0000 200.0000 –200.0000 –200.0000 170.0000 1.0000 0.0000 5v1v 1.0000 O|B l> B 5.
Section 12: Calculating with Matrices Keystrokes ´> 2 ´< C ÷ |c lC lC lC lC ´U ´> 0 Display A A C C 0.0372 0.1311 0.0437 0.1543 0.1543 0.1543 4 4 4 4 4 2 1 2 171 Transforms AP into Ã. Designates matrix C as result matrix. Calculates XP and stores in C. Transforms XP into XC. Recalls c11. Recalls c12. Recalls c21. Recalls c22. Deactivates User mode. Redimensions all matrices to 0×0. The currents, represented by the complex matrix X, can be derived from C I 0.0372 0.
Section 12: Calculating with Matrices 1. Store the elements of A in memory, in the form either of AP or of AC. 2. Recall the descriptor of the matrix representing A into the display. 3. If the elements of A were entered in the form AC, press ´ p to transform AC into AP. 4. Press ´> 2 to transform AP into Ã. 5. Press O< to designate the matrix representing A as the result matrix. 6. Press ∕ to calculate (Ã)-1. 7.
Section 12: Calculating with Matrices 173 A problem using this procedure is given in the HP-15C Advanced Functions Handbook under Solving a Large System of Complex Equations. Miscellaneous Operations Involving Matrices Using a Matrix Element With Register Operations If a letter key specifying a matrix is pressed after any of the following function keys, the operation is performed using the matrix element specified by the row and column numbers in R0 and R1, just as though it were a data storage register.
Section 12: Calculating with Matrices Pressing ´mV dimensions the matrix specified in RI according to the dimensions in the X- and Y-registers. Pressing lmV recalls to the X- and Y-registers the dimensions of the matrix specified in RI. Pressing GV or tV has the same result as pressing G or t followed by the letter of the matrix specified in R I. (This is not actually a matrix operation – only the letter in the matrix descriptor is used.
Section 12: Calculating with Matrices 175 Several matrix functions operate on the matrix specified in the X-register only and store the result in the same matrix. For these operations the contents of the stack (including the LAST X register) are not moved – although the display changes to show the new dimensions if necessary.
Section 12: Calculating with Matrices Using Matrix Operations in a Program If the calculator is in User mode during program entry when you enter a O or l{A through E, %} instruction to store or recall a matrix element, a u replaces the dash usually displayed after the line number. When this line is executed in a running program, it operates as though the calculator were in User mode.
Section 12: Calculating with Matrices 177 The > 7 (row norm) and > 8 (Frobenius norm) functions also operate as conditional branching instructions in a program. If the X-register contains a matrix descriptor, these functions calculate the norm in the usual manner, and program execution continues with the next program line. If the X-register contains a number, program execution skips the next line. In both cases, the original contents of the X-register are stored in the LAST X register.
Section 12: Calculating with Matrices Keystroke(s) Results result matrix. ´> 6 Calculates residual in result matrix. ´> 7 Calculates row norm of matrix specified in Xregister. ´> 8 Calculates Frobenius or Euclidean norm of matrix specified in X-register. ´> 9 Calculates determinant of matrix specified in Xregister, Place LU in result matrix. ´p Transforms ZC into ZP. l{A through E, %} Recalls value from specified matrix, using row and column numbers in R0 and R1.
Section 12: Calculating with Matrices 179 Keystroke(s) Results O< Designates matrix specified in X-register as result matrix. ´U Row and column numbers in R0 and R1 are automatically incremented each time O or l {A through E, %} is pressed. ∕ Inverts matrix specified in X-register. Stores in result matrix. Use ´ ∕ if User mode is on. +, - If matrix descriptors specified in both X- and Yregisters, adds or subtracts corresponding elements of matrices specified.
Section 13 Finding the Roots of an Equation In many applications you need to solve equations of the form f(x)=0.* This means finding the values of x that satisfy the equation. Each such value of x is called a root of the equation f(x) = 0 and a zero of the function f(x). These roots (or zeros) that are real numbers are called real roots (or real zeros). For many problems the roots of an equation can be determined analytically through algebraic manipulation; in many other instances, this is not possible.
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.
Section 13: Finding the Roots of an Equation Keystrokes ´b0 3 * 1 0 |n Display 001–42,21, 0 002– 003– 004– 005– 006– 007– 008– 3 30 20 1 0 30 43 32 Begin with b instruction. Subroutine assumes stack loaded with x. Calculate x – 3. Calculate (x – 3)x. Calculate (x – 3)x – 10. 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 |¥ 0v 10 Display* Run mode. 0.0000 10 Initial estimates.
Section 13: Finding the Roots of an Equation Keystrokes ´_ 0 Display 5.0000 183 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.
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 _. G G r 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.
Section 13: Finding the Roots of an Equation Keystrokes “ ' “ 1 + 5 0 0 0 * ® Display 005– 006– 007– 008– 009– 010– 011– 012– 013– 014– 015– 2 0 0 * |n 016– 017– 018– 019– 020– 021– 16 12 16 1 40 5 0 0 0 20 34 2 0 0 20 30 43 32 185 – t / 20. – e– t / 20. 1 – e– t / 20. 5000 (1 – e– t / 20). Brings another t-value into X-register. 200t. 5000(1 – e– t / 20) – 200t. Switch to Run mode, key in two initial estimates of the time (for example, 5 and 6 seconds) and execute _.
Section 13: Finding the Roots of an Equation Fahr's 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.
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.0000 1v Initial estimates. –1 1“ Error 8 This display indicates that no ´_1 root was found. 0.0000 Clear error display.
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.
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 function's magnitude.
Section 13: Finding the Roots of an Equation Keystrokes * 8 + * 4 * 7 . 5 |n Display 003– 004– 005– 005– 007– 008– 009– 010– 011– 012– 013– 014– 30 20 8 40 20 4 20 7 48 5 30 43 32 (x – 6) x. ((x – 6) x + 8) x. 4 ((x – 6) x + 8) x. 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.
Section 13: Finding the Roots of an Equation 191 By making the height 1.5 decimeters, a 5.0×1.0×1.5-decimeter box is specified. If you ignore the upper limit on the height and use initial estimates of 3 and 4 decimeters (still less than the width), you will obtain a height of 4.2026 decimeters – a root that is physically meaningless. If you use small initial estimates such as 0 and 1 decimeter, you will obtain a height of 0.2974 decimeter – producing an undesirably short, flat box.
Section 13: Finding the Roots of an Equation Many functions exhibit special behavior when their arguments approach zero. You can check your function to determine values of x for which any argument within your function becomes zero, and then specify estimates at or near those values. Although two different initial estimates are usually supplied when using _, you can also use _ with the same estimate in both the X- and Y-registers.
Section 13: Finding the Roots of an Equation 193 Restriction on the Use of _ The one restriction regarding the use of _ is that _ cannot be used recursively. That is, you cannot use _ in a subroutine that is called during the execution of _. If this situation occurs, execution stops and Error 7 is displayed. It is possible, however, to use _ with f thereby using the advanced capabilities of both of these keys. Memory Requirements _ requires five registers to operate.
Section 14 Numerical Integration Many problems in mathematics, science, and engineering require calculating the definite integral of a function. If the function is denoted by f(x) and the interval of integration is a to b, the integral can be expressed mathematically as b I a f ( x ) dx. The quantity I can be interpreted geometrically as the area of a region bounded by the graph of f(x), the x-axis, and the limits x = a and x = b.
Section 14: Numerical Integration 195 In Run mode: 2. Key the lower limit of integration (a) into the X-register, then press v to lift it into the Y-register. 3. Key the upper limit of integration (b) in to the X-register. 4. Press ´ f followed by the label of your subroutine. Example: Certain problems in physics and engineering require calculating Bessel functions. The Bessel function of the first kind of order 0 can be expressed as J 0 ( x) 1 π π cos ( x sin θ) dθ .
Section 14: Numerical Integration Keystrokes Display |¥ 0v 0.0000 |$ 3.1416 |R 3.1416 Run mode. Key lower limit, 0, into Yregister. Key upper limit, π, into Xregister. Specify Radians mode for trigonometric functions. Now you are ready to press ´f 0 to calculate the integral. When you do so, you'll find that – just as with _ – the calculator will not display the result right away, as it does with other operations. The HP-15C calculates integrals using a sophisticated iterative algorithm.
Section 14: Numerical Integration 197 Before calling the subroutine you provide to evaluate f(x), the f algorithm – just like the _ algorithm – places the value of x in the X-, Y-, Z-, and T-registers. Because every stack register contains the x-value, your subroutine can calculate with this number without having to recall it from a storage register. The subroutines in the next two examples take advantage of this feature.
Section 14: Numerical Integration Keystrokes [ - Display 002– 003– 23 30 004– 005– 24 43 32 \ |n Calculate sin θ. Since a value of θ will be placed into the Y-register by the f algorithm before it executes this subroutine, the - operation at this point will calculate (θ – sin θ). Calculate cos (θ – sin θ). In Run mode, key the limits of integration into the X- and Y-registers. Be sure that the trigonometric mode is set to Radians, then press ´f 1 to calculate the integral.
Section 14: Numerical Integration 199 Find Si(2). Key in the following subroutine to evaluate the function f(x) = (sin x) / x.* Keystrokes |¥ ´ b .2 Display 000– 001–42,21, .2 [ ® 002– 003– 23 34 ÷ |n 004– 005– 10 43 32 Program mode. Begin subroutine with a b instruction. Calculate sin x. Since a value of x will be placed in the Y-register by the f algorithm before it executes this subroutine, the ® operation at this point will return x to the X-register and move sin x to the Yregister.
Section 14: Numerical Integration Accuracy of f The accuracy of the integral of any function depends on the accuracy of the function itself. Therefore, the accuracy of an integral calculated using f is limited by the accuracy of the function calculated by your subroutine. * To specify the accuracy of the function, set the display format so that the display shows no more than the number of digits that you consider accurate in the function's values.
Section 14: Numerical Integration 201 Because the accuracy of any integral is limited by the accuracy of the function (as indicated in the display format), the calculator cannot compute the value of an integral exactly, but rather only approximates it. The HP-15C places the uncertainty* of an integral's approximation in the Yregister at the same time it places the approximation in the X-register. To determine the accuracy of an approximation, check its uncertainty by pressing ®.
Section 14: Numerical Integration If the uncertainty of an approximation is larger than what you choose to tolerate, you can decrease it by specifying a greater number of digits in the display format and repeating the approximation.* Whenever you want to repeat an approximation, you don't need to key the limits of integration back into the X- and Y-registers.
Section 14: Numerical Integration 203 In the preceding example, the uncertainty indicated that the approximation might be correct to only four decimal places. If we temporarily display all 10 digits of the approximation, however, and compare it to the actual value of the integral (actually, an approximation known to be accurate to a sufficient number of decimal places), we find that the approximation is actually more accurate than its uncertainty indicates. Keystrokes ® ´ CLEAR u Display 1.
Section 14: Numerical Integration Memory Requirements f requires 23 registers to operate. (Appendix C explains how they are automatically allocated from memory.) If 23 unoccupied registers are not available, f will not run and Error 10 will be displayed. A routine that combines f and _ also requires 23 registers of space. For Further Information This section has given you the information you need to use f with confidence over a wide range of applications.
Appendix A Error Conditions If you attempt a calculation containing an improper operation – say division by zero – the display will show Error and a number. To clear an error message, press any one key. This also restores the display prior to the Error display. The HP-15C has the following error messages. (The description of Error 2 includes a list of statistical formulas used.) Error 0: Improper Mathematics Operation Illegal argument to math routine: ÷, where x = 0.
Appendix A: Error Conditions x or y is noninteger; x < 0 or y < 0; x > y; x or y ≥ 1010. Error 1: Improper Matrix Operation Applying an operation other than a matrix operation to a matrix, that is, attempting a nonmatrix operation while a matrix is in the relevant register (whether the X- or Y-register or a storage register).
Appendix A: Error Conditions 207 Error 3: Improper Register Number or Matrix Element Storage register named is nonexistent or matrix element indicated is nonexistent. Error 4: Improper Line Number or Label Call Line number called for is currently unoccupied or nonexistent (>448); or you have attempted to load a program line without available space; or the label called does not exist; or User mode is on and you did not press ´ before ¤, ', @, y or ∕.
Appendix A: Error Conditions + or -, where the dimensions are incompatible. *, where: the dimensions are incompatible; or the result is one of the arguments. ∕, where the matrix is not square. scalar/matrix ÷, where the matrix is not square. ÷, where: the matrix in the X-register is not square; the dimensions are incompatible; or the result is the matrix in the X-register. > 2, where the input is a scalar; or the number of rows is odd.
Appendix B Stack Lift and the LAST X Register The HP-15C calculator has been designed to operate in a natural manner. As you have seen working through this handbook, most calculations do not require you to think about the operation of the automatic memory stack. There are occasions, however – especially as you delve into programming – when you need to know the effect of a particular operation upon the stack. The following explanation should help you.
Appendix B: Stack Lift and the LAST X Register Disabling Operations Stack Lift. There are four stack-disabling operations on the calculator.* These operations disable the stack lift, so that a number keyed in after one of these disabling operations writes over the current number in the displayed X-register and the stack does not lift. These special disabling operations are: v ` z w Imaginary X-Register.
Appendix B: Stack Lift and the LAST X Register 211 T y y y y Z x x x x Y 4.0000 53.1301 53.1301 53.1301 X 3 5.0000 0.0000 Keys: |: |` Stack Stack enabled. disabled. 7 7 No stack lift. Imaginary X-Register. All enabling functions provide for a zero to be placed in the imaginary X-register when the next number is keyed or recalled into the display. Neutral Operations Stack Lift. Some operations, like •, are neutral; that is, they do not alter the previous status of the stack lift.
Appendix B: Stack Lift and the LAST X Register LAST X Register The following operations save x in the LAST X register: + * ÷ a q ‘ & ∕ ! ¤ x [ \ ] , { / P[ P\ P] H[ H\ H] h À d r N ' o @ Y * Except when used as a matrix function. † f uses the LAST X register in a special way, as described in appendix E.
Appendix C Memory Allocation The Memory Space Storage registers, program lines, and advanced function execution * all draw on a common memory space in the HP-15C. The availability of memory for a specific purpose depends on the current allocation of memory, as well as on the total memory capacity of the calculator. Registers Memory space in the HP-15C is allocated on the basis of registers. This space is partitioned into two pools, which strictly define how a register may be used.
Appendix C: Memory Allocation Total allocatable memory: 64 registers, numbered R2 through R65. [(dd – 1) + uu + pp + (matrix elements) + (imaginary stack) + (_ and f)] = 64. For memory allocation and indirect addressing, data registers R.0 through R.9 are referred to as R10 through R19.
Appendix C: Memory Allocation 215 Memory Status (W) To view the current memory configuration of the calculator, press | W (memory), holding W to retain the display.
Appendix C: Memory Allocation 1. Place dd, the number of the highest data storage register you want allocated, into the display. 1dd65. The number of registers in the uncommitted pool (and therefore potentially available for programming) will be (65 – dd). 2. Press ´ m %. There are two ways to review your allocation: Press lm % to recall into the stack the number of the highest-allocated data storage register, dd. (Programmable.
Appendix C: Memory Allocation 217 When converting registers, note that: You can convert registers from the common pool only if they are uncommitted. If, for example, you try to convert registers which contain program instructions, you will get an Error 10 (insufficient memory). You can convert occupied registers from the data storage pool, causing a loss of stored data. An Error 3 results if you try to address a "lost" – that is, nonexistent – register.
Appendix C: Memory Allocation Your very first program instruction will commit R65 (all seven bytes) from an uncommitted register to a program register. Your eighth program instruction commits R64, and so on, until the boundary of the common pool is encountered. Registers from the data storage pool (at power-up, this is R19 and below) are not available for program memory without reallocating registers using m %.
Appendix C: Memory Allocation 219 For _ and f, allocation and deallocation of the required register space takes place automatically.* Memory is thereby allocated only for the duration of these operations. Space for the imaginary stack is allocated whenever ´ V, ´ }, or | F 8 is pressed. The imaginary stack is deallocated when " 8 is executed. Space for matrix registers is not allocated until you dimension it (using m). Reallocation takes place when you redimension a matrix.
Appendix D A Detailed Look at _ Section 13, Finding the Roots of an Equation, includes the basic information needed for the effective use of the _ algorithm. This appendix presents more advanced, supplemental considerations regarding _. How _ Works You will be able to use _ most effectively by having a basic understanding of how the algorithm works.
Appendix D: A Detailed Look at _ 221 As discussed in section 13, page 186, the occurrence of other situations in the iteration process indicates the apparent absence of a function zero. The reason is that there is no way to logically predict a new estimate that is likely to have a function value closer to zero. In such cases, Error 8 is displayed. You should note that the initial estimates you provide are used to begin the "prediction" process.
Appendix D: A Detailed Look at _ The function's graph is either convex everywhere or concave everywhere. The only local minima and maxima of the function's graph occur singly between adjacent zeros of the function. In addition, it is assumed that the _ algorithm will not be interrupted by an improper operation. Accuracy of the Root When you use the _ key to find a root of an equation, the root is found accurately.
Appendix D: A Detailed Look at _ 223 If a calculation has a result whose magnitude is smaller than 1.000000000×10-99, the result is set equal to zero. This effect is referred to as ―underflow.‖ If the subroutine that calculates your function encounters underflow for a range of x and if this affects the value of the function, then a root in this range may be expected to have some inaccuracy. For example, the equation x4 = 0 has a root at x = 0. Because of underflow, _ produces a root of 1.
Appendix D: A Detailed Look at _ the root 1.0000 is found for initial estimates of 1 and 2. By recognizing situations in which round-off error may influence the operation of _, you can evaluate the results accordingly and perhaps rewrite the function to reduce the effects of round-off. In a variety of practical applications, the parameters in an equation – or perhaps the equation itself – are merely approximations. Physical parameters have an inherent accuracy (or inaccuracy).
Appendix D: A Detailed Look at _ 225 In order to find the first time at which the height is 107 meters, use initial estimates of 0 and 1 second and execute _ using B. Keystrokes |¥ 0v 1 ´_ B ) ) Display Run mode. 0.0000 1 4.1718 4.1718 0.0000 Initial estimates. The desired root. A previous estimate of the root. Value of f(t) at root. It takes 4.1718 seconds for the ridget to reach a height of exactly 107 meters. (It takes approximately two seconds to find this solution.
Appendix D: A Detailed Look at _ Execute _ again: Keystrokes |¥ 0v 1 ´vB ) ) Display Run mode. 0.0000 1 4.0681 4.0681 0.0000 Initial estimates. The desired root. A previous estimate of the root. Value of modified f(t) at root. After 4.0681 seconds, the ridget is at a height of 107 ± 0.5 meters. This solution, although different from the previous answer, is correct considering the uncertainty of the height equation. (And this solution is found in just under half the time of the earlier solution.
Appendix D: A Detailed Look at _ 227 Special consideration is required for a different type of situation in which _ finds a root with a nonzero function value. If your function's graph has a discontinuity that crosses the x-axis, _ specifies as a root an x-value adjacent to the discontinuity. This is reasonable because a large change in the function value between two adjacent values of x might be the result of a very rapid, continuous transition.
Appendix D: A Detailed Look at _ Solution: The equation for the shear stress for x between 0 and 10 is more efficiently programmed after rewriting it using Horner's method: Q = (3x–45)x2 + 350 Keystrokes |¥ ´b2 1 0 |£ t9 |` 3 * 4 5 * * 3 5 0 + |n ´b9 ‛ 3 |n for 0 < x < 10. Display 000– 001–42,21, 2 002– 1 003– 0 004– 43 10 005– 22 9 006– 43 35 007– 3 008– 20 009– 4 010– 5 011– 30 012– 20 013– 20 014– 3 015– 5 016– 0 017– 40 013– 43 32 019–42,21, 9 020– 26 021– 3 022– 43 32 Program mode.
Appendix D: A Detailed Look at _ Keystrokes |¥ 7v 14 ´_ 2 )) 229 Display Run mode. 7.0000 14 10.0000 1,000.0000 Initial estimates. Possible root. Stress not zero. The large stress value at the root points out that the _ routine has found a discontinuity. This is a place on the beam where the stress quickly changes from negative to positive. Start at the other end of the beam (estimates of 0 and 7) and use _ again. Keystrokes 0v 7 ´_2 )) Display 0.0000 7 3.1358 2.0000 Initial estimates.
Appendix D: A Detailed Look at _ If the algorithm terminates its search near a local minimum of the function's magnitude, clear the Error 8 display and observe the numbers in the X-, Y-, and Z-registers by rolling down the stack. If the value of the function saved in the Z-register is relatively close to zero, it is possible that a root of your equation has been found – the number returned in the X-register may be a 10-digit number very close to a theoretical root.
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 Yregisters (or perhaps two numbers somewhat further apart).
Appendix D: A Detailed Look at _ Keystrokes ÷ ' Display 017– 018– 10 12 + 3 019– 020– 40 3 + |n 021– 022– 40 43 32 x / 10. e x /10 3e 2e x /10 x 2e 2e x . x 2e x . Use _ with the following single initial estimates: 10, 1, and 10-20. Keystrokes |¥ 10 v ´ _ .0 − ) ) | (| ( ´ _.0 − )) Display 10.0000 Error 8 455.335 48,026,721.85 1.0000 455.4335 Error 8 48,026,721.85 1.0000 1v ´ _.0 − ) ) | (| ( ´ _.0 − )) 1.0000 Error 8 2.1213 2.1471 0.3788 2.1213 Error 8 2.1213 0.
Appendix D: A Detailed Look at _ Keystrokes ´ _.0 − ) ) | (| ( ´ _ .0 − ) ) Display Error 8 1.0000 1.1250 2.0000 1.0000 Error 8 1.1250 1.5626 2.0000 –20 –20 –20 –20 –16 233 Best x-value. Previous value. Function value. Restore the stack. Another x-value. Previous value. 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).
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.
Appendix D: A Detailed Look at _ Keystrokes * 3 0 0 3 + * 6 1 7 1 + * 2 8 9 0 |n Display 008– 009– 010– 011– 012– 013– 014– 015– 016– 017– 018– 019– 020– 021– 022– 023– 024– 025– 026– 027– 235 30 20 3 0 0 3 40 20 6 1 7 1 40 20 2 8 9 0 30 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 |¥ 10 “ v 20 “ ´_2 O0 )) Display Run mode. –10.0000 –20 –1.6667 –1.6667 4.0000 –06 Initial estimates. First root.
Appendix D: A Detailed Look at _ Return to Program mode and add instructions to your subroutine to eliminate the root just found. Keystrokes |¥ |‚| ‚ ® l0 ÷ Display 000026– 027– 028– 029– 030– 30 34 45 0 30 10 Program mode. Line before n. Brings x into X-register. Divides by (x – a), where a is known root. Now use the same initial estimates to find the next root. Keystrokes |¥ 10 “ v 20 “ ´_2 O1 )) Display 4.0000 -06 –10.0000 –20 0.4000 0.4000 0.0000 Run mode. Same initial estimates.
Appendix D: A Detailed Look at _ 237 Again, use the same initial estimates to find the next root. Keystrokes |¥ 10 “ v 20 “ ´_2 O2 )) Display 0.0000 –10.0000 –20 8.4999 8.4999 –1.0929 –07 Run mode. Same initial estimates. Third root. Stores root for deflation. Deflated function value near zero. Now change your subroutine to eliminate the third root. Keystrokes |¥ |‚| ‚ ® l2 ÷ Display 000– 034– 035– 036037– 038– 10 45 34 2 30 10 Program mode. Line before n. Brings x into X-register.
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.
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.
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 function's values at many values of x (known as sample points) within the interval of integration.
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.
Appendix E: A Detailed Look at f Calculate the integral in the expression for J4 (1), cos(4 sin )d 0 First, switch to Program mode and key in a subroutine that evaluates the function f(θ) = cos (4θ – sin θ). Keystrokes |¥ ´ CLEAR M ´b0 4 * ® [ \ |n Display 000000001–42,21, 002– 003– 004– 005– 006– 007– 008– 43 Program mode. 0 4 20 34 23 30 24 32 Now, switch to Run mode and key the limits of integration into the X- and Y-registers.
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 ® ´ CLEAR u (hold) Display 7.79 -03 7785820888 Return display. approximation to All 10 digits of i 2 approximation. The actual value of this integral, correct to five significant digits, is 7.7805×10-3.
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.
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.
Appendix E: A Detailed Look at f F ( x) f ( x) δ2 ( x) , where δ2(x) is the uncertainty associated with f(x) that is caused by the approximation to the actual physical situation. Since f ( x) fˆ ( x) δ1 ( x) , the function you want to integrate is F ( x) fˆ ( x) δ1 ( x) δ2 ( x) F ( x) fˆ ( x) δ( x) , or where δ(x) is the net uncertainty associated with f(x).
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 δ(x) 0.5 10 n 10m( x ) 0.5 10 n m( x) In this formula, n is the number of digits specified in the display format and m(x) is the exponent of the function's 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 function's value at x.
Appendix E: A Detailed Look at f Δ b δ(x) dx a b [0.5 10 n m( x) ] dx . a 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 fˆ ( x) . 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.
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.
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.
Appendix E: A Detailed Look at f 251 Since you’re evaluating this integral numerically, you might think (naively in this case, as you'll see) that you should represent the upper limit of 99 integration by 10 – 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 |¥ ´b1 “ ' * |n Display 000001-42,21, 1 0021 6 00312 00420 00543 32 Program mode. Set the calculator to Run mode.
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.
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.
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 you're 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.
Appendix E: A Detailed Look at f Keystrokes 0v Display 0.000 ‛3 1 ´f1 ® 1.000 1.824 00 03 00 -04 255 Keys lower limit into Y-register. Keys upper limit into X-register. Approximation to integral. 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.
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.
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.
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.) 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. 3.
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.
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.
Appendix F: Batteries 261 Verifying Proper Operation (Self-Tests) If it appears that the calculator will not turn on or otherwise is not operating properly, use the following procedures to access the test system; 1) Turn the calculator off. 2) Press and HOLD the | and v keys (keep both keys held down for the next step). 3) Press the = key (while both | and v keys are held down from Step 2 above). 4) Release the = key. 5) Release the | and v keys.
Function Summary and Index = Turns the calculator's display on and off (page 18). It is also used in resetting Continuous Memory (page 63), changing the digit separator (page 61), and in various tests of the calculator's operation (pages 261). Complex Functions } Real exchange imaginary. Activates Complex mode (establishing an imaginary stack) and exchanges the real and imaginary X-registers (page 124). V Used to enter complex numbers. Activates Complex mode (establishing an imaginary stack) (page 121).
Function Summary and Index ‛ Enter exponent; next digits keyed in are exponents of 10 (page 19). 0 through 9 digit keys (page 22). . Decimal point (page 22) Display Control • Selects fixed point display mode (page 58). i Selects scientific notation display mode (page 59). ^ Selects engineering notation display mode (page 59). Mantissa. Pressing ´ CLEAR u displays all 10 digits of the number in the Xregister as long as the u key is held down (page 60).
Function Summary and Index number in display (Xregister) (enter y, then x). Causes the stack to drop (page 29). Mathematics -+-÷ Arithmetic operators; cause the stack to drop (page 29). ¤ Computes square root x (page 25). f Integrate. Computes the definite integral of f(x), with the expression f(x) defined by the user in a labeled subroutine (page 194). Matrix Functions m Dimensions a matrix of a given name {A to E, V} (page 141).
Function Summary and Index matrices or of one matrix and a scalar. Stores in result matrix (page 152-155). complex transform. to ZP (page164). > {0 through 9} Matrix operations. > 9 Calculates determinant of matrix specified in X-register (also does LU decomposition of the matrix) (page 150). 265 "partitioned form" (Z P) (page 162). > 4 Transpose X ~ T 0 T 5 to XT (page 150).
Function Summary and Index register) by truncating the blue function fractional portion (page printed below that key 24). (page 18). different items taken x at a time, and causes the stack to drop (page 47). (For matrix use, refer to Matrix Functions keys, & Rounds mantissa For other prefix keys, refer to Display Control page 264.) of entire (10-digit) number in X-register to keys (page 263), match display format Storage keys (page Stack (page 24).
Function Summary and Index ` Clears contents of display (X-register) to zero (page 21). − In Run mode: removes the last digit keyed in, or clears the display (if digit entry has been terminated) (page21). Statistics z Accumulates numbers from X- and Y-registers into storage registers R2 through R7 (page 49). w Removes numbers in X- and Y-registers from storage registers R2 through R7 for correcting z accumulations (page 52). and correlation coefficient.
Function Summary and Index Trigonometry D Sets decimal Degrees mode for trigonometric functions—indicated by absence of GRAD or RAD annunciator (page 26). Not operative for complex trigonometry. R Sets Radians mode for trigonometric functions—indicated by RAD annunciator (page 26). [, \, ] Compute sine, cosine, or tangent, respectively, of number in display (X-register) (page 26).
Programming Summary and Index ¥ Program/Run mode. Sets the calculator to Program mode (PRGM annunciator on) or Run mode (PRGM annunciator cleared) (page 66). W Displays current status of calculator memory (number of registers dedicated to data storage, the common pool, and program memory) (page 215). W Displays current status of calculator memory (number of registers dedicated to data storage, the common pool, and program memory) (page 215). − Back arrow.
Programming Summary and Index following the G (page 101). calculator to return to line 000 and halt execution (if running) (page 68). If in a ‚ Back step. Moves calculator back subroutine, merely returns to line after one or more lines in program memory. (Also G (page 101). scrolls in Program mode.) Displays line F Set flag (= true). number and contents of Sets designated flag (0 previous program line to 9). Flags 0 through 7 (page 83).
Subject Index Page numbers in bold type indicate primary references; page numbers in regular type indicate secondary references.
Subject Index in matrices, 177 “, 19 Clearing blinking in display, 100 complex numbers, 125-127 display, 21 memory, 63 operations, 20-21 overflow condition, 45, 61 prefix keys, 19 statistics registers, 49 Coefficient matrix, 156 Combinations function (c), 47 Common pool, 213 Complex arithmetic example, 132 Complex conjugate, forming, 125 Complex matrix, inverting, 162, 164, 165 multiplying, 162, 164, 166 storing elements, 161 transforming, 162, 164 Complex mode, 120-121 activating, 99, 120-121, 133 de
Subject Index Continuous Memory, duration of, 62 resetting (clearing), 63 what it retains, 43, 48, 58, 61, 62 Conventions, handbook, 18 Conversions, degrees and radians, 27 polar and rectangular coordinates, 30-31 time and angle, 26-27 Correcting accumulated statistics data, 52 Correlation coefficient, find the (j), 55-56 \,{, 26 Counters in program loops, 98, 112-114 Crocus example, 43 Cumulative calculations, 41 D ___________________________________________ Data storage, 42 Data storage pool, 213-214 De
Subject Index s 109-111, 112, 116 E ___________________________________________ ‛, 19 Electrical circuit example, 169-171 Enabling stack lift, 36 ^, 59 Engineering notation, 59 v, 12, 33-34, 36 effect on digit entry, 22, 29 effect on stack movement, 37, 41 Entering data for statistical analysis, 49 Error conditions, 205-208 display, 61 stops, 78 Errors, with f, 203-204 with _, 187, 192, 193 Euclidean norm (See Frobenius norm) Exchanging the real and imaginary stacks, 124 Exponential function (See Pow
Subject Index G ___________________________________________ |, 18 Gamma function (!), 25 g, 26 G, 101 t, 90, 97, 98 t “, 82 H ___________________________________________ Horner's Method, 79, 181 Hyperbolic functions, 28 I ____________________________________________ Imaginary stack, clearing the, 124 creation of, 121-123, 133 display of, 124 stack lift of, 124 Index register arithmetic, 108, 112 display format control, 109, 114, 115, 116 exchange with X-register, 108, 112 flag control, 109, 115 loop cont
Subject Index uncertainty in, 202-203, 240-244, 245-249 Interchanging functions (See User mode) Interference, radio and television, 271 Intermediate results, 22, 38 Interpolation, using j, 57 I, 109-111, 116 Iterations using I and s, 111 K ___________________________________________ Keycodes, 74-75 Keying in chain calculations, 22 exponents, 19-20 one-number functions, 22 two-number functions, 22, 29 L ____________________________________________ Labels, 67, 77, 90, 97 LAST X register, 35 in matrix
Subject Index dimensioning, 140, 142, 142, 174 dimensions, displaying, 142, 147 equation, complex, 168 memory, 140, 171 name (See Matrix descriptors) partitioned, 161, 164 Matrix elements, accessing individually, 145-147 displaying, 144 storing and recalling, 143-144, 147, 149, 176 Matrix functions, using RI, 173-174 using registers, 173 arithmetic, 153 conditional, 177 inverse, 150, 154 multiplication, 154 one-matrix, 149-151 programmed, 176-177 reciprocal, 150 residual, 159 row norm, 150, 177 summary, 17
Subject Index Multiple roots, 234 N ___________________________________________ Negative numbers, 19 in Complex mode, 124-125 Nested calculations, 38 Neutral operations, 211 Nonprogrammable functions, 80 Normalizing statistics data, 50 null display, 144, 149 Numerical integration, 194-204 O ___________________________________________ =, and off, 18 to reset Continuous Memory, 63 to set decimal point display, 61 Overflow condition, 45, 61, 100 P____________________________________________ ¥, 66, 68
Subject Index position, changing, 82, 86 running, 68-69 starting, 69 stops, 68, 78 Program execution, 69 after G, 101 after t, 97 after overflow, 100 after test, 92 from or through labels, 78-79 Program lines (instructions), 67, 74 deleting, 83, 86 inserting, 83, 86 Program memory, 67, 70, 75, 217-219 automatic real location, 217-218 clearing, 67 moving in, 67 Q ___________________________________________ Quadratic equation, solving, 181 R ___________________________________________ R0 and R1, using to a
Subject Index Rice yield example, 50-56 Ridget hurling example, 184-186, 224-226 Roll down, 34 Roll up, 34 Roots, eliminating, 233, 234, 237 Roots, meaningless, 188, 191 Rounding (&), 24 Rounding in the display, 59 Round-off errors, 52, 60, with _, 223, 237 Row norm, 150, 177 Run/Stop (¦), 68, 91 running display, 69, 147, 182 S ___________________________________________ Scalar operations, 151-153 i, 58 Scientific notation, 58 Scrolling, 82 Secant line calculation example, 102 Self-tests, 261 Service
Subject Index using as a conditional test, 192 using functions with discontinuities, 227 using functions with poles, 227 using functions with several roots, 233-238 with no root, 186-188, 192, 229 Square root (¤), 25 Squaring (x), 25 Stack contents, with f, 197, 202 drop, 33, 38 lift, 33, 36, 38, 44, 209-211 manipulation functions, 33-34, in Complex mode, 131 imaginary, 120-125 used to access matrix elements, 146-147 Stack-disabling operations, 210 Stack-enabling operations, 210-211 Stack movement, 32, 33-
Subject Index Storage arithmetic, 43 Storage registers, 42 allocation, 42, 215-217 arithmetic, 43 clearing, 43 statistics, 42, 49 Subroutine levels, 102, 105 limits, 102, 105 nesting example, 103 returns, 101, 105 using with _, 180-181, 192 System flags, 92, 99 T____________________________________________ T-register, 32, 33 in matrix functions, 174-176 with f, 202 ] /, 26 T, 91 Tracing, 82 Transpose, 150, 151, 154 Trigonometric modes in Complex mode, 121, 134 Trigonometric operations, 26 U ________
Subject Index X ___________________________________________ X exchange (X), 42 X exchange Y (®), 34 X-register, 32, 35, 37, 42, 60, 209-210 imaginary, 210, 211 in matrix functions, 141, 156, 175-176 with f, 202 with _, 181, 183, 102, 226 Y ___________________________________________ y-intercept, finding, 54 Y-register, 32, 37 in matrix functions, 141,156, 175-176 with f, 202 _, 181, 183, 192, 226 Z ___________________________________________ Z-register, 32 in matrix functions, 174-176 with f, 202 with _,
Product Regulatory & Environment Information Federal Communications Commission Notice This equipment has been tested and found to comply with the limits for a Class B digital device, pursuant to Part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference in a residential installation.
Declaration of Conformity for Products Marked with FCC Logo, United States Only This device complies with Part 15 of the FCC Rules. Operation is subject to the following two conditions: (1) this device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. If you have questions about the product that are not related to this declaration, write to Hewlett-Packard Company P. O.
European Union Regulatory Notice Products bearing the CE marking comply with the following EU Directives: • Low Voltage Directive 2006/95/EC • EMC Directive 2004/108/EC • Ecodesign Directive 2009/125/EC, where applicable CE compliance of this product is valid if powered with the correct CEmarked AC adapter provided by HP.
Japanese Notice Korean Notice Disposal of Waste Equipment by Users in Private Household in the European Union This symbol on the product or on its packaging indicates that this product must not be disposed of with your other household waste. Instead, it is your responsibility to dispose of your waste equipment by handing it over to a designated collection point for the recycling of waste electrical and electronic equipment.
Chemical Substances HP is committed to providing our customers with information about the chemical substances in our products as needed to comply with legal requirements such as REACH (Regulation EC No 1907/2006 of the European Parliament and the Council). A chemical information report for this product can be found at: www.hp.com/go/reach.