Académique Documents
Professionnel Documents
Culture Documents
Hp11c Anglais
Hp11c Anglais
] 7) | >| 002-7) 003- [[PSE]_|——>] 003- TIFSE) ZI 003- (25) | "| 004- Gen) “- 004- (@)E) 008-(a) || 008- fart Wa (005- [=] 006- (HIFSE] > 006- [5] 7 [oos- (tese) 007- (+) “> 007- [f)[PSE} wa 008- (1) PSE] VAI 008- (7) Vr x 009- [0 ][RTN) 010-[a]IATN) wwe Section 6: Program Editing 107 If you modified the Pythagorean Theorem program as described above, the program now pauses only once, to display the sum of the squares. The length of the hypoteneuse is then calculated and execution halts, Run the program for a right triangle having sides a and 6 of 17 and 84 meters respectively, Keystrokes Display @ Set the HP-11C to Run mode, 7 34 34 He 1,445.0000 Pause to display sum of the squares of sides a and b. 38.0132 Length of hypoteneuse. When deleting instructions from a program of more than 63 lines, the process of automatically allocating storage registers to Program lines works in reverse. For example, deleting any instruction from a ‘71-line program automatically converts program lines 71-77 back to storage register Rs, (Refer to appendix C, How Automatic Memory Reallocation Operates.) Problems 1. The following program is used by the manager of a savings CT and loan company to compute = | — the future values of savings 2° accounts according to the for Yo mula FV = PV (1 + i)", where xe [n_]| FV is future value or amount, PV is present value, i is the periodic interest rate expressed as a decimal, and n is the number of periods. Assuming PV and n keyed in as shown before beginning execution, and an annual interest rate of 7.5%, the program is: Keystrokes Display @@0m) 001-42,21,11 frx)2 002-42, 7, 2108 — Section 6; Program Editing Keystrokes Display 1 003- 1 a oos- 48 0 005- © Interest 7 006- 7 5 007- 5 rey 008- 34 & o09- 14 +i & o10- 20 PVa+iP aw O11- 4332 a. Load the program into the caleulator. b. Run the program to find the future amount of $1,000 invested for 5 years; (Answer: $1,435.63) of $2,300 invested for 4 years, (Answer: $3,071.58) c. Alter the program to account for a change of the annual interest rate from 7.5% to 8%, d. Run the program for the new interest rate to find the future value of $500 invested for 4 years; of $2,000 invested for 10 years, (Answers: $680.24; $4,317.85) 2. The following program calculates the time it takes for an ubject to fall to the earth when dropped from a given height. (Friction from the air is not taken into account.) When the height A in meters is keyed into the displayed X-register and (B)is pressed, the time t in seconds the object takes to fall to earth is computed according to the formula: Clear all previously recorded programs from the calculator, reset the display mode to [Fix}4, and load the following program. wee eye vee YL Vee VyVeVeVeV eV eY Section 6: Program Editing 109 Keystrokes Display neo 001-42.21.12 2 002- 2 a 003- 20 9 004- 9 Q 005- 48 8 006- 8 a 007- 10 Qa o08- WwW (ojtarn} 009-43 32 b. Run the program to compute the time taken by a stone to fall from the top of the Riffel Tower, 300.61 meters high; and from a blimp stationed 1000 meters in the air. (Answers: 7.8313 seconds; 14.2857 seconds.) © Alter the program to compute the time of descent when the height in feet is known, according to the formula: 2h 32.1740 d. Run the altered program to compute the time taken by a stone to fall from the top of the Grand Coulee Dam, 550 feet high; and from the 1350-foot height of the World ‘Trade Center buildings in New York City. (Answers: 5.8471 seconds; 9.1607 seconds.)Section 7 Program Decisions and Control Decisions and Control In Brief Program Conditional Tests The HP-11C’s eight conditional teste are true/false tests used in programs to enable your HP-11C to make decisions. In a running Program, when the result of a conditional test is true, program execution continues with the first instruction following the conditional test. When the result of a conditional test is false, execution bypasses the first instruction following the test and resumes with the second instruction following the test. Is the test true? Conditional Test “Doif True" Rule Your HP-11C’s conditionals operate by comparing the value in the X-register to either the number in the Y-register or to zero in the following manner: tests to see if the value in the X-register is less than or equal to the value in the Y-register. tests to see if the value in the X-register is greater than the value in the Y-register, tests to see if the value in the X-register is not equal to the value in the Y-register. 110 weve Veueveyvvervvvr Section 7: Program Decisions and Control 114 tests to see if the value in the X-register is equal to the value in the Y-register. tests to see if the value in the X-register is less than zero. tests to see if the value in the X-register is greater than oro. tests to see if the value in the X-register is not equal to zero. tests to see if the value in the X-register is equal to zero. Flags Another type of decision-making test for use in programs is a flag test. A flag is actually a status indicator that is in either a set (true) or clear (false) status. A running program can test a flag and make a decision based upon whether the flag is set or clear. Flag tests affect program execution in the same way as conditional tests. ‘The two flags in your HP-11C are numbered 0 and 1. To set a flag, press (0][SF](set flag) followed by the proper digit key (0 or 1) of the desired flag. To clear a flag, press (6) (CF) (clear flag) followed by the proper digit key. To test a flag use (31 flag set?) followed by the digit key specifying the flag to be test A flag that has been set by a [T][SF)n command remains set until it is cleared by a [8)(CF)n command or until Continuous Memory is reset. Is flag 1 set (True)? Yes , [instruction No L, Instruction t Instruction 4 Instruction {112 ion 7: Program Decisions and Control Program Control GoTo instruction you have used earlier to position the calcula- tor to a specific program line for viewing or editing is also used to transfer execution to a label elsewhere in program memory. When used as an instruction in a program {GTO} is followed by an alpha or numeric label address, 1S | Tinstton | Instruction | Instruction When a running program encounters a label instruction, execution is auspended while the calculator searches downward in memory for the specified label. Program execution resumes at the first line found to contain the label. Branching and Looping Unconditional Branching. An unconditional branch is simply instruction that is always executed in a running program to transfer program execution elsewhere in the ‘am, regardless of data status. The preceding illustration of [GTO] operation is an unconditional branch. Conditional Branching. When [GTO] /abel is used in conjuncti with a conditional test, as in the following illustration, th Jabel instruction becomes a conditional branch. That is, the result of the conditional test preceding the [GTO] determines whether or not the [GTO}instruction will be executed. ~~~--~--~ Vevey YY YY EY YY YEE wee vevuvve Section 7: Program Decisions and Control 113 (xy) =True Instruction (cto}7 - instruction { Instruction | (etl? in Instruction When the calculator is in Run mode, pressing (GTO}/abel causes the calculator to go to the specified label and halt. This feature is convenient when you want to review or edit lines of memory following a certain label instead of executing them as part of a program. Looping. Looping is a special case of branching in which a instruction is used to repeat the execution of a series of instructions ‘one or more times. Loops are frequently used for counters and for sequen- tially calculating a series of results using the same set of program instructions. The continuation of a loop for a new iteration or the transfer of execution out of a loop is controlled by a conditional branch. In the following illustration, as long as the result of the conditional test preceding the is true the calculator continues successive iterations of the loop. When the result of the loop conditional test becomes false, execution skips th ‘instruction and continues with the rest of the program. Use of an unconditional branch to control a loop results in an infinite loop, that is, a loop that is reexecuted indefinitely.114 Section 7: Program Decisions and Control Conditional Branch Control of Program Loop Instruction Instruction Htest true, looping continues. iftest false, looping terminates. Instruction Example of Conditonal Loop Control. The following program calculates and displays the square roots of consecutive whole numbers from 1 to 10. After the square root of an integer is calculated and displayed, an conditional test determines whether or not that integer was leas than 10. If the integer was less than 10, a (GTO) 0 conditional branch is executed and the loop is repeated using the next highest integer. If the test finds thi integer was not less than 10, program execution bypasses the 0 conditional branch and the loop is terminated. (The loop portion of the following program is included in lines 004 through 015,) Keystrokes Display @ o00- Sets HP-11C to Program mode, (CLEAR 000- ta 001-42,21,13 002- 0 } Clears R, of any 003- 44 1J unwanted data from previous calculations. 004-4221, 0 Begins loop. 005- 1 006-44,40, 1 Integer counter/ ‘increment. Section 7: Program Decisions and Control 115 Keystrokes Display 0o7- 45 1 008- 42.31 Displays next integer. 009- 11 Square root of integer. 010- 42.31 Displays square root. 011- 4336 Recalls copy of integer from LAST X register. 1 012- 1 Compares last integer to o 013- © highest integer allowed by OGS5 014- 4220 the program. [sto]o 015- 22 0 Conditional branch. If last integer is less than 10, goto and resume... 016- 43.35 ...otherwise, avoid another 017- 43 32 loop, clear displayed X- register and halt program. Sets HP-11C to Run mode. aa) To run the program press [f]{¢). The calculator will display a table of integers from 1 to 10 with their corresponding square roots. When 0.0000 is displayed, program execution is completed. How It Works: When you press [i (E], the calculator searches through program memory until it encounters the [7] instruction. It executes that label and each subsequent instruction in sequential order through line 014, the [<>] conditional test. If the result of the conditional test ia true—that is, the last integer used was less than 10—the following [GTO] 0 instruction is executed, the calculator returns to the (LBL]0 instruction at line 004, and execution resumes as a new iteration of the loop. However, if the result of the [15] conditional test is false, meaning the last, integer used was 10, the O instruction is bypassed and the loop is terminated. For an additional discussion of looping and loop control techniques, refer to page 214, Looping, in part III of this handbook. Problem. Write a program to calculate and display sales commissions. For sales of less than $100 the commission should be 10% of the sale. For sales of $100 or more the commission should be 15%. Use a conditional branch in your solution.116 — Section ?: Program Decisions and Control Using Flags Like the x:y and x:0 conditional tests, flags give you the capability to either skip or execute individual lines in program memory. However, while the x:y and x:0 conditionals function by comparing values, flags function by telling the calculator status. That is, if a set flag ((@) (SF) n) instruction is placed in a program. branch, testing that flag elsewhere ((¢) rn) can tell the calculator whether or not that branch has been executed. Example. The following program closely approximates the conversion of an input in miles to kilometers (f(A), or the conversion of an input in kilometers to miles ({)(B)). The calculator uses the status of flag 0 to decide whether to convert a user input to kilometers (multiply input by conversion factor) or to miles (divide input by conversion factor). key les. kilometers. Start Start _/ Clear flag Set flag ‘| Cc — T ¥ Place 1.6093 in X-register. Section 7: Program Decisions and Control = 117 Keystrokes Display RA 000- Sets HP-11C to Program mode. (OCLEAR (FRG 000- Clears program memory. Meow) 001-42.21.11 Program begins with input in miles. Wo 002-43, 6, 0 FlagOcleared (“remembers” miles input for later program control). (ero}1 003- 22 1 Unconditional branch to io (ouet) 004-42,21,12 Program begins with input in kilometers. WGA 005-43, 4, O Flag Oset(“‘remembers” kilometers input for later in program). 006-42,21, 1 ([BL}I begins calculation portion of program. 1 007- 1 a oo8- 48 6 oos- 6 (Place conversion factor ° 010- 0 fin X-register. 9 o11- 9 3 012- 3, wl 013-43, 6, O Flag test. [f true (kilo- 014- 22 2 meters input), goto(LBL]2. o1s- 20 If flag teot falec (miles in wo 016- 43.32 put), calculate conversion tokilometers and halt program. (uarl2 017-42,21, 2. Calculateconversion to a o18- 10 miles and halt program wo 019-4332 ER Sets HP-11C to Run mode, Run the program to convert 26 miles into kilometers; to convert 1.5 kilometers into miles,118 Section 7: Program Decisions and Control Keystrokes Display 26 26 Input miles. aw 41.8418 Execute Miles to Kilometers option. Result of conversion displayed. 15 16 Input kilometers. OB 0.9321 Execute Kilometers to Miles option. Result of conversion displayed. How It Works. When you input a value and identify the type of conversion you want by pressing [f)[A] (miles to kilometers) or [)(B) (kilometers to miles), the calculator sets or clears flag 0, then executes the main program (beginning at label 1). After placing the conversion factor in the X-register the program tests flag 0. If the flag is set (true), execution transfers to label 2, the conversion to miles is calculated, and execution halts. If the flag is clear (false), the conditional branch to (I8t] 2 is bypassed, a conversion to kilometers is calculated, and execution halts. The function of the flag is to tell the calculator which of the two labels has been executed and, therefore, which conversion is desired. For a further discussion of flag use, refer to page 215, Flags, in part Ti of this handbook. 2 oS 2 Sey ees eS YUVUYUBMYEULLYLEYEULEUUUL wy ~ y % \ Ve ye te te te Oe de NO ND So SD 0 Se OF Oe ve 2 Zz 2 > ‘ > ‘ o Section 8 Subroutines Subroutines In Brief Often a program contains a certain series of instructions that are executed several times during a single execution of the program. When the same set of instructions occurs more than once in a program, memory space can be conserved by executing the instructions as a subroutine. Go To Subroutine A subroutine is executed using (G58) with the desired alpha or numeric label address.* A (G58) instruction transfers execution to the specified label address in the same way as (GTO). However, when a instruction is executed in a running program, a pending return condition is set in the calculator. When a pending return condition exists, the first subsequent (return) instruction encountered by a running program will cause program execution to transfer back to the program instruction immediately following the last (G88). Execution then continues sequentially downward through program memory, (When the (RTN]is executed, the “pending” condition is cleared.) Compare the following illustrations of a branch and a subroutine. Branch Da] f GaSe) (ero)e) | Execution trans- ri fers to line 000 and halts. + & [E$B] followed by an alpha label address axe 78, Abbreviated Key Sequences, abbreviated key sequence. Refer to 119120 Section 8: Subroutines ee, Subroutine [o(tela)} 4 FOB) | = (csE | 7 \ »~ KS \ Execution trans- Daw) SL Execution trans- fers to line 000 fers back to main ondhatta proprem pending foturnstetus cleared. As you can see, the nly difference between using (go to (go to branch) is the transfer of execution line 000 and halt; after a execution to transfer back tott Subroutine 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 only by the number of returns ( that can be held pending at any one time in the HP-11C. Here is how the HP-11C operates with nested subroutines. Main Program (ou (aut (03 4 4 4 | + = f , = / (esa t a am] “Can End Section 8 Subroutines 121 The calculator can return back to the main program from subroutines that are nested four deep, as shown. If you attempt to call a subroutine that is nested five levels deep, the calculator will halt and display Error § when it encounters the instruction calling the fifth subroutine level. Note. While any one set of nested subroutines can be up to four levels deep, there is no limit to the number of nested subroutine sets or non-nested subroutines you can include ina program. Subroutine Usage Example. Write a program for cal- culating the average slope between x, and x2 on the graph shown, where y=x!—sinx. ye dxz! ¥2-%y Notice that the solution requires two computations of the expreasion x? — sin x (once for x = x, and again for x = x9). Since the solution includes an expression that must be repeated for both values of x, we can create a subroutine to execute the repetition and save space in program memory.122 Section 8: Subroutines ‘Main Program 001- (EBt)(E) 002- [sTo}o 003- [x=] 004. (Program assumes [DEG] trig mode.) When you press [f] (C] with x, in the Y-register and x, in the displayed X-register, execution begins with the |(C)instruction in line 001. When the (GS6] 0 instruction in line 005 is encountered, execution transfers to the 0 instruction in line 013 and calculates »;. If for example, we used a value of 2 for x and a value f3 for x2, here is how the solution would be calculated. 001 002 003 004 ™T I zw Y> 2 3 x» 3 2 (STO]E0 (gino) (Exchange) (x2-xy in Ro) Section 8: Subroutines 123, 005 013 014 018 ™ z> 3 yo, 3 [ 3 3 4 xeL2 [2 [4 2 Keye> (sso [Miso WE) isn {Goto (Begin (xy?) ) fabel0) subroutine) 016 017 018 006 Keys (SiN) a Gn) {sinxy) (x? —sinxy (Return to (—(xy =n) main —sinx,)) program) From line 018 execution transfers back to the main program and with the first line after the last (6S8) instruction. When instruction in line 008 is encountered, execution again transfers to the (L8C] 0 instruction in line 013. 007 008 013 014 ™> Zz Y » [-3.9651 | -3.9661 | -3.9667 | -3.9651 xeL 3 3 3 2 Keys so ow (Exchange) (Goto (Begin (x2) label0) Subroutine)124 — Section 8: Subroutines 015 016 O17 018 T+ Z| -3.9651 | -3.9651 Y> 9 9 xe 3 0.0523 Keys> (JEST) [SiN] 8 (G)(eTN) bx) (sinx,) (x,2—sin x, (Return to main =¥2) program} ‘After the calculator passes through the subroutine under (C81) 0 a second time to compute y2, the f](RTN]instruction at line 018 causes execution to return to line 009, the first instruction after the most recent (G5}0 instruction. At this point, yzis in the X-register; -y, is in the Y-register. The remaining instructions complete the slope calculation. ooo 010 011 012 ™ z Y> 4.9826 x [4.9826 1__| #9826 | 4.9826 Q Ory vn (End of pom Program) When calculation halts, the slope of the line between x and x2 appears in the display. To execute the program yourself, key in the instructions listed on page 122 and calculate the average slope for following values of x, and x9:0.5, 1.25; 2.62,3.72; 5,7. Answers: 1.7325, 6.2226, 11.9826. Section 8: Subroutines 1268 For additional guidelines concerning the use of subroutines, refer to page 210, Subroutines, in part III of this handbook. Notice that and instructions always cause the calculator to search downward in program memory for the specified label. This feature often allows you to write a program in such a way that it uses a given label more than once. Example: The followin, am to calculate the value of the expression Vat + f+ 2 + uses (TL) [A] to identify both the beginning of the program and a subroutine within the program. The program is executed by placing the variables x, y, z, and ¢ in the stack and pressing (A].* Keystrokes Display 000- (CLEAR (PRGM) 000- a 001-42,21.11 Ow) oo2- 4311 x? (Gs8)(A) 003- 3211 Calculates y?and x? + y? (os) 004-3211 Caleulates2"andx? +9? te (38) 005-3211 Calculates? and x?+y?+ 2t+t 006- 11 Calculates vx? + y? +2? +42 DORN 007- 4332 st) 008-42,21,11 009- 34 De) 010- 4311 one 40 012- 4332 ol "While it i generally beat to avoid the uae of identical labels to reduce the possibility of confusion or programming errors, the following program illustrates one way identical Inbela might be used, if necessary.126 Section 8 Subroutines Key in the following set of variable x=4.3, y=79, 2=13, t= 8.0 Keystrokes Display 8.0000 1.3 (ENTER 1.3000 7.9(ENTER)4.3 (H(A) 12.1074 Section 9 The Index Register The Index Register In Brief ‘The Index register (R) is one of the most powerful programming tools available on your HP-11C. In addition to simple storage and | recall of data, the Index register can also be used for: © Program loop counter and control functions. © Indirectly addressing data storage registers, branches, and | subroutines, Index register control of loops and indirect addressing is performed using a control number you place in the Index register itself. The integer portion of the control number determines the result of each loop iteration or indirect addressing operation. The decimal portion of the control number contains the parameters for altering and Limiting the integer portion. (0 and (i) Abbreviated Key Sequences. The calculator is designed so that you can omit the [1] prefix key in (1) or [fa] key sequences. Even when the [7] prefix key is pressed in an [iJor [{i)key sequence, the calculator will automatically exclude the code for (1) Direct Index Register Functions Direct Index register functions act on the contents of the Index register itself. Index Register Store and Recall. (ST0){I](store D (recat! from R;) operate in the same way as and [RCL] operate with data storage registers Ry through R, and R 9 through Ro. Exchanging X andI. Pressing [F[-=iJexchanges the contents of the displayed ter and the Index register in the same way that pressing xchanges the contents of the displayed X- register and the Y-register. eee 127128 Section 9: The Index Ragister ISG} (increment, then skip if greater) and (OSE) (decrement, then skip if less than or equal) functions use the loop control number you place in the Index register, | | | Both (ig6) and interpret and compare the components of the | loop control number according to the following format: | tannnn isthe current counter value, nanny, where xxi the counter test value, and w is the increment or decrement value. annnn is the integer portion of the control number and is used for counting successive iterations of a program loop, for determining when to exit from a loop, and for indirectly addressing branches, subroutines, and storage registers. nnnnn can be from | to 5 digits and, if unspecified, defaults to zero. nnnnn is incremented or decremented by executions of [iSG)or (OSE). Example of Loop ControlNumber | nnn xx yy 9.05002 ata ee Begin Count Count ater upto 60 by two's xxx is in the decimal portion of the control number. When you use (50) or to increment or decrement nnnnn, xxx is then compared internally to nnnnn by the calculator to determine when the desired number of increments or decrements have been executed, xxx must be specified as a three-digit number. For example, an xxx value of 10 would be specified as 010. (xxx is a reference value and is not changed by executions of (ISG]or [DSE]. yy is also in the decimal portion of the control number. yy tells the calculator what increments to count in, that is, nnann will be incremented or decremented by the value of yy. A specified yy Incrementing and Decrementing the Index Register. The | | I Section 9: The index Register 129. must be two digits (for example, 02, 03, 55). An unspecified yy | defaults to OL. (vy is a reference value and is not changed by executions of (iSG]or [DSE).) and Operation. The increment and decrement functions use nmnnn/xxx comparisons to control a running program in a manner similar to the conditional tests described in section 7. Each execution of [f)(ISG] increments nnann by yy. Ina running program a test is then made to see if nnnnn is greater than xxx. [f it is, the HP-11C skips the next line in the program before resuming program execution. nnn < xxx Instruction ter OK (50s) Instruction. Instruction | yo “1 1 1 (DSE] decrements nnnnn by yy. In a running progtam it then tests to see if nnnnn is equal to (or less than) xxx If it is, the HP-L1C skips the next line in the program before resuming program execution. pnnnn > xxx Instruction [omens 4 Instruction} | Inairustion | ¢* Chang successive iterations of Iterations > | 9 7 2 3 4 ‘+ | 000802 |200802 | 400602 | 6.00602 | 8.00602 (Skip) TGs) + | 8.00002 |4.00002 | 200002 | 0.00002 | -2.00002 (Skip) | Skip»130 Section 9; The Index Register indirect Index Register Functions Indirect Index register functions do not affect the contents of Ry. Instead, they use the nnnnn (integer) portion of the number stored in Ry as an address for determining where in memory to execute the function, Indirect functions are frequently used in conjunction with (15G)or (OSE) in programs when it is desirable to use the same program instruction repeatedly to sequentially address storage registers, branches, or subroutines. Indirect Storage and Recall. (S70) [i]) and (RCL [{j)* store or recall numbers using the data storage register addressed by the absolute value of nnnnn. For addressing Ry through Ro, nnn = 0 through 9; for Ro through Ro, nnnnn = 10 through 19; for Ri, nnnnn = 20. (Refer to the Indirect Addressing table on the following page.) Exchange X, Indirect. [7] (©={j] exchanges the contents of the X-register with the contents of the storage register addressed by the absolute value of nannn, Indirect Storage Regi @.0.0.0R) [performs storage register arithmetic on the contents of the storage register addressed by the absolute value of nnnnn. Examples. If 5.01202 is stored in the Index register: nnnnn=5 xxx =012 yy =02 and Re Contents \Indirect Branching to Label or Line Number. In a running [program: 1. Ifnnnnnis > 0, branches execution downward in program memory to the next label specified by nnnnn. | + Rofer to page 127, (and Abbreviated Key Sequences Section 9: The Index Register 131 2 Ifnnnnn is < 0, (GTO) branches execution directly to the occupied line number specified by the absolute value of nnnnn. For example i 1 | Poescteswwcton) | [008-Instruction| | | [006 Instruction] ~> [o07- fietis [008- instruction Indirect Subroutine Label or Line Number. In a running program, [38](i] indirectly transfers execution to a subroutine in the same way that (GTO) [I indirectly transfers execution to a branch. Indirect Addressing Table GTO} or (658 )[1) (Solo al Ifnnnnnis: ‘transfers addresses execution to: storage register: °132 Section 9: The Index Register AL? Section 9: The Index Register 133 Loop Control Using [ISG | > Now run the program by pressing [71]. Example: Here is a program that illustrates how [ISG] works. It yy) . contains a loop that pauses to display the current value in Ry and Keystrokes Display uses {ISG] to control the number of passes through the loop and the i) am 2.0000 When the calculator value of a squared number. The program generates a table of ) i ) 4.0000 begins executing, it first squares of even numbers from 2 through 50. | 4.0000 pauses to display the Keystrokes Display yp ‘ number to be squared, ‘ 16.0000 then pauses to display the ee C00 Program mode. y| > : square of the number. + 2 When the loop counter oe) 001-42,21.11 Program label. yt oy 50.0000 increments beyond 50, the 2 002- 2} Current counter value ) 2,600.0000 program halts. (annnn). ) 003- 48 004- ° ) |) Here is what happens when you run the above program. 008- 5 | Counter test value (xxx). yO) 1. Under label (A], the number 2.05002 is stored in the Lregister 006- ° \ 4s the loop control value: 007- 0 ) ) 008. 3} Increment value(yy). 009- 44.25 Store loop control valuein yd fnnnn pox yw R. sl > (00012 050 02 010-42,21, 1 Begin the loop. Current Counter Test Increment 011- 45.25 Recall the number in Ry. a) Value value Value 012- 4344 Take the integer portion. y } 013-4231. Pausetodisplay the 2, Under label 1, the following sequence occurs: integer. yf After 2 and 4 (the square of 2) are displayed, the current 014 43.11 Square the number. counter value in Ry, 00002 (anne, is incremented by the - q 19 increment value 02 (yy). The new number in Ry is 4.05002, (OSE 018-4231 Display the square of the which isinterpreted hy yourenlenlntor ag : »} 2 (sc) 016- 42 6 IncrementRy by 2and check to see that the »} > nnnnn 700 vv counter is not greater than (0004 O50 1 02 thefinal ursber 60) If p> CurentCounter | Test | Increment the final number, skip the yO? Value | vatve Value next line in the program. ) ) 017- 22 1 Loopback to label 1. The new counter value is then compared to the test value 050 oie. 4332 Helewh al (xxx). As the counter value has not exceeded the test value, - falta the program. the calculator proceeds to the next line, , and the Ron mode. sry process is repeated with the new number.134 = Section 9: The Index Register 3. After 25 even numbers (2-50) and their squares are displayed, the eurrent counter value finally increments beyond 50. This causes the calculator to skip one line after the [SG] at line 16. Ao a result, the (GTO) 1 command at line 17 is bypassed and the ‘ommand at line 18 is executed, causing the calculator to return to line 000 and halt. Afterrunning the program, press{i][Fix)5, then (RCIIII. The recalled Tregister value in your display should now look like this 52,05002_ ‘Current Test Increment Counter Value Value Value (nnn) (xxx) (yw) Press [i)[FiX] 4 to return the calculator to display mode. ISG and DSE Limits, Note that [5G] and [DSE) can be used to increment and decrement any number that the calculator can display. However, the decimal portion of the loop control value will be affected by current counter values exceeding the five-digit nnnnn value. For example, the number 99,950.50055, when incremented using [SG] would become 100,005.5006. The initial number was incremented by 55. But since the new number 100,005.50085, cannot be fully displayed, the decimal portion of the number was rounded. As the calculator assumes a two-digit number for the increment value (yy), the next increment would be by 60, not 55. ‘And when the number becomes 999.945.5006, the next number would be 1,000,005.501, thus rounding the decimal portion of the number again. Since no increment value yy is present, the next increment would default to 01 instead of remaining at 60. Direct Rj Operations Example To Execute Keystrokes Display Store in Ry 12385 12.345, 12,345.0000 ~~~ ww Section 9: The Index Register 135. & To Execute Kaneces | Display (Clear display) i 0.0000 Recall from Ay (the value stored eartier using SoM. (Rc) 12,345.0000 (Clear display) we 0.0000 Exchange X and! 0.0000, (using the value remain- ing in [from above examples) 12,345.0000 Indirect R; Operations To Execute Example Display (Store 3 in R, as an address, that is, nnnnn | =3) 3.0000 Indirect storage and recall of \/7 using Ry (indirectly addressed by first storing 3 in Ry, above). 2.0408 2.6458 9.0000 Ow 2.6458 4 0.0000 Exchange, indirect, the 0.0000 in the X-register and the 2.6488 remain: i ing in Ry. (The nnann address 3 remains in R,,) flea) 2.6458 0.0000136 Section 9: The index Register | Example , To Execute ae os Display Indirect storage register | (Cz) 3.1416 arithmetic; divide the =SISIn contents of Ry by pi Sow | s1416 eng 0.8422 For an additional discussion of indirect storage register addressing techniques, refer to page 211, (ISG) With (RCL]{{], in part III of this handbook. Indirect Program Control Indirect Label Branches and Subroutines You ean indirectly branch to line numbers and labels in the same way that you indirectly address data storage registers. The table on page 131 shows the numerical address that corresponds to each possible label. Each possible address is the nnnnn portion of a positive loop control value atored in Ry. To indirectly branch to a label use [. When a running program encounters [GTO]|[I], execution is transferred downward in program memory to the label that is indirectly addressed by the current nnnnn value. For example, if 3.005 is the current counter value in the Index register... then... (906- Instruction | R, [3.00500 [006- instruction Annnn oy, (default to 01) (oo7- {sro} 008- instruction 1009- Instruction (010- instruction fo11- (rfcen)3. (012- Instruction (013- instruction 7 [Execution |transfers to [label 3 and jresumes. The same method is used to indirectly execute a subroutine, except that [G38] [is used instead of (67O\L). ~vwve Section 9: The Index Register 137/138 Indirect Line Number Branches and Subroutines Program line numbers can be indirectly addressed by a branch or subroutine instruction in almost the same way that labels are indirectly addressed. As covered earlier, when an indirect branch or subroutine instruction is executed with a positive nnnnn value in Rj, execution transfers to the label addressed by nannn and resumes. However, when an indirect branch or subroutine instruction is executed with a negative nnnnn value in Ry, execution transfers to the line number addressed by the absolute value of —nnnnn. If suthen.. Fu L-Z.00800 001- Instruction | (002- instruction 003-0] “| (004- instruction \ Execution transfers to nnnnn xx yy [006= Instruction if (default [996— Instruction Ye 007 and tool) | resumes. o07- [Gets | p—~ (008- Instruction 009- InstructionPart III Ei 3s E'S gn Sg & 2 £? tI PaSection 10 Applications Programs Matrix Algebra ‘This program calculates the determinant and inverse of a 3X3 matrix (if it exists, i.e. det. = 0) and, with a minor program manipulation, the solution to the system of linear equations represented by the matrix, Equations: ay m2 a9 by xm A Gz, zy aay by X= | x Aa) agg aay bs x3 Jaze xs) fers asf faw ara! 432 @a5| Qs Gas 222 G23, 1 Jao, anf far aif far aia det A a3) | ta) Ga JZ, 33] Jay axe] fan arf fan a] Jas: ase] Jas: aan] Jan aaa where C is the inverse of A, det A = a4 (g325 ~ ayy) — a9 49;043) ~ 0350) Fagan, 032 — G25) 140 weve we Section 10: Applications Programs 141 AX = Bis solved by X = CB, viz., Jaze a: »,[ 252 Og m1 wef 1 |g, foe 225 x) deta Jas, 3s Jez any by Jas a2 Note: © Matrix operations can be especially prone to roundoff error. In certain cases this error may significantly affect the program results. © If you have several sets of simultaneous equations to solve, key in the determinant routine to find the determinants for each 3X3 matrix. Replace the determinant routine with the simultaneous equations routine and store the respective determinant in Ro for each calculation. a a2 0 * A2X2matrix should bestored as | aq, agg 0 oo 1 © Error 0 will be displayed if the matrix entered is singular.142 Section 10: Applications Programs Main Program xevstroxes | pispiay | KEYSTROKES | DISPLAY (ictear fac | o00- 027-45 001-42.21, 9 joes. 48 002- [ozs- 45 | 003- 030-45 3 004- o31- 32 8 008- 032-46 i 006- 45 3| 007- 45 oos- 44 | 45 oos- 43 32| (Gsule 32 010-42,21,12| (nct}8 037-45 8 on- 48. 3] (Rt? Ce 012-45 .3| (Rats 038-45 5 13-45 2 040-45 o14- 45 ol (cssle oai- 32 8| 016-32 _8| (GsB)2 042-32 | 16-45 .2| [Rcxs 043-45 | 017-46 7|(actie}2 044-45 2 ore- 45 6 | (CLI) 045-45 1 o19- 45 .3| (Reo 46-45 9 020-32 a (ssble 047-32 8 o2i- 45 6| (Acct as 45 41 022-48 .0| actj6 vas 46 | 023-45. 3] [Rci5 060-45 5 o24- 45 7| ost 45 2 026-32 8] 062-32 | 026— 2| 053-45 5 Section 10: Applications Programs 143 KEYSTROKES | DISPLAY | KEYSTROKES | DISPLAY 45 9 0 31 meus joss- 45 8 | aI(RTR) oss- 43 32| mens jose- 46 6 [nuab2 069-42,21, 2 Miele los7-a2.21, @ [cus o70- 45 4 {ba lose. 20 071-43, 6, o| mH loss- 33 o72- 31 a loso. 20 073-42,21, 3 frnceal Josr- 43.33 [1 o74— 1 le Josz- 30 [sTOIN) 076-44 25| loss- 45 0 fo loea- 10 fsvola \065-43, 6, 0 [a7 lose- 22 1 REGISTERS: Ri index Rg: Det Ry: by a:b Rs: by Rents [Reon Re: ave yang i 221 Re: 222 Rea on IR: a0) Rx a Ry: ass Determinant Subroutine KEYSTROKES | DISPLAY | KEYSTROKES | DISPLAY Bie feat lo beso (Geo |oso-43, 5. of acticjo pes: 45.0 a4 lost alan as- 45 .2| josz- 44 25 [cselo pse- 32 9444 Section 10: Applications Programs KEYSTROKES | DISPLAY | KEYSTROKES DISPLAY fare jos7—- 48 8 ACL] }2 095-45 2 jenos lof 48 .3|(Gs8)9 o96- 32 9 (ea 089-32 9 (ficLIS 097-45 6 098-45 3 oss- 32 9 100-45 6 1oI- 45 4 DISPLAY | KEYSTROKES ISPLAY 079-4221, 1 os8- 44 3] oB0- 45 24|(Ra) o8s- 3 osi- 20 090-44 2 (082-44.40, 4] (Re) osi- 33] oas- 42 6| 092-44 7 oB4- 42 31 | (csa)3 093-32 3] 086~ 43 32|{Gsal[e) os¢- 32 12 086-42,21,13|[a)(cr]0 095-43, 6. 087-43, 4, 0|[act}4 096-45 4] mstrucrioNs KEYSTROKES. 1 _ rey inne main program ines 000 078) 2 [serinert Rey in sabroioe ZEA ines 079-102), (G¥9))078 l (HFA. eR] y Section 10: Applications Programs 146 ver] ‘insTRUCTIONS INPUT DATA/UNTTS KEYSTROKES ‘ourPut OATA/UNITS. 3 |Setuser mode, 4-_| S10 the elements ofthe matrix (sims (stBi6 a3 (S57 (os (st0l8 a on (sole so! os eon B55 so08 [Find the determinant w 6 _|toverae (Optional Find the lovers ol (3 7__| Simutaneous Equations (Optional Delete lines 078 10 102 (BST) wz 92 3 (SEE oe. 4332] 8 [Key in subroutine under ono 079-4221, 1 tines 079 036), fore146 Section 10: Applications Programs iMPUT: ‘ouTeUT ster} INSTRUCTIONS. aravunrrs| KEYSTROKES. | aatayuuirs Hoput the colume mati and find x aes) 10 | For new columa matrix goto simp 9 n 4 11] For new detoominant ot inverse alte ines 079 t 098, {Con RTs) Ce (88) wi @. Sota step 2 uu Example 1: Find the inverse of [ 4 a] then solve salle)-[] Keystrokes Display Set User mode. Mies Key in the determinant routine. 14 (5105 8 (CHS )[STO}6 2 104.0000 0.1154 Det. A Keystrokes (a7S| amo) (eR) Oe. Display 0.0769 0.0000 0.0769 0.1348 9.0000 0.0000 0.0000 1.0000 102- 078- 32 9 43 32 Section 10: Appiications Programs = 147 oe 13 ea 2 Cu 3, 39 3a Key in the simultaneous equations subroutine, Keystrokes rR 20 (ENTER) 5 (ENTER) ° Display 2.6923 2.2115 0.0000 x Ry 5 Example 2: Solve for the loop currents in the following circuit. 19148 — Section +0: Applications Programs The three loop equations are: Loop 1 4, ~ 41, + 15, -15fg-40= Loop 2 4Ip~ 41, +8ly +10, ~ 101 Loop 3 10Is ~ 101g +11; + 161g — 15, =0 or 191, ~4I,~ 151, =40 41, + 222-101) =0 15h, ~ 10%, +264, or in matrix form 9 4 22 -10}]%]=|0 5 Keystrokes 19 (STo}S (sto) 6 15 |[StO}7 4 8 22(ST0)9 10 (cHs)[STo]Jo 15 (cHs)(sTO}L}1 10([cHS)(StO}-)2 26 (STOI-13 Delete the simultancous equations routine if it is still in program memory, and insert the determinant routine. 2,402.0000 Delete the determinant routine and insert the simultaneous equations routine. Display 40 (ENTER) © (ENTER)(C] 7.8601 4.2298 6.1615 v~ ‘Section 10: Applications Programs = 149. Systems of Linear Equations With Three Unknowns This program uses Cramer's rule to solve systems of linear equations with three unknowns. It has been included here because of the relative ease with which it can be used to solve systems of linear equations compared to the Matrix Algebra program. Equations: A system of linear equations can be expressed as AX=B. ay a2 ay For three unknowns, ay Oy Brg ay dy O35 x X= | a det A = ay,(azgagq ~ 23032) ~ @y2(421493 — 22931) + @y(@21Ag9 ~ @22051) - xis are solved by det (2) Det A for Det A #0 where det (i) is the determinant of the A matrix with the i" column replaced by B. Remarks: If Det A =0, then the system is linearly dependent and this program is not applicable. The program will terminate with Error 0. If Det A is very close to zero, the calculator representation of the number will contain significant round-off error and the ratio (det (i)/Det A) will be in error.FeO | Section TU. Applications Frograms aaa ae] | KEYSTROKES | DISPLAY | KEYSTROKES | DISPLAY d [cLeaR (paGM) | 000- (Ges 02-45 6 y eo) 001-42,21,11 |(RCL)7 030- 45 7 058- 4 |RcUo jO75- 45 .0 059-32 _ 7 |G) (RIN) jO76- 43.32 Section 10: Applications Programs 181 KEYSTROKES | DISPLAY | KEYSTROKES | DISPLAY 002~ 1 |(es89 jost- 329 [oos- as. [o32— 16 obo~ _31 jf usu8 077-42,21. 8 | { —_ a 061- 7 ° 004~ (Reus 033-45 3 \ - (cs5)7 062-32 7 1) tes 063~ 31 008- rane 034-45 8 008- 3 |(esa}9 036-32 9 036-45 1 Jos7- 45 (064-42,21, 7 i lsmone ———foss- 4a 4 | [sro oss- 4425 |(sB)8 067-32 8 o68- 32 0 09-45 0 008-42,21, 2 009-4526 o10- 43.44 on- 4231 012-4524 013-31 9 038-32 9 039-45 2 7 9 040-45 041-42,21, 042-42 6 ) O14- 4424 043-4231 Os 42 6 044-4524 o1e- 22 2 046- 20 ) 017-32 0 o46- 20 yf) oe 44 0 047-40 o1- at o4s- 43:32 020-42,21, 0 049-42,21,12 ) o21- 050-443 ) 022- os1- 33 ) ) on- 440 o72- 454 073- 44 26 |(STo)3 jo90- 44-3 076-32 8 (HRTw) lost- 4332 REGISTERS Ry; Index 023-45 O52- 44 2 024-45 025-32 026-45 027-45 o2s- 32 053- 33 054-441 yoo oss. ) [are] srmucrons |, POT (GSB) 7 o66- 32 7 AS 067- 31 ‘ouTPUT EYSTRONES | A ATAVUNITS ) 1_| Key in the progr ) 2_ | setUsor made wlolalolmia182 Section 10: Applications Programs Keyinthe 33 matin in column order (ote to eae the daplayed valve in the ragister press (A7S}). Re % we 5h ts. ws 2h 4 fcr am tn 2) ah ‘Te review the mati press (I. 4 [tnput the colon mats. 5._| For new column manix go to step 4 8_| Fornew3 x3 mavi step 3. Example 1; Find the solution matrix for the following: 19-4 -15 x 40 -4 22 -10] |x.]=] 0 =15 -10 26] [x 0 Keystrokes Display (CLEAR (REG) ‘Set User mode. 1.0000 0.0000 vue Section 10. Applications Programs Keystrokes Display 9 2.0000 0.0000 4 RS) 3.0000 0.0000 16 4.0000 0.0000 4 5.0000 0.0000 22 6.0000, 0.0000 40 [CHS)[RZS) 7.0000 0.0000 15, 8.0000 0.0000 9.0000 0.0000 2,402.0000 Det. 7.8601 oa BS) 4.2298 xp 6.1615 xy Example 2: Find the solution matrix for: 19-4 4 xy 5 5 -12 -10] |x -3 15 8 3 x3 4 Keystrokes Display 1.0000 19.0000 2.0000 -4.0000 3.0000 -15.0000 4.0000 4.0000 6.0000 22.0000 6.0000 ~10.0000 7.0000 -15.0000 8.0000 ~10.0000 9.0000 26.0000 284.0000 Det. ~1.6667 xn 4.4091 a 4.7576 an 153154 — Section 10: Applications Programs Newton’s Method Solution to f(x) =O ‘One of the most common and frustrating problems in algebra is the solution of an equation like: Inx +3x = 10.8074, in which the 2's refuse to conveniently migrate to one side of the equation and isolate themselves. That is, there is no simple algebraic solution. The following program uses Newton's method to find a solution for f(x) = 0, where f(x) is specified by the user. The user must define the function f(x) by entering into program memory the keystrokes required to find f(x), assuming x is in the X-register. The main program is 68 steps long and requires registers 0-4. The remaining memory and available registers may be used for defining f(x) by the user. In addition, the user must provide the program with an initial guess, xo, for the solution. The closer the initial guess is to the actual solution, the faster the program will converge to an answer. y wey section 10: Applications Programs: 166 ‘The program will halt when the following conditions are satisfied: 1. Loop count > Loop Limit 2 f(x} tolerance (e) 3. Benew —Xotdl S Aa limit The user may choose values for ¢ and Ax or the program will use default values, Equations: _ fix) FQ) ‘This program makes a numerical approximation for the derivative f(x) to give the following equation: fx) F(xi+ 6) fx) Hin = Hy 8 where 6) = 10 5 xp and 6; Note: © After the program has finished, x for f(x) = 0 will be displayed and will also be in register 2. * Error 0 will be displayed if, in the attempt to find a root, there ia a division by zero. If this occurs, try a new guess that is close toyour last guess. © This program also keeps track of the number of iterations that take place when trying to find a root. Rj is initialized to 50 (lines 020, 021 and 022) and an error (Error 4) will occur if that many iterations have taken place, The user may change the maximum number of iterations by deleting lines 020 and 021 and keying in the desired number. ‘© The user may like to see each x;. as it is found by Newton's method. To do this key in [7}[PSE] after (at line 047 if no other modifications have been made to the program). * If the tolerance is too small, round-off error within the calculator will become significant and the roots become erroneous.166 Section 10: Applications Programs 8 008 8 037-43 40| cos 44 3 ‘fose- 44 | 010-44 4 039-452 ou- at o40- 34 o12- 44 3 oat- 10 o13s- 31 042-45 0} o14- 44 4 oas- 20 015-4335 ou te o16- 43:32 O4s- 45 1 017-42,21,12 oae- 40 o1s- 44 2 47-44 2 019-44,20, 0) 4-43 36 020- 5 o4s- 30 ° o21- os0- 44 | Gan 022- 51-42 6 (sa) 023- os2- 22 2 (eu2 024— os3- 32.9 (Star) 026- }054-42,21, 2 On 026-42,21, 1 oss- 45 2| (a2 027-45 2 lose 32 13| (So) ozs- 44 1| (RBS) los7- 43.16] “~~ wee EY YES Section 10: Applications Programs = 157 KEYSTROKES | DISPLAY os4- 431 065-42 10] 066-43 321 067-22 068-42,21.13] Re: 8) Ry: Loop counter| Rg Axlieit staucTioNs Set Program mode, Key inthe function tobe solved {ntalice tolerances, pata 1 | ey in the program, 2 | Gor (aI). DATA/UMT [| |__| {Optional tpt ‘you do not wih toate the ‘default value of (10°) but wish tc Ing he intl guess nd compute168 = Section 10: Applications Pragrams: ‘ourPut DATA/URITS sep 10. For nnw toerances goto stop 8 ‘Set program made and delete lines Goto tap 4. Example: Find a root of fx)=2x with x= Keystrokes Display (Gro}(c] (el 068-42,21,13 (Sto) ee) fers) 075- 30 fl (Fix 9 User mode. 0000000010 Default cand Ax. 1.134724138 x, -0.000000004 f(x;) ~ vw Section 10: Applications Programs 159 Numerical Integration by Discrete Points ‘This program will perform numerical integration when a function is known at a finite number of equally spaced points (discrete case). The integrals are approximated by either the trapezoidal rule or Simpson's rule. Equations Let x9, 21, .., ben + 1 equally spaced points (x;= x9 +h, j=0,1, 2, ..., 2) at which corresponding values f(x), f(x;) .... f(x,) of the function f(x) are known. Theintegral: J — f(x)dx may be approximated using: 0 1. The trapezoidal rule: e f ftayax~* rooea(S rs) +Flae) 0 Ft 2 Simpson’s rule: f Aandi ~B (fxg) + Aflay) + 2/029) +. Af lena) + 2f(X pa) + Ap) + flan) In order to apply Simpson's rule, n must be even. Ifit is not, Error 0 will be displayed. KEYSTROKES | DISPLAY | KEVSTROKES | DISPLAY (CLEAR (eRem) [000- foos- 440 BUA (001-42,21.11 [T0165 loos- 44 5 (sral4 (002-44 alo [007 o 003- fc loos- 44 3. 004~42,21, alma foo9-42,21, 1‘od d Section 10: Applications Programs: 181 ‘ —ree >) > Gre] wsmucrons | it@UT ] aersmones |, 000 yoy 011~42.21,12 ) 1] Kevin te progam, ) [a [server mote 12-441 [cus los7- 46 5 ova. a2 2 |auaio oa .a2.21, 0 y) 5) [5 [reunite peonen cates | 4 oe as. a8 a 1) Le [rtm att cn ty o15— logo- 30 yy rete i) &) s o1eaao, 6 josie ab ; | cocaine tn integra viahe . oe a2 20 y trapezital ue Top f 018-44,40, 3 04s 34 yo) o* oi. as a 10 hy bySinpsors lea musthae | r 030 3H Wy bean oven. o Sino DDE) 021-42.21.12 lo4e-42.21. 2 | S| fornem ease cover (ial 022-44 1 [ENTER] loa7- 36. a) (esa)2 ozs. 32 2 | loas- 40 )| >) Example: Given the values below for f(x), = 0,1, .. 8, caleulate Haale o28daaor 6 qano 0 5 the approximations to the integral 2 1 026~ 050-43. 32 1 fede asa. 2 means] | f e275 3 sz. SO ) by using the trapezoidal rule and by using Simpson's rule, The | value for h is 0.25. joz8- 22-1 05 3— 10 yt ) Jozs—42,21,13 (i se azeep | j fof s|2{a|s|sjeoj7 je 1030— 2 (oe=o G5 43 40 ) | xy 0 | 0.25 I 05/075] 1 1.251 1574.75 i 2 jost- _46_o faim) os6— 43 32 ) ty) [2 [a8 [se] sz [7 [92 [iar fiee [20 osz- 22 0 > yy o39-42,21.14 |) Keystrokes Display | OlER2 , Set User mode, ) 0.25 REGISTERS Ry Unused y 3 0.00 Ro. Used Ry: fx) Ry: Unused R, 28(8) 1.00 o 2 ) rus 1 )) > ey 2eo Reh Used g-Aig: Unused yy) 82a 300162 Section 10: Applications Programs Keystrokes Display 4.00 5.00 6.00 7.00 8.00 16.68 16.58 Trapezoidal. Simpson's. Curve Fitting Your HP-11C calculator is equipped with a powerful builtin function, linear regression, |, which quickly and conveniently fits data to a straight line. (See page 63.) ‘This capability is used here in a program to fit dat of curves: to other types 1, Exponential curves; y =ae"* (a>0) 2, Logarithmic curves; y=a+bInx 3. Power curves; y= ax? (a >0) which may be transformed to the general linear form Y=A +X. ‘The regression coefficients A and 4 are found by solving the following system of linear equations no YX Ay_—sx 2X, 1x? b x¥.X) where nis the number of data pairs. ‘The relations of the variables are defined as the following: Regression A X ¥, | Code Exponential | ina | x | In | 1 Logarithmic a Inxy vi 2 Power Ina | inx, | iny, 3 www Vee Vee Yee Section 10: Applications Programs 163 ‘The coefficient of determination is: ALY, +62X,¥,— 1 cry? uyi-t eye n ‘The type of curve fit to be run is determined before data input begins by inputting the code number. The coefficient of determination indicates the quality of fit achieved by the regression. Values of r? close to 1.00 indicate a better fit than values close to zero. The regression coefficients « and 6 define the curve generated, according to the equations at the beginning of this discussion. Logarithmic Curve Fit Code =2 Exponential Curve Fit Code =1 y=atbinx164 Section 10: Applications Programs yp od Section 10; Applications Programs 165 Power Curve Fit 4D KEYSTROKES yy |_xevstaoxes | DISPLAY Code =3 yo) [ean o12- 22 26| (ai o36- 43.49 | > [Beanz 013-42,21, 7 |(eTo}9 037-22 9 | (wee 014-43, 6, 1 (TERS) 038-42,21.12 1). Terete o1s- 22 sina) _[ess-_aza9 \) ) Iago o16-42.21. 8|(alrn0 ‘Joao-a3, 6.0 \| > [@eAe 017-43, 5. 0[=) ost 12 | ) ) 018-42,21, 9|/R7S 042- 31 ; (ees o19- 31 043-34 | 1) [wre 020-43, 6, 0 oa 31 yy) EN) 021- 4312 Remarks: yl 022-38 * The program applies the least squares method, either to the ° oA 023-43, 6, 1 caustione crponentalcurveandgoweecarwes eermet 3) tern o24- 43:12 3 © Negative and zero values of x, will cause a machine error for >| 9 |tgens 025-48 6 049-42.21,14 logarithmic curve fits. Negative and zero values of y; will »} > jee O26- 43.30 o50- 1 cause a machine error for exponential curve fils. For power 027-22 6 os1- 4a 6 curve fits, both x;and y; must be positive, non-zero values. 1) lee ose 052. 229 © As the differences between x and/or y values become small, oo Ie 028. as 5342.21.18 the accuracy of the regression coefficients will decrease, * During operation of the program all storage registers are d} > [eas 930-22 9 ona-43, 6, 1 cleared. Any data stored in extra registers will therefore be 031-42,21, 6 O65- 43:12 destroyed. uy 032— aa ORR- 47 48 ) 033- o 057-43, 6, 0 DISPLAY KEYSTROKES | DISPLAY ) 034 46 6 jo5e- 12 {cvear (acm) | o00- foos- é ) 35-33 mao) 001-42,21,11 joov- a0 Gciear Res) |ooz- 4234 oos- 44 25| ) Wg2 003-42, 7. 2 loos- a3 | REGISTERS Ri Code 004— 36 010-43, 4, o| yt Ry dx Re: Sx? Rs: By, 005— 36 011-43, 4, 1 ty Re: avi Rg: Tor Ryo! Uni166 __Section 10: Applications Programs 7) 7 Section 10: Applications Programs 167 wPUT OUTPUT yo ste esTRCTION DATA/URITS | DATA/UNITS: J y 1 | kere pogrom 2_| servsermote WO 2 [Seite eel onee hy i 1 100 | toe ~ a )) ) Keystrokes Display Logartie 2 a 200 i Set User mode. Powe 3 @ 300 apy 1.00 4 | tots; vtn an yl, i ‘ENTER) ))) 7R(ERTER)2.16 (R75) ae 0 1.31 1.61 » ws) i hy (Repetto a data pois i yo) 5 | Gaeta reson oi . see 3.45 a 4 ye) ~0.58 8 and cafe of determination 2 i 0.98 rf > 1.44 9 6 _| Maka projection ot new 7 for 8 | tonwn ae Ei ? 2) ) Bxampte2: {Rape so 6 forall vals ot )) (ogarithmie, Code =2) sane) p> x 3 4 7. | tne corecton yoy yr 16 | 93 | 234 | 488 | 601 Erne inputs arsep 4 ayn i sorrectad by pressing [D)and EoD Solution: a] wen, bana “han onto ep and ara y= 47008 1 41.991n x > 7?=098 core da. _| i 9B > Forx=8, $=39.06 yi) Forx=14.5, }=63.67 Example , ) (Exponential, Cod >|) Kevatrokes Display 2(4) 2.00 0.72 1.31 1.95 2.58 314 )} ) 3 [ENTER] 1.5 y, | 216 116 0s st 4 (Eren}9.3 6 (ENTER)23.168 Section 10: Applications Programs Keystrokes Display 10 [ENTER)45.8 12 (ENTER]60.1 @ ~47.02 a 41.39 o G3] 0.98 rf af 39.06 y 14.5[6) 63.67 ¥ Example 3: (Power, Code =3) xi 13 | 26 4 54 y, [374] 615 | 721 | 803 | eea Solution: @ = 3.49, 6 =0.50 y= 3.49 x99 ?=0.97 Keystrok Display 3.00 2.6 (ENTER]6.15 [R/S] 4 (ENTER) 7.21 5.4 [ENTER)8.03 7.1 (ENTER)}8.84 (R/S) B 3.49 0.50 0.97 ee Section 10: Applications Programs = 169 Triangle Solutions ‘This program may be used to find the sides, the angles, and the area of a plane triangle. A J \ Sy Sz As Ar Ss In general, the specification of any three of the six parameters of a triangle (3 sides, 3 angles) is sufficient to define a triangle. (The exception is that three angles will not define a triangle). There are thus five possible cases that this program will handle: two sides and the included angle (SAS), two angles and the included side (ASA), two sides and the adjacent angle (SSA—an ambiguous case), two angles and the adjacent side (AAS), and three sides (88s), If the three known input values are selected in a clockwise order around the triangle, the outputs will also follow a clockwise order. Remarks: ¢ Inputs may be in any angular mode (i.c., DEG, RAD, GRAD). Be sure to set the angular mode of the calculator to match that of the inputs, « Note that the triangle described by the program does not conform to standard triangle notation; i.e., A; is not opposite 8). « Angles must be entered as decimals. The (8) [5H] conversion can be used to convert degrees, minutes, and seconds to decimal degrees, © Accuracy of solution may degenerate for triangles containing extremely small angles.170 Section 10: Applications Programs KEYSTROKES [DISPLAY | KEYSTROKES | DISPLAY | (Octear (racm) | o00- [car 029-45 2| ose) 001-42,21,14 | (RCLI6 030- 45 6| (st0)s 002-44 5] 031- 40) ee 003-33 | (sim) 032-23 (sto}3 oos- 44 3/5) 033-10 fora 008-33. 034-45 1 (01 006-44 1 035-20 (rcx}3 007-45 3 038-44 3 eA oos- 4326 037-22 0 me 008-4311 038~42,21.13 (cas 10-45 5 039-44 4 oe one 4311 o4o- 33 Bo o1z- 30 oai- 44 2 (eu 13-45 1 42-33 (Reus 45 3 oas- 44 1 @ 20 oaa- 45 4 2 2 45-45 2 a 20 oae- 40 10 oa7- 23 ros, 4324 o4s- 45 4 Giz o2zo- 44 2 049- 23 (Gta}o 21-22 0 060-10 022-42,21,12 51-45 1 (sT0)2 023-44 2 052-20 =H 02 33 053-44 3 (sto) 026-44 1 o5a- 22 0 ior) 026— 33 065-42,21,15 (sale 027-44 6 056-44 4 ow 028-23, 057-33, Section 10: Applications Programs: Wt KEYSTROKES | DISPLAY | KEYSTROKES | DISPLAY fo7-42,21,14 Joes 44 3 oss 33 jon0- 44 2 osi- 33 os2- 444 (093-42,21, 0 oss 45 2 oss- 45 1 ose- 4226 oo7- 45 3| oss- 34 joss- 30 100-4326 noi- 44 6 oz a8 nos- 4a 4 roa 45 2 hos 40 106-32 9 no7- 44 6 os- 23 os- 20 10-45 1 1-20 a2 2 113-10 oas- 44 2|(sTa10 i14- 44 0 oas- 22 o|) ais- 4BVIZ Section 10: Applications Programs KEYSTROKES: KEYSTROKES: lo 116- 124-22 2 lo we 0 |S 125-42.21, 8 18- 6 |(s)icen 126- 43:35 119-44 26 |(o)/RIN) 127-4332 120-42,21, 2 |Otas 128-42,21, 9 121-46 24 |[605) 129- 122-31 |[eHs) 130-16 123-42 6 |(a)cos) 331-4324 sre] srmucrons | gig | aerernoes | OUTPUT 7 | intern 2 | Surwde 2 | Sa ntt pire [| (DEG, RAD, GRAD) Section TO, Applications Programs = 173 ster sraucTiONS pataruarrs | FEVSTROKES | garavuntrs | S813 aie __ fer [sitet 5 wre | Sin? 3 (ENTER) Seo wl Ae otoste | 5 | asa mon included side} ar Angie 3 Ay (ENTER) | | sae s | | anges A @ ana | Gorosten9 | 5 | SAAT anges + adjacensida} fater | Site 1 Ss: Crna Angle A Angle? A hea Goose 1 | SAS 12 sides + inched ang) tor | Site Ss CENTER Angle 1 AL (eure) Se? S o wer ota sep. 8 | SAD sites + adacont ange} _ fer: | sie 5 ENTER] | Site? 3 oe174: Section 10: Applications Programs TAPUT iesraucTiONS loarnrunrTs Tote the remaining sides ond angles Ho alternative triangle is possible 9 | second triangle is poste Example 1: A surveyor is to find the area and dimensions of a triangular land parcel. From point A, the distances to B and C are measured with an electronic distunce meter. The angie between AB and AC is also measured. Find the area and other dimensions of the triangle. A 297.35 meters 98° 12" NN —__ c 171.63 meters, Ve ever veer ve Section 10: Appiications Programs 175 ‘Thisis a side-angle-side problem where: $,=171.63, A,=98°12' and S)=297.35. Keystrokes Display (EG) OEn2 Set User mode. 171.63 (ENTER) 171.63 98.12 (0)[-oH) 98.20 297.35 (0) 25,266.21 Area. 171.63 8 A 98.20 Ay 297.35 Ss 27.83 Ay 363.91 Ss 53.97 As Example 2: Given 2 sides and a nonincluded angle, solve for the triangle: Side, = 25.6 Sidey = 328 Angleg 2.3178 Section 10: Applications Programs Keystrokes Display 28.6 (ENTER) 26.60 32.8 32.80 42.3) 410.85 Area. 26.60 Sy 78.12 Ay 32.80 8, 42.30 Ag 37.22 Sy 59.68 As 2.00 Second Solution, 124.68 Area. 26.60 8, 17.28 A 32.80 8, 42.30 Ay 11.30 83 120.42 Ag t Statistics Paired t Statistics Given a set of paired observations from two normal populations with means 1, #2 (unknown) let sp= Section 10: Applications Programs 177 ‘The test statistic Bb 8D vr which has 1 ~ 1 degrees of freedom (df) can be used to test the null hypothesis, Hy: wy = uo. +t Statistic for Two Means Suppose {2;,.2,-, ¥n,} aNd [Y1, ¥2, .--.Yng! are independent random samples from two normal populations having means 1; and pz (unknown) and the same unknown variance o”. We want to test the null hypothesis Hy: y — 4 =d. Equations: 1 fee? —mi? + Sy — mi me mm =2 We can use this t statistic (which has the t distribution with n, + np — 2 degrees of freedom (df) to test the null hypothesis Ho. References: 1. Statistics in Research, B. Ostle, lowa State University Press, 1963. 2. Statistical Theory and Methodology in Science and Engi- neering, K.A. Brownlee, John Wiley and Sons, 1965.178 Section 10: Applications Programe KEYSTROKES | DISPLAY KEYSTROKES | DISPLAY MDcuear (PaGM) | 0o0- (sroIe2 029-442 Aww 001-42,21.11 | [ACLIO 030-45 0 el 002- 30 jo o31- 44.0 Ga 003- 4g|o 032- o (cas) oos- 31 |fcuean(s) joss 4232 a (005~42,21.13 034-31 006-43 0 035-42,21,14 007-44 6) 446 oos- 31 451 os 009- 43.48) 45 2 o1o- st a4 fecur) on- 45 6! 34 012-45 0] 443 o- t 430 014-20) aa 8 o1s- 34 34 16-10) 45 0 o7- at 20 o1s- 45 0) 45.0 o18- 1 10 020-30 aa 7 o2t- 31 34 022-2213 30 023-42,21.12 45 6 24-48 30 025-1 45 4 026-45 1 453 27-441 457 o28- 45 2|i0 os7- 20 ~~~ Section 10: Applications Programs 179 KEYSTROKES | DISPLAY KEYSTROKES | DISPLAY a 088. Reo HOO [es Tea (074- 15] [coat] 076-45 0] (mct}e 062-45 Bllid o76- 18 Gl 063- o77- 40 2 064 om [RcLio o6s- 45 olf) 073-20 fcr] e REGISTERS” Rj Unused Ry: 3x Sy 3D [Re unacea | Re: a RyRy Unused ‘Entries before the semiculon indleate ragiater nage fo the t Statietna fue Ban Moan program. Entries atter the semicolon aze for the Puived t Statistics program. A hlank entry represents unused a single entry withaut a semicolon ia valid for both programs INPUT: DATA/UNITS ‘ourPuT DATA/UNITS stmucTiONS Key infines 001-022, Inia the program, Repeat steps 5100) = 1, 2,10 Repaat step 90 review 91 (8) 103 (8) 180 Section 10: Applications Programs ap oF Saction 10: Applications Programs = 181 arPaT Y} 0) Example 1: wsrauenions DATA/UNITS ae) ; x | 14 |178| 17 [176 [15.4 yd vy | 17 [20.7/ 21-6 [209 |172 Ts @ i )) ) Find D, sp. ¢and df for the above data. 5 | fopnona Yo caret eronoue 1, ) Keystrokes Display She Ae yo) eA )y Setter Mode (CLEAR [REC] 8 _| Tocabelte ast sans: i 14 (ENTER) 17 [4] 1.0000 @ Yi) 47 CeneR} 15 (a) 2.0000 Error. ” yi oy 17RD # I 15 Ell 1.0000 Correction. t t ) 17.5 [ENTER)20.7(@) 2.0000 9 a 17 (ENTER|21.6(&) 3.0000 5 )) ) 17-5 [ENTER}209/2) 4.0000 7 | Repeat top 6 trview the results 154[ENTER}172°%) 6.0000 - 1 Statetic for Two Means a} > -3.2000 DB 1.0000 8 1 | key woes 073-088, )) fee ~7.1854 e 2. | twit the program. (E)CLeAR (REG) jy) &8 4.0000 af 3. | Sat user mode | 4 | Inputs i @ i yl) x| 79] 84|108|114]120)103/122/120 | 5_| Tocorect erraneous mput 1) A ices) ua yf > y} 91] 103) 90]113]108) 87/100) 80 |99| 54 §_{ ton fr he soon a of | Hd =0tie,, Ho 21 ~ uy) find t and df for the above data, wo Repeat pe 8 f00/=1.2 ) ) Keystrokes Display 7 | tpt, ” @ctear bes ) 2 Te(Bje4(a}99 8 | Toconat eroneous nut n iI ) 2.0000 & | tnput tt clei as statisti: | a df | 8.0000 | d 0.0000 ) )182 Section 10: Applications Programs Keystrokes Display 90(8)113 B) 108 (5)87 8) 80 (8) 99 (8/54 (8) 10.0000 ofp) 1.7316 t &S) 16.0000 df Chi-Square Evaluation This program calculates the value of the x” statistic for the goodness of fit test by the equation: (df=n-Y) where 0; E, = expected frequency. If the expected values are equal, E=E=——* foralli, n then M20? so WEG, i Note: In order to apply the goodness of fit test to a set of given data, combining some classes may be necessary to ensure that each expected frequency is not too small (say, not less than 5). Reference: Mathematical Statistics, J.E. Freund, Prentice Hall, 1962. weve Section 10: Applications Programs 183 {[ievstaoxes | oisPiay | KEYSTROKES | DISPLAY ctean (ero |ooo- THO 022-2213 Rena (001-42,21,11 (o23-42.21.12 [IEA 002-43, 6. 0 024- 49 [oos-42,21, 0|(RS) 025-31 | cacecite) 026-42,21,14 [RcLlo 027-45 0 een 028-45 2 Ce) o29- 20 (ce) 030-45 1 iG 031- 10 010-43, 6, o|(Rcut 032-45 3 one 16/5 033-30 012-4440, 1 |(WS 034-31 013- 1 036-45 1 014-43, 6, 0 036-45 0 o- 16 o3s7- to 016-44.40, 0 038-31 o17- 45 0 039-2214 fos an | (040242,21.16 019-42.21.13 041-43, 4, 0 20-45 4 42-22 0 ou- at REGISTERS SYS nus] Ry Index Rye 20; Ry SOF Ry Used Ry Used Ag Used Re—Rgi Unused184 Saction 50: Applications Programs 8_| Toco acneout 0, or fy | Coleiate x1. Repeat step 6 to review the result (Dctean RES) Ropeat steps 3-4 for i=1, 2, 0. 3_| moto, o @ é 4 | To conect eranaaus 0, % fries bt & | catia af o | « £ Aopen sep 510 elo an. Example 1; Find the value of the ,* statistic for the goodness of fit for the following data set: so | 47 | 56 | 5 | 14 46.75 | 61.85 | 64.4 | 8.25 | 9.15 wwe Section 10 Applications Programs — 188 Keystrokes Display (crear falar Set User Mode. 8 9.6 (A) 1.0000 5O[ENTER]46,75 [A] 2.0000 47 51.85 3.0000 S6[ENTER|54.4(A] 4.0000 100 [ENTER](A] 5.0000 Error. 100 [ENTER)(E} 4.0000 Correction. S(ENTER}8.25(A) 6.0000 14(ENTER]9.15[) 6.0000 4.8444 x? Example 2: The following table shows the observed frequencies in toasing a die 120 times. x can be used to test if the die is fair. (df 5) Note: Assume that the expected frequencies are equal. Number 1 2 3 4 5 | 6 Frequency O; 25 17 15 23 24 16 Keystrokes Display (crear 26(8)17(8)19(B] 3.0000 Error. 19[9)(2-) 2.0000 Correction. 15 (6]23 [B24 1 6.0000 @) 8.0000 x? cS 20.0000 E ‘The value of x? for df = 5 and 5% significance (found on p. 438 of Freund’s Mathematical Statistics, Ind edition) is 11.070. Since 5.00 is less than 11.070, no statistically significant differences exist between the observed and expected frequencies. Finance: Annuities and Compound Amounts ‘This program can be used to salve a variety of problems involving money and time. The following variables (except the interest rate,186 Section 10: Applications Programs which must be given) can be either inputs or outputs: n: The number of compounding periods. (For a 30 year loan with monthly payments, n = 12 X 30 = 360.) i: The periodic interest rate expressed as a percentage. (For other than annual compounding, divide the annual percent- age rate by the number of compounding periods in a year, i.e. 10% annual interest compounded monthly equals 10/12 or 0.83%) PV: The present value of the cash flow or compound amounts. PMT: The periodic payment, FV: The future value; the final cash flow (balloon payment or remaining balance) or the compounded value of a series of cash flows. Accumulated interest and remaining balance may also be computed with this program. The program accommodates payments which are made at the beginning or end of compounding periods. Payments made at the end of compounding periods (ordinary annuity) are common in direct reduction loans and mortgages while payments at the beginning of compounding periods (annuity due) are common in leasing. For ordinary annuity press [A] and then until 1 is displayed. For annuity due press (A) ther juntil 0 is displayed. ‘This program uses the convention that cash outlays are input as negative, and cash incomes are input as positive. Pressing provides a safe, convenient, easy to remember method of preparing the calculator for a new problem. However, it is not necessary to use [f] CLEAR ‘between problems containing the same combination of variables. For instance, any number of n, i, PV, PMT, FV problems involving different numbers and/or different combinations of knowns can be done in succession without clearing the registers. Only the values which change from problem to problem would have to be keyed in. To change the combination of variables without using [#) CLEAR (REG), simply input zero for any variable which is no longer applicable. To go from a problem where a, i, PMT, PV are knowns toa problem where n, i, PV, FV are knowns, a zero would be stored in place of PMT. The following table summarizes these procedures. Ve eV Ve vevVeve Ve VEY Ye Yr YE YY UY Section 10; Applications Programs = 187 Possible Solutions Using Annuities and Compound Amounts Unterest is given) Applications l 1 — Initial | Ordinary Annuity Procedure Variables Annuity 1, PV, PAT, Direct reduc- | Leases Use (input any two | tion loan [CLEAR [REG] and calculate Discounted or set FV tozero the third) notes Mortgages 1, PV, PMT, FV | Directreduc- |Leasewith | None (input any three| tion loan with | residual values! andcalculate | balloon the fourth). Discounted notes with | balloon i PMT.FV | Sinkingfund | Periodic Use (input any two savings, (CLEAR and calculate | or set FV tozero the third}, Insurance L | 7. PV.FV ‘Compound amount | Use { {input any two | Savings | [CLEAR | and calculste | (Annuity mode is not applicable | or set PMT to zero the third) and has no effect) l Equations: PMT. . PV = —— All -(1 si"+ FV +i where aefh ordinary annuity (1 +i) annuity due Note: ‘© Problems with an interest rate of 0 will result in Error 0. * Problems with extremely high (10°) or low values (10°) for n or imay give invalid results.188 Section 10: Applications Programs 029-44 1 001-42,21.11| (3) 030- 43.32 002-42, 7, 2 031-42,21,13 003-44 a|(sia)3 032-48 3 004-42.21. 4 033-31 oos- ——_33|(G58)1 034-321 o 008 of ase)2 035-32 2 wee 007-43, 6, 0|(cHS) 034 16 1 008 alsros 037-44 3 @EFo 009-43, 6. O|[a)(RTN) 038-4332 {GIR=0) 010-43 40) 039-42,21,14 011-43, 4, olfsral4 o40- 44 4 o12- 22 4 oat- 31 013-42,21,12|1 042— 1 o14- 44 1|STO)4 oag- 44 4| o1s- —_31i{ese)1 4a 321 o1e- 32 1 o4s- 15 017-45 5|(RCL)3 o4e- 45 3 o1B- 43 36|{685}2 047-32 2 o19- 30 oas- 20 020-45 | os9- 16 oz1- 43 36|{876)4 060-44 4 022- 061-4332 023- 052-42,21.15 024- 053-44 5 025- os4- it 026- oss- 32 1 027- ose 45 3 057-40 vv Veevvve VY wee Vee een Section 10: Applications Pragrams 189. KEYSTROKES | DISPLAY | KEYSTROKES | DISPLAY Ren? oss. 48 7/0 [ove ose- 10 (sro)? o77- o7e- 1 086-20 [068-44 o|fajiarw) os7- 4332 ovo- 40 |MTa2 | ose-az.an. 2 o71- ose- 45 5 072-43, 6, 0 [RUT 090-45 7 o73- 44 0 osi- 20 074-45 4 _ [092-40 ome 6 ~ REGISTERS Ri Unused Ro: 1 or 14100] Rn Ry PV Rei 14/100 Ry -+1/100) "|190 Section 10: Applications Programs ste instructions. pataruurrs | NEVSTAOMES | ADT ta prog. S 2 | Set User mode. “5 | einai ites 4 | papers inerest ate om | @ ‘ts 5 | Serna aay mate 7s) 100 x annuity ve made ws | 00 repeating this step toggles ~ Doxa oo node 6 | Input the known values: - je Number of periods - “ & a © Present value Pp | ig Pv odie payment Pur ae PMT Fue abe a a w Marte fps BRS - # Present value Os) Py +Food pveunt ec Pur Fee i SRS) a B_| To modity the problem, go to st bd charge te spot vatues Input zeta for any valve wt appl | eaten new bi, 2 [ Fornemcave grasp Example 1; If you place $155 in a savings account paying 5%% compounded monthly, what sum of money can you withdraw at the end of 9 years? wee Vee YY Ye YY DY Section 10: Appiications Programs 194 Fv? 4 | 1 2 3 106 107 108} | a — PY =—155 Keystrokes Display (ACLEAR [RES ‘Set User mode. 5.78 12018) 0.48 % monthly interest rate. 0.00 Annuity due. 108.00 # of months. -155.00 Initial deposit, 259.74 FV Example 2: You receive $30,000 from a bank as a 30 year, 13% mortgage. What monthly payment must you make to the bank to fully amortize the mortgage? =] al eal {CASH OUTLAYS)492° Section 10: Applications Programs Keystrokes Display [MICLEAR (REG) 13 (ENTER)12(1A] 1.08 Yomonthly interest rate. 1.00 Ordinary annuity. 30(ENTER]12(x](6] 360.00 n 30000 [¢) 30,000.00 Py oi -331.86 PMT Example 3: Two individuals are constructing a loan with a balloon payment. The loan amount is $3,600, and it is agreed that the annual interest rate will be 10% with 36 monthly payments of $100. What balloon payment amount, to be paid coincident with the 36 payment, is required to fulfill the loan agreement? (Note the cash flow diagram below is with respect to the lender. For the borrower, the appropriate diagram will be exactly the opposite.) . | os { 36 PMT PMT PMT PMT PMT 100 +100 100 100 100 PV =-3600 Fv? Keystrokes Display (CLEAR TO[ENTERJI2=JA] 0.83 % monthly interest rate. ic] 1.00 Ordinary annuity. 36(B) 36.00 a 3600 (6x8): ~3,600.00 PV 100(B)(E] 675.27 FV (Note that the final payment is $675.27 + $100.00 = $775.27 since the final payment falls at the end of the last period.) Section 10° Applications Programs 193 Example 4: This program may also be used to calculate accumulated interest/remaining balance for loans. The accumu- lated interest between two points in time, n, and no, is just the total payments made in that period less the principal reduction in that period. The principal reduction is the difference of the remaining balances for the two points in time. . For a 360 month, $50,000 loan at a 14% annual interest rate, find the remaining balance after the 24th payment and the accrued interest for payments 13-24 (between the 12th and 24th payments). First we must calculate the payment on the loan: Keystrokes Display (CLEAR [FEC] 360 360.00 a 14 12 1A7 i (Ws) 1.00 Ordinary annuity. 50000 -80,000.00 PV (Bl 592.44 PMT The remaining balance at month 24 is: 24 BEI 49,749.56 © FVat month 24. Store this remaining balance and calculate the remaining balance at month 12: 12 (6) 49,883.48 FV at month 12, ‘The principal reduction between payments 12 and 24 is: a 133.92 ‘The accrued interest is 12 payments less the principal reduction: (Recs 12f) 7,109.23 Total paid out. f200) 6,975.31 Accrued interest, Example 6: A third party leasing firm is considering the purchase of a minicomputer priced at $63,000 and intends to achieve a 13% annual yield by leasing the computer to a customer for a 5-year period. Ownership is retained by the leasing firm, and at the end of the lease they expect to be able to sell the equipment for at least $10,000. (Since lease payments occur at the start of each194 Section 10: Applications Programs period, this is an annuity due problem.) What monthly payment should the firm charge in order to achieve the 13% yield? stats ve oa! 59 | 80 PMT? PMT? PMT? PMT? FV PV =-63,000 Keystrokes Display (icLEAR ; (ENTER) 12 1.08 i 0.00 Annuity due. 5 12)8) 60.00 2 63000 [CHS](C} ~63,000.00 FV 10000 &)(B)| 1,300.16 PMT the price is increased to $70,000 what should the payments be? [ca] 70,000.00 or 1,487.73 PMT Submarine Hunt Using your destroyer, try to locate the position of the enemy submarine in a 10 x 10 grid, then destroy it with a depth charge. Input a seed (between 0 and 1) and the calculator will position the submarine in the center of the 100 squares (R,C), where R = row, and C= column, and where R and C can each be 0, 1, 2,... 9. Section 10: Appiications Programs 195 Make guesses as to where you think the eubmarine is hiding by taking sonar readings. Input the location of your destroyer (R,C) and press (8). If the submarine is in one of the 8 adjacent squar (or directly under your destroyer), the calculator will display Otherwise, a “0” will be shown. When you think you've located the submarine, move your destroyer directly over it (move to the same square) and drop a depth charge. Blinking “1's” indicate a hit, while a “0” shows a miss. If you miss, the submarine will move randomly to one of the 4 adjacent squares in the same row or column. To make a more challenging game, press mediately after inputting the seed. This allows the submarine to move after each sonar echo as well as after each depth charge miss. The submarine always moves randomly to an adjacent square in the eame row or column. A depth charge has a range of 0.9 squares. When you position your destroyer for a depth charge drop, you may move anywhere on the board, not just to the center of a square. For instance, a depth charge dropped from a (2.5, 6.5) location would destroy any submarine in the center of squares (2, 6) (2, 7)(3, 6)and (3, 7). ‘Try to destroy the submarine using no more than 10 sonar readings and 1 depth charge. You can check your status any time the display is steady by pressing [D). Status format is XX.YY where: XX = Number of depth charges fired. YY =Number of sonar readings. keystrokes | pispLay | KEYSTROKES | DISPLAY (cuear acm) | 000- [mom oos- 43.32 001-42,21.13/ (0S) (006-42,21.15 1 002 a|@cuear Ges) |oo7- 4234 (sT0}0 003-44 o[taiiero 008-43, 6, 0 SFO 004-43, 4, o[sTolmaNi) —foos- 4.36196 © Section 10: Apptications Programs ay ? Section 10 Applications Programs 197, kevstroxes | vispray | KevsTaoxes | DISPLAY yO KEYSTROKES | DISPLAY KeysTaoKes | _ DISPLAY sat) O10- 32 9 | (IRS) 039-4231 yp) 5 068- 6| HERO 097-42. 7, | on- 441 [(atar) oao- 43.32 ) [eesa o69- 42 20 HIRT o98- 43.32 012-32 8 041~42,21,12 on fac o70- 22 of (Haile 099-42,21, 6 13-44 2/1 042~ 1 ‘ (Ret) o71- 45 4] 100-45 2} 014-42, 7, 0 |StOIGs 043-44,40, 8 } > ea 072-32 1 101- 30] o1s- 43.35 |e) eae 33 yoy [sr 073-44 4 102-34 o16- 43 32 |A(EKIO 045-42, 7. 0 | (ero2 074-22 2 103-45 1 017-42,21,11 046-43, 5, 1 , i 075-42.21. o| 104. 30) o18- 1 |(s86 oa7- 32 6 3 o76- 46 2 105-43 26] 019-4440, 7 o4s- 45 0 yoy 077-32 1 108-44 4] 020-33 049-44 5 shy o7e- 44 2 107-43, 6. 1 021-43, 4, 1 050-43. 6. 0 079-22 2 108-22 0 022-32 6 51-32 5 0 080-42.21. 1] 109- 1 023-4330 052-45 3 oy ost- 45 of O 110-30) 024-22 0 063-43 32 yy oaz- 4 111-42,21, 0| 028 1 064-42,21, 5 ly 083-43 10| (5) 12-48 o2ze- 44 65 |(asele ose- 32 9 oa4- 22 O19 113- 9 027-325 4 dy 3 o8s- Efe 114 30 o2e- 4332 34 Moo ose- 34 115-4310 028-42,21, 0 4220 ly 087-4210] 116-22 0 030- 9 22 0) - (TRTN) ose- 43 32 17 o 031- 18 45 5 > 089-42,21. 0} 118-22 1 Gms 032-42. 7. 3 16 | 090- 45 6 119-42,21, 0 (ESE) 033-4231 224 3 091- alt 120- 1 orms 034-42, 7, 5 063-42,21. 0 092-20) (Ua 121-42,21, 1 OR 035-4231 064-45 5 } 093- 30| (S70)3 122-44 3 036-42. 7. 7 065-42,21, 1 ) 094-43 32| (RIN) 123-4332 037-4231 066-44 6 ) 095~42,21, 2| (aL) 124-42,21,14 038-42, 7, 9 |[cs8]9 967-32 9 96-45 3] (Hir2 125-42. 7. 2198 ‘Section 10: Applications Programs KEYSTROKES | DISPLAY KEYSTROKES | DISPLAY (RC)? 126- 48 7(7GeD9 133-42,21, 9 (Reve 127-48 8 (DRAW 134-42 36| (x 128. 26/1 136- 1| 2 129- 2|o 136~ ° G 130-10) 137-20 131- 40 |(SILINT) 138-4344 wm) 132-43 32 (aan) 139-43 32 REGISTERS Ry: Unused Ro: 0.1 Ry Py Ry: Po Rg: Response Ryd Rig: Used Re: Used R: Used Ry: Used /sTeP wsTaUCTIONS pataumirs | REVSTROKES | oT re 1 | kay inthe program 2_| serUeer mode, 3_| Input seed between O an). a B ° 4+ | Fraga game, goto step 6 | seac stern game (submarine says moving) a 1 6 | Seow ow (eae) "means no echo, al Dat 1" means ocho reine. on Depth Charge Row (ENTER) 0" means mie al @ oo ‘Binking “1's” means HT ‘ik Section 10: Apy INSTRUCTIONS Neu lOATA/UNITS: cations Programs — 199 ourPuT NEVSTRONES DATA/UMITS 7_[ Repeat step 6 wt submarin is hit Te evi status at oy ti XX = number of dapth charges fed | ¥¥=unber snr ec 8 |For now game gota step 3 4