hp 49g+ graphing calculator user’s guide H Edition 4 HP part number F2228-90006
Notice REGISTER YOUR PRODUCT AT: www.register.hp.com 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, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. HEWLETT-PACKARD CO.
Preface You have in your hands a compact symbolic and numerical computer that will facilitate calculation and mathematical analysis of problems in a variety of disciplines, from elementary mathematics to advanced engineering and science subjects. Although referred to as a calculator, because of its compact format resembling typical hand-held calculating devices, the hp 49g+ should be thought of as a graphics/programmable hand-held computer.
(numerical) mode. The display can be adjusted to provide textbook-type expressions, which can be useful when working with matrices, vectors, fractions, summations, derivatives, and integrals. The high-speed graphics of the calculator are very convenient for producing complex figures in very little time. Thanks to the infrared port and the USB cable available with your calculator, you can connect your calculator with other calculators or computers.
Table of contents Chapter 1 - Getting started, 1-1 Basic Operations, 1-1 Batteries, 1-1 Turning the calculator on and off, 1-2 Adjusting the display contrast, 1-2 Contents of the calculator’s display, 1-2 Menus, 1-3 SOFT menus vs.
Editing algebraic expressions, 2-8 Using the Equation Writer (EQW) to create expressions, 2-10 Creating arithmetic expressions, 2-11 Editing arithmetic expressions, 2-16 Creating algebraic expressions, 2-19 Editing algebraic expressions, 2-20 Creating and editing summations, derivatives, and integrals, 2-28 Organizing data in the calculator, 2-32 Functions for manipulation of variables, 2-33 The HOME directory, 2-34 The CASDIR sub-directory, 2-35 Typing directory and variable names, 2-37 Creating sub-direct
Addition, subtraction, multiplication, division, 3-3 Using parentheses, 3-4 Absolute value function, 3-4 Squares and square roots, 3-5 Powers and roots, 3-5 Base-10 logarithms and powers of 10, 3-5 Using powers of 10 in entering data, 3-6 Natural logarithms and exponential function, 3-6 Trigonometric functions, 3-6 Inverse trigonometric functions, 3-6 Differences between functions and operators, 3-7 Real number functions in the MTH menu, 3-7 Hyperbolic functions and their inverses, 3-9 Real number functions
Chapter 4 - Calculations with complex numbers, 4-1 Definitions, 4-1 Setting the calculator to COMPLEX mode, 4-1 Entering complex numbers, 4-2 Polar representation of a complex number, 4-3 Simple operations with complex numbers, 4-4 Changing sign of a complex number, 4-4 Entering the unit imaginary number, 4-5 The CMPLX menus, 4-5 CMPLX menu through the MTH menu, 4-5 CMPLX menu in keyboard, 4-7 Functions applied to complex numbers, 4-8 Functions from the MTH menu, 4-8 Function DROITE: equation of a straight
LGCD, 5-10 PROPFRAC, 5-10 SIMP2, 5-10 INTEGER menu, 5-10 POLYNOMIAL menu, 5-11 MODULO menu, 5-12 Applications of the ARITHMETIC menu, 5-12 Modular arithmetic, 5-12 Finite arithmetic in the calculator, 5-15 Polynomials, 5-18 Modular arithmetic with polynomials, 5-19 The CHINREM function, 5-19 The EGCD function, 5-19 The GCD function, 5-19 The HERMITE function, 5-20 The HORNER function, 5-20 The variable VX, 5-20 The LAGRANGE function, 5-21 The LCM function, 5-21 The LEGENDRE function, 5-22 The PCOEF function
BASE convert menu, 5-28 TRIGONOMETRIC convert menu, 5-28 MATRICES convert menu, 5-28 REWRITE convert menu, 5-28 Chapter 6 - Solution to single equations, 6-1 Symbolic solution of algebraic equations, 6-1 Function ISOL, 6-1 Function SOLVE, 6-2 Function SOLVEVX, 6-4 Function ZEROS, 6-4 Numerical solver menu, 6-5 Polynomial equations, 6-6 Financial calculations, 6-9 Solving equations with one unknown through NUM.
Chapter 8 - Operations with Lists, 8-1 Definitions, 8-1 Creating and storing lists, 8-1 Composing and decomposing lists, 8-2 Operations with lists of numbers, 8-3 Changing sign, 8-3 Addition, subtraction, multiplication, division, 8-3 Real number functions from the keyboard, 8-5 Real number functions from the MTH menu, 8-5 Examples of functions that use two arguments, 8-6 Lists of complex numbers, 8-7 Lists of algebraic objects, 8-8 The MTH/LIST menu, 8-8 Manipulating elements of a list, 8-10 List size, 8-1
Building a vector with ARRY, 9-6 Identifying, extracting, and inserting vector elements, 9-7 Simple operations with vectors, 9-9 Changing sign, 9-9 Addition, subtraction, 9-9 Multiplication and division by a scalar, 9-10 Absolute value function, 9-10 The MTH/VECTOR menu, 9-10 Magnitude, 9-11 Dot product, 9-11 Cross product, 9-11 Decomposing a vector, 9-12 Building a two-dimensional vector, 9-12 Building a three-dimensional vector, 9-13 Changing coordinate system, 9-13 Application of vector operations, 9-16
Functions GETI and PUTI, 10-6 Function SIZE, 10-7 Function TRN, 10-8 Function CON, 10-8 Function IDN, 10-9 Function RDM, 10-10 Function RANM, 10-11 Function SUB, 10-11 Function REPL, 10-12 Function DIAG, 10-12 Function DIAG , 10-13 Function VANDERMONDE, 10-14 Function HILBERT, 10-14 A program to build a matrix out of a number of lists, 10-15 Lists represent columns of the matrix, 10-15 Lists represent rows of the matrix, 10-17 Manipulating matrices by columns, 10-18 Function COL, 10-18 Function COL , 10-1
Function ABS, 11-7 Function SNRM, 11-7 Functions RNRM and CNRM, 11-8 Function SRAD, 11-9 Function COND, 11-9 Function RANK, 11-10 Function DET, 11-11 Function TRACE, 11-13 Function TRAN, 11-14 Additional matrix operations (the matrix OPER menu), 11-14 Function AXL, 11-15 Function AXM, 11-15 Function LCXM, 11-15 Solution of linear systems, 11-16 Using the numerical solver for linear systems, 11-17 Least-square solution (function LSQ), 11-23 Solution with the inverse matrix, 11-26 Solution by “division” of ma
Matrix Quadratic Forms, 11-51 The QUADF menu, 11-52 Linear Applications, 11-54 Function IMAGE, 11-54 Function ISOM, 11-54 Function KER, 11-55 Function MKISOM, 11-55 Chapter 12 - Graphics, 12-1 Graphs options in the calculator, 12-1 Plotting an expression of the form y = f(x) , 12-2 Some useful PLOT operations for FUNCTION plots, 12-5 Saving a graph for future use, 12-8 Graphics of transcendental functions, 12-10 Graph of ln(X) , 12-8 Graph of the exponential function, 12-10 The PPAR variable, 12-11 Inverse
Gridmap plots, 12-42 Pr-Surface plots, 12-43 The VPAR variable, 12-44 Interactive drawing, 12-44 DOT+ and DOT-, 12-45 MARK, 12-46 LINE, 12-46 TLINE, 12-46 BOX, 12-47 CIRCL, 12-47 LABEL, 12-47 DEL, 12-47 ERASE, 12-48 MENU, 12-48 SUB, 12-48 REPL, 12-48 PICT , 12-48 X,Y , 12-48 Zooming in and out in the graphics display, 12-49 ZFACT, ZIN, ZOUT, and ZLAST, 12-49 BOXZ, 12-50 ZDFLT, ZAUTO, 12-50 HZIN, HZOUT, VZIN, and VZOUT, 12-50 CNTR, 12-50 ZDECI, 12-50 ZINTG, 12-51 ZSQR, 12-51 ZTRIG, 12-51 The SYMBOLIC menu an
Derivatives, 13-3 Function DERIV and DERVX,13-3 The DERIV&INTEG menu, 13-3 Calculating derivatives with ∂,13-4 The chain rule,13-6 Derivatives of equations,13-6 Implicit derivatives,13-7 Application of derivatives,13-7 Analyzing graphics of functions,13-7 Function DOMAIN, 13-9 Function TABVAL, 13-9 Function SIGNTAB, 13-10 Function TABVAR, 13-10 Using derivatives to calculate extreme points, 13-12 Higher-order derivatives, 13-13 Anti-derivatives and integrals, ,13-14 Functions INT, INTVX, RISCH, SIGMA, and S
Total differential of a function z = z(x,y) , 14-5 Determining extrema in functions of two variables, 14-5 Using function HESS to analyze extrema, 14-6 Multiple integrals, 14-8 Jacobian of coordinate transformation, 14-9 Double integral in polar coordinates, 14-9 Chapter 15 - Vector Analysis Applications, 15-1 Definitions, 15-1 Gradient and directional derivative, 15-1 A program to calculate the gradient, 15-2 Using function HESS to obtain the gradient, 15-2 Potential of a gradient, 15-3 Divergence, 15-4 L
Function FOURIER, 16-28 Fourier series for a quadratic function, 16-29 Fourier series for a triangular wave, 16-35 Fourier series for a square wave, 16-39 Fourier series applications in differential equations, 16-42 Fourier Transforms, 16-43 Definition of Fourier transforms, 16-46 Properties of the Fourier transform, 16-48 Fast Fourier Transform (FFT) , 16-49 Examples of FFT applications, 16-50 Solution to specific second-order differential equations, 16-53 The Cauchy or Euler equation , 16-53 Legendre’s eq
Discrete probability distributions, 17-4 Binomial distribution, 17-4 Poisson distribution, 17-5 Continuous probability distributions, 17-6 The gamma distribution, 17-6 The exponential distribution, 17-7 The beta distribution, 17-7 The Weibull distribution, 17-7 Functions for continuous distributions, 17-7 Continuous distributions for statistical inference, 17-9 Normal distribution pdf, 17-9 Normal distribution cdf, 17-10 The Student-t distribution, 17-10 The Chi-square distribution, 17-11 The F distribution
population variance is known, 18-23 Confidence intervals for the population mean when the population variance is unknown, 18-24 Confidence interval for a proportion, 18-24 Sampling distributions of differences and sums of statistics, 18-25 Confidence intervals for sums and differences of mean values, 18-26 Determining confidence intervals, 18-27 Confidence intervals for the variance, 18-33 Hypothesis testing, 18-34 Procedure for testing hypotheses, 18-35 Errors in hypothesis testing, 18-35 Inferences concer
Wordsize, 19-4 Operations with binary integers, 19-4 The LOGIC menu, 19-5 The BIT menu, 19-6 The BYTE menu, 19-6 Hexadecimal numbers for pixel references, 19-7 Chapter 20 - Customizing menus and keyboard, 20-1 Customizing menus, 20-1 The PRG/MODES/MENU, 20-1 Menu numbers (RCLMENU and MENU functions), 20-2 Custom menus (MENU and TMENU functions), 20-2 Menu specification and CST variable, 20-4 Customizing the keyboard, 20-5 The PRG/MODES/KEYS sub-menu, 20-5 Recall current user-defined key list, 20-6 Assign a
Interactive input in programs, 21-19 Prompt with an input string, 21-21 A function with an input string, 21-22 Input string for two or three input values, 21-24 Input through input forms, 21-27 Creating a choose box, 21-31 Identifying output in programs, 21-33 Tagging a numerical result, 21- 33 Decomposing a tagged numerical result into number and tag, 21-33 “De-tagging” a tagged quantity, 21-33 Examples of tagged output, 21-34 Using a message box, 21-37 Relational and logical operators, 21-43 Relational op
Generating plots with programs, 22-14 Two-dimensional graphics, 22-14 Three-dimensional graphics, 22-15 The variable EQ, 22-15 Examples of interactive plots using the PLOT menu, 22-15 Examples of program-generated plots, 22-17 Drawing commands for use in programming, 22-19 PICT, 22-20 PDIM, 22-20 LINE, 22-20 TLINE, 22-20 BOX, 22-21 ARC, 22-21 PIX?, PIXON, and PIXOFF, 22-22 PVIEW, 22-22 PX C, 22-22 C PX, 22-22 Programming examples using drawing functions, 22-22 Pixel coordinates, 22-25 Animating graphics, 22
The characters list, 23-3 Chapter 24 - Calculator objects and flags, 24-1 Description of calculator objects, 24-1 Function TYPE, 24-2 Function VTYPE, 24-2 Calculator flags, 24-3 System flags, 24-3 Functions for setting and changing flags, 24-3 User flags, 24-4 Chapter 25 - Date and Time Functions, 25-1 The TIME menu, 25-1 Setting an alarm, 25-1 Browsing alarms, 25-2 Setting time and date, 25-2 TIME Tools, 25-2 Calculations with dates, 25-3 Calculations with times, 25-4 Alarm functions, 25-4 Chapter 26 -
Installing and attaching a library, 26-8 Library numbers, 26-9 Deleting a library, 26-9 Creating libraries, 26-9 Backup battery, 26-9 Appendices Appendix A - Using input forms, A-1 Appendix B - The calculator’s keyboard, B-1 Appendix C - CAS settings, C-1 Appendix D - Additional character set, D-1 Appendix E - The Selection Tree in the Equation Writer, E-1 Appendix F - The Applications (APPS) menu, F-1 Appendix G - Useful shortcuts, G-1 Appendix H - The CAS help facility, H-1 Appendix I - Command catalog l
Chapter 1 Getting started This chapter is aimed at providing basic information in the operation of your calculator. The exercises are aimed at familiarizing yourself with the basic operations and settings before actually performing a calculation. Basic Operations The following exercises are aimed at getting you acquainted with the hardware of your calculator. Batteries The calculator uses 3 AAA (LR03) batteries as main power and a CR2032 lithium battery for memory backup.
b. Insert a new CR2032 lithium battery. Make sure its positive (+) side is facing up. c. Replace the plate and push it to the original place. After installing the batteries, press [ON] to turn the power on. Warning: When the low battery icon is displayed, you need to replace the batteries as soon as possible. However, avoid removing the backup battery and main batteries at the same time to avoid data lost. Turning the calculator on and off The $ key is located at the lower left corner of the keyboard.
At the top of the display you will have two lines of information that describe the settings of the calculator. The first line shows the characters: RAD XYZ HEX R= 'X' For details on the meaning of these specifications see Chapter 2. The second line shows the characters: { HOME } indicating that the HOME directory is the current file directory in the calculator’s memory. In Chapter 2 you will learn that you can save data in your calculator by storing them in files or variables.
pressing the L (NeXT menu) key. This key is the third key from the left in the third row of keys in the keyboard. Press L once more to return to the main TOOL menu, or press the I key (third key in second row of keys from the top of the keyboard). The TOOL menu is described in detain in the next section. At this point we will illustrate some properties of menus that you will find useful while using your calculator. SOFT menus vs.
using the up and down arrow keys, —˜, or by pressing the number corresponding to the function in the CHOOSE box. After the function name is selected, press the @@@OK@@@ soft menu key (F). Thus, if you wanted to use function R B (Real to Binary), you could press 6F. If you want to move to the top of the current menu page in a CHOOSE box, use „—. To move to the bottom of the current page, use „˜. To move to the top of the entire menu, use ‚—. To move to the bottom of the entire menu, use ‚˜.
To navigate through the functions of this menu, press the L key to move to the next page, or „«(associated with the L key) to move to the previous page. The following figures show the different pages of the BASE menu accessed by pressing the L key twice: Pressing the L key once more will takes us back to the first menu page. Note: With the SOFT menu setting for system flag 117, the keystroke combination ‚(hold) ˜, will show a list of the functions in the current soft menu.
@VIEW @@ RCL @@ @@STO@ ! PURGE CLEAR B C D E F VIEW the contents of a variable ReCaLl the contents of a variable STOre the contents of a variable PURGE a variable CLEAR the display or stack The calculator has only six soft menu keys, and can only display 6 labels at any point in time. However, a menu can have more than six entries. Each group of 6 entries is called a Menu page. The TOOL menu has eight entries arranged in two pages.
As indicated above, the TIME menu provides four different options, numbered 1 through 4. Of interest to us as this point is option 3. Set time, date... Using the down arrow key, ˜, highlight this option and press the !!@@OK#@ F soft menu key. The following input form (see Appendix 1-A) for adjusting time and date is shown: Setting the time of the day Using the number keys, 1234567890, start by adjusting the hour of the day.
Let’s change the minute field to 25, by pressing: 25 !!@@OK#@ . The seconds field is now highlighted. Suppose that you want to change the seconds field to 45, use: 45 !!@@OK#@ The time format field is now highlighted. To change this field from its current setting you can either press the W key (the second key from the left in the fifth row of keys from the bottom of the keyboard), or press the @CHOOS soft menu key ( B).
To set the date, first set the date format. The default format is M/D/Y (month/day/year). To modify this format, press the down arrow key. This will highlight the date format as shown below: Use the @CHOOS soft menu key ( B), to see the options for the date format: Highlight your choice by using the up and down arrow keys,— ˜, and press the !!@@OK#@ F soft menu key to make the selection.
The figure shows 10 rows of keys combined with 3, 5, or 6 columns. Row 1 has 6 keys, rows 2 and 3 have 3 keys each, and rows 4 through 10 have 5 keys each. There are 4 arrow keys located on the right-hand side of the keyboard in the space occupied by rows 2 and 3. Each key has three, four, or five functions. The main key function correspond to the most prominent label in the key.
combined with some of the other keys to activate the alternative functions shown in the keyboard.
Press the !!@@OK#@ F soft menu key to return to normal display. Examples of selecting different calculator modes are shown next. Operating Mode The calculator offers two operating modes: the Algebraic mode, and the Reverse Polish Notation (RPN) mode. The default mode is the Algebraic mode (as indicated in the figure above), however, users of earlier HP calculators may be more familiar with the RPN mode. To select an operating mode, first open the CALCULATOR MODES input form by pressing the H button.
The equation writer is a display mode in which you can build mathematical expressions using explicit mathematical notation including fractions, derivatives, integrals, roots, etc. To use the equation writer for writing the expression shown above, use the following keystrokes: ‚OR3*!Ü51/3*3 ——————— /23Q3™™+!¸2.5` After pressing `the calculator displays the expression: √ (3*(5-1/(3*3))/23^3+EXP(2.5)) Pressing `again will provide the following value. Accept Approx. mode on, if asked, by pressing !!@@OK#@.
Notice that the display shows several levels of output labeled, from bottom to top, as 1, 2, 3, etc. This is referred to as the stack of the calculator. The different levels are referred to as the stack levels, i.e., stack level 1, stack level 2, etc. Basically, what RPN means is that, instead of writing an operation such as 3 + 2, in the calculator by using 3+2`, we write first the operands, in the proper order, and then the operator, i.e., 3`2`+.
3.` Enter 3 in level 1 5.` Enter 5 in level 1, 3 moves to y 3.` Enter 3 in level 1, 5 moves to level 2, 3 to level 3 3.* Place 3 and multiply, 9 appears in level 1 Y 1/(3×3), last value in lev. 1; 5 in level 2; 3 in level 3 5 - 1/(3×3) , occupies level 1 now; 3 in level 2 * 3× (5 - 1/(3×3)), occupies level 1 now. 23.`Enter 23 in level 1, 14.66666 moves to level 2. 3.Q Enter 3, calculate 233 into level 1. 14.666 in lev. 2. / (3× (5-1/(3×3)))/233 into level 1 2.5 Enter 2.5 level 1 !¸ e2.
line will execute the DUP function which copies the contents of stack level 1 of the stack onto level 2 (and pushes all the other stack levels one level up). This is extremely useful as showed in the previous example. To select between the ALG vs.
The number is rounded to the maximum 12 significant figures, and is displayed as follows: In the standard format of decimal display, integer numbers are shown with no decimal zeros whatsoever. Numbers with different decimal figures will be adjusted in the display so that only those decimal figures that are necessary will be shown. More examples of numbers in standard format are shown next: • Fixed format with no decimals: Press the H button.
• Fixed format with decimals: This mode is mainly used when working with limited precision. For example, if you are doing financial calculation, using a FIX 2 mode is convenient as it can easily represent monetary units to a 1/100 precision. Press the H button. Next, use the down arrow key, ˜, to select the option Number format. Press the @CHOOS soft menu key ( B), and select the option Fixed with the arrow down key ˜. Press the right arrow key, ™, to highlight the zero in front of the option Fix.
• Scientific format The scientific format is mainly used when solving problems in the physical sciences where numbers are usually represented as a number with limited precision multiplied by a power of ten. To set this format, start by pressing the H button. Next, use the down arrow key, ˜, to select the option Number format. Press the @CHOOS soft menu key ( B), and select the option Scientific with the arrow down key ˜. Keep the number 3 in front of the Sci.
Press the !!@@OK#@ soft menu key return to the calculator display. number now is shown as: The Because this number has three figures in the integer part, it is shown with four significative figures and a zero power of ten, while using the Engineering format. For example, the number 0.00256, will be shown as: • • • Decimal comma vs. decimal point Decimal points in floating-point numbers can be replaced by commas, if the user is more familiar with such notation.
Angle Measure Trigonometric functions, for example, require arguments representing plane angles. The calculator provides three different Angle Measure modes for working with angles, namely: • Degrees: There are 360 degrees (360o) in a complete circumference, or 90 degrees (90o) in a right angle. This representation is mainly used when doing basic geometry, mechanical or structural engineering, and surveying.
The coordinate system selection affects the way vectors and complex numbers are displayed and entered. To learn more about complex numbers and vectors, see Chapters 4 and 9, respectively. Two- and three-dimensional vector components and complex numbers can be represented in any of 3 coordinate systems: The Cartesian (2 dimensional) or Rectangular (3 dimensional), Cylindrical (3 dimensional) or Polar (2 dimensional), and Spherical (only 3 dimensional).
• Press the H button. Next, use the down arrow key, ˜, three times. Select the Angle Measure mode by either using the \ key (second from left in the fifth row from the keyboard bottom), or pressing the @CHOOS soft menu key ( B). If using the latter approach, use up and down arrow keys,— ˜, to select the preferred mode, and press the !!@@OK#@ F soft menu key to complete the operation.
• • • Use the down arrow key, ˜, four times to select the _Last Stack option. Use the @ CHK@ soft menu key (i.e., the B key) to change the selection. Press the left arrow key š to select the _Key Click option. Use the @ CHK@ soft menu key (i.e., the B key) to change the selection. Press the left arrow key š to select the _Beep option. Use the @ CHK@ soft menu key (i.e., the B key) to change the selection. Press the !!@@OK#@ F soft menu key to complete the operation.
• • • • To navigate through the many options in the DISPLAY MODES input form, use the arrow keys: š™˜—. To select or deselect any of the settings shown above, that require a check mark, select the underline before the option of interest, and toggle the @ CHK@ soft menu key until the right setting is achieved. When an option is selected, a check mark will be shown in the underline (e.g., the Textbook option in the Stack: line above).
additional fonts that you may have created (see Chapter 23) or downloaded into the calculator. Practice changing the display fonts to sizes 7 and 6. Press the OK soft menu key to effect the selection. When done with a font selection, press the @@@OK@@@ soft menu key to go back to the CALCULATOR MODES input form. To return to normal calculator display at this point, press the @@@OK@@@ soft menu key once more and see how the stack display change to accommodate the different font.
To illustrate these settings, either in algebraic or RPN mode, use the equation writer to type the following definite integral: ‚O…Á0™„虄¸\x™x` In Algebraic mode, the following screen shows the result of these keystrokes with neither _Small nor _Textbook are selected: With the _Small option selected only, the display looks as shown below: With the _Textbook option selected (default value), regardless of whether the _Small option is selected or not, the display shows the following result: Selecting prope
For the example of the integral ∫ ∞ 0 e − X dX , presented above, selecting the _Small Stack Disp in the EQW line of the DISPLAY MODES input form produces the following display: Selecting the size of the header First, press the H button to activate the CALCULATOR MODES input form. Within the CALCULATOR MODES input form, press the @@DISP@ soft menu key (D) to display the DISPLAY MODES input form. Press the down arrow key, ˜, four times, to get to the Header line.
Chapter 2 Introducing the calculator In this chapter we present a number of basic operations of the calculator including the use of the Equation Writer and the manipulation of data objects in the calculator. Study the examples in this chapter to get a good grasp of the capabilities of the calculator for future applications. Calculator objects Any number, expression, character, variable, etc., that can be created and manipulated in the calculator is referred to as an object.
If the approximate mode (APPROX) is selected in the CAS (see Appendix C), integers will be automatically converted to reals. If you are not planning to use the CAS, it might be a good idea to switch directly into approximate mode. Refer to Appendix C for more details. Mixing integers and reals together or mistaking an integer for a real is a common occurrence. The calculator will detect such mixing of objects and ask you if you want to switch to approximate mode.
An algebraic object, or simply, an algebraic (object of type 9), is a valid algebraic expression enclosed between apostrophes. Binary integers, objects of type 10, are used in some computer science applications. Graphics objects, objects of type 11, store graphics produced by the calculator. Tagged objects, objects of type 12, are used in the output of many programs to identify results. For example, in the tagged object: Mean: 23.2, the word Mean: is the tag used to identify the number 23.
5.*„Ü1.+1./7.5™/ „ÜR3.-2.Q3 The resulting expression is: 5.*(1.+1./7.5)/(ƒ3.-2.^3). Press ` to get the expression in the display as follows: Notice that, if your CAS is set to EXACT (see Appendix C) and you enter your expression using integer numbers for integer values, the result is a symbolic quantity, e.g., 5*„Ü1+1/7.5™/ „ÜR3-2Q3 Before producing a result, you will be asked to change to Approximate mode.
The result will be shown as follows: To evaluate the expression we can use the EVAL function, as follows: µ„î` As in the previous example, you will be asked to approve changing the CAS setting to Approx. Once this is done, you will get the same result as before. An alternative way to evaluate the expression entered earlier between quotes is by using the option …ï.
This latter result is purely numerical, so that the two results in the stack, although representing the same expression, seem different. To verify that they are not, we subtract the two values and evaluate this difference using function EVAL: Subtract level 1 from level 2 µ Evaluate using function EVAL The result is zero (0.). Note: Avoid mixing integer and real data to avoid conflicts in the calculations.
The editing cursor is shown as a blinking left arrow over the first character in the line to be edited. Since the editing in this case consists of removing some characters and replacing them with others, we will use the right and left arrow keys, š™, to move the cursor to the appropriate place for editing, and the delete key, ƒ, to eliminate characters.
x R +2L R+ y b 2L 1 + We set the calculator operating mode to Algebraic, the CAS to Exact, and the display to Textbook. To enter this algebraic expression we use the following keystrokes: ³2*~l*R„Ü1+~„x/~r™/ „ Ü ~r+~„y™+2*~l/~„b Press ` to get the following result: Entering this expression when the calculator is set in the RPN mode is exactly the same as this Algebraic mode exercise.
The editing cursor is shown as a blinking left arrow over the first character in the line to be edited. As in an earlier exercise on line editing, we will use the right and left arrow keys, š™, to move the cursor to the appropriate place for editing, and the delete key, ƒ, to eliminate characters.
• Press „˜ to activate the line editor once more. The result is now: • Pressing ` once more to return to normal display. To see the entire expression in the screen, we can change the option _Small Stack Disp in the DISPLAY MODES input form (see Chapter 1). After effecting this change, the display will look as follows: Note: To use Greek letters and other characters in algebraic expressions use the CHARS menu. This menu is activated by the keystroke combination …±. Details are presented in Appendix D.
The Equation Writer is launched by pressing the keystroke combination … ‚O (the third key in the fourth row from the top in the keyboard).
in “textbook” style instead of a line-entry style. Thus, when a division sign (i.e., /) is entered in the Equation Writer, a fraction is generated and the cursor placed in the numerator. To move to the denominator you must use the down arrow key. For example, try the following keystrokes in the Equation Writer screen: 5/5+2 The result is the expression The cursor is shown as a left-facing key. The cursor indicates the current edition location.
The expression now looks as follows: Suppose that now you want to add the fraction 1/3 to this entire expression, i.e., you want to enter the expression: 5 5 + 2 ⋅ (5 + 2 π ) 2 + 1 3 First, we need to highlight the entire first term by using either the right arrow (™) or the upper arrow (—) keys, repeatedly, until the entire expression is highlighted, i.e.
To recover the larger-font display, press the @BIG C soft menu key once more. Evaluating the expression To evaluate the expression (or parts of the expression) within the Equation Writer, highlight the part that you want to evaluate and press the @EVAL D soft menu key. For example, to evaluate the entire expression in this exercise, first, highlight the entire expression, by pressing ‚ ‘. Then, press the @EVAL D soft menu key. If your calculator is set to Exact CAS mode (i.e.
Use the function UNDO ( …¯) once more to recover the original expression: Evaluating a sub-expression Suppose that you want to evaluate only the expression in parentheses in the denominator of the first fraction in the expression above. You have to use the arrow keys to select that particular sub-expression.
Then, press the @EVAL D soft menu key to obtain: Let’s try a numerical evaluation of this term at this point.
And will use the editing features of the Equation Editor to transform it into the following expression: In the previous exercises we used the arrow keys to highlight sub-expressions for evaluation. In this case, we will use them to trigger a special editing cursor.
Next, press the down arrow key (˜) to trigger the clear editing cursor highlighting the 3 in the denominator of π 2/3. Press the left arrow key (š) once to highlight the exponent 2 in the expression π 2/3. Next, press the delete key (ƒ) once to change the cursor into the insertion cursor. Press ƒ once more to delete the 2, and then 5 to enter a 5. Press the upper arrow key (—) three times to highlight the expression π 5/3. Then, type ‚¹ to apply the LN function to this expression.
down arrow key (˜) in any location, repeatedly, to trigger the clear editing cursor. In this mode, use the left or right arrow keys (š™) to move from term to term in an expression. When you reach a point that you need to edit, use the delete key (ƒ) to trigger the insertion cursor and proceed with the edition of the expression. Creating algebraic expressions An algebraic expression is very similar to an arithmetic expression, except that English and Greek letters may be included.
The expression tree The expression tree is a diagram showing how the Equation Writer interprets an expression. See Appendix E for a detailed example. The CURS function The CURS function (@CURS) in the Equation Writer menu (the B key) converts the display into a graphical display and produces a graphical cursor that can be controlled with the arrow keys (š™—˜) for selecting subexpressions. The sub-expression selected with @CURS will be shown framed in the graphics display.
• At an editing point, use the delete key (ƒ) to trigger the insertion cursor and proceed with the edition of the expression. To see the clear editing cursor in action, let’s start with the algebraic expression that we entered in the exercise above: Press the down arrow key, ˜, at its current location to trigger the clear editing cursor. The 3 in the exponent of θ will be highlighted. Use the left arrow key, š, to move from element to element in the expression.
™ ~‚2 Enters the factorial for the 3 in the square root (entering the factorial changes the cursor to the selection cursor) ˜˜™™ Selects the µ in the exponential function /3*~‚f Modifies exponential function argument ™™™™ Selects ∆y R Places a square root symbol on ∆y (this operation also changes the cursor to the selection cursor) ˜˜ ™—— S Select θ1/3 and enter the SIN function The resulting screen is the following: Evaluating a sub-expression ( ) highlighted, let’s press Since we already have the sub-e
This expression does not fit in the Equation Writer screen. We can see the entire expression by using a smaller-size font. Press the @BIG C soft menu key to get: Even with the larger-size font, it is possible to navigate through the entire expression by using the clear editing cursor. Try the following keystroke sequence: C˜˜˜˜, to set the clear editing cursor atop the factor 3 in the first term of the numerator. Then, press the right arrow key, ™, to navigate through the expression.
Factoring an expression In this exercise we will try factoring a polynomial expression. To continue the previous exercise, press the ` key. Then, launch the Equation Writer again by pressing the ‚O key. Type the equation: XQ2™+2*X*~y+~y Q2™~‚a Q2™™+~‚b Q2 resulting in Let’s select the first 3 terms in the expression and attempt a factoring of this sub-expression: ‚—˜‚™‚™ . This produces: Now, press the @FACTO soft menu key, to get Press ‚¯to recover the original expression.
Press ‚¯to recover the original expression. Note: Pressing the @EVAL or the @SIMP soft menu keys, while the entire original expression is selected, produces the following simplification of the expression: Using the CMDS menu key With the original polynomial expression used in the previous exercise still selected, press the L key to show the @CMDS and @HELP soft menu keys. These two commands belong to the second part of the soft menu available with the Equation Writer.
Next, press the L key to recover the original Equation Writer menu, and press the @EVAL@ soft menu key (D) to evaluate this derivative. The result is: Using the HELP menu Press the L key to show the @CMDS and @HELP soft menu keys. Press the @HELP soft menu key to get the list of CAS commands. Then, press ~ d ˜ ˜ ˜ to select the command DERVX.
2 / R3 ™™ * ~‚m + „¸\ ~‚m ™™ * ‚¹ ~„x + 2 * ~‚m * ~‚c ~„y ——— / ~‚t Q1/3 The original expression is the following: We want to remove the sub-expression x+2⋅λ⋅∆y from the argument of the LN function, and move it to the right of the λ in the first term. Here is one possibility: ˜ššš———‚ªšš—*‚¬ The modified expression looks as follows: Next, we’ll copy the fraction 2/√3 from the leftmost factor in the expression, and place it in the numerator of the argument for the LN function.
To select the sub-expression of interest, use: ™™™™™™™™‚¢ ™™™™™™™™™™‚¤ The screen shows the required sub-expression highlighted: We can now copy this expression and place it in the denominator of the LN argument, as follows:‚¨™™… (27 times) … ™ ƒƒ… (9 times) … ƒ ‚¬ The line editor now looks like this: Pressing ` shows the expression in the Equation Writer (in small-font format, press the @BIG C soft menu key): Press ` to exit the Equation Writer.
Press ‚O to activate the Equation Writer. Then press ‚½to enter the summation sign. Notice that the sign, when entered into the Equation Writer screen, provides input locations for the index of the summation as well as for the quantity being summed.
Derivatives We will use the Equation Writer to enter the following derivative: d (α ⋅ t 2 + β ⋅ t + δ ) dt Press ‚O to activate the Equation Writer. Then press ‚¿to enter the (partial) derivative sign. Notice that the sign, when entered into the Equation Writer screen, provides input locations for the expression being differentiated and the variable of differentiation.
d (α ⋅ t 2 − β ⋅ t + δ ) = 2α ⋅ t + β . dt Second order derivatives are possible, for example: which evaluates to: Note: The notation ∂ ( ∂x ) is proper of partial derivatives. The proper notation for total derivatives (i.e., derivatives of one variable) is d ( ) . The dx calculator, however, does not distinguish between partial and total derivatives. Definite integrals We will use the Equation Writer to enter the following definite integral: τ ∫ t ⋅ sin(t ) ⋅ dt .
This indicates that the general expression for a derivative in the line editor or in the stack is: ∫(lower_limit, upper_limit,integrand,variable_of_integration) Press ` to return to the Equation Writer. The resulting screen is not the definite integral we entered, however, but its symbolic value, namely, To recover the derivative expression use ‚¯. To evaluate the derivative again, you can use the D soft menu key.
This screen gives a snapshot of the calculator’s memory and of the directory tree. The screen shows that the calculator has three memory ports (or memory partitions), port 0:IRAM, port 1:ERAM, and port 2:FLASH . Memory ports are used to store third party application or libraries, as well as for backups. The size of the three different ports is also indicated. The fourth and subsequent lines in this screen show the calculator’s directory tree.
@RENAM To rename a variable @NEW To create a new variable @ORDER To order a set of variables in the directory @SEND To send a variable to another calculator or computer @RECV To receive a variable from another calculator or computer If you press the L key, the third set of functions is made available: @HALT To return to the stack temporarily @VIEW To see contents of a variable @EDITB To edit contents of a binary variable (similar to @EDIT) @HEADE To show the directory containing the variable in the header @
subdirectories, in a hierarchy of directories similar to folders in modern computers. The subdirectories will be given names that may reflect the contents of each subdirectory, or any arbitrary name that you can think of. The CASDIR sub-directory The CASDIR sub-directory contains a number of variables needed by the proper operation of the CAS (Computer Algebraic System, see appendix C).
• GNAME means a global name, and REAL means a real (or floating-point) numeric variable. The fourth and last column represents the size, in bytes, of the variable truncated, without decimals (i.e., nibbles). Thus, for example, variable PERIOD takes 12.5 bytes, while variable REALASSUME takes 27.5 bytes (1 byte = 8 bits, 1 bit is the smallest unit of memory in computers and calculators). CASDIR Variables in the stack Pressing the $ key closes the previous screen and returns us to normal calculator display.
CASINFO MODULO REALASSUME PERIOD VX EPS These variables are variable, but one created by a previous exercise a graph that provides CAS information Modulo for modular arithmetic (default = 13) List of variable names assumed as real values Period for trigonometric functions (default = 2π) Name of default independent variable (default = X) Value of small increment (epsilon), (default = 10-10) used for the operation of the CAS.
³~~math` ³~~m„a„t„h` ³~~m„~at„h` The calculator display will show the following (left-hand side is Algebraic mode, right-hand side is RPN mode): Note: if system flag 60 is set, you can lock the alphabetical keyboard by just pressing ~. See Chapter 1 for more information on system flags. Creating subdirectories Subdirectories can be created by using the FILES environment or by using the command CRDIR. The two approaches for creating sub-directories are presented next.
showing that only one object exists currently in the HOME directory, namely, the CASDIR sub-directory. Let’s create another sub-directory called MANS (for MANualS) where we will store variables developed as exercises in this manual. To create this sub-directory first enter: L @@NEW@@ (C) . This will produce the following input form: The Object input field, the first input field in the form, is highlighted by default. This input field can hold the contents of a new variable that is being created.
Next, we will create a sub-directory named INTRO (for INTROduction), within MANS, to hold variables created as exercise in subsequent sections of this chapter. Press the $ key to return to normal calculator display (the TOOLS menu will be shown). Then, press J to show the HOME directory contents in the soft menu key labels.
Use the down arrow key (˜) to select the option 2. MEMORY… , or just press 2. Then, press @@OK@@. This will produce the following pull-down menu: Use the down arrow key (˜) to select the 5. DIRECTORY option, or just press 5. Then, press @@OK@@. This will produce the following pull-down menu: Use the down arrow key (˜) to select the 5. CRDIR option, and press @@OK@@.
Command CRDIR in RPN mode To use the CRDIR in RPN mode you need to have the name of the directory already available in the stack before accessing the command. For example: ~~„~chap2~` Then access the CRDIR command by either of the means shown above, e.g.
key to list the contents of the directory in the screen. Select the sub-directory (or variable) that you want to delete. Press L@PURGE. A screen similar to the following will be shown: The ‘S2’ string in this form is the name of the sub-directory that is being deleted.
Use the down arrow key (˜) to select the option 2. MEMORY… Then, press @@OK@@. This will produce the following pull-down menu: Use the down arrow key (˜) to select the 5. DIRECTORY option. Then, press @@OK@@. This will produce the following pull-down menu: Use the down arrow key (˜) to select the 6. PGDIR option, and press @@OK@@.
Press @@OK@@, to get: Then, press )@@S3@@ to enter ‘S3’ as the argument to PGDIR. Press ` to delete the sub-directory: Command PGDIR in RPN mode To use the PGDIR in RPN mode you need to have the name of the directory, between quotes, already available in the stack before accessing the command. For example: ³~s2` Then access the PGDIR command by either of the means shown above, e.g.
Using the PURGE command from the TOOL menu The TOOL menu is available by pressing the I key (Algebraic and RPN modes shown): The PURGE command is available by pressing the @PURGE soft menu key (E). In the following examples we want to delete sub-directory S1: • Algebraic mode: Enter @PURGE J)@@S1@@` • RPN mode: Enter J³@S1@@ `I@PURGE J Variables Variables are like files on a computer hard drive.
sub-directory {HOME MANS INTRO}, created in an earlier example, we want to store the following variables with the values shown: Name Contents A 12.5 -0.25 α A12 3×105 Q ‘r/(m+r)' R [3,2,1] z1 3+5i p1 << → r 'π*r^2' >> Type real real real algebraic vector complex program Using the FILES menu We will use the FILES menu to enter the variable A. We assume that we are in the sub-directory {HOME MANS INTRO}.
To enter variable A (see table above), we first enter its contents, namely, the number 12.5, and then its name, A, as follows: 12.5 @@OK@@ ~a@@OK@@. Resulting in the following screen: Press @@OK@@ once more to create the variable. The new variable is shown in the following variable listing: The listing indicates a real variable (|R), whose name is A, and that occupies 10.5 bytes of memory. To see the contents of the variable in this screen, press L@VIEW@.
Name Contents -0.25 α A12 3×105 Q ‘r/(m+r)' R [3,2,1] z1 3+5i p1 << → r 'π*r^2' >> • Type real real algebraic vector complex program Algebraic mode Use the following keystrokes to store the value of –0.25 into variable α: 0.25\ K ~‚a. AT this point, the screen will look as follows: This expression means that the value –0.25 is being stored into α (the symbol suggests the operation). Press ` to create the variable.
You will see six of the seven variables listed at the bottom of the screen: p1, z1, R, Q, A12, α. • RPN mode Use the following keystrokes to store the value of –0.25 into variable α: 0.25\` ~‚a`. At this point, the screen will look as follows: This expression means that the value –0.25 is ready to be stored into α. Press K to create the variable.
Checking variables contents As an exercise on peeking into the contents of variables we will use the seven variables entered in the exercise above. We showed how to use the FILES menu to view the contents of a variable in an earlier exercise when we created the variable A. In this section we will show a simple way to look into the contents of a variable.
Note: By pressing @@@p1@@ ` we are trying to activate (run) the p1 program. However, this program expects a numerical input. Try the following exercise: $@@@p1@ „Ü5`. The result is: The program has the following structure: << → r 'π*r^2' >> The « » symbols indicate a program in User RPL language (the original programming language of the HP 28/48 calculators, and available in the HP 49G series). The characters → r indicate that an input, to be referred to as r, is to be provided to the program.
Using the right-shift key ‚ followed by soft menu key labels This approach for viewing the contents of a variable works the same in both Algebraic and RPN modes. Try the following examples in either mode: J‚@@p1@@ ‚ @@z1@@ ‚ @@@R@@ ‚@@@Q@@ ‚ @@A12@@ This produces the following screen (Algebraic mode in the left, RPN in the right) Notice that this time the contents of program p1 are listed in the screen.
Check the new contents of variable A12 by using ‚@@A12@@ . Using the RPN operating mode: ³~‚b/2` ³@@A12@@ ` K or, in a simplified way, ³~‚b/2™ ³@@A12@@ K Using the left-shift „ key followed by the variable’s soft menu key (RPN) This is a very simple way to change the contents of a variable, but it only works in the RPN mode. The procedure consists in typing the new contents of the variable and entering them into the stack, and then pressing the left-shift key followed by the variable’s soft menu key.
variables p1, z1, R, Q, A12, α, and A. Suppose that we want to copy variable A and place a copy in sub-directory {HOME MANS}. Also, we will copy variable R and place a copy in the HOME directory. Here is how to do it: Press „¡@@OK@@ to produce the following list of variables: Use the down-arrow key ˜ to select variable A (the last in the list), then press @@COPY@. The calculator will respond with a screen labeled PICK DESTINATION: Use the up arrow key — to select the sub-directory MANS and press @@OK@@.
Using the history in Algebraic mode Here is a way to use the history (stack) to copy a variable from one directory to another with the calculator set to the Algebraic mode. Suppose that we are within the sub-directory {HOME MANS INTRO}, and want to copy the contents of variable z1 to sub-directory {HOME MANS}. Use the following procedure: ‚@@z1@ K@@z1@ ` This simply stores the contents of z1 into itself (no change effected on z1). Next, use „§` to move to the {HOME MANS} sub-directory.
‚@@ @Q@@ K@@@Q@@ ` „§` ƒ ƒ ƒ` ƒƒƒƒ` To verify the contents of the variables, use ‚@@ @R@ and ‚@@ @Q. This procedure can be generalized to the copying of three or more variables. Copying two or more variables using the stack in RPN mode The following is an exercise to demonstrate how to copy two or more variables using the stack when the calculator is in RPN mode.
Next, we’ll list the new order of the variables by using their names typed between quotes: „ä ³)@INTRO ™‚í³@@@@A@@@ ™‚í³@@@z1@@™‚í³@@@Q@@@™ ‚í³@@@@R@@@ ™‚í³@@A12@@ ` The screen now shows the new ordering of the variables: RPN mode In RPN mode, the list of re-ordered variables is listed in the stack before applying the command ORDER. Suppose that we start from the same situation as above, but in RPN mode, i.e.
Notice that variable A12 is no longer there. If you now press „§, the screen will show the contents of sub-directory MANS, including variable A12: Note: You can use the stack to move a variable by combining copying with deleting a variable. Procedures for deleting variables are demonstrated in the next section. Deleting variables Variables can be deleted using function PURGE. This function can be accessed directly by using the TOOLS menu (I), or by using the FILES menu „¡@@OK@@ .
Using function PURGE in the stack in Algebraic mode We start again at subdirectory {HOME MANS INTRO} containing now only variables p1, z1, Q, R, and α. We will use command PURGE to delete variable p1. Press I @PURGE@ J@@p1@@ `. The screen will now show variable p1 removed: You can use the PURGE command to erase more than one variable by placing their names in a list in the argument of PURGE. For example, if now we wanted to purge variables R and Q, simultaneously, we can try the following exercise.
UNDO and CMD functions Functions UNDO and CMD are useful for recovering recent commands, or to revert an operation if a mistake was made. These functions are associated with the HIST key: UNDO results from the keystroke sequence ‚¯, while CMD results from the keystroke sequence „®. To illustrate the use of UNDO, try the following exercise in algebraic (ALG) mode: 5*4/3`. The UNDO command (‚¯) will simply erase the result. The same exercise in RPN mode, will follow these keystrokes: 5`4`*3`/.
Pressing „® produces the following selection box: As you can see, the numbers 3, 2, and 5, used in the first calculation above, are listed in the selection box, as well as the algebraic ‘SIN(5x2)’, but not the SIN function entered previous to the algebraic. Flags A flag is a Boolean value, that can be set or cleared (true or false), that specifies a given setting of the calculator or an option in a program. Flags in the calculator are identified by numbers. There are 256 flags, numbered from -128 to 128.
Example of flag setting: general solutions vs. principal value For example, the default value for system flag 01 is General solutions. What this means is that, if an equation has multiple solutions, all the solutions will be returned by the calculator, most likely in a list. By pressing the @ CHK@ soft menu key you can change system flag 01 to Principal value. This setting will force the calculator to provide a single value known as the principal value of the solution.
‚O~ „t Q2™+5*~ „t+6—— ‚Å0` ` (keeping a second copy in the RPN stack) ³~ „t` Use the following keystroke sequence to enter the QUAD command: ‚N~q (use the up and down arrow keys, —˜ , to select command QUAD) , press @@OK@@ . The screen shows the principal solution: Now, change the setting of flag 01 to General solutions: H@FLAGS@ ƒ³ ~ „t` @ CHK@ @@OK@@ @@OK@@ . And try the solution again: ‚N~q (use the up and down arrow keys, —˜ , to select command QUAD) , press @@OK@@ .
CHOOSE boxes vs. Soft MENU In some of the exercises presented in this chapter we have seen menu lists of commands displayed in the screen. This menu lists are referred to as CHOOSE boxes.
Press twice to return to normal calculator display. Now, we’ll try to find the ORDER command using similar keystrokes to those used above, i.e., we start with „°. Notice that instead of a menu list, we get soft menu labels with the different options in the PROG menu, i.e., Press B to select the MEMORY soft menu ()@@MEM@@). The display now shows: Press E to select the DIRECTORY soft menu ()@@DIR@@) The ORDER command is not shown in this screen.
• The HELP menu, activated with I L @HELP • The CMDS (CoMmanDS) menu, activated within the Equation Writer, i.e.
Chapter 3 Calculation with real numbers This chapter demonstrates the use of the calculator for operations and functions related to real numbers. Operations along these lines are useful for most common calculations in the physical sciences and engineering. The user should be acquainted with the keyboard to identify certain functions available in the keyboard (e.g., SIN, COS, TAN, etc.). Also, it is assumed that the reader knows how to adjust the calculator's operation, i.e.
2. Coordinate system specification (XYZ, R∠Z, R∠∠). stands for an angular coordinate. XYZ: Cartesian or rectangular (x,y,z) R∠Z: cylindrical Polar coordinates (r,θ,z) R∠∠: Spherical coordinates (ρ,θ,φ) 3. Number base specification (HEX, DEC, OCT, BIN) HEX: hexadecimal numbers (base 16) DEC: decimal numbers (base 10) OCT: octal numbers (base 8) BIN: binary numbers (base 2) 4. Real or complex mode specification (R, C) R: real numbers C: complex numbers 5.
specification. Real number calculations will be demonstrated in both the Algebraic (ALG) and Reverse Polish Notation (RPN) modes. Changing sign of a number, variable, or expression Use the \ key. In ALG mode, you can press \ before entering the number, e.g., \2.5`. Result = -2.5. In RPN mode, you need to enter at least part of the number first, and then use the \ key, e.g., 2.5\. Result = -2.5.
3.7#5.2 6.3#8.5 4.2#2.5 2.3#4.5 + * / Using parentheses Parentheses can be used to group operations, as well as to enclose arguments of functions. The parentheses are available through the keystroke combination „Ü. Parentheses are always entered in pairs. For example, to calculate (5+3.2)/(7-2.2): In ALG mode: „Ü5+3.2™/„Ü7-2.2` In RPN mode, you do not need the parenthesis, calculation is done directly on the stack: 5`3.2`+7`2.
Squares and square roots The square function, SQ, is available through the keystroke combination: „º. When calculating in the stack in ALG mode, enter the function before the argument, e.g., „º\2.3` In RPN mode, enter the number first, then the function, e.g., 2.3\„º The square root function, √, is available through the R key. When calculating in the stack in ALG mode, enter the function before the argument, e.g., R123.4` In RPN mode, enter the number first, then the function, e.g., 123.
Using powers of 10 in entering data Powers of ten, i.e., numbers of the form -4.5×10-2, etc., are entered by using the V key. For example, in ALG mode: \4.5V\2` Or, in RPN mode: 4.5\V2\` Natural logarithms and exponential function Natural logarithms (i.e., logarithms of base e = 2.7182818282) are calculated by the keystroke combination ‚¹ (function LN) while its inverse function, the exponential function (function EXP) is calculated by using „¸.
these functions will be given in the selected angular measure (DEG, RAD, GRD). Some examples are shown next: In ALG mode: „¼0.25` „¾0.85` „À1.35` In RPN mode: 0.25`„¼ 0.85`„¾ 1.35`„À All the functions described above, namely, ABS, SQ, √, ^, XROOT, LOG, ALOG, LN, EXP, SIN, COS, TAN, ASIN, ACOS, ATAN, can be combined with the fundamental operations (+-*/) to form more complex expressions.
for system flag 117 (see Chapter 2), the MTH menu is shown as the following menu list: As they are a great number of mathematic functions available in the calculator, the MTH menu is sorted by the type of object the functions apply on. For example, options 1. VECTOR.., 2. MATRIX., and 3. LIST.. apply to those data types (i.e., vectors, matrices, and lists) and will discussed in more detail in subsequent chapters. Options 4. HYPERBOLIC.. and 5. REAL..
2. To quickly select one of the numbered options in a menu list (or CHOOSE box), simply press the number for the option in the keyboard. For example, to select option 4. HYPERBOLIC.. in the MTH menu, simply press 4. Hyperbolic functions and their inverses Selecting Option 4. HYPERBOLIC..
4 @@OK@@ 5 @@OK@@ Select the 4. HYPERBOLIC.. menu Select the 5. TANH function The result is: The operations shown above assume that you are using the default setting for system flag 117 (CHOOSE boxes). If you have changed the setting of this flag (see Chapter 2) to SOFT menu, the MTH menu will show as labels of the soft menu keys, as follows (left-hand side in ALG mode, right –hand side in RPN mode): Pressing L shows the remaining options: Note: Pressing „«will return to the first set of MTH options.
Note: To see additional options in these soft menus, press the L key or the „«keystroke sequence. For example, to calculate tanh(2.5), in the ALG mode, when using SOFT menus over CHOOSE boxes, follow this procedure: „´ )@@HYP@ @@TANH@ 2.5` Select MTH menu Select the HYPERBOLIC.. menu Select the TANH function Evaluate tanh(2.5) In RPN mode, the same value is calculated using: 2.5` Enter argument in the stack „´ Select MTH menu )@@HYP@ Select the HYPERBOLIC..
Option 19. MATH.. returns the user to the MTH menu. The remaining functions are grouped into six different groups described below. If system flag 117 is set to SOFT menus, the REAL functions menu will look like this (ALG mode used, the same soft menu keys will be available in RPN mode): The very last option, )@@MTH@, returns the user to the MTH menu.
The result is shown next: In RPN mode, recall that argument y is located in the second level of the stack, while argument x is located in the first level of the stack. This means, you should enter x first, and then, y, just as in ALG mode. Thus, the calculation of %T(15,45), in RPN mode, and with system flag 117 set to CHOOSE boxes, we proceed as follows: 15` Enter first argument 45` Enter second argument „´ Select MTH menu 5 @@OK@@ Select the 5. REAL.. menu 3 @@OK@@ Select the 5.
As an exercise, verify that 15 MOD 4 = 15 mod 4 = residual of 15/4 = 3 Absolute value, sign, mantissa, exponent, integer and fractional parts ABS(x) : calculates the absolute value, |x| SIGN(x) : determines the sign of x, i.e., -1, 0, or 1. MANT(x): determines the mantissa of a number based on log10.
GAMMA: PSI: Psi: The Gamma function Γ(α) N-th derivative of the digamma function Digamma function, derivative of the ln(Gamma) The Gamma function is defined by Γ(α ) = ∫ ∞ 0 x α −1e − x dx . This function has applications in applied mathematics for science and engineering, as well as in probability and statistics. Factorial of a number The factorial of a positive integer number n is defined as n!=n⋅(n-1)⋅(n2) …3⋅2⋅1, with 0! = 1. The factorial function is available in the calculator by using ~‚2.
Calculator constants The following are the mathematical constants used by your calculator: • e: the base of natural logarithms. • i: the imaginary unit, ii 2 = -1. • π: the ratio of the length of the circle to its diameter. • MINR: the minimum real number available to the calculator. • MAXR: the maximum real number available to the calculator. To have access to these constants, select option 11. CONSTANTS..
Operations with units Numbers in the calculator can have units associated with them. Thus, it is possible to calculate results involving a consistent system of units and produce a result with the appropriate combination of units. The UNITS menu The units menu is launched by the keystroke combination ‚Û(associated with the 6 key). With system flag 117 set to CHOOSE boxes, the result is the following menu: Option 1. Tools.. contains functions used to operate on units (discussed later). Options 3. Length..
For extensive operations with units SOFT menus provide a more convenient way of attaching units. Change system flag 117 to SOFT menus (see Chapter 1), and use the keystroke combination ‚Û to get the following menus. Press L to move to the next menu page. Pressing on the appropriate soft menu key will open the sub-menu of units for that particular selection. For example, for the @)SPEED sub-menu, the following units are available: Pressing the soft menu key @)UNITS will take you back to the UNITS menu.
chain (chain), rd (rod), fath (fathom), ftUS (survey foot), Mil (Mil), µ (micron), Å (Angstrom), fermi (fermi) AREA m^2 (square meter), cm^2 (square centimeter), b (barn), yd^2 (square yard), ft^2 (square feet), in^2 (square inch), km^2 (square kilometer), ha (hectare), a (are), mi^2 (square mile), miUS^2 (square statute mile), acre (acre) VOLUME m^3 (cubic meter), st (stere), cm^3 (cubic centimeter), yd^3 (cubic yard), ft^3 (cubic feet), in^3 (cubic inch), l (liter), galUK (UK gallon), galC (Canadian gallo
POWER W (watt), hp (horse power), PRESSURE Pa (pascal), atm (atmosphere), bar (bar), psi (pounds per square inch), torr (torr), mmHg (millimeters of mercury), inHg (inches of mercury), inH20 (inches of water), TEMPERATURE C (degree Celsius), o F (degree Fahrenheit), K (Kelvin), o R (degree Rankine), o ELECTRIC CURRENT (Electric measurements) V (volt), A (ampere), C (coulomb), Ω (ohm), F (farad), W (watt), Fdy (faraday), H (henry), mho (mho), S (siemens), T (tesla), Wb (weber ) ANGLE (planar and solid angl
MENU(117.02) in ALG mode, or 117.02 ` MENU in RPN mode. The menu will show in the screen as follows (use ‚˜to show labels in display): These units are also accessible through the catalog, for example: gmol: lbmol: rpm: dB: ‚N~„g ‚N~„l ‚N~„r ‚N~„d Converting to base units To convert any of these units to the default units in the SI system, use the function UBASE.
In RPN mode, system flag 117 set to CHOOSE boxes: 1 Enter 1 (no underline) ‚Û Select the UNITS menu — @@OK@@ Select the VISCOSITY option @@OK@@ Select the unit P (poise) ‚Û Select the UNITS menu @@OK@@ Select the TOOLS menu ˜ @@OK@@ Select the UBASE function In ALG mode, system flag 117 set to SOFT menus: ‚Û Select the UNITS menu )@TOOLS Select the TOOLS menu @UBASE Select the UBASE function 1 ‚Ý Enter 1 and underline ‚Û Select the UNITS menu „« @)VISC Select the VISCOSITY option @@@P@@ Select the unit P (p
8@@OK@@ @@OK@@ ` Select units of force (8. Force..) Select Newtons (N) Enter quantity with units in the stack The screen will look like the following: Note: If you forget the underscore, the result is the expression 5*N, where N here represents a possible variable name and not Newtons. To enter this same quantity, with the calculator in RPN mode, use the following keystrokes: 5 Enter number (do not enter underscore) ‚Û Access the UNITS menu 8@@OK@@ Select units of force (8. Force..
The same quantity, entered in RPN mode uses the following keystrokes: 5 Enter number (no underscore) ‚Û Access the UNITS menu L @)@FORCE Select units of force @ @@N@@ Select Newtons (N) Note: You can enter a quantity with units by typing the underline and units with the ~keyboard, e.g., 5‚Ý~n will produce the entry: 5_N Unit prefixes You can enter prefixes for units according to the following table of prefixes from the SI system.
Using UBASE to convert to the default unit (1 m) results in: Operations with units Once a quantity accompanied with units is entered into the stack, it can be used in operations similar to plain numbers, except that quantities with units cannot be used as arguments of functions (say, SQ or SIN). Thus, attempting to calculate LN(10_m) will produce an error message: Error: Bad Argument Type. Here are some calculation examples using the ALG operating mode.
which transformed to SI units, with function UBASE, produces: Addition and subtraction can be performed, in ALG mode, without using parentheses, e.g., 5 m + 3200 mm, can be entered simply as 5_m + 3200_mm `: More complicated expression require the use of parentheses, e.g., (12_mm)*(1_cm^2)/(2_s) `: Stack calculations in the RPN mode, do not require you to enclose the different terms in parentheses, e.g., 12_m ` 1.
5_m ` 3200_mm ` + 12_mm ` 1_cm^2 `* 2_s ` / These last two operations produce the following output: Note: Units are not allowed in expressions entered in the equation writer.
Examples of UVAL: UVAL(25_ft/s) ` UVAL(0.021_cm^3) ` Examples of UFACT UFACT(1_ha,18_km^2) ` UFACT(1_mm,15.1_cm) ` Examples of UNIT UNIT(25,1_m) ` UNIT(11.3,1_mph) ` Physical constants in the calculator Following along the treatment of units, we discuss the use of physical constants that are available in the calculator’s memory. These physical constants are contained in a constants library activated with the command CONLIB.
~~conlib~` or, you can select the command CONLIB from the command catalog, as follows: First, launch the catalog by using: ‚N~c. Next, use the up and down arrow keys —˜ to select CONLIB. Finally, press the F(@@OK@@) soft menu key. Press `, if needed.
VALUE when selected, constants are shown without units STK copies value (with or without units) to the stack QUIT exit constants library (*) Active only if the function VALUE is active.
The display shows what is called a tagged value, Vm:359.0394. In here, Vm, is the tag of this result. Any arithmetic operation with this number will ignore the tag.
TINC: temperature increment command Out of all the functions available in this MENU (UTILITY menu), namely, ZFACTOR, FANNING, DARCY, F0λ, SIDENS, TDELTA, and TINC, functions FANNING and DARCY are described in Chapter 6 in the context of solving equations for pipeline flow. The remaining functions are described following. Function ZFACTOR Function ZFACTOR calculates the gas compressibility correction factor for nonideal behavior of hydrocarbon gas.
Function TDELTA Function TDELTA(T0,Tf) yields the temperature increment Tf – T0. The result is returned with the same units as T0, if any. Otherwise, it returns simply the difference in numbers. For example, The purpose of this function is to facilitate the calculation of temperature differences given temperatures in different units. Otherwise, it’s simply calculates a subtraction, e.g., Function TINC Function TINC(T0,∆T) calculates T0+DT.
Suppose that you have a need to evaluate this function for a number of discrete values and, therefore, you want to be able to press a single button and get the result you want without having to type the expression in the righthand side for each separate value. In the following example, we assume you have set your calculator to ALG mode.
In the RPN mode, to activate the function enter the argument first, then press the soft menu key corresponding to the variable name @@@H@@@ . For example, you could try: 2`@@@H@@@ . The other examples shown above can be entered by using: 1.2`@@@H@@@ , 2/3`@@@H@@@ . Functions can have more than 2 arguments. For example, the screen below shows the definition of the function K(α,β) = α+β, and its evaluation with the arguments K(√2,π), and K(1.2,2.3): The contents of the variable K are: << α β ‘α+β’ >>.
(associated with the Y key). To define this function in ALG mode use the command: DEF(f(x) = IFTE(x>0, x^2-1, 2*x-1)) then, press `. In RPN mode, type the function definition between apostrophes: ‘f(x) = IFTE(x>0, x^2-1, 2*x-1)’ then press „à. Press J to recover your variable menu. The function @@@f@@@ should be available in your soft key menu.
Chapter 4 Calculations with complex numbers This chapter shows examples of calculations and application of functions to complex numbers. Definitions A complex number z is a number written as z = x + iy, where x and y are real numbers, and i is the imaginary unit defined by i2 = -1. The complex number x+iy has a real part, x = Re(z), and an imaginary part, y = Im(z).
Press @@OK@@ , twice, to return to the stack. Entering complex numbers Complex numbers in the calculator can be entered in either of the two Cartesian representations, namely, x+iy, or (x,y). The results in the calculator will be shown in the ordered-pair format, i.e., (x,y). For example, with the calculator in ALG mode, the complex number (3.5,-1.2), is entered as: „Ü3.5‚í\1.2` A complex number can also be entered in the form x+iy. For example, in ALG mode, 3.5-1.2i is entered as: 3.5 -1.
Polar representation of a complex number The result shown above represents a Cartesian (rectangular) representation of the complex number 3.5-1.2i. A polar representation is possible if we change the coordinate system to cylindrical or polar, by using function CYLIN. You can find this function in the catalog (‚N). Changing to polar shows the result: For this result the angular measure is set to radians (you can always change to radians by using function RAD).
Simple operations with complex numbers Complex numbers can be combined using the four fundamental operations (+-*/). The results follow the rules of algebra with the caveat that i2= -1. Operations with complex numbers are similar to those with real numbers.
Entering the unit imaginary number To enter the unit imaginary number type : „¥ Notice that the number i is entered as the ordered pair (0,1) if the CAS is set to APPROX mode. In EXACT mode, the unit imaginary number is entered as i. Other operations Operations such as magnitude, argument, real and imaginary parts, and complex conjugate are available through the CMPLX menus detailed later. The CMPLX menus There are two CMPLX (CoMPLeX numbers) menus available in the calculator.
RE(z) : Real part of a complex number IM(z) : Imaginary part of a complex number C→R(z) : Takes a complex number (x,y) and separates it into its real and imaginary parts R→C(x,y): Forms the complex number (x,y) out of real numbers x and y ABS(z) : Calculates the magnitude of a complex number or the absolute value of a real number. ARG(z): Calculates the argument of a complex number.
Also, the result of function ARG, which represents an angle, will be given in the units of angle measure currently selected. In this example, ARG(3.+5. i) = 1.0303… is given in radians. In the next screen we present examples of functions SIGN, NEG (which shows up as the negative sign - ), and CONJ. CMPLX menu in keyboard A second CMPLX menu is accessible by using the right-shift option associated with the 1 key, i.e., ‚ß.
Functions applied to complex numbers Many of the keyboard-based functions defined in Chapter 3 for real numbers, e.g., SQ, ,LN, ex, LOG, 10X, SIN, COS, TAN, ASIN, ACOS, ATAN, can be applied to complex numbers. The result is another complex number, as illustrated in the following examples. To apply this functions use the same procedure as presented for real numbers (see Chapter 3). Note: When using trigonometric functions and their inverses with complex numbers the arguments are no longer angles.
The following screen shows that functions EXPM and LNP1 do not apply to complex numbers. However, functions GAMMA, PSI, and Psi accept complex numbers: Function DROITE: equation of a straight line Function DROITE takes as argument two complex numbers, say, x1+iy1 and x2+iy2, and returns the equation of the straight line, say, y = a+bx, that contains the points (x1,y1) and (x2,y2).
Chapter 5 Algebraic and arithmetic operations An algebraic object, or simply, algebraic, is any number, variable name or algebraic expression that can be operated upon, manipulated, and combined according to the rules of algebra. Examples of algebraic objects are the following: • A number: 12.3, 15.2_m, ‘π’, ‘e’, ‘i’ • A variable name: ‘a’, ‘ux’, ‘width’, etc. • An expression: ‘p*D^2/4’,’f*(L/D)*(V^2/(2*g))’ • An equation: ‘Q=(Cu/n)*A(y)*R(y)^(2/3)*So^0.
Simple operations with algebraic objects Algebraic objects can be added, subtracted, multiplied, divided (except by zero), raised to a power, used as arguments for a variety of standard functions (exponential, logarithmic, trigonometry, hyperbolic, etc.), as you would any real or complex number.
@@A1@@ * @@A2@@ ` ‚¹@@A1@@ @@A1@@ / @@A2@@ ` „¸@@A2@@ The same results are obtained in RPN mode if using the following keystrokes: @@A1@@ ` @@A2@@ + @@A1@@ `@@A2@@ @@A1@@ ` @@A2@@ * @@A1@@ `@@A2@@ / @@A1@@ ` ‚¹ @@A2@@ `„¸ Functions in the ALG menu The ALG (Algebraic) menu is available by using the keystroke sequence ‚× (associated with the ‚ key).
We notice that, at the bottom of the screen, the line See: EXPAND FACTOR suggests links to other help facility entries, the functions EXPAND and FACTOR. To move directly to those entries, press the soft menu key @SEE1! for EXPAND, and @SEE2! for FACTOR. Pressing @SEE1!, for example, shows the following information for EXPAND: The help facility provides not only information on each command, but also provides an example of its application.
The help facility will show the following information on the commands: COLLECT: EXPAND: FACTOR: LNCOLLECT: LIN: PARTFRAC: SOLVE: SUBST: TEXPAND: Page 5-5
Note: Recall that, to use these, or any other functions in the RPN mode, you must enter the argument first, and then the function. For example, the example for TEXPAND, in RPN mode will be set up as: ³„¸+~x+~y` At this point, select function TEXPAND from menu ALG (or directly from the catalog ‚N), to complete the operation. Other forms of substitution in algebraic expressions Functions SUBST, shown above, is used to substitute a variable in an expression.
In ALG mode, substitution of more than one variable is possible as illustrated in the following example (shown before and after pressing `) In RPN mode, it is also possible to substitute more than one variable at a time, as illustrated in the example below. Recall that RPN mode uses a list of variable names and values for substitution.
hyperbolic functions in terms of trigonometric identities or in terms of exponential functions. The menus containing functions to replace trigonometric functions can be obtained directly from the keyboard by pressing the right-shift key followed by the 8 key, i.e., ‚Ñ. The combination of this key with the left-shift key, i.e., ‚ Ð, produces a menu that lets you replace expressions in terms of exponential or natural logarithm functions. In the next sections we cover those menus in more detail.
These functions allow to simplify expressions by replacing some category of trigonometric functions for another one. For example, the function ACOS2S allows to replace the function arccosine (acos(x)) with its expression in terms of arcsine (asin(x)). Description of these commands and examples of their applications are available in the calculator’s help facility (IL@HELP). The user is invited to explore this facility to find information on the commands in the TRIG menu.
of functions that apply to specific mathematical objects. This distinction between sub-menus (options 1 through 4) and plain functions (options 5 through 9) is made clear when system flag 117 is set to SOFT menus.
IABCUV Solves au + bv = c, with a,b,c = integers IBERNOULLI n-th Bernoulli number ICHINREM Chinese reminder for integers IDIV2 Euclidean division of two integers IEGCD Returns u,v, such that au + bv = gcd(a,b) IQUOT Euclidean quotient of two integers IREMAINDER Euclidean remainder of two integers ISPRIME? Test if an integer number is prime NEXTPRIME Next prime for a given integer number PA2B2 Prime number as square norm of a complex number PREVPRIME Previous prime for a given integer number POLYNOMIAL menu
MODULO menu ADDTMOD DIVMOD DIV2MOD Add two expressions modulo current modulus Divides 2 polynomials modulo current modulus Euclidean division of 2 polynomials with modular coefficients EXPANDMOD Expands/simplify polynomial modulo current modulus FACTORMOD Factorize a polynomial modulo current modulus GCDMOD GCD of 2 polynomials modulo current modulus INVMOD inverse of integer modulo current modulus MOD (not entry available in the help facility) MODSTO Changes modulo setting to specified value MULTMOD Multi
Operations in modular arithmetic Addition in modular arithmetic of modulus n, which is a positive integer, follow the rules that if j and k are any two nonnegative integer numbers, both smaller than n, if j+k≥ n, then j+k is defined as j+k-n. For example, in the case of the clock, i.e., for n = 12, 6+9 “=” 3.
6 does not show the result 5 in modulus 12 arithmetic. This multiplication table is shown below: 6*0 6*1 6*2 6*3 6*4 6*5 (mod (mod (mod (mod (mod (mod 12) 12) 12) 12) 12) 12) 0 6 0 6 0 6 6*6 (mod 12) 6*7 (mod 12) 6*8 (mod 12) 6*9 (mod 12) 6*10 (mod 12) 6*11 (mod 12) 0 6 0 6 0 6 Formal definition of a finite arithmetic ring The expression a ≡ b (mod n) is interpreted as “a is congruent to b, modulo n,” and holds if (b-a) is a multiple of n.
Finite arithmetic rings in the calculator All along we have defined our finite arithmetic operation so that the results are always positive. The modular arithmetic system in the calculator is set so that the ring of modulus n includes the numbers -n/2+1, …,-1, 0, 1,…,n/2-1, n/2, if n is even, and –(n-1)/2, -(n-3)/2,…,-1,0,1,…,(n-3)/2, (n-1)/2, if n is odd.
ADDTMOD examples 6+5 ≡ -1 (mod 12) 11+5 ≡ 4 (mod 12) 6+6 ≡ 0 (mod 12) 8+10 ≡ -6 (mod 12) SUBTMOD examples 5 - 7 ≡ -2 (mod 12) 11 – 8 ≡ 3 (mod 12) 8 – 4 ≡ 4 (mod 12) 8 - 12 ≡ -4 (mod 12) 5 –10 ≡ -5 (mod 12) MULTMOD examples 6⋅8 ≡ 0 (mod 12) 5⋅6 ≡ 6 (mod 12) 9⋅8 ≡ 0 (mod 12) 11⋅3 ≡ -3 (mod 12) 3⋅2 ≡ 6 (mod 12) DIVMOD examples 12/3 ≡ 4 (mod 12) 25/5 ≡ 5 (mod 12) 66/6 ≡ -1 (mod 12) 6+7 ≡ 1 (mod 12) 12/8 (mod 12) does not exist 64/13 ≡ 4 (mod 12) DIV2MOD examples 2/3 (mod 12) does not exist 26/12 (mod
before operating on them. You can also convert any number into a ring number by using the function EXPANDMOD. For example, EXPANDMOD(125) ≡ 5 (mod 12) EXPANDMOD(17) ≡ 5 (mod 12) EXPANDMOD(6) ≡ 6 (mod 12) The modular inverse of a number Let a number k belong to a finite arithmetic ring of modulus n, then the modular inverse of k, i.e., 1/k (mod n), is a number j, such that j⋅k ≡ 1 (mod n).
Note: Refer to the help facility in the calculator for description and examples on other modular arithmetic. Many of these functions are applicable to polynomials. For information on modular arithmetic with polynomials please refer to a textbook on number theory. Polynomials Polynomials are algebraic expressions consisting of one or more terms containing decreasing powers of a given variable.
The CHINREM function CHINREM stands for CHINese REMainder. The operation coded in this command solves a system of two congruences using the Chinese Remainder Theorem. This command can be used with polynomials, as well as with integer numbers (function ICHINREM). The input consists of two vectors [expression_1, modulo_1] and [expression_2, modulo_2]. The output is a vector containing [expression_3, modulo_3], where modulo_3 is related to the product (modulo_1)⋅(modulo_2).
The HERMITE function The function HERMITE [HERMI] uses as argument an integer number, k, and returns the Hermite polynomial of k-th degree. A Hermite polynomial, Hek(x) is defined as He0 = 1, Hen ( x) = (−1) n e x 2 /2 d n −x2 / 2 (e ), n = 1,2,... dx n An alternate definition of the Hermite polynomials is H 0 * = 1, H n * ( x) = (−1) n e x 2 d n −x2 (e ), n = 1,2,... dx n where dn/dxn = n-th derivative with respect to x. This is the definition used in the calculator.
The LAGRANGE function The function LAGRANGE requires as input a matrix having two rows and n columns. The matrix stores data points of the form [[x1,x2, …, xn] [y1, y2, …, yn]]. Application of the function LAGRANGE produces the polynomial expanded from n n pn −1 ( x) = ∑ j =1 ∏(x − x ) k k =1, k ≠ j n ∏(x k =1, k ≠ j j − xk ) ⋅ y j.
The LEGENDRE function A Legendre polynomial of order n is a polynomial function that solves the 2 differential equation (1 − x ) ⋅ dy d2y − 2 ⋅ x ⋅ + n ⋅ (n + 1) ⋅ y = 0 2 dx dx To obtain the n-th order Legendre polynomial, use LEGENDRE(n), e.g., LEGENDRE(3) = ‘(5*X^3-3*X)/2’ LEGENDRE(5) = ‘(63*X ^5-70*X^3+15*X)/8’ The PCOEF function Given an array containing the roots of a polynomial, the function PCOEF generates an array containing the coefficients of the corresponding polynomial.
The QUOT and REMAINDER functions The functions QUOT and REMAINDER provide, respectively, the quotient Q(X) and the remainder R(X), resulting from dividing two polynomials, P1(X) and P2(X). In other words, they provide the values of Q(X) and R(X) from P1(X)/P2(X) = Q(X) + R(X)/P2(X). For example, QUOT(X^3-2*X+2, X-1) = X^2+X-1 REMAINDER(X^3-2*X+2, X-1) = 1. Thus, we can write: (X3-2X+2)/(X-1) = X2+X-1 + 1/(X-1).
The TCHEBYCHEFF function The function TCHEBYCHEFF(n) generates the Tchebycheff (or Chebyshev) polynomial of the first kind, order n, defined as Tn(X) = cos(n⋅arccos(X)). If the integer n is negative (n < 0), the function TCHEBYCHEFF(n) generates the Tchebycheff polynomial of the second kind, order n, defined as Tn(X) = sin(n⋅arccos(X))/sin(arccos(X)).
PROPFRAC(‘5/4’) = ‘1+1/4’ PROPFRAC(‘(x^2+1)/x^2’) = ‘1+1/x^2’ The PARTFRAC function The function PARTFRAC decomposes a rational fraction into the partial fractions that produce the original fraction. For example: PARTFRAC(‘(2*X^6-14*X^5+29*X^4-37*X^3+41*X^2-16*X+5)/(X^57*X^4+11*X^3-7*X^2+10*X)’) = ‘2*X+(1/2/(X-2)+5/(X-5)+1/2/X+X/(X^2+1))’ This technique is useful in calculating integrals (see chapter on calculus) of rational fractions.
If you press µ you will get: ‘(X^6+8*X^5+5*X^4-50*X^3)/(X^7+13*X^6+61*X^5+105*X^4-45*X^3297*X^2-81*X+243)’ The FROOTS function The function FROOTS obtains the roots and poles of a fraction. As an example, applying function FROOTS to the result produced above, will result in: [1 –2. –3 –5. 0 3. 2 1. –5 2.]. The result shows poles followed by their multiplicity as a negative number, and roots followed by their multiplicity as a positive number.
The CONVERT Menu and algebraic operations The CONVERT menu is activated by using „Ú key (the 6 key). This menu summarizes all conversion menus in the calculator. The list of these menus is shown next: The functions available in each of the sub-menus are shown next. UNITS convert menu (Option 1) This menu is the same as the UNITS menu obtained by using ‚Û. The applications of this menu are discussed in detail in Chapter 3.
BASE convert menu (Option 2) This menu is the same as the UNITS menu obtained by using ‚ã. The applications of this menu are discussed in detail in Chapter 19. TRIGONOMETRIC convert menu (Option 3) This menu is the same as the TRIG menu obtained by using ‚Ñ. The applications of this menu are discussed in detail in this Chapter. MATRICES convert menu (Option 5) This menu contains the following functions: These functions are discussed in detail in Chapter 10.
Function NUM has the same effect as the keystroke combination ‚ï (associated with the ` key). Function NUM converts a symbolic result into its floating-point value. Function Q converts a floating-point value into a fraction. Function Qπ converts a floating-point value into a fraction of π, if a fraction of π can be found for the number; otherwise, it converts the number to a fraction. Examples are of these three functions are shown next.
LIN LNCOLLECT POWEREXPAND SIMPLIFY Page 5-30
Chapter 6 Solution to single equations In this chapter we feature those functions that the calculator provides for solving single equations of the form f(X) = 0. Associated with the 7 key there are two menus of equation-solving functions, the Symbolic SOLVer („Î), and the NUMerical SoLVer (‚Ï). Following, we present some of the functions contained in these menus. Change CAS mode to Complex for these exercises (see Chapter 2).
Using the RPN mode, the solution is accomplished by entering the equation in the stack, followed by the variable, before entering function ISOL. Right before the execution of ISOL, the RPN stack should look as in the figure to the left. After applying ISOL, the result is shown in the figure to the right: The first argument in ISOL can be an expression, as shown above, or an equation. For example, in ALG mode, try: Note: To type the equal sign (=) in an equation, use ‚Å (associated with the \ key).
The following examples show the use of function SOLVE in ALG and RPN modes: The screen shot shown above displays two solutions. In the first one, β4-5β =125, SOLVE produces no solutions { }. In the second one, β4 - 5β = 6, SOLVE produces four solutions, shown in the last output line. The very last solution is not visible because the result occupies more characters than the width of the calculator’s screen.
Function SOLVEVX The function SOLVEVX solves an equation for the default CAS variable contained in the reserved variable name VX. By default, this variable is set to ‘X’. Examples, using the ALG mode with VX = ‘X’, are shown below: In the first case SOLVEVX could not find a solution. In the second case, SOLVEVX found a single solution, X = 2.
To use function ZEROS in RPN mode, enter first the polynomial expression, then the variable to solve for, and then function ZEROS. The following screen shots show the RPN stack before and after the application of ZEROS to the two examples above: The Symbolic Solver functions presented above produce solutions to rational equations (mainly, polynomial equations).
Notes: 1. Whenever you solve for a value in the NUM.SLV applications, the value solved for will be placed in the stack. This is useful if you need to keep that value available for other operations. 2. There will be one or more variables created whenever you activate some of the applications in the NUM.SLV menu.
Press ` to return to stack. The stack will show the following results in ALG mode (the same result would be shown in RPN mode): To see all the solutions, press the down-arrow key (˜) to trigger the line editor: All the solutions are complex numbers: (0.432,-0.389), (0.432,0.389), (0.766, 0.632), (-0.766, -0.632). Note: Recall that complex numbers in the calculator are represented as ordered pairs, with the first number in the pair being the real part, and the second number, the imaginary part.
Press ` to return to stack, the coefficients will be shown in the stack. Press ˜ to trigger the line editor to see all the coefficients. Note: If you want to get a polynomial with real coefficients, but having complex roots, you must include the complex roots in pairs of conjugate numbers. To illustrate the point, generate a polynomial having the roots [1 (1,2) (1,-2)]. Verify that the resulting polynomial has only real coefficients.
To generate the algebraic expression using the roots, try the following example. Assume that the polynomial roots are [1,3,-2,1]. Use the following keystrokes: ‚Ϙ˜@@OK@@ ˜„Ô1‚í3 ‚í2\‚í 1@@OK@@ ˜@SYMB@ ` Select Solve poly… Enter vector of roots Generate symbolic expression Return to stack. The expression thus generated is shown in the stack as:'(X-1)*(X-3)*(X+2)*(X-1)'. To expand the products, you can use the EXPAND command. The resulting expression is: 'X^4+-3*X^3+ -3*X^2+11*X-6'.
Definitions Often, to develop projects, it is necessary to borrow money from a financial institution or from public funds. The amount of money borrowed is referred to as the Present Value (PV). This money is to be repaid through n periods (typically multiples or sub-multiples of a month) subject to an annual interest rate of I%YR. The number of periods per year (P/YR) is an integer number of periods in which the year will be divided for the purpose of repaying the loan money.
The screen now shows the value of PMT as –39,132.30, i.e., the borrower must pay the lender US $ 39,132.30 at the end of each month for the next 60 months to repay the entire amount. The reason why the value of PMT turned out to be negative is because the calculator is looking at the money amounts from the point of view of the borrower. The borrower has + US $ 2,000,000.00 at time period t = 0, then he starts paying, i.e., adding -US $ 39132.30 at times t = 1, 2, …, 60.
This means that at the end of 60 months the US $ 2,000,000.00 principal amount has been paid, together with US $ 347,937.79 of interest, with the balance being that the lender owes the borrower US $ 0.000316. Of course, the balance should be zero. The value shown in the screen above is simply round-off error resulting from the numerical solution. Press $or `, twice, to return to normal calculator display.
2. The values calculated in the financial calculator environment are copied to the stack with their corresponding tag (identifying label). Deleting the variables When you use the financial calculator environment for the first time within the HOME directory, or any sub-directory, it will generate the variables @@@N@@ @I©YR@ @@PV@@ @@PMT@@ @@PYR@@ @@FV@@ to store the corresponding terms in the calculations..
J „ä @@@n@@ @I©YR@ @@PV@@ @@PMT@@ @@PYR@@ @@FV@@ ` I@PURGE Prepare a list of variables to be purged Enter name of variable N Enter name of variable I%YR Enter name of variable PV Enter name of variable PMT Enter name of variable PYR Enter name of variable FV Enter list of variables in stack Purge variables in list Before the command PURGE is entered, the RPN stack will look like this: Solving equations with one unknown through NUM.SLV The calculator's NUM.SLV menu provides item 1. Solve equation..
Press J to see the newly created EQ variable: Then, enter the SOLVE environment and select Solve equation…, by using: ‚Ï@@OK@@. The corresponding screen will be shown as: The equation we stored in variable EQ is already loaded in the Eq field in the SOLVE EQUATION input form. Also, a field labeled x is provided. To solve the equation all you need to do is highlight the field in front of X: by using ˜, and press @SOLVE@. The solution shown is X: 4.
• • The user then highlights the field corresponding to the unknown for which to solve the equation, and presses @SOLVE@ The user may force a solution by providing an initial guess for the solution in the appropriate input field before solving the equation. The calculator uses a search algorithm to pinpoint an interval for which the function changes sign, which indicates the existence of a root or solution. It then utilizes a numerical method to converge into the solution.
At this point follow the instructions from Chapter 2 on how to use the Equation Writer to build an equation. The equation to enter in the Eq field should look like this (notice that we use only one sub-index to refer to the variables, i.e., exx is translated as ex, etc. -- this is done to save typing time): Use the following shortcuts for special characters: σ: ~‚s α: ~‚a ∆: ~‚c and recall that lower-case letters are entered by using ~„ before the letter key, thus, x is typed as ~„x.
The solution can be seen from within the SOLVE EQUATION input form by pressing @EDIT while the ex: field is highlighted. The resulting value is 2.470833333333E-3. Press @@@OK@@ to exit the EDIT feature. Suppose that you now, want to determine the Young’s modulus that will produce a strain of exx = 0.005 under the same state of stress, neglecting thermal expansion. In this case, you should enter a value of 0.005 in the ex: field, and a zero in the ∆T: field (with ∆T = 0, no thermal effects are included).
y 1 m b We can type in the equation for E as shown above and use auxiliary variables for A and V, so that the resulting input form will have fields for the fundamental variables y, Q, g, m, and b, as follows: • First, create a sub-directory called SPEN (SPecific ENergy) and work within that sub-directory. • Next, define the following variables: • Launch the numerical solver for solving equations: ‚Ï@@OK@@.
• The result is 0.149836.., i.e., y = 0.149836. It is known, however, that there are actually two solutions available for y in the specific energy equation. The solution we just found corresponds to a numerical solution with an initial value of 0 (the default value for y, i.e., whenever the solution field is empty, the initial value is zero). To find the other solution, we need to enter a larger value of y, say 15, highlight the y input field and solve for y once more: The result is now 9.99990, i.e.
written as h f = f ⋅ L V2 ⋅ . The quantity f is known as the friction factor of D 2g the flow and it has been found to be a function of the relative roughness of the pipe, ε/D, and a (dimensionless) Reynolds number, Re. The Reynolds number is defined as Re = ρVD/µ = VD/ν, where ρ and µ are the density and dynamic viscosity of the fluid, respectively, and ν = µ/ρ is the kinematic viscosity of the fluid.
Example 3 – Flow in a pipe You may want to create a separate sub-directory (PIPES) to try this example. The main equation governing flow in a pipe is, of course, the Darcy-Weisbach equation. Thus, type in the following equation into EQ: Also, enter the following variables (f, A, V, Re): In this case we stored the main equation (Darcy-Weisbach equation) into EQ, and then replaced several of its variables by other expressions through the definition of variables f, A, V, and Re.
Thus, the equation we are solving, after combining the different variables in the directory, is: QD 2 ε 8Q 2 L h f = 2 5 ⋅ DARCY , πD / 4 D Nu π gD The combined equation has primitive variables: hf, Q, L, g, D, ε, and Nu. Launch the numerical solver (‚Ï@@OK@@) to see the primitive variables listed in the SOLVE EQUATION input form: Suppose that we use the values hf = 2 m, ε = 0.00001 m, Q = 0.05 m3/s, Nu = 0.000001 m2/s, L = 20 m, and g = 9.806 m/s2, find the diameter D.
Example 4 – Universal gravitation Newton’s law of universal gravitation indicates that the magnitude of the attractive force between two bodies of masses m1 and m2 separated by a distance r is given by the equation F = G ⋅ M1 ⋅ M 2 .
Solve for F, and press to return to normal calculator display. The solution is F : 6.67259E-15_N, or F = 6.67259×10-15 N. Note: When using units in the numerical solver make sure that all the variables have the proper units, that the units are compatible, and that the equation is dimensionally homogeneous. Different ways to enter equations into EQ In all the examples shown above we have entered the equation to be solved directly into variable EQ before activating the numerical solver.
At this point the equation is ready for solution. Alternatively, you can activate the equation writer after pressing @EDIT to enter your equation. Press ` to return to the numerical solver screen. Another way to enter an equation into the EQ variable is to select a variable already existing in your directory to be entered into EQ. This means that your equation would have to have been stored in a variable name previously to activating the numerical solver.
The SOLVE soft menu The SOLVE soft menu allows access to some of the numerical solver functions through the soft menu keys. To access this menu use in RPN mode: 74 MENU, or in ALG mode: MENU(74). Alternatively, you can use ‚(hold) 7 to activate the SOLVE soft menu.
The SOLVR sub-menu The SOLVR sub-menu activates the soft-menu solver for the equation currently stored in EQ. Some examples are shown next: Example 1 - Solving the equation t2-5t = -4 For example, if you store the equation ‘t^2-5*t=-4’ into EQ, and press @)SOLVR, it will activate the following menu: This result indicates that you can solve for a value of t for the equation listed at the top of the display. If you try, for example, „[ t ], it will give you the result t: 1.
As variables Q, a, and b, get assigned numerical values, the assignments are listed in the upper left corner of the display. At this point we can solve for t, by using „[ t ]. The result is t: 2. Pressing @EXPR= shows the results: Example 3 - Solving two simultaneous equations, one at a time You can also solve more than one equation by solving one equation at a time, and repeating the process until a solution is found.
After solving the two equations, one at a time, we notice that, up to the third decimal, X is converging to a value of 7.500, while Y is converging to a value o 0.799. Using units with the SOLVR sub-menu These are some rules on the use of units with the SOLVR sub-menu: • Entering a guess with units for a given variable, will introduce the use of those units in the solution. • If a new guess is given without units, the units previously saved for that particular variable are used.
Function PROOT This function is used to find the roots of a polynomial given a vector containing the polynomial coefficients in decreasing order of the powers of the independent variable. In other words, if the polynomial is anxn + an-1xn-1 + … + a2x2 + a1x + a0, the vector of coefficients should be entered as [an, an1, … , a2, a1 , a0]. For example, the roots of the polynomial whose coefficients are [1, -5, 6] are [2, 3].
The SOLVR sub-menu The SOLVR sub-menu in the TVM sub-menu will launch the solver for solving TVM problems. For example, pressing @)SOLVR, at this point, will trigger the following screen: As an exercise, try using the values n = 10, I%YR = 5.6, PV = 10000, and FV = 0, and enter „[ PMT ] to find PMT = -1021.08…. Pressing L, produces the following screen: Press J to exit the SOLVR environment. Find your way back to the TVM sub-menu within the SOLVE sub-menu to try the other functions available.
Function BEG If selected, the TMV calculations use payments at the beginning of each period. If deselected, the TMV calculations use payments at the end of each period.
Chapter 7 Solving multiple equations Many problems of science and engineering require the simultaneous solutions of more than one equation. The calculator provides several procedures for solving multiple equations as presented below. Please notice that no discussion of solving systems of linear equations is presented in this chapter. Linear systems solutions will be discussed in detail in subsequent chapters on matrices and linear algebra.
At this point, we need only press K twice to store these variables. To solve, first change CAS mode to Exact, then, list the contents of A2 and A1, in that order: @@@A2@@@ @@@A1@@@ . Use command SOLVE at this point (from the S.
Notice that the right-hand sides of the two equations differ only in the sign between the two terms. Therefore, to write these equations in the calculator, I suggest you type the first term and store in a variable T1, then the second term, and store it in T2. Writing the equations afterwards will be matter of recalling the contents of T1 and T2 to the stack and adding and subtracting them.
To solve for Pi and Po, use the command SOLVE from the S.SLV menu („Î), it may take the calculator a minute to produce the result: {[‘Pi=-(((σθ-σr)*r^2-(σθ+σr)*a^2)/(2*a^2))’ ‘Po=-(((σθ-σr)*r^2-(σθ+σr)*b^2)/(2*b^2))’ ] }, i.e., Notice that the result includes a vector [ ] contained within a list { }. To remove the list symbol, use µ. Finally, to decompose the vector, use function OBJ .
Example 1 – Example from the help facility As with all function entries in the help facility, there is an example attached to the MSLV entry as shown above. Notice that function MSLV requires three arguments: 1. A vector containing the equations, i.e., ‘[SIN(X)+Y,X+SIN(Y)=1]’ 2. A vector containing the variables to solve for, i.e., ‘[X,Y]’ 3. A vector containing initial values for the solution, i.e., the initial values of both X and Y are zero for this example.
Example 2 - Entrance from a lake into an open channel This particular problem in open channel flow requires the simultaneous solution of two equations, the equation of energy: H o = y + Manning’s equation: Q = V2 , and 2g Cu A 5 / 3 ⋅ ⋅ S o .
To see the original equations, EQ1 and EQ2, in terms of the primitive variables listed above, we can use function EVAL applied to each of the equations, i.e., µ@@@EQ1@@ µ @@@EQ2@@. The equations are listed in the stack as follows (small font option selected): We can see that these equations are indeed given in terms of the primitive variables b, m, y, g, So, n, Cu, Q, and Ho. In order to solve for y and Q we need to give values to the other variables. Suppose we use H0 = 5 ft, b = 1.5 ft, m = 1, n = 0.
Now, we are ready to solve the equation. First, we need to put the two equations together into a vector. We can do this by actually storing the vector into a variable that we will call EQS (EQuationS): As initial values for the variables y and Q we will use y = 5 (equal to the value of Ho, which is the maximum value that y can take) and Q = 10 (this is a guess). To obtain the solution we select function MSLV from the NUM.SLV menu, e.g.
Press @@OK@@ and allow the solution to proceed. An intermediate solution step may look like this: The vector at the top representing the current value of [y,Q] as the solution progresses, and the value .358822986286 representing the criteria for convergence of the numerical method used in the solution. If the system is well posed, this value will diminish until reaching a value close to zero. At that point a numerical solution would have been found.
Using the Multiple Equation Solver (MES) The multiple equation solver is an environment where you can solve a system of multiple equations by solving for one unknown from one equation at a time. It is not really a solver to simultaneous solutions, rather, it is a one-by-one solver of a number of related equations. To illustrate the use of the MES for solving multiple equations we present an application related to trigonometry in the next section. The examples shown here are developed in the RPN mode.
cosine law, and sum of interior angles of a triangle, to solve for the other three variables. If the three sides are known, the area of the triangle can be calculated with Heron’s formula A = s ⋅ ( s − a) ⋅ ( s − b) ⋅ ( s − c) ,where s is known as the a+b+c . semi-perimeter of the triangle, i.e., s = 2 Triangle solution using the Multiple Equation Solver (MES) The Multiple Equation Solver (MES) is a feature that can be used to solve two or more coupled equations.
‘a^2 = b^2+c^2-2*b*c*COS(α)’ ‘α+β+γ = 180’ ‘s = (a+b+c)/2’ ‘A = √ (s*(s-a)*(s-b)*(s-c))’ Then, enter the number 9, and create a list of equations by using: function LIST (use the command catalog ‚N). Store this list in the variable EQ. The variable EQ contains the list of equations that will be scanned by the MES when trying to solve for the unknowns.
Preparing to run the MES The next step is to activate the MES and try one sample solution. Before we do that, however, we want to set the angular units to DEGrees, if they are not already set to that, by typing ~~deg`. Next, we want to keep in the stack the contents of TITLE and LVARI, by using: !@TITLE @LVARI! We will use the following MES functions • MINIT: MES INITialization: initializes the variables in the equations stored in EQ.
5[ a 3[ b 5[ c To solve „[ α ] a:5 is listed in the top left corner of the display. ] b:3 is listed in the top left corner of the display. ] c:5 is listed in the top left corner of the display. for the angles use: ] Calculator reports Solving for α, and shows the result α: 72.5423968763. Note: If you get a value that is larger than 180, try the following: 10[ α „[ α ] ] Re-initialize a to a smaller value.
When done, press $ to return to the MES environment. Press J to exit the MES environment and return to the normal calculator display. Organizing the variables in the sub directory Your variable menu will now contain the variables (press L to see the second set of variables): Variables corresponding to all the variables in the equations in EQ have been created.
Programming the MES triangle solution using User RPL To facilitate activating the MES for future solutions, we will create a program that will load the MES with a single keystroke.
Example 2 - Any type of triangle Use a = 3, b = 4, c = 6. The solution procedure used here consists of solving for all variables at once, and then recalling the solutions to the stack: J @TRISO To clear up data and re-start MES 3[ a ] 4 [ b ] 6[ c ] To enter data L To move to the next variables menu. „ @ALL! Solve for all the unknowns.
carry over information from the previous solution that may wreck havoc with your current calculations. a b c α( ο) β( ο) γ( ο) 2.5 6.9837 7.2 20.299 75 84.771 8.6933 7.2 8.5 14.26 22.616 27 130.38 23.309 21.92 17.5 13.2 90 41.92 23 29.6 75 32 73 328.81 10.27 3.26 10.5 77 18 85 16.66 17 25 32 31.79 A 52.97 37.03 115.5 50.78 97.44 210.
________________________________________________________________ Program or value Store into variable: << PEQ STEQ MINIT NAME LIST MITM MSOLVR >> SOLVEP "vel. & acc. polar coord.
Start the multiple equation solver by pressing J@SOLVE. The calculator produces a screen labeled , "vel. & acc. polar coord.", that looks as follows: To enter the values of the known variables, just type the value and press the button corresponding to the variable to be entered. Use the following keystrokes: 2.5 [ r ] 0.5 [ rD ] 1.5 \ [ rDD ] 2.3 [ θD ] 6.5 \ [ θDD ]. Notice that after you enter a particular value, the calculator displays the variable and its value in the upper left corner of the display.
To use a new set of @SOLVE. values press, either @EXIT @@ALL@ LL, or J Let's try another example using r = 2.5, vr = rD = -0.5, rDD = 1.5, v = 3.0, a = 25.0. Find, θD, θDD, vθ, ar, and aθ.
Chapter 8 Operations with lists Lists are a type of calculator’s object that can be useful for data processing and in programming. This Chapter presents examples of operations with lists. Definitions A list, within the context of the calculator, is a series of objects enclosed between braces and separated by spaces (#), in the RPN mode, or commas (‚í), in both modes. Objects that can be included in a list are numbers, letters, character strings, variable names, and/or operators.
„ä 1 # 2 # 3 # 4 ` ~l1`™K The figure below shows the RPN stack before pressing the K key: Composing and decomposing lists Composing and decomposing lists makes sense in RPN mode only. Under such operating mode, decomposing a list is achieved by using function OBJ . With this function, a list in the RPN stack is decomposed into its elements, with stack level 1: showing the number of elements in the list.
Operations with lists of numbers To demonstrate operations with lists of numbers, we will create a couple of other lists, besides list L1 created above: L2={-3,2,1,5}, L3={-6,5,3,1,0,3,-4}, L4={3,-2,1,5,3,2,1}. In ALG mode, the screen will look like this after entering lists L2, L3, L4: In RPN mode, the following screen shows the three lists and their names ready to be stored. To store the lists in this case you need to press K three times.
Addition of a single number to a list produces a list augmented by the number, and not an addition of the single number to each element in the list. For example: Subtraction, multiplication, and division of lists of numbers of the same length produce a list of the same length with term-by-term operations.
Real number functions from the keyboard Real number functions from the keyboard (ABS, ex, LN, 10x, LOG, SIN, x2, √, COS, TAN, ASIN, ACOS, ATAN, yx) can be used on lists.
SINH, ASINH COSH, ACOSH TANH, ATANH SIGN, MANT, XPON IP, FP FLOOR, CEIL D R, R D Examples of functions that use two arguments The screen shots below show applications of the function % to list arguments. Function % requires two arguments. The first two examples show cases in which only one of the two arguments is a list. The results are lists with the function % distributed according to the list argument.
%({10, 20, 30},1) = {%(10,1),%(20,1),%(30,1)}, while %(5,{10,20,30}) = {%(5,10),%(5,20),%(5,30)} In the following example, both arguments of function % are lists of the same size. In this case, a term-by-term distribution of the arguments is performed, i.e., %({10,20,30},{1,2,3}) = {%(10,1),%(20,2),%(30,3)} This description of function % for list arguments shows the general pattern of evaluation of any function with two arguments when one or both arguments are lists.
The following example shows applications of the functions RE(Real part), IM(imaginary part), ABS(magnitude), and ARG(argument) of complex numbers. The results are lists of real numbers: Lists of algebraic objects The following are examples of lists of algebraic objects with the function SIN applied to them: The MTH/LIST menu The MTH menu provides a number of functions that exclusively to lists.
Next, with system flag 117 set to SOFT menus: This menu contains the following functions: ∆LIST : Calculate increment among consecutive elements in list ΣLIST : Calculate summation of elements in the list ΠLIST : Calculate product of elements in the list SORT : Sorts elements in increasing order REVLIST : Reverses order of list ADD : Operator for term-by-term addition of two lists of the same length (examples of this operator were shown above) Examples of application of these functions in ALG mode are show
Manipulating elements of a list The PRG (programming) menu includes a LIST sub-menu with a number of functions to manipulate elements of a list. With system flag 117 set to CHOOSE boxes: Item 1. ELEMENTS.. contains the following functions that can be used for the manipulation of elements in lists: List size Function SIZE, from the PRG/LIST/ELEMENTS sub-menu, can be used to obtain the size (also known as length) of the list, e.g.
Functions GETI and PUTI, also available in sub-menu PRG/ ELEMENTS/, can also be used to extract and place elements in a list. These two functions, however, are useful mainly in programming. Function GETI uses the same arguments as GET and returns the list, the element location plus one, and the element at the location requested. Function PUTI uses the same arguments as GET and returns the list and the list size.
SEQ is useful to produce a list of values given a particular expression and is described in more detail here. The SEQ function takes as arguments an expression in terms of an index, the name of the index, and starting, ending, and increment values for the index, and returns a list consisting of the evaluation of the expression for all possible values of the index. The general form of the function is SEQ(expression, index, start, end, increment).
Defining functions that use lists In Chapter 3 we introduced the use of the DEFINE function ( „à) to create functions of real numbers with one or more arguments. A function defined with DEF can also be used with list arguments, except that, any function incorporating an addition must use the ADD operator rather than the plus sign (+). For example, if we define the function F(X,Y) = (X-5)*(Y-2), shown here in ALG mode: we can use lists (e.g.
Next, we store the edited expression into variable @@@G@@@: Evaluating G(L1,L2) now produces the following result: As an alternative, you can define the function with ADD rather than the plus sign (+), from the start, i.e., use DEFINE('G(X,Y)=(X ADD 3)*Y') : You can also define the function as G(X,Y) = (X--3)*Y. Applications of lists This section shows a couple of applications of lists to the calculation of statistics of a sample. By a sample we understand a list of values, say, {s1, s2, …, sn}.
and that we store it into a variable called S (The screen shot below shows this action in ALG mode, however, the procedure in RPN mode is very similar. Just keep in mind that in RPN mode you place the arguments of functions in the stack before activating the function): Harmonic mean of a list This is a small enough sample that we can count on the screen the number of elements (n=10). For a larger list, we can use function SIZE to obtain that number, e.g.
3. Divide the result above by n = 10: 4. Apply the INV() function to the latest result: Thus, the harmonic mean of list S is sh = 1.6348… Geometric mean of a list The geometric mean of a sample is defined as xg = n n ∏x k =1 k = n x1 ⋅ x 2 L x n To find the geometric mean of the list stored in S, we can use the following procedure: 1. Apply function ΠLIST() to list S: 2. Apply function XROOT(x,y), i.e., keystrokes ‚», to the result in 1: Thus, the geometric mean of list S is sg = 1.
Weighted average Suppose that the data in list S, defined above, namely: S = {1,5,3,1,2,1,3,4,2,1} is affected by the weights, W = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} If we define the weight list as W = {w1,w2,…,wn}, we notice that the k -th element in list W, above, can be defined by wk = k.
3. Use function ΣLIST, once more, to calculate the denominator of sw: 4. Use the expression ANS(2)/ANS(1) to calculate the weighted average: Thus, the weighted average of list S with weights in list W is sw= 2.2. Note: ANS(1) refers to the most recent result (55), while ANS(2) refers to the previous to last result (121). Statistics of grouped data Grouped data is typically given by a table showing the frequency (w) of data in data classes or bins.
Given the list of class marks S = {s1, s2, …, sn }, and the list of frequency counts W = {w1, w2, …, wn }, the weighted average of the data in S with weights W represents the mean value of the grouped data, that we call s, in this context: n s= ∑ wk ⋅ s k k =1 n ∑w k =1 where N = n = ∑w k =1 k ⋅ sk , N k n ∑w k =1 k represents the total frequency count. The mean value for the data in lists S and W, therefore, can be calculated using the procedure outlined above for the weighted average, i.
To calculate this last result, we can use the following: The standard deviation of the grouped data is the square root of the variance: Page 8-20
Chapter 9 Vectors This Chapter provides examples of entering and operating with vectors, both mathematical vectors of many elements, as well as physical vectors of 2 and 3 components. Definitions From a mathematical point of view, a vector is an array of 2 or more elements arranged into a row or a column. These will be referred to as row and column vectors.
There are two definitions of products of physical vectors, a scalar or internal product (the dot product) and a vector or external product (the cross product). The dot product produces a scalar value defined as A•B = |A||B|cos(θ), where θ is the angle between the two vectors.
In RPN mode, you can enter a vector in the stack by opening a set of brackets and typing the vector components or elements separated by either commas (‚í) or spaces (#). Notice that after pressing ` , in either mode, the calculator shows the vector elements separated by spaces. Storing vectors into variables Vectors can be stored into variables.
Vectors vs. matrices To see the @VEC@ key in action, try the following exercises: (1) Launch the Matrix Writer („²). With @VEC and @GO→ selected, enter 3`5`2``. This produces [3. 5. 2.]. (In RPN mode, you can use the following keystroke sequence to produce the same result: 3#5#2``). (2) With @VEC@@ deselected and @GO→ selected,, enter 3#5#2``. This produces [[3. 5. 2.]].
Activate the Matrix Writer again by using „², and press L to check out the second soft key menu at the bottom of the display. It will show the keys: @+ROW@ @-ROW @+COL@ @-COL@ @→STK@@ @GOTO@ The @+ROW@ key will add a row full of zeros at the location of the selected cell of the spreadsheet. The @-ROW key will delete the row corresponding to the selected cell of the spreadsheet. The @+COL@ key will add a column full of zeros at the location of the selected cell of the spreadsheet.
Press @-COL@. The first column will disappear. Press @+COL@. A row of two zeroes appears in the first row. Press @GOTO@ 3@@OK@@ 3@@OK@@ @@OK@@ to move to position (3,3). Press @→STK@@. This will place the contents of cell (3,3) on the stack, although you will not be able to see it yet. (9) Press ` to return to normal display. Element (3,3) and the full matrix will be available in the screen.
The following screen shots show the RPN stack before and after applying function ARRY: In RPN mode, the function [→ARRY] takes the objects from stack levels n+1, n, n-1, …, down to stack levels 3 and 2, and converts them into a vector of n elements. The object originally at stack level n+1 becomes the first element, the object originally at level n becomes the second element, and so on.
More complicated expressions involving elements of A can also be written. For example, using the Equation Writer (‚O), we can write the following summation of the elements of A: Highlighting the entire expression and using the @EVAL@ soft menu key, we get the result: -15. Note: The vector A can also be referred to as an indexed variable because the name A represents not one, but many values identified by a sub-index.
Note: This approach for changing the value of an array element is not allowed in ALG mode, if you try to store 4.5 into A(3) in this mode you get the following error message: Invalid Syntax. To find the length of a vector you can use the function SIZE, available through the command catalog (N) or through the PRG/LIST/ELEMENTS sub-menu.
Attempting to add or subtract vectors of different length produces an error message (Invalid Dimension), e.g., v2+v3, u2+u3, A+v3, etc. Multiplication by a scalar, and division by a scalar Multiplication by a scalar or division by a scalar is straightforward: Absolute value function The absolute value function (ABS), when applied to a vector, produces the magnitude of the vector. For a vector A = [A1,A2,…,An], the magnitude is defined as | A |= Ax2 + Ay2 + L + Az2 .
Magnitude The magnitude of a vector, as discussed earlier, can be found with function ABS. This function is also available from the keyboard („Ê). Examples of application of function ABS were shown above. Dot product Function DOT is used to calculate the dot product of two vectors of the same length. Some examples of application of function DOT, using the vectors A, u2, u3, v2, and v3, stored earlier, are shown next in ALG mode.
Examples of cross products of one 3-D vector with one 2-D vector, or vice versa, are presented next: Attempts to calculate a cross product of vectors of length other than 2 or 3, produce an error message (Invalid Dimension), e.g., CROSS(v3,A), etc. Decomposing a vector Function V is used to decompose a vector into its elements or components. If used in the ALG mode, V will provide the elements of the vector in a list, e.g.
Building a three-dimensional vector Function V3 is used in the RPN mode to build a vector with the values in stack levels 1: , 2:, and 3:. The following screen shots show the stack before and after applying function V2: Changing coordinate system Functions RECT, CYLIN, and SPHERE are used to change the current coordinate system to rectangular (Cartesian), cylindrical (polar), or spherical coordinates.
„Ô5 ‚í ~‚6 25 ‚í 2.3 Before pressing `, the screen will look as in the left-hand side of the following figure. After pressing `, the screen will look as in the right-hand side of the figure (For this example, the numerical format was changed to Fix, with three decimals). Notice that the vector is displayed in Cartesian coordinates , with components x = r cos(θ), y = r sin(θ), z = z, even though we entered it in polar coordinates.
The conversion from Cartesian to cylindrical coordinates is such that r = (x2+y2)1/2, θ = tan-1(y/x), and z = z. For the case shown above the transformation was such that (x,y,z) = (3.204, 2.112, 2.300), produced (r,θ,z) = (3.536,25o,3.536). At this point, change the angular measure to Radians. If we now enter a vector of integers in Cartesian form, even if the CYLINdrical coordinate system is active, it will be shown in Cartesian coordinates, e.g.
Notice that the vectors that were written in cylindrical polar coordinates have now been changed to the spherical coordinate system. The transformation is such that ρ = (r2+z2)1/2, θ = θ, and φ = tan-1(r/z). However, the vector that originally was set to Cartesian coordinates remains in that form. Application of vector operations This section contains some examples of vector operations that you may encounter in Physics or Mechanics applications.
Thus, the result is θ = 122.891o. In RPN mode use the following: [3,-5,6] ` [2,1,-3] ` DOT [3,-5,6] ` ABS [2,1,-3] ` ABS * / ACOS NUM Moment of a force The moment exerted by a force F about a point O is defined as the crossproduct M = r×F, where r, also known as the arm of the force, is the position vector based at O and pointing towards the point of application of the force. Suppose that a force F = (2i+5j-6k) N has an arm r = (3i-5j+4k)m.
Thus the angle between vectors r and F is θ = 41.038o. RPN mode, we can use: [3,-5,4] ` [2,5,-6] ` CROSS ABS [3,-5,4] ` ABS [2,5,-6] ` ABS * / ASIN NUM Equation of a plane in space Given a point in space P0(x0,y0,z0) and a vector N = Nxi+Nyj+Nzk normal to a plane containing point P0, the problem is to find the equation of the plane. We can form a vector starting at point P0 and ending at point P(x,y,z), a generic point in the plane.
We can now use function EXPAND (in the ALG menu) to expand this expression: Thus, the equation of the plane through point P0(2,3,-1) and having normal vector N = 4i+6j+2k, is 4x + 6y + 2z – 24 = 0. In RPN mode, use: [2,3,-1] ` ['x','y','z'] ` - [4,6,2] DOT EXPAND Row vectors, column vectors, and lists The vectors presented in this chapter are all row vectors. In some instances, it is necessary to create a column vector (e.g., to use the pre-defined statistical functions in the calculator).
OBJ , ARRY, and LIST will be available in soft menu keys A, B, and C. Function DROP is available by using „°@)STACK @DROP. Following we introduce the operation of functions OBJ , LIST, ARRY, and DROP with some examples. Function OBJ This function decomposes an object into its components.
n+1:. For example, to create the list {1, 2, 3}, type: 1` 2` 3` 3` „°@)TYPE! ! LIST@. Function ARRY This function is used to create a vector or a matrix. In this section, we will use it to build a vector or a column vector (i.e., a matrix of n rows and 1 column). To build a regular vector we enter the elements of the vector in the stack, and in stack level 1: we enter the vector size as a list, e.g., 1` 2` 3` „ä 3` „°@)TYPE! ! ARRY@.
A new variable, @@RXC@@, will be available in the soft menu labels after pressing J: Press ‚@@RXC@@ to see the program contained in the variable RXC: << OBJ 1 + ARRY >> This variable, @@RXC@@, can now be used to directly transform a row vector to a column vector. In RPN mode, enter the row vector, and then press @@RXC@@. Try, for example: [1,2,3] ` @@RXC@@. After having defined this variable , we can use it in ALG mode to transform a row vector into a column vector.
3 - Press the delete key ƒ (also known as function DROP) to eliminate the number in stack level 1: 4 - Use function LIST to create a list 5 - Use function ARRY to create the row vector These five steps can be put together into a UserRPL program, entered as follows (in RPN mode, still): ‚å„°@)TYPE! @OBJ @ @OBJ @ „°@)STACK @DROP „°@)TYPE! ! LIST@ ! ARRY@ ` ³~~cxr ` K A new variable, @@CXR@@, will be available in the soft menu labels after pressing J: Press ‚@@CXR@@ to see the program contained in the va
resulting in: Transforming a list into a vector To illustrate this transformation, we’ll enter the list {1,2,3} in RPN mode.
After having defined variable @@LXV@@, we can use it in ALG mode to transform a list into a vector. Thus, change your calculator’s mode to ALG and try the following procedure: {1,2,3} ` J @@LXV@@ „Ü „î, resulting in: Transforming a vector (or matrix) into a list To transform a vector into a list, the calculator provides function AXL. You can find this function through the command catalog, as follows: ‚N~~axl~@@OK@@ As an example, apply function AXL to the vector [1,2,3] in RPN mode by using:[1,2,3] ` AXL.
Chapter 10 Creating and manipulating matrices This chapter shows a number of examples aimed at creating matrices in the calculator and demonstrating manipulation of matrix elements. Definitions A matrix is simply a rectangular array of objects (e.g., numbers, algebraics) having a number of rows and columns. A matrix A having n rows and m columns will have, therefore, n×m elements. A generic element of the matrix is represented by the indexed variable aij, corresponding to row i and column j.
Entering matrices in the stack In this section we present two different methods to enter matrices in the calculator stack: (1) using the Matrix Writer, and (2) typing the matrix directly into the stack. Using the Matrix Writer As with the case of vectors, discussed in Chapter 9, matrices can be entered into the stack by using the Matrix Writer. For example, to enter the matrix: − 2.5 4.2 2.0 0.3 1.9 2.8, 2 − 0.1 0.5 first, start the matrix writer by using „².
If you have selected the textbook display option (using H@)DISP! and checking off Textbook), the matrix will look like the one shown above. Otherwise, the display will show: The display in RPN mode will look very similar to these. Note: Details on the use of the matrix writer were presented in Chapter 9. Typing in the matrix directly into the stack The same result as above can be achieved by entering the following directly into the stack: „Ô „Ô 2.5\ ‚í 4.2 ‚í 2 ™ ‚í „Ô .3 ‚í 1.9 ‚í 2.8 ™ ‚í „Ô 2 ‚í .
or in the MATRICES/CREATE menu available through „Ø: The MTH/MATRIX/MAKE sub menu (let’s call it the MAKE menu) contains the following functions: while the MATRICES/CREATE sub-menu (let’s call it the CREATE menu) has the following functions: Page 10-4
As you can see from exploring these menus (MAKE and CREATE), they both have the same functions GET, GETI, PUT, PUTI, SUB, REPL, RDM, RANM, HILBERT, VANDERMONDE, IDN, CON, →DIAG, and DIAG→. The CREATE menu includes the COLUMN and ROW sub-menus, that are also available under the MTH/MATRIX menu. The MAKE menu includes the functions SIZE, that the CREATE menu does not include. Basically, however, both menus, MAKE and CREATE, provide the user with the same set of functions.
Functions GET and PUT Functions GET, GETI, PUT, and PUTI, operate with matrices in a similar manner as with lists or vectors, i.e., you need to provide the location of the element that you want to GET or PUT. However, while in lists and vectors only one index is required to identify an element, in matrices we need a list of two indices {row, column} to identify matrix elements. Examples of the use of GET and PUT follow.
Notice that the screen is prepared for a subsequent application of GETI or GET, by increasing the column index of the original reference by 1, (i.e., from {2,2} to {2,3}), while showing the extracted value, namely A(2,2) = 1.9, in stack level 1. Now, suppose that you want to insert the value 2 in element {3 1} using PUTI. Still in RPN mode, try the following keystrokes: ƒ ƒ{3 1} ` 2 ` PUTI.
Function TRN Function TRN is used to produce the transconjugate of a matrix, i.e., the transpose (TRAN) followed by its complex conjugate (CONJ). For example, the following screen shot shows the original matrix in variable A and its transpose, shown in small font display (see Chapter 1): If the argument is a real matrix, TRN simply produces the transpose of the real matrix. Try, for example, TRN(A), and compare it with TRAN(A). In RPN mode, the transconjugate of matrix A is calculated by using @@@A@@@ TRN.
value. Function CON generates a matrix with constant elements. For example, in ALG mode, the following command creates a 4×3 matrix whose elements are all equal to –1.5: In RPN mode this is accomplished by using {4,3} ` 1.5 \ ` CON. Function IDN Function IDN (IDeNtity matrix) creates an identity matrix given its size. Recall that an identity matrix has to be a square matrix, therefore, only one value is required to describe it completely.
Function RDM Function RDM (Re-DiMensioning) is used to re-write vectors and matrices as matrices and vectors. The input to the function consists of the original vector or matrix followed by a list of a single number, if converting to a vector, or two numbers, if converting to a matrix. In the former case the number represents the vector’s dimension, in the latter the number of rows and columns of the matrix.
If using RPN mode, we assume that the matrix is in the stack and use {6} ` RDM. Note: Function RDM provides a more direct and efficient way to transform lists to arrays and vice versa, than that provided at the end of Chapter 9. Function RANM Function RANM (RANdom Matrix) will generate a matrix with random integer elements given a list with the number of rows and columns (i.e., the dimensions of the matrix).
want to extract elements a12, a13, a22, and a23 from the last result, as a 2×2 sub-matrix, in ALG mode, use: In RPN mode, assuming that the original 2×3 matrix is already in the stack, use {1,2} ` {2,3} ` SUB. Function REPL Function REPL replaces or inserts a sub-matrix into a larger one. The input for this function is the matrix where the replacement will take place, the location where the replacement begins, and the matrix to be inserted.
Function →DIAG Function →DIAG takes the main diagonal of a square matrix of dimensions n×n, and creates a vector of dimension n containing the elements of the main diagonal. For example, for the matrix remaining from the previous exercise, we can extract its main diagonal by using: In RPN mode, with the 3×3 matrix in the stack, we simply have to activate function DIAG to obtain the same result as above.
so the main diagonal included only the elements in positions (1,1) and (2,2). Thus, only the first two elements of the vector were required to form the main diagonal. Function VANDERMONDE Function VANDERMONDE generates the Vandermonde matrix of dimension n based on a given list of input data. The dimension n is, of course, the length of the list.
The Hilbert matrix has application in numerical curve fitting by the method of linear squares. A program to build a matrix out of a number of lists In this section we provide a couple of UserRPL programs to build a matrix out of a number of lists of objects. The lists may represent columns of the matrix (program @CRMC) or rows of the matrix (program @CRMR). The programs are entered with the calculator set to RPN mode, and the instructions for the keystrokes are given for system flag 117 set to SOFT menus.
„°@)BRCH! @)FOR@! @NEXT „°@)BRCH! @)@IF@ @@IF@@ ~ „n #1 „°@)TEST! @@@>@@@ „°@)BRCH! @@IF@ @THEN 1# ~ „n #1„°@)BRCH! @)FOR@! @FOR@ ~ „j # ~ „j #1+ „°@)STACK! L@ROLL! „°@)BRCH! @)FOR@! @NEXT! „°@)BRCH! )@@IF@! @END@ ~„n # „´@)MATRX! @)COL! @COL! NEXT IF n1 > THEN 1 n1FOR j j1+ ROLL NEXT END n COL ` Program is displayed in level 1 To save the program: ³~~crmc~ K Note: if you save this program in your HOME directory it will be available from any other sub-directory you use.
To use the program in ALG mode, press @CRMC followed by a set of parentheses („Ü). Within the parentheses type the lists of data representing the columns of the matrix, separated by commas, and finally, a comma, and the number of columns.
Manipulating matrices by columns The calculator provides a menu with functions for manipulating matrices by operating in their columns. This menu is available through the MTH/MATRIX/COL.. sequence: („´) shown in the figure below with system flag 117 set to CHOOSE boxes: or through the MATRICES/CREATE/COLUMN sub-menu: Both approaches will show the same functions: When system flag 117 is set to SOFT menus, the COL menu is accessible through „´!)MATRX !)@MAKE@ !)@@COL@ , or through „Ø!)@CREAT@ !)@@COL@ .
decomposed in columns. To see the full result, use the line editor (triggered by pressing ˜). In RPN mode, you need to list the matrix in the stack, and the activate function COL, i.e., @@@A@@@ COL. The figure below shows the RPN stack before and after the application of function COL. In this result, the first column occupies the highest stack level after decomposition, and stack level 1 is occupied by the number of columns of the original matrix. The matrix does not survive decomposition, i.e.
as columns in the resulting matrix. The following figure shows the RPN stack before and after using function COL . Function COL+ Function COL+ takes as argument a matrix, a vector with the same length as the number of rows in the matrix, and an integer number n representing the location of a column. Function COL+ inserts the vector in column n of the matrix. For example, in ALG mode, we’ll insert the second column in matrix A with the vector [-1,-2,-3], i.e.
In RPN mode, place the matrix in the stack first, then enter the number representing a column location before applying function COL-. The following figure shows the RPN stack before and after applying function COL-. Function CSWP Function CSWP (Column SWaP) takes as arguments two indices, say, i and j, (representing two distinct columns in a matrix), and a matrix, and produces a new matrix with columns i and j swapped. The following example, in ALG mode, shows an application of this function.
MTH/MATRIX/ROW.. sequence: („´) shown in the figure below with system flag 117 set to CHOOSE boxes: or through the MATRICES/CREATE/ROW sub-menu: Both approaches will show the same functions: When system flag 117 is set to SOFT menus, the ROW menu is accessible through „´!)MATRX !)@MAKE@ !)@@ROW@ , or through „Ø!)@CREAT@ !)@@ROW@ . Both approaches will show the same set of functions: The operation of these functions is presented below.
In RPN mode, you need to list the matrix in the stack, and the activate function ROW, i.e., @@@A@@@ ROW. The figure below shows the RPN stack before and after the application of function ROW. In this result, the first row occupies the highest stack level after decomposition, and stack level 1 is occupied by the number of rows of the original matrix. The matrix does not survive decomposition, i.e., it is no longer available in the stack.
Function ROW+ Function ROW+ takes as argument a matrix, a vector with the same length as the number of rows in the matrix, and an integer number n representing the location of a row. Function ROW+ inserts the vector in row n of the matrix. For example, in ALG mode, we’ll insert the second row in matrix A with the vector [-1,-2,-3], i.e., In RPN mode, enter the matrix first, then the vector, and the row number, before applying function ROW+.
Function RSWP Function RSWP (Row SWaP) takes as arguments two indices, say, i and j, (representing two distinct rows in a matrix), and a matrix, and produces a new matrix with rows i and j swapped. The following example, in ALG mode, shows an application of this function. We use the matrix stored in variable A for the example. This matrix is listed first. In RPN mode, function CSWP lets you swap the rows of a matrix listed in stack level 3, whose indices are listed in stack levels 1 and 2.
This same exercise done in RPN mode is shown in the next figure. The lefthand side figure shows the setting up of the matrix, the factor and the row number, in stack levels 3, 2, and 1. The right-hand side figure shows the resulting matrix after function RCI is activated. Function RCIJ Function RCIJ stands for “take Row I and multiplying it by a constant C and then add that multiplied row to row J, replacing row J with the resulting sum.
Chapter 11 Matrix Operations and Linear Algebra In Chapter 10 we introduced the concept of a matrix and presented a number of functions for entering, creating, or manipulating matrices. In this Chapter we present examples of matrix operations and applications to problems of linear algebra. Operations with matrices Matrices, like other mathematical objects, can be added and subtracted. They can be multiplied by a scalar, or among themselves.
Addition and subtraction Consider a pair of matrices A = [aij]m×n and B = [bij]m×n. Addition and subtraction of these two matrices is only possible if they have the same number of rows and columns. The resulting matrix, C = A ± B = [cij]m×n has elements cij = aij ± bij. Some examples in ALG mode are shown below using the matrices stored above (e.g.
By combining addition and subtraction with multiplication by a scalar we can form linear combinations of matrices of the same dimensions, e.g., In a linear combination of matrices, we can multiply a matrix by an imaginary number to obtain a matrix of complex numbers, e.g., Matrix-vector multiplication Matrix-vector multiplication is possible only if the number of columns of the matrix is equal to the length of the vector.
Vector-matrix multiplication, on the other hand, is not defined. This multiplication can be performed, however, as a special case of matrix multiplication as defined next. Matrix multiplication Matrix multiplication is defined by Cm×n = Am×p⋅Bp×n, where A = [aij]m×p, B = [bij]p×n, and C = [cij]m×n. Notice that matrix multiplication is only possible if the number of columns in the first operand is equal to the number of rows of the second operand.
The product of a vector with a matrix is possible if the vector is a row vector, i.e., a 1×m matrix, which multiplied with a matrix m×n produces a 1xn matrix (another row vector). For the calculator to identify a row vector, you must use double brackets to enter it, e.g., Term-by-term multiplication Term-by-term multiplication of two matrices of the same dimensions is possible through the use of function HADAMARD. The result is, of course, another matrix of the same dimensions.
The inverse matrix The inverse of a square matrix A is the matrix A-1 such that A⋅A-1 = A-1⋅A = I, where I is the identity matrix of the same dimensions as A. The inverse of a matrix is obtained in the calculator by using the inverse function, INV (i.e., the Y key).
These functions are described next. Because many of these functions use concepts of matrix theory, such as singular values, rank, etc., we will include short descriptions of these concepts intermingled with the description of functions. Function ABS Function ABS calculates what is known as the Frobenius norm of a matrix.
Singular value decomposition To understand the operation of Function SNRM, we need to introduce the concept of matrix decomposition. Basically, matrix decomposition involves the determination of two or more matrices that, when multiplied in a certain order (and, perhaps, with some matrix inversion or transposition thrown in), produce the original matrix.
Function SRAD Function SRAD determines the Spectral RADius of a matrix, defined as the largest of the absolute values of its eigenvalues. For example, Definition of eigenvalues and eigenvectors of a matrix The eigenvalues of a square matrix result from the matrix equation A⋅x = λ⋅x. The values of λ that satisfy the equation are known as the eigenvalues of the matrix A. The values of x that result from the equation for each value of l are known as the eigenvectors of the matrix.
The condition number of a singular matrix is infinity. The condition number of a non-singular matrix is a measure of how close the matrix is to being singular. The larger the value of the condition number, the closer it is to singularity. (A singular matrix is one for which the inverse does not exist). Try the following exercise for matrix condition number on matrix A33. The condition number is COND(A33) , row norm, and column norm for A33 are shown to the left.
where the values dj are constant, we say that ck is linearly dependent on the columns included in the summation. (Notice that the values of j include any value in the set {1, 2, …, n}, in any combination, as long as j≠k.) If the expression shown above cannot be written for any of the column vectors then we say that all the columns are linearly independent. A similar definition for the linear independence of rows can be developed by writing the matrix as a column of row vectors.
The determinant of a matrix The determinant of a 2x2 and or a 3x3 matrix are represented by the same arrangement of elements of the matrices, but enclosed between vertical lines, i.e., a11 a 21 a12 , a 22 a11 a 21 a31 a12 a 22 a32 a13 a 23 a33 A 2×2 determinant is calculated by multiplying the elements in its diagonal and adding those products accompanied by the positive or negative sign as indicated in the diagram shown below.
For square matrices of higher order determinants can be calculated by using smaller order determinant called cofactors. The general idea is to “expand” a determinant of a n×n matrix (also referred to as a n×n determinant) into a sum of the cofactors, which are (n-1)×(n-1) determinants, multiplied by the elements of a single row or column, with alternating positive and negative signs.
Function TRAN Function TRAN returns the transpose of a real or the conjugate transpose of a complex matrix. TRAN is equivalent to TRN. The operation of function TRN was presented in Chapter 10.
Function AXL Function AXL converts an array (matrix) into a list, and vice versa. For examples, Note: the latter operation is similar to that of the program CRMR presented in Chapter 10. Function AXM Function AXM converts an array containing integer or fraction elements into its corresponding decimal, or approximate, form. For example, Function LCXM Function LCXM can be used to generate matrices such that the element aij is a function of i and j.
The implementation of function LCXM for this case requires you to enter: 2`3`‚@@P1@@ LCXM ` The following figure shows the RPN stack before and after applying function LCXM: In ALG mode, this example can be obtained by using: The program P1 must still have been created and stored in RPN mode. Solution of linear systems A system of n linear equations in m variables can be written as a11⋅x1 + a12⋅x2 + a13⋅x3 + …+ a21⋅x1 + a22⋅x2 + a23⋅x3 + …+ a31⋅x1 + a32⋅x2 + a33⋅x3 + …+ . . . … . . .
Using the numerical solver for linear systems There are many ways to solve a system of linear equations with the calculator. One possibility is through the numerical solver ‚Ï. From the numerical solver screen, shown below (left), select the option 4. Solve lin sys.., and press @@@OK@@@. The following input form will be provide (right): To solve the linear system A⋅x = b, enter the matrix A, in the format [[ a11, a12, … ], … [….]] in the A: field. Also, enter the vector b in the B: field.
To enter matrix A you can activate the Matrix Writer while the A: field is selected. The following screen shows the Matrix Writer used for entering matrix A, as well as the input form for the numerical solver after entering matrix A (press ` in the Matrix Writer): Press ˜ to select the B: field. The vector b can be entered as a row vector with a single set of brackets, i.e., [13,-13,-6] @@@OK@@@ .
Under-determined system The system of linear equations 2x1 + 3x2 –5x3 = -10, x1 – 3x2 + 8x3 = 85, can be written as the matrix equation A⋅x = b, if x1 2 3 − 5 A= , x = x2 , and 1 − 3 8 x3 − 10 b= . 85 This system has more unknowns than equations, therefore, it is not uniquely determined. We can visualize the meaning of this statement by realizing that each of the linear equations represents a plane in the three-dimensional Cartesian coordinate system (x1, x2, x3).
To see the details of the solution vector, if needed, press the @EDIT! button. This will activate the Matrix Writer. Within this environment, use the rightand left-arrow keys to move about the vector, e.g., Thus, the solution is x = [15.373, 2.4626, 9.6268]. To return to the numerical solver environment, press `. The procedure that we describe next can be used to copy the matrix A and the solution vector X into the stack.
Let’s store the latest result in a variable X, and the matrix into variable A, as follows: Press K~x` to store the solution vector into variable X Press ƒ ƒ ƒ to clear three levels of the stack Press K~a` to store the matrix into variable A Now, let’s verify the solution by using: @@@A@@@ * @@@X@@@ `, which results in (press ˜ to see the vector elements): [-9.99999999999 85. ], close enough to the original vector b = [-10 85]. Try also this, @@A@@@ * [15,10/3,10] ` ‚ï`, i.e.
can be written as the matrix equation A⋅x = b, if 3 1 x A = 2 − 5, x = 1 , and x2 − 1 1 15 b = 5 . 22 This system has more equations than unknowns (an over-determined system). The system does not have a single solution. Each of the linear equations in the system presented above represents a straight line in a two-dimensional Cartesian coordinate system (x1, x2).
Press ` to return to the numerical solver environment. To check that the solution is correct, try the following: • • • • • • Press Press Press Press Press Press ——, to highlight the A: field. L @CALC@ `, to copy matrix A onto the stack. @@@OK@@@ to return to the numerical solver environment. ˜ ˜@CALC@ `, to copy solution vector X onto the stack. @@@OK@@@ to return to the numerical solver environment. ` to return to the stack.
• • • If A is a square matrix and A is non-singular (i.e., it’s inverse matrix exist, or its determinant is non-zero), LSQ returns the exact solution to the linear system. If A has less than full row rank (underdetermined system of equations), LSQ returns the solution with the minimum Euclidean length out of an infinity number of solutions. If A has less than full column rank (over-determined system of equations), LSQ returns the "solution" with the minimum residual value e = A⋅x – b.
Under-determined system Consider the system 2x1 + 3x2 –5x3 = -10, x1 – 3x2 + 8x3 = 85, with x1 2 3 − 5 A= , x = x 2 , and 1 − 3 8 x3 − 10 b= . 85 The solution using LSQ is shown next: Over-determined system Consider the system x1 + 3x2 = 15, 2x1 – 5x2 = 5, -x1 + x2 = 22, with 3 1 x A = 2 − 5, x = 1 , and x2 − 1 1 15 b = 5 .
Compare these three solutions with the ones calculated with the numerical solver. Solution with the inverse matrix The solution to the system A⋅x = b, where A is a square matrix is x = A-1⋅ b. This results from multiplying the first equation by A-1, i.e., A-1⋅A⋅x = A-1⋅b. By definition, A-1⋅A = I, thus we write I⋅x = A-1⋅b. Also, I⋅x = x, thus, we have, x = A-1⋅ b.
previous section. The procedure for the case of “dividing” b by A is illustrated below for the case 2x1 + 3x2 –5x3 = 13, x1 – 3x2 + 8x3 = -13, 2x1 – 2x2 + 4x3 = -6, The procedure is shown in the following screen shots: The same solution as found above with the inverse matrix.
The sub-indices in the variable names X, Y, and Z, determine to which equation system they refer to. To solve this expanded system we use the following procedure, in RPN mode, [[14,9,-2],[2,-5,2],[5,19,12]] ` [[1,2,3],[3,-2,1],[4,2,-1]] `/ The result of this operation is: 2 1 2 X = 2 5 1 .
To start the process of forward elimination, we divide the first equation (E1) by 2, and store it in E1, and show the three equations again to produce: Next, we replace the second equation E2 by (equation 2 – 3×equation 1, i.e., E1-3×E2), and the third by (equation 3 – 4×equation 1), to get Next, divide the second equation by –8, to get Next, replace the third equation, E3, with (equation 3 + 6×equation 2, i.e.
Y+ Z = 3, -7Z = -14. The process of backward substitution in Gaussian elimination consists in finding the values of the unknowns, starting from the last equation and working upwards. Thus, we solve for Z first: Next, we substitute Z=2 into equation 2 (E2), and solve E2 for Y: Next, we substitute Z=2 and Y = 1 into E1, and solve E1 for X: The solution is, therefore, X = -1, Y = 1, Z = 2.
A aug 2 4 6 14 = 3 − 2 1 − 3 4 2 −1 − 4 The matrix Aaug is the same as the original matrix A with a new row, corresponding to the elements of the vector b, added (i.e., augmented) to the right of the rightmost column of A. Once the augmented matrix is put together, we can proceed to perform row operations on it that will reduce the original A matrix into an upper-triangular matrix. For this exercise, we will use the RPN mode (H\@@OK@@), with system flag 117 set to SOFT menu.
If you were performing these operations by hand, you would write the following: 2 4 6 14 1 2 3 7 A aug = 3 − 2 1 − 3 ≅ 3 − 2 1 − 3 4 2 −1 − 4 4 2 −1 − 4 1 2 3 7 1 2 3 7 A aug ≅ 0 − 8 − 8 − 24 ≅ 0 1 1 3 0 − 6 − 13 − 32 0 − 6 − 13 − 32 A aug 1 2 3 7 ≅ 0 1 1 3 0 0 − 7 − 14 The symbol ≅ (“ is equivalent to”) indicates that what follows is equivalent to the previous matrix with some row (or column) operations involved
Multiply row 3 by –3, add it to row 1, replacing it: 3\#3#1@RCIJ! Multiply row 2 by –2, add it to row 1, replacing it: 2\#2#1 @RCIJ! Writing this process by hand will result in the following steps: 1 2 3 7 1 2 3 7 1 2 3 7 3 ≅ 0 1 1 3 ≅ 0 1 1 1 A aug = 0 1 1 0 0 − 7 − 14 0 0 1 2 0 0 1 2 Aaug 1 2 0 1 1 0 0 − 1 ≅ 0 1 0 1 ≅ 0 1 0 1 .
pivoting operations. When row and column exchanges are allowed in pivoting, the procedure is known as full pivoting. When exchanging rows and columns in partial or full pivoting, it is necessary to keep track of the exchanges because the order of the unknowns in the solution is altered by those exchanges. One way to keep track of column exchanges in partial or full pivoting mode, is to create a permutation matrix P = In×n, at the beginning of the procedure.
First, we check the pivot a11. We notice that the element with the largest absolute value in the first row and first column is the value of a31 = 8. Since we want this number to be the pivot, then we exchange rows 1 and 3, by using: 1#3L @RSWP. The augmented matrix and the permutation matrix now are: 8 16 -1 41 0 0 1 2 0 3 -1 0 1 0 1 2 3 2 0 0 1 Checking the pivot at position (1,1) we now find that 16 is a better pivot than 8, thus, we perform a column swap as follows: 1#2‚N @@OK@@ @RSWP.
0 0 3 25/8 2 0 -1 -25/82 1 0 0 0 0 1 Checking the pivot at position (2,2), we now find that the value of 25/8, at position (3,2), is larger than 3.
Finally, we eliminate the –1/16 from position (1,2) by using: 16 Y # 2#1@RCIJ 1 0 0 2 0 1 0 0 1 0 -1 0 0 1 0 0 1 1 1 0 0 We now have an identity matrix in the portion of the augmented matrix corresponding to the original coefficient matrix A, thus we can proceed to obtain the solution while accounting for the row and column exchanges coded in the permutation matrix P.
Then, for this particular example, in RPN mode, use: [2,-1,41] ` [[1,2,3],[2,0,3],[8,16,-1]] `/ The calculator shows an augmented matrix consisting of the coefficients matrix A and the identity matrix I, while, at the same time, showing the next procedure to calculate: L2 = L2-2⋅L1 stands for “replace row 2 (L2) with the operation L2 – 2⋅L1. If we had done this operation by hand, it would have corresponded to: 2\#1#1@RCIJ. Press @@@OK@@@, and follow the operations in your calculator’s screen.
To see the intermediate steps in calculating and inverse, just enter the matrix A from above, and press Y, while keeping the step-by-step option active in the calculator’s CAS. Use the following: [[ 1,2,3],[3,-2,1],[4,2,-1]] `Y After going through the different steps, the solution returned is: What the calculator showed was not exactly a Gauss-Jordan elimination with full pivoting, but a way to calculate the inverse of a matrix by performing a Gauss-Jordan elimination, without pivoting.
Based on the equation A-1 = C/det(A), sketched above, the inverse matrix, A-1, is not defined if det(A) = 0. Thus, the condition det(A) = 0 defines also a singular matrix. Solution to linear systems using calculator functions The simplest way to solve a system of linear equations, A⋅x = b, in the calculator is to enter b, enter A, and then use the division function /.
to produce the solution: [X=-1,Y=2,Z = -3]. Function LINSOLVE works with symbolic expressions. Functions REF, rref, and RREF, work with the augmented matrix in a Gaussian elimination approach. Functions REF, rref, RREF The upper triangular form to which the augmented matrix is reduced during the forward elimination part of a Gaussian elimination procedure is known as an "echelon" form. Function REF (Reduce to Echelon Form) produces such a matrix given the augmented matrix in stack level 1.
The diagonal matrix that results from a Gauss-Jordan elimination is called a row-reduced echelon form. Function RREF ( Row-Reduced Echelon Form) The results of this function call is to produce the row-reduced echelon form so that the matrix of coefficients is reduced to an identity matrix. The extra column in the augmented matrix will contain the solution to the system of equations.
The result is the augmented matrix corresponding to the system of equations: X+Y = 0 X-Y =2 Residual errors in linear system solutions (Function RSD) Function RSD calculates the ReSiDuals or errors in the solution of the matrix equation A⋅x=b, representing a system of n linear equations in n unknowns. We can think of solving this system as solving the matrix equation: f(x) = b A⋅x = 0. Suppose that, through a numerical method, we produce as a first approximation the solution x(0).
Eigenvalues and eigenvectors Given a square matrix A, we can write the eigenvalue equation A⋅x = λ⋅x, where the values of λ that satisfy the equation are known as the eigenvalues of matrix A. For each value of λ, we can find, from the same equation, values of x that satisfy the eigenvalue equation. These values of x are known as the eigenvectors of matrix A. The eigenvalues equation can be written also as (A – λ⋅I)x = 0.
Using the variable λ to represent eigenvalues, this characteristic polynomial is to be interpreted as λ 3-2λ 2-22λ +21=0. Function EGVL Function EGVL (EiGenVaLues) produces the eigenvalues of a square matrix. For example, the eigenvalues of the matrix shown below are calculated in ALG mode using function EGVL: The eigenvalues λ = [ -√10, √10 ].
Change mode to Approx and repeat the entry, to get the following eigenvalues: [(1.38,2.22), (1.38,-2.22), (-1.76,0)]. Function EGV Function EGV (EiGenValues and eigenvectors) produces the eigenvalues and eigenvectors of a square matrix. The eigenvectors are returned as the columns of a matrix, while the corresponding eigenvalues are the components of a vector.
Function JORDAN Function JORDAN is intended to produce the diagonalization or Jordan-cycle decomposition of a matrix.
In RPN mode, function MAD generate a number of properties of a square matrix, namely: • • • • the determinant (stack level 4) the formal inverse (stack level 3), in stack level 2, the matrix coefficients of the polynomial p(x) defined by (x⋅I-A) ⋅p(x)=m(x)⋅I, the characteristic polynomial of the matrix (stack level 1) Notice that the equation (x⋅I-A)⋅p(x)=m(x)⋅I is similar, in form, to the eigenvalue equation A⋅x = λ⋅x.
Function contained in this menu are: LQ, LU, QR,SCHUR, SVD, SVL. Function LU Function LU takes as input a square matrix A, and returns a lower-triangular matrix L, an upper triangular matrix U, and a permutation matrix P, in stack levels 3, 2, and 1, respectively. The results L, U, and P, satisfy the equation P⋅A = L⋅U. When you call the LU function, the calculator performs a Crout LU decomposition of A using partial pivoting.
The Singular Value Decomposition (SVD) of a rectangular matrix Am×n consists in determining the matrices U, S, and V, such that Am×n = U m×m ⋅S m×n ⋅V T n×n, where U and V are orthogonal matrices, and S is a diagonal matrix. The diagonal elements of S are called the singular values of A and are usually ordered so that si ≥ si+1, for i = 1, 2, …, n-1. The columns [uj] of U and [vj] of V are the corresponding singular vectors.
1: [[-1.03 1.02 3.86 ][ 0 5.52 8.23 ][ 0 –1.82 5.52]] Function LQ The LQ function produces the LQ factorization of a matrix An×m returning a lower Ln×m trapezoidal matrix, a Qm×m orthogonal matrix, and a Pn×n permutation matrix, in stack levels 3, 2, and 1. The matrices A, L, Q and P are related by P⋅A = L⋅Q. (A trapezoidal matrix out of an n×m matrix is the equivalent of a triangular matrix out of an n×n matrix). For example, [[ 1, -2, 1][ 2, 1, -2][ 5, -2, 1]] LQ produces 3: [[-5.48 0 0][-1.10 –2.
2 1 − 1 X x ⋅ A ⋅ x = [ X Y Z ] ⋅ 5 4 2 ⋅ Y 3 5 − 1 Z 2X + Y − Z = [ X Y Z ] ⋅ 5 X + 4Y + 2 Z 3 X + 5Y − Z T x⋅A⋅xT = 2X2+4Y2-Z2+6XY+2XZ+7ZY Finally, The QUADF menu The HP 49 G calculator provides the QUADF menu for operations related to QUADratic Forms. The QUADF menu is accessed through „Ø. This menu includes functions AXQ, CHOLESKY, GAUSS, QXA, and SYLVESTER.
Function QXA Function QXA takes as arguments a quadratic form in stack level 2 and a vector of variables in stack level 1, returning the square matrix A from which the quadratic form is derived in stack level 2, and the list of variables in stack level 1.
• The list of variables (stack level 1) For example, 'X^2+Y^2-Z^2+4*X*Y-16*X*Z' ` ['X','Y','Z'] ` GAUSS returns 4: 3: 2: 1: [1 –0.333 20.333] [[1 2 –8][0 –3 16][0 0 1]] ’61/3*Z^2+ -1/3*(16*Z+-3*Y)^2+(-8*z+2*Y+X)^2‘ [‘X’ ‘Y’ ‘Z’] Linear Applications The LINEAR APPLICATIONS menu is available through the „Ø. Information on the functions listed in this menu is presented below by using the calculator’s own help facility. The figures show the help facility entry and the attached examples.
Function KER Function MKISOM Page 11-55
Chapter 12 Graphics In this chapter we introduce some of the graphics capabilities of the calculator. We will present graphics of functions in Cartesian coordinates and polar coordinates, parametric plots, graphics of conics, bar plots, scatterplots, and a variety of three-dimensional graphs.
These graph options are described briefly next.
return to normal calculator display. The PLOT SET UP window should look similar to this: • Note: You will notice that a new variable, called PPAR, shows up in your soft menu key labels. This stands for Plot PARameters. To see its contents, press ‚@PPAR. A detailed explanation of the contents of PPAR is provided later in this Chapter. Press ƒ to drop this line from the stack. • Enter the PLOT environment by pressing „ñ(press them simultaneously if in RPN mode).
<< →X ‘EXP(-X^2/2)/ √(2*π)‘ >>. Press ƒ, twice, to drop the contents of the stack. • Enter the PLOT WINDOW environment by entering „ò (press them simultaneously if in RPN mode). Use a range of –4 to 4 for HVIEW, then press @AUTO to generate the V-VIEW automatically. The PLOT WINDOW screen looks as follows: • Plot the graph: @ERASE @DRAW (wait till the calculator finishes the graphs) To see labels: @EDIT L @LABEL @MENU To recover the first graphics menu: LL@)PICT To trace the curve: @TRACE @@X,Y@@ .
Some useful PLOT operations for FUNCTION plots In order to discuss these PLOT options, we'll modify the function to force it to have some real roots (Since the current curve is totally contained above the x axis, it has no real roots.) Press ‚@@@Y1@@ to list the contents of the function Y1 on the stack: << →X ‘EXP(-X^2/2)/ √(2*π) ‘ >>. To edit this expression use: ˜ ‚˜ ššš-0.
• • • • • • • • If you move the cursor towards the right-hand side of the curve, by pressing the right-arrow key (™), and press @ROOT, the result now is ROOT: 1.6635... The calculator indicated, before showing the root, that it was found through SIGN REVERSAL. Press L to recover the menu. Pressing @ISECT will give you the intersection of the curve with the xaxis, which is essentially the root. Place the cursor exactly at the root and press @ISECT.
• • curves intercept at two points. Move the cursor near the left intercept point and press @)@FCN! @ISECT, to get I-SECT: (-0.6834…,0.21585). Press L to recover the menu. To leave the FCN environment, press @)PICT (or L)PICT). Press @CANCL to return to the PLOT WINDOW environment. Then, press L @@@OK@@@ to return to normal calculator display. Note: the stack will show all the graph operations performed, properly identified. • • Enter the PLOT environment by pressing, simultaneously if in RPN mode, „ñ.
Move the cursor to the upper left corner of the display, by using the š and — keys. To display the figure currently in level 1 of the stack press L REPL . To return to normal calculator function, press @)PICT @CANCL. Note: To save printing space, we will not include more graphs produced by following the instructions in this Chapter. The user is invited to produce those graphics on his or her own.
equation writer with the expression Y1(X)= . Type LN(X). Press ` to return to the PLOT-FUNCTION window. Press L@@@OK@@@ to return to normal calculator display. The next step is to press, simultaneously if in RPN mode, the left-shift key „ and the ò(B) key to produce the PLOT WINDOW - FUNCTION window. Most likely, the display will show the horizontal (H-View) and vertical (V-View) ranges as: H-View: -6.5 6.5, V-View: -3.1 3.
Note: When you press J , your variables list will show new variables called @@@X@@ and @@Y1@@ . Press ‚@@Y1@@ to see the contents of this variable. You will get the program << → X ‘LN(X)’ >> , which you will recognize as the program that may result from defining the function ‘Y1(X) = LN(X)’ by using „à. This is basically what happens when you @@ADD@! a function in the PLOT – FUNCTION window (the window that results from pressing ñ, simultaneously if in RPN mode), i.e.
To add labels to the graph press @EDIT L@)LABEL. Press @MENU to remove the menu labels, and get a full view of the graph. Press LL@)PICT! @CANCL to return to the PLOT WINDOW – FUNCTION. Press ` to return to normal calculator display. The PPAR variable Press J to recover your variables menu, if needed. In your variables menu you should have a variable labeled PPAR . Press ‚@PPAR to get the contents of this variable in the stack.
Inverse functions and their graphs Let y = f(x), if we can find a function y = g(x), such that, g(f(x)) = x, then we say that g(x) is the inverse function of f(x). Typically, the notation g(x) = f -1(x) is used to denote an inverse function. Using this notation we can write: if y = f(x), then x = f -1(y). Also, f(f -1(x)) = x, and f -1(f(x)) = x. As indicated earlier, the ln(x) and exp(x) functions are inverse of each other, i.e., ln(exp(x)) = x, and exp(ln(x)) = x.
Press @CANCL to return to the PLOT FUNCTION – WINDOW screen. Modify the vertical and horizontal ranges to read: H-View: -8 8, V-View: -4 4 By selecting these ranges we ensure that the scale of the graph is kept 1 vertical to 1 horizontal. Press @ERASE @DRAW and you will get the plots of the natural logarithm, exponential, and y = x functions. It will be evident from the graph that LN(X) and EXP(X) are reflections of each other about the line y = X. Press @CANCL to return to the PLOT WINDOW – FUNCTION.
Note: the soft menu keys @EDIT and @CHOOS are not available at the same time. One or the other will be selected depending on which input field is highlighted. • • • • • • • Press the AXES soft menu key to select or deselect the plotting of axes in the graph. If the option ‘plot axes’ is selected, a square dot will appear in the key label: @AXES . Absence of the square dot indicates that axes will not be plotted in the graph. Use @ERASE to erase any graph currently existing in the graphics display window.
• • • Use @MOVE° and @MOVE³ to move the selected equation one location up or down, respectively. Use @CLEAR if you want to clear all the equations currently active in the PLOT – FUNCTION window. The calculator will verify whether or not you want to clear all the functions before erasing all of them. Select YES, and press @@@OK@@@ to proceed with clearing all functions. Select NO, and press @@@OK@@@ to de-activate the option CLEAR. Press @@@OK@@@ when done to return to normal calculator display.
• • • • • • • • • • Use @ERASE to erase any graph currently existing in the graphics display window. Use @DRAW to produce the graph according to the current contents of PPAR for the equations listed in the PLOT-FUNCTION window. Press L to activate the second menu list. Use @RESET to reset the field selected (i.e., where the cursor is positioned) to its default value. Use @CALC to access calculator stack to perform calculations that may be necessary to obtain a value for one of the options in this window.
the function Y=X when plotting simultaneously a function and its inverse to verify their ‘reflection’ about the line Y = X. Function SIN(X) ASIN(X) SIN & ASIN COS(X) ACOS(X) COS & ACOS TAN(X) ATAN(X) TAN & ATAN SINH(X) ASINH(X) SINH & ASINH COSH(X) ACOSH(X) COS & ACOS TANH(X) ATANH(X) TAN & ATAN H-View range Minimum Maximum -3.15 3.15 -1.2 1.2 -3.2 3.2 -3.15 3.15 -1.2 1.2 -3.2 3.2 -3.15 3.15 -10 10 -2 -2 -2 2 -5 5 -5 5 -2 2 -1 5 -5 5 -5 5 -1.2 1.2 -5 5 V-View range Minimum Maximum AUTO AUTO -1.6 1.
• • • will be highlighted. If this field is not already set to FUNCTION, press the soft key @CHOOS and select the FUNCTION option, then press @@@OK@@@. Next, press ˜ to highlight the field in front of the option EQ, and type the function expression: ‘X/(X+10)’ To accept the changes made to the PLOT SETUP screen press L @@@OK@@@. You will be returned to normal calculator display. The next step is to access the Table Set-up screen by using the keystroke combination„õ (i.e.
• The @ZOOM key, when pressed, produces a menu with the options: In, Out, Decimal, Integer, and Trig. Try the following exercises: • • • • • • • • With the option In highlighted, press @@@OK@@@. The table is expanded so that the x-increment is now 0.25 rather than 0.5. Simply, what the calculator does is to multiply the original increment, 0.5, by the zoom factor, 0.5, to produce the new increment of 0.25. Thus, the zoom in option is useful when you want more resolution for the values of x in your table.
• • • • • • The cursor is now in the Indep field. Press ³~‚t @@@OK@@@ to change the independent variable to θ. • Press L@@@OK@@@ to return to normal calculator display. • Press „ò, simultaneously if in RPN mode, to access the PLOT window (in this case it will be called PLOT –POLAR window). • Change the H-VIEW range to –8 to 8, by using 8\@@@OK@@@8@@@OK@@@, and the V-VIEW range to -6 to 2 by using 6\@@@OK@@@2@@@OK@@@.
will get the equation ‘2*(1-SIN(θ))’ highlighted. Let’s say, we want to plot also the function ‘2*(1-COS(θ))’ along with the previous equation. • • Press @@ADD@! , and type 2*„Ü1- T~‚t`, to enter the new equation. Press @ERASE @DRAW to see the two equations plotted in the same figure. The result is two intersecting cardioids. Press @CANCL $ to return to normal calculator display. Plotting conic curves The most general form of a conic curve in the x-y plane is: Ax2+By2+Cxy+Dx+Ey+F = 0.
{ ‘(X-1)^2+(Y-2)^2=3’ , ‘X^2/4+Y^2/3=1’ } into the variable EQ. These equations we recognize as those of a circle centered at (1,2) with radius √3, and of an ellipse centered at (0,0) with semi-axis lengths a = 2 and b = √3. • • • • • • • Enter the PLOT environment, by pressing „ô, simultaneously if in RPN mode, and select Conic as the TYPE. The list of equations will be listed in the EQ field. Make sure that the independent variable (Indep) is set to ‘X’ and the dependent variable (Depnd) to ‘Y’.
centered at the origin (0,0), will extend from -2 to 2 in x, and from -√3 to √3 in y. Notice that for the circle and the ellipse the region corresponding to the left and right extremes of the curves are not plotted. This is the case with all circles or ellipses plotted using Conic as the TYPE.
X(t) = X0 + V0*COS(θ0)*t Y(t) = Y0 + V0*SIN(θ0)*t – 0.5*g*t^2 which will add the variables @@@Y@@@ and @@@X@@@ to the soft menu key labels. To produce the graph itself, follow these steps: • Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP window. • Change TYPE to Parametric, by pressing @CHOOS ˜˜@@@OK@@@. • Press ˜ and type ‘X(t) + i*Y(t)’ @@@OK@@@ to define the parametric plot as that of a complex variable.
• • Press @ERASE @DRAW to draw the parametric plot. Press @EDIT L @LABEL @MENU to see the graph with labels. The window parameters are such that you only see half of the labels in the x-axis. • Press L to recover the menu. Press L@)PICT to recover the original graphics menu. Press TRACE @(X,Y)@ to determine coordinates of any point on the graph. Use ™ and š to move the cursor about the curve. At the bottom of the screen you will see the value of the parameter t and coordinates of the cursor as (X,Y).
if in RPN mode). Then, press @ERASE @DRAW. Press @CANCL to return to the PLOT, PLOT WINDOW, or PLOT SETUP screen. Press $, or L@@@OK@@@, to return to normal calculator display. Generating a table for parametric equations In an earlier example we generated a table of values (X,Y) for an expression of the form Y=f(X), i.e., a Function type of graph. In this section, we present the procedure for generating a table corresponding to a parametric plot.
of differential equations of the form Y'(T) = F(T,Y). For our case, we let Y x and T t, therefore, F(T,Y) f(t,x) = exp(-t2). Before plotting the solution, x(t), for t = 0 to 5, delete the variables EQ and PPAR. • • • • • • • • Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP window. Change TYPE to Diff Eq. Press ˜ and type ³„ ¸-~ „tQ2@@@OK@@@. The cursor is now in the H-Var field. It should show H-Var:0 and also VVar:1.
• • • • • • Press L to recover the menu. Press L@)PICT to recover the original graphics menu. When we observed the graph being plotted, you'll notice that the graph is not very smooth. That is because the plotter is using a time step that is too large. To refine the graph and make it smoother, use a step of 0.1. Try the following keystrokes: @CANCL ˜˜˜.1@@@OK@@@ @ERASE @DRAW. The plot will take longer to be completed, but the shape is definitely smoother than before.
Truth plots Truth plots are used to produce two-dimensional plots of regions that satisfy a certain mathematical condition that can be either true or false. For example, suppose that you want to plot the region for X^2/36 + Y^2/9 < 1, proceed as follows: • Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP window. • Change TYPE to Truth. • Press ˜ and type {‘(X^2/36+Y^2/9 < 1)','(X^2/16+Y^2/9 > 1)’} @@@OK@@@ to define the conditions to be plotted. • The cursor is now in the Indep field.
You can have more than one condition plotted at the same time if you multiply the conditions. For example, to plot the graph of the points for which X2/36 + Y2/9 < 1, and X2/16 + Y2/9 > 1, use the following: • • • Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP window. Press ˜ and type ‘(X^2/36+Y^2/9 < 1)⋅ (X^2/16+Y^2/9 > 1)’@@@OK@@@ to define the conditions to be plotted. Press @ERASE @DRAW to draw the truth plot. Again, you have to be patient while the calculator produces the graph.
[[3.1,2.1,1.1],[3.6,3.2,2.2],[4.2,4.5,3.3], [4.5,5.6,4.4],[4.9,3.8,5.5],[5.2,2.2,6.6]] ` to store it in ΣDAT, use the function STOΣ (available in the function catalog, ‚N). Press VAR to recover your variables menu. A soft menu key labeled ΣDAT should be available in the stack. The figure below shows the storage of this matrix in ALG mode: To produce the graph: • • • • • • • • Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP window. Change TYPE to Bar.
• Press @CANCL to return to the PLOT WINDOW environment. Then, press $ , or L@@@OK@@@, to return to normal calculator display. The number of bars to be plotted determines the width of the bar. The H- and V-VIEW are set to 10, by default. We changed the V-VIEW to better accommodate the maximum value in column 1 of ΣDAT. Bar plots are useful when plotting categorical (i.e., non-numerical) data.
• • • • • • • Press ˜˜ to highlight the Cols: field. Enter 1@@@OK@@@ 2@@@OK@@@ to select column 1 as X and column 2 as Y in the Y-vs.-X scatter plot. Press L@@@OK@@@ to return to normal calculator display. Press „ò, simultaneously if in RPN mode, to access the PLOT WINDOW screen. Change the plot window ranges to read: H-View: 0 6, V-View: 0 6. Press @ERASE @DRAW to draw the bar plot.
• • Press LL@)PICT to leave the EDIT environment. Press @CANCL to return to the PLOT WINDOW environment. Then, press $ , or L@@@OK@@@, to return to normal calculator display. Slope fields Slope fields are used to visualize the solutions to a differential equation of the form y’ = f(x,y). Basically, what is presented in the plot are segments tangential to the solution curves, since y’ = dy/dx, evaluated at any point (x,y), represents the slope of the tangent line at point (x,y).
• Press @CANCL to return to the PLOT WINDOW environment. Then, press $ , or L@@@OK@@@, to return to normal calculator display. If you could reproduce the slope field plot in paper, you can trace by hand lines that are tangent to the line segments shown in the plot. This lines constitute lines of y(x,y) = constant, for the solution of y’ = f(x,y). Thus, slope fields are useful tools for visualizing particularly difficult equations to solve.
• • • • Make sure that ‘X’ is selected as the Indep: and ‘Y’ as the Depnd: variables. Press L@@@OK@@@ to return to normal calculator display. Press „ò, simultaneously if in RPN mode, to access the PLOT WINDOW screen. Keep the default plot window ranges to read: X-Left:-1, X-Right:1, Y-Near:-1, Y-Far: 1, Z-Low: -1, Z-High: 1, Step Indep: 10, Depnd: 8 Note: The Step Indep: and Depnd: values represent the number of gridlines to be used in the plot.
• • • When done, press @EXIT. Press @CANCL to return to PLOT WINDOW. Press $ , or L@@@OK@@@, to return to normal calculator display. Try also a Fast 3D plot for the surface z = f(x,y) = sin (x2+y2) • • • • • • Press „ô, simultaneously if in RPN mode, to access the PLOT SETUP window. Press ˜ and type ‘SIN(X^2+Y^2)’ @@@OK@@@. Press @ERASE @DRAW to draw the plot. When done, press @EXIT. Press @CANCL to return to PLOT WINDOW. Press $ , or L@@@OK@@@, to return to normal calculator display.
The coordinates XE, YE, ZE, stand for “eye coordinates,” i.e., the coordinates from which an observer sees the plot. The values shown are the default values. The Step Indep: and Depnd: values represent the number of gridlines to be used in the plot. The larger these number, the slower it is to produce the graph. For the time being we’ll keep the default values of 10 and 8 for the Step data. • • • • • • Press @ERASE @DRAW to draw the three-dimensional surface.
• Press @ERASE @DRAW to see the surface plot. This time the bulk of the plot is located towards the right –hand side of the display. • • Press @CANCL to return to the PLOT WINDOW environment. Press $ , or L@@@OK@@@, to return to normal calculator display. Try also a Wireframe plot for the surface z = f(x,y) = x2+y2 • • • • • Press „ô, simultaneously if in RPN mode, to access the PLOT SETUP window. Press ˜ and type ‘X^2+Y^2’ @@@OK@@@. Press @ERASE @DRAW to draw the slope field plot.
• • • • • • • Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP window. Change TYPE to Ps-Contour. Press ˜ and type ‘X^2+Y^2’ @@@OK@@@. Make sure that ‘X’ is selected as the Indep: and ‘Y’ as the Depnd: variables. Press L@@@OK@@@ to return to normal calculator display. Press „ò, simultaneously if in RPN mode, to access the PLOT WINDOW screen.
• • Press LL@)PICT to leave the EDIT environment. Press @CANCL to return to the PLOT WINDOW environment. Then, press $ , or L@@@OK@@@, to return to normal calculator display. Y-Slice plots Y-Slice plots are animated plots of z-vs.-y for different values of x from the function z = f(x,y). For example, to produce a Y-Slice plot for the surface z = x3-xy3, use the following: • • • • • • • • Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP window. Change TYPE to Y-Slice.
• • • • • Press „ô, simultaneously if in RPN mode, to access the PLOT SETUP window. Press ˜ and type ‘(X+Y)*SIN(Y)’ @@@OK@@@. Press @ERASE @DRAW to produce the Y-Slice animation. Press $ to stop the animation. Press @CANCL to return to the PLOT WINDOW environment. Then, press $ , or L@@@OK@@@, to return to normal calculator display.
• Press $ , or L@@@OK@@@, to return to normal calculator display. Other functions (1) SIN((X,Y)) (3) EXP((X,Y)) (5) TAN((X,Y)) (7) (X,Y)^3 (9) √ (X,Y) of a complex variable worth trying for Gridmap plots are: i.e., F(z) = sin(z) (2)(X,Y)^2 i.e., F(z) = z2 i.e., F(z) = ez (4) SINH((X,Y)) i.e., F(z) = sinh(z) i.e., F(z) = tan(z) (6) ATAN((X,Y)) i.e., F(z) = tan-1(z) 3 i.e., F(z) = z (8) 1/(X,Y) i.e., F(z) = 1/z 1/2 i.e.
• • Press LL@)PICT @CANCL to return to the PLOT WINDOW environment. Press $ , or L@@@OK@@@, to return to normal calculator display. The VPAR variable The VPAR (Volume Parameter) variable contains information regarding the “volume” used to produce a three dimensional graph. Therefore, you will see it produced whenever you create a three dimensional plot such as Fast3D, Wireframe, or Pr-Surface.
points, lines, circles, etc. on the graphics screen, as described below. To see how to use these functions we will try the following exercise: First, we get the graphics screen corresponding to the following instructions: • • • • • • • • • Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP window. Change TYPE to Function, if needed Change EQ to ‘X’ Make sure that Indep: is set to ‘X’ also Press L@@@OK@@@ to return to normal calculator display.
MARK This command allows the user to set a mark point which can be used for a number of purposes, such as: • • • Start of line with the LINE or TLINE command Corner for a BOX command Center for a CIRCLE command Using the MARK command by itself simply leaves an x in the location of the mark (Press L@MARK to see it in action). LINE This command is used to draw a line between two points in the graph. To see it in action, position the cursor somewhere in the first quadrant, and press „«@LINE.
BOX This command is used to draw a box in the graph. Move the cursor to a clear area of the graph, and press @BOX@. This highlights the cursor. Move the cursor with the arrow keys to a point away, and in a diagonal direction, from the current cursor position. Press @BOX@ again. A rectangle is drawn whose diagonal joins the initial and ending cursor positions. The initial position of the box is still marked with and x.
ERASE The function ERASE clears the entire graphics window. This command is available in the PLOT menu, as well as in the plotting windows accessible through the soft menu keys. MENU Pressing @MENU will remove the soft key menu labels to show the graphic unencumbered by those labels. To recover the labels, press L. SUB Use this command to extract a subset of a graphics object. The extracted object is automatically placed in the stack.
Zooming in and out in the graphics display Whenever you produce a two-dimensional FUNCTION graphic interactively, the first soft-menu key, labeled @)ZOOM, lets you access functions that can be used to zoom in and out in the current graphics display. The ZOOM menu includes the following functions (press Lto move to the next menu): We present each of these functions following. You just need to produce a graph as indicated in Chapter 12, or with one of the programs listed earlier in this Chapter.
BOXZ Zooming in and out of a given graph can be performed by using the softmenu key BOXZ. With BOXZ you select the rectangular sector (the “box”) that you want to zoom in into. Move the cursor to one of the corners of the box (using the arrow keys), and press @)ZOOM @BOXZ. Using the arrow keys once more, move the cursor to the opposite corner of the desired zoom box. The cursor will trace the zoom box in the screen. When desired zoom box is selected, press @ZOOM.
ZINTG Zooms the graph so that the pixel units become user-define units. For example, the minimum PICT window has 131 pixels. When you use ZINTG, with the cursor at the center of the screen, the window gets zoomed so that the x-axis extends from –64.5 to 65.5. ZSQR Zooms the graph so that the plotting scale is maintained at 1:1 by adjusting the x scale, keeping the y scale fixed, if the window is wider than taller. This forces a proportional zooming.
ALGEBRA.. ARITHMETIC.. CALCULUS.. SOLVER.. TRIGONOMETRIC.. EXP&LN.. ‚× (the 4 key) „Þ (the 1 key) „Ö (the 4 key) „Î (the 7 key) ‚Ñ (the 8 key) „Ð (the 8 key) Ch. Ch. Ch. Ch. Ch. Ch.
PLOTADD(X^2-X) is similar to „ô but adding this function to EQ: X^2 -1. Using @ERASE @DRAW produces the plot: TABVAL(X^2-1,{1, 3}) produces a list of {min max} values of the function in the interval {1,3}, while SIGNTAB(X^2-1) shows the sign of the function in the interval (-∞,+), with f(x) > 0 in (-∞,-1), f(x) <0, in (-1,1), and f(x) > 0 in (1,+ ∞).
The output is in a graphical format, showing the original function, F(X), the derivative F’(X) right after derivation and after simplification, and finally a table of variation. The table consists of two rows, labeled in the right-hand side. Thus, the top row represents values of X and the second row represents values of F. The question marks indicates uncertainty or non-definition. For example, for X<0, LN(X) is not defined, thus the X lines shows a question mark in that interval.
Chapter 13 Calculus Applications In this Chapter we discuss applications of the calculator’s functions to operations related to Calculus, e.g., limits, derivatives, integrals, power series, etc. The CALC (Calculus) menu Many of the functions presented in this Chapter are contained in the calculator’s CALC menu, available through the keystroke sequence „Ö (associated with the 4 key).
Function lim The calculator provides function lim to calculate limits of functions. This function uses as input an expression representing a function and the value where the limit is to be calculated. Function lim is available through the command catalog (‚N~„l) or through option 2. LIMITS & SERIES… of the CALC menu (see above). Note: The functions available in the LIMITS & SERIES menu are shown next: Function DIVPC is used to divide two polynomials producing a series expansion.
Derivatives The derivative of a function f(x) at x = a is defined as the limit f ( x + h) − f ( x ) df = f ' ( x) = lim h − >0 h dx Some examples of derivatives using this limit are shown in the following screen shots: Functions DERIV and DERVX The function DERIV is used to take derivatives in terms of any independent variable, while the function DERVX takes derivatives with respect to the CAS default variable VX (typically ‘X’).
Out of these functions DERIV and DERVX are used for derivatives. The other functions include functions related to anti-derivatives and integrals (IBP, INTVX, PREVAL, RISCH, SIGMA, and SIGMAVX), to Fourier series (FOURIER),and to vector analysis (CURL, DIV, HESS, LAPL). Next we discuss functions DERIV and DERVX, the remaining functions are presented either later in this Chapter or in subsequent Chapters. Calculating derivatives with ∂ The symbol is available as ‚¿ (the T key).
The insert cursor ( ) will be located right at the denominator awaiting for the user to enter an independent variable, say, s: ~„s. Then, press the right-arrow key (™) to move to the placeholder between parentheses: Next, enter the function to be differentiated, say, s*ln(s): To evaluate the derivative in the Equation Writer, press the up-arrow key —, four times, to select the entire expression, then, press @EVAL.
derivatives, utilizing the same symbol for both. The user must keep this distinction in mind when translating results from the calculator to paper. The chain rule The chain rule for derivatives applies to derivatives of composite functions. A general expression for the chain-rule is d{f[g(x)]}/dx = (df/dg)⋅ (dg/dx).
Notice that in the expressions where the derivative sign (∂) or function DERIV was used, the equal sign is preserved in the equation, but not in the cases where function DERVX was used. In these cases, the equation was re-written with all its terms moved to the left-hand side of the equal sign. Also, the equal sign was removed, but it is understood that the resulting expression is equal to zero.
maxima) of the function, to plot the derivative, and to find the equation of the tangent line. Try the following example for the function y = tan(x). • Press „ô, simultaneously in RPN mode, to access to the PLOT SETUP window. • Change TYPE to FUNCTION, if needed, by using [@CHOOS]. • Press ˜ and type in the equation ‘TAN(X)’. • Make sure the independent variable is set to ‘X’. • Press L @@@OK@@@ to return to normal calculator display.
• Press L @PICT @CANCL $ to return to normal calculator display. Notice that the slope and tangent line that you requested are listed in the stack. Function DOMAIN Function DOMAIN, available through the command catalog (‚N), provides the domain of definition of a function as a list of numbers and specifications. For example, indicates that between –∞ and 0, the function LN(X) is not defined (?), while from 0 to +∞, the function is defined (+).
This result indicates that the range of the function f (X ) = 1 X 2 +1 2 26 , . 2 26 corresponding to the domain D = { -1,5 } is R = Function SIGNTAB Function SIGNTAB, available through the command catalog (‚N), provides information on the sign of a function through its domain. For example, for the TAN(X) function, SIGNTAB indicates that TAN(X) is negative between –π/2 and 0, and positive between 0 and π /2.
• Two lists, the first one indicates the variation of the function (i.e., where it increases or decreases) in terms of the independent variable VX, the second one indicates the variation of the function in terms of the dependent variable. • A graphic object showing how the variation table was computed. Example: Analyze the function Y = X3-4X2-11X+30, using the function TABVAR.
The interpretation of the variation table shown above is as follows: the function F(X) increases for X in the interval (-∞, -1), reaching a maximum equal to 36 at X = -1. Then, F(X) decreases until X = 11/3, reaching a minimum of –400/27. After that F(X) increases until reaching +∞. Also, at X = ±∞, F(X)= ±∞. Using derivatives to calculate extreme points “Extreme points,” or extrema, is the general designation for maximum and minimum values of a function in a given interval.
For example, to determine where the critical points of function 'X^3-4*X^211*X+30' occur, we can use the following entries in ALG mode: We find two critical points, one at x = 11/3 and one at x = -1. To evaluate the second derivative at each point use: The last screen shows that f”(11/3) = 14, thus, x = 11/3 is a relative minimum. For x = -1, we have the following: This result indicates that f”(-1) = -14, thus, x = -1 is a relative maximum.
Anti-derivatives and integrals An anti-derivative of a function f(x) is a function F(x) such that f(x) = dF/dx. For example, since d(x3) /dx = 3x2, an anti-derivative of f(x) = 3x2 is F(x) = x3 + C, where C is a constant. One way to represent an anti-derivative is as a indefinite integral, i.e., and C = constant.
Please notice that functions SIGMAVX and SIGMA are designed for integrands that involve some sort of integer function like the factorial (!) function shown above. Their result is the so-called discrete derivative, i.e., one defined for integer numbers only. Definite integrals In a definite integral of a function, the resulting anti-derivative is evaluated at the upper and lower limit of an interval (a,b) and the evaluated values subtracted.
At this point, you can press ` to return the integral to the stack, which will show the following entry (ALG mode shown): This is the general format for the definite integral when typed directly into the stack, i.e., ∫ (lower limit, upper limit, integrand, variable of integration) Pressing ` at this point will evaluate the integral in the stack: The integral can be evaluated also in the Equation Writer by selecting the entire expression an using the soft menu key @EVAL.
Notice the application of the chain rule in the first step, leaving the derivative of the function under the integral explicitly in the numerator. In the second step, the resulting fraction is rationalized (eliminating the square root from the denominator), and simplified. The final version is shown in the third step. Each step is shown by pressing the @EVAL menu key, until reaching the point where further application of function EVAL produce no more changes in the expression.
Integrating an equation Integrating an equation is straightforward, the calculator simply integrates both sides of the equation simultaneously, e.g., Techniques of integration Several techniques of integration can be implemented in the calculators, as shown in the following examples. Substitution or change of variables Suppose we want to calculate the integral ∫ 2 x 0 1− x2 dx .
The last four steps show the progression of the solution: a square root, followed by a fraction, a second fraction, and the final result. This result can be simplified by using function @SIMP, to read: Integration by parts and differentials A differential of a function y = f(x), is defined as dy = f’(x) dx, where f’(x) is the derivative of f(x). Differentials are used to represent small increments in the variables.
Thus, we can use function IBP to provide the components of an integration by parts. The next step will have to be carried out separately. It is important to mention that the integral can be calculated directly by using, for example, Integration by partial fractions Function PARTFRAC, presented in Chapter 5, provides the decomposition of a fraction into partial fractions. This technique is useful to reduce a complicated fraction into a sum of simple fractions that can then be integrated term by term.
Improper integrals These are integrals with infinite limits of integration. Typically, an improper integral is dealt with by first calculating the integral as a limit to infinity, e.g., ∫ ∞ 1 ε dx dx = lim ∫ 2 . 2 1 ε →∞ x x Using the calculator, we proceed as follows: Alternatively, you can evaluate the integral to infinity from the start, e.g.
If you enter the integral with the CAS set to Exact mode, you will be asked to change to Approx mode, however, the limits of the integral will be shown in a different format as shown here: These limits represent 1×1_mm and 0×1_mm, which is the same as 1_mm and 0_mm, as before. Just be aware of the different formats in the output.
Infinite series ∞ An infinite series has the form ∑ h ( n)( x − a ) n . The infinite series typically n = 0 ,1 starts with indices n = 0 or n = 1. Each term in the series has a coefficient h(n) that depends on the index n.
k f ( x) = ∑ n =0 i.e., ∞ f ( n ) ( xo ) f ( n ) ( xo ) ⋅ ( x − xo ) n + ∑ ⋅ ( x − xo ) n , n! n! n = k +1 f ( x) = Pk ( x) + Rk ( x). The polynomial Pk(x) is referred to as Taylor’s polynomial. The order of the residual is estimated in terms of a small quantity h = x-x0, i.e., evaluating the polynomial at a value of x very close to x0. The residual if given by Rk ( x ) = f ( k +1) (ξ ) k +1 ⋅h , k! where ξ is a number near x = x0.
Function TAYLR produces a Taylor series expansion of a function of any variable x about a point x = a for the order k specified by the user. Thus, the function has the format TAYLR(f(x-a),x,k). For example, Function SERIES produces a Taylor polynomial using as arguments the function f(x) to be expanded, a variable name alone (for Maclaurin’s series) or an expression of the form ‘variable = value’ indicating the point of expansion of a Taylor series, and the order of the series to be produced.
In the right-hand side figure above, we are using the line editor to see the series expansion in detail.
Chapter 14 Multi-variate Calculus Applications Multi-variate calculus refers to functions of two or more variables. In this Chapter we discuss the basic concepts of multi-variate calculus including partial derivatives and multiple integrals. Multi-variate functions A function of two or more variables can be defined in the calculator by using the DEFINE function („à).
f ( x + h, y ) − f ( x , y ) ∂f . = lim h → 0 h ∂x Similarly, ∂f f ( x, y + k ) − f ( x, y ) = lim . k → 0 ∂y k We will use the multi-variate functions defined earlier to calculate partial derivatives using these definitions. Here are the derivatives of f(x,y) with respect to x and y, respectively: Notice that the definition of partial derivative with respect to x, for example, requires that we keep y fixed while taking the limit as h 0.
therefore, with DERVX you can only calculate derivatives with respect to X. Some examples of first-order partial derivatives are shown next: Higher-order derivatives The following second-order derivatives can be defined ∂ ∂f ∂2 f ∂ ∂f ∂ 2 f = , 2 = , 2 ∂x ∂x ∂y ∂y ∂y ∂x ∂ ∂f ∂2 f ∂ ∂f ∂ 2 f = = , ∂y∂x ∂y ∂x ∂x∂y ∂x ∂y The last two expressions represent cross-derivatives, the partial derivatives signs in the denominator shows the order of derivation.
Third-, fourth-, and higher order derivatives are defined in a similar manner. To calculate higher order derivatives in the calculator, simply repeat the derivative function as many times as needed. Some examples are shown below: The chain rule for partial derivatives Consider the function z = f(x,y), such that x = x(t), y = y(t). The function z actually represents a composite function of t if we write it as z = f[x(t),y(t)].
Total differential of a function z = z(x,y) From the last equation, if we multiply by dt, we get the total differential of the function z = z(x,y), i.e., dz = (∂z/∂x)⋅dx + (∂z/∂y)⋅dy. A different version of the chain rule applies to the case in which z = f(x,y), x = x(u,v), y = y(u,v), so that z = f[x(u,v), y(u,v)].
We find critical points at (X,Y) = (1,0), and (X,Y) = (-1,0). To calculate the discriminant, we proceed to calculate the second derivatives, fXX(X,Y) = ∂2f/∂X2, fXY(X,Y) = ∂2f/∂X/∂Y, and fYY(X,Y) = ∂2f/∂Y2. The last result indicates that the discriminant is ∆ = -12X, thus, for (X,Y) = (1,0), ∆ <0 (saddle point), and for (X,Y) = (-1,0), ∆>0 and ∂2f/∂X2<0 (relative maximum).
Applications of function HESS are easier to visualize in the RPN mode. Consider as an example the function φ(X,Y,Z) = X2 + XY + XZ, we’ll apply function HESS to function φ in the following example. The screen shots show the RPN stack before and after applying function HESS. When applied to a function of two variables, the gradient in level 2, when made equal to zero, represents the equations for critical points, i.e., ∂φ/∂xi = 0, while the matrix in level 3 represent second derivatives.
The resulting matrix has elements a11 = ∂2φ/∂X2 = 6., a22 = ∂2φ/∂X2 = -2., and a12 = a21 = ∂2φ/∂X∂Y = 0. The discriminant, for this critical point s2(1,0) is ∆ = (∂2f/∂x2)⋅ (∂2f/∂y2)-[∂2f/∂x∂y]2 = (6.)(-2.) = -12.0 < 0, indicating a saddle point. Multiple integrals A physical interpretation of an ordinary integral, ∫ b a f ( x)dx , is the area under the curve y = f(x) and abscissas x = a and x = b.
Jacobian of coordinate transformation Consider the coordinate transformation x = x(u,v), y = y(u,v). The Jacobian of this transformation is defined as ∂x | J |= det( J ) = det ∂u ∂y ∂u ∂x ∂v . ∂y ∂v When calculating an integral using such transformation, the expression to use is ∫∫φ ( x, y)dydx = ∫∫φ[ x(u, v), y(u, v)] | J | dudv , where R’ is the region R R R' expressed in (u,v) coordinates.
β g (θ ) α f (θ ) ∫∫φ (r ,θ )dA = ∫ ∫ R' φ (r ,θ )rdrdθ where the region R’ in polar coordinates is R’ = {α < θ < β, f(θ) < r < g(θ)}. Double integrals in polar coordinates can be entered in the calculator, making sure that the Jacobian |J| = r is included in the integrand.
Chapter 15 Vector Analysis Applications In this Chapter we present a number of functions from the CALC menu that apply to the analysis of scalar and vector fields. The CALC menu was presented in detail in Chapter 13. In particular, in the DERIV&INTEG menu we identified a number of functions that have applications in vector analysis, namely, CURL, DIV, HESS, LAPL. For the exercises in this Chapter, change your angle measure to radians.
At any particular point, the maximum rate of change of the function occurs in the direction of the gradient, i.e., along a unit vector u = ∇φ/|∇φ|. The value of that directional derivative is equal to the magnitude of the gradient at any point Dmaxφ(x,y,z) = ∇φ •∇φ/|∇φ| = |∇φ| The equation φ(x,y,z) = 0 represents a surface in space. It turns out that the gradient of the function at any point on this surface is normal to the surface.
n independent variables φ(x1, x2, …,xn), and a vector of the functions [‘x1’ ‘x2’…’xn’]. Function HESS returns the Hessian matrix of the function φ, defined as the matrix H = [hij] = [∂φ/∂xi∂xj], the gradient of the function with respect to the n-variables, grad f = [ ∂φ/∂x1, ∂φ/∂x2 , … ∂φ/∂xn], and the list of variables [‘x1’ ‘x2’…’xn’].
function φ(x,y,z) does not exist. In such case, function POTENTIAL returns an error message. For example, the vector field F(x,y,z) = (x+y)i + (x-y+z)j + xzk, does not have a potential function associated with it, since, ∂f/∂z ≠ ∂h/∂x. The calculator response in this case is shown below: Divergence The divergence of a vector function, F(x,y,z) = f(x,y,z)i+g(x,y,z)j+h(x,y,z)k, is defined by taking a “dot-product” of the del operator with the function, i.e.
Curl The curl of a vector field F(x,y,z) = f(x,y,z)i+g(x,y,z)j+h(x,y,z)k, is defined by a “cross-product” of the del operator with the vector field, i.e., i j k ∂ ∂ ∂ [] [] [] curlF = ∇ × F = ∂x ∂y ∂z f ( x, y , z ) g ( x, y , z ) h ( x, y , z ) ∂h ∂g ∂f ∂h ∂h ∂g = i − + j − + k − ∂y ∂z ∂y ∂z ∂z ∂x The curl of vector field can be calculated with function CURL.
As an example, in an earlier example we attempted to find a potential function for the vector field F(x,y,z) = (x+y)i + (x-y+z)j + xzk, and got an error message back from function POTENTIAL. To verify that this is a rotational field (i.e.
produces the vector potential function Φ2 = [0, ZYX-2YX, Y-(2ZX-X)], which is different from Φ1. The last command in the screen shot shows that indeed F = ∇× Φ2. Thus, a vector potential function is not uniquely determined. The components of the given vector field, F(x,y,z) = f(x,y,z)i+g(x,y,z)j +h(x,y,z)k, and those of the vector potential function, Φ(x,y,z) = φ(x,y,z)i+ψ(x,y,z)j+η(x,y,z)k, are related by f = ∂η/∂y - ∂ψ/∂x, g = ∂φ/∂z ∂η/∂x, and h = ∂ψ/∂x - ∂φ/∂y.
Chapter 16 Differential Equations In this Chapter we present examples of solving ordinary differential equations (ODE) using calculator functions. A differential equation is an equation involving derivatives of the independent variable. In most cases, we seek the dependent function that satisfies the differential equation. Basic operations with differential equations In this section we present some uses of the calculator for entering, checking and visualizing the solution of ODEs.
The result is ‘∂x(∂x(u(x)))+3*u(x)*∂x(u(x))+u^2=1/x ’. This format shows up in the screen when the _Textbook option in the display setting (H@)DISP) is not selected. Press ˜ to see the equation in the Equation Writer. An alternative notation for derivatives typed directly in the stack is to use ‘d1’ for the derivative with respect to the first independent variable, ‘d2’ for the derivative with respect to the second independent variable, etc. A secondorder derivative, e.g.
result by using function EVAL to verify the solution. For example, to check that u = A sin ωot is a solution of the equation d2u/dt2 + ωo2⋅u = 0, use the following: In ALG mode: SUBST(‘∂t(∂t(u(t)))+ ω0^2*u(t) = 0’,‘u(t)=A*SIN (ω0*t)’) ` EVAL(ANS(1)) ` In RPN mode: ‘∂t(∂t(u(t)))+ ω0^2*u(t) = 0’ ` ‘u(t)=A*SIN (ω0*t)’ ` SUBST EVAL The result is ‘0=0’. For this example, you could also use: ‘∂t(∂t(u(t))))+ ω0^2*u(t) = 0’ to enter the differential equation.
The CALC/DIFF menu The DIFFERENTIAL EQNS.. sub-menu within the CALC („Ö) menu provides functions for the solution of differential equations. The menu is listed below with system flag 117 set to CHOOSE boxes: These functions are briefly described next. They will be described in more detail in later parts of this Chapter.
Function LDEC The calculator provides function LDEC (Linear Differential Equation Command) to find the general solution to a linear ODE of any order with constant coefficients, whether it is homogeneous or not. This function requires you to provide two pieces of input: • • the right-hand side of the ODE the characteristic equation of the ODE Both of these inputs must be given in terms of the default independent variable for the calculator’s CAS (typically ‘X’).
of constants result from factoring out the exponential terms after the Laplace transform solution is obtained. Example 2 – Using the function LDEC, solve the non-homogeneous ODE: d3y/dx3-4⋅(d2y/dx2)-11⋅(dy/dx)+30⋅y = x2.
Allow the calculator about ten seconds to produce the result: ‘X^2 = X^2’. Example 3 - Solving a system of linear differential equations with constant coefficients. Consider the system of linear differential equations: x1’(t) + 2x2’(t) = 0, 2x1’(t) + x2’(t) = 0. 1 2 .
dy/dx + x2⋅y(x) = 5. In the calculator use: 'd1y(x)+x^2*y(x)=5' ` 'y(x)' ` DESOLVE The solution provided is (INT(5*EXP(xt^3/3),xt,x)+cC0)*1/EXP(x^3/3))’ }, i.e., ( {‘y = ) y ( x) = exp(− x 3 / 3) ⋅ ∫ 5 ⋅ exp( x 3 / 3) ⋅ dx + cC0 . The variable ODETYPE You will notice in the soft-menu key labels a new variable called @ODETY (ODETYPE). This variable is produced with the call to the DESOL function and holds a string showing the type of ODE used as input for DESOLVE.
Next, we can write dy/dx = (C + exp x)/x = C/x + ex/x. In the calculator, you may try to integrate: ‘d1y(x) = (C + EXP(x))/x’ ` ‘y(x)’ ` DESOLVE The result is { ‘y(x) = INT((EXP(xt)+C)/xt,xt,x)+C0’ }, i.e., y ( x) = ∫ ⋅ ex + C dx + C 0 x Performing the integration by hand, we can only get it as far as: y ( x) = ∫ ⋅ ex dx + C ⋅ ln x + C 0 x because the integral of exp(x)/x is not available in closed form. Example 3 – Solving an equation with initial conditions.
The solution is: Press µµto simplify the result to ‘y(t) = -((19*√5*SIN(√5*t)-(148*COS(√5*t)+80*COS(t/2)))/190)’. Press J @ODETY to get the string “Linear w/ cst coeff” for the ODE type in this case. Laplace Transforms The Laplace transform of a function f(t) produces a function F(s) in the image domain that can be utilized to find the solution of a linear differential equation involving f(t) through algebraic methods. The steps involved in this application are three: 1. 2. 3.
circuits. In most cases one is interested in the system response after time t>0, thus, the definition of the Laplace transform, given above, involves an integration for values of t larger than zero. The inverse Laplace transform maps the function F(s) onto the original function f(t) in the time domain, i.e., L -1{F(s)} = f(t). The convolution integral or convolution product of two functions f(t) and g(t), where g is shifted in time, is defined as ( f * g )( t ) = ∫ t 0 f ( u ) ⋅ g ( t − u ) ⋅ du .
function LAP you get back a function of X, which is the Laplace transform of f(X). Example 2 – Determine the Laplace transform of f(t) = e2t⋅sin(t). Use: ‘EXP(2*X)*SIN(X)’ ` LAP The calculator returns the result: 1/(SQ(X-2)+1). Press µ to obtain, 1/(X2-4X+5). When you translate this result in paper you would write F ( s ) = L{e 2t ⋅ sin t} = 1 s − 4⋅s +5 2 Example 3 – Determine the inverse Laplace transform of F(s) = sin(s). Use: ‘SIN(X)’ ` ILAP.
L{df/dt} = s⋅F(s) - fo. Example 1 – The velocity of a moving particle v(t) is defined as v(t) = dr/dt, where r = r(t) is the position of the particle. Let ro = r(0), and R(s) =L{r(t)}, then, the transform of the velocity can be written as V(s) = L{v(t)}=L{dr/dt}= s⋅R(s)-ro. • Differentiation theorem for the second derivative. Let fo = f(0), and (df/dt)o = df/dt|t=0, then L{d2f/dt2} = s2⋅F(s) - s⋅fo – (df/dt) o. Example 2 – As a follow up to Example 1, the acceleration a(t) is defined as a(t) = d2r/dt2.
Now, use ‘(-X)^3*EXP(-a*X)’ ` LAP µ. The result is exactly the same. • Integration theorem. Let F(s) = L{f(t)}, then { t } L ∫ f (u )du = • 0 1 ⋅ F ( s ). s Convolution theorem. Let F(s) = L{f(t)} and G(s) = L{g(t)}, then { t } L ∫ f (u ) g (t − u )du = L{( f * g )(t )} = 0 L{ f (t )} ⋅L{g (t )} = F ( s ) ⋅ G ( s ) Example 4 – Using the convolution theorem, find the Laplace transform of (f*g)(t), if f(t) = sin(t), and g(t) = exp(t).
∞ f (t ) L = ∫ s F (u )du. t • Laplace transform of a periodic function of period T: L{ f (t )} = • T 1 ⋅ f (t ) ⋅ e − st ⋅ dt. − sT ∫ 0 1− e Limit theorem for the initial value: Let F(s) = L{f(t)}, then f 0 = lim f (t ) = lim[ s ⋅ F ( s )]. t →0 • s →∞ Limit theorem for the final value: Let F(s) = L{f(t)}, then f ∞ = lim f (t ) = lim[ s ⋅ F ( s )].
An interpretation for the integral above, paraphrased from Friedman (1990), is that the δ-function “picks out” the value of the function f(x) at x = x0. Dirac’s delta function is typically represented by an upward arrow at the point x = x0, indicating that the function has a non-zero value only at that particular value of x0. Heaviside’s step function, H(x), is defined as 1, x > 0 H ( x) = 0, x < 0 Also, for a continuous function f(x), ∫ ∞ −∞ ∞ f ( x) H ( x − x0 )dx = ∫ f ( x)dx.
Another important result, known as the second shift theorem for a shift to the right, is that L -1{e–as ⋅F(s)}=f(t-a)⋅H(t-a), with F(s) = L{f(t)}. In the calculator the Heaviside step function H(t) is simply referred to as ‘1’. To check the transform in the calculator use: 1 ` LAP. The result is ‘1/X’, i.e., L{1} = 1/s. Similarly, ‘U0’ ` LAP , produces the result ‘U0/X’, i.e., L{U0} = U0/s. You can obtain Dirac’s delta function in the calculator by using: 1` ILAP The result is ‘Delta(X)’.
Example 1 – To solve the first order equation, dh/dt + k⋅h(t) = a⋅e–t, by using Laplace transforms, we can write: L{dh/dt + k⋅h(t)} = L{a⋅e–t}, L{dh/dt} + k⋅L{h(t)} = a⋅L{e–t}. Note: ‘EXP(-X)’ ` LAP , produces ‘1/(X+1)’, i.e., L{e–t }=1/(s+1). With H(s) = L{h(t)}, and L{dh/dt} = s⋅H(s) - ho, where ho = h(0), the transformed equation is s⋅H(s)-ho+k⋅H(s) = a/(s+1). Use the calculator to solve for H(s), by writing: ‘X*H-h0+k*H=a/(X+1)’ ` ‘H’ ISOL The result is ‘H=((X+1)*h0+a)/(X^2+(k+1)*X+k)’.
The result is: , i.e., h(t) = a/(k-1)⋅e-t +((k-1)⋅cCo-a)/(k-1)⋅e-kt. Thus, cC0 in the results from LDEC represents the initial condition h(0). Note: When using the function LDEC to solve a linear ODE of order n in f(X), the result will be given in terms of n constants cC0, cC1, cC2, …, cC(n-1), representing the initial conditions f(0), f’(0), f”(0), …, f(n-1) (0). Example 2 – Use Laplace transforms to solve the second-order linear equation, d2y/dt2+2y = sin 3t.
To find the solution to the ODE, y(t), we need to use the inverse Laplace transform, as follows: OBJ ƒ ƒ ILAPµ Isolates right-hand side of last expression Obtains the inverse Laplace transform The result is i.e., y(t) = -(1/7) sin 3x + yo cos √2x + (√2 (7y1+3)/14) sin √2x. Check what the solution to the ODE would be if you use the function LDEC: ‘SIN(3*X)’ ` ‘X^2+2’ ` LDEC µ The result is: i.e., the same as before with cC0 = y0 and cC1 = y1.
L{d2y/dt2} + L{y(t)} = L{δ(t-3)}. With ‘Delta(X-3)’ ` LAP , the calculator produces EXP(-3*X), i.e., L{δ(t-3)} = e–3s. With Y(s) = L{y(t)}, and L{d2y/dt2} = s2⋅Y(s) - s⋅yo – y1, where yo = h(0) and y1 = h’(0), the transformed equation is s2⋅Y(s) – s⋅yo – y1 + Y(s) = e–3s. Use the calculator to solve for Y(s), by writing: The result is ‘X^2*Y-X*y0-y1+Y=EXP(-3*X)’ ` ‘Y’ ISOL ‘Y=(X*y0+(y1+EXP(-(3*X))))/(X^2+1)’.
‘X/(X^2+1)’ ` ILAP ‘1/(X^2+1)’ ` ILAP ‘EXP(-3*X)/(X^2+1)’ ` ILAP Result, ‘COS(X)’, i.e., L -1{s/(s2+1)}= cos t. Result, ‘SIN(X)’, i.e., L -1{1/(s2+1)}= sin t. Result, SIN(X-3)*Heaviside(X-3)’. [2]. The very last result, i.e., the inverse Laplace transform of the expression ‘(EXP(-3*X)/(X^2+1))’, can also be calculated by using the second shifting theorem for a shift to the right L -1{e–as ⋅F(s)}=f(t-a)⋅H(t-a), if we can find an inverse Laplace transform for 1/(s2+1).
Defining and using Heaviside’s step function in the calculator The previous example provided some experience with the use of Dirac’s delta function as input to a system (i.e., in the right-hand side of the ODE describing the system). In this example, we want to use Heaviside’s step function, H(t). In the calculator we can define this function as: ‘H(X) = IFTE(X>0, 1, 0)’ `„à This definition will create the variable @@@H@@@ in the calculator’s soft menu key.
Change TYPE to FUNCTION, if needed Change EQ to ‘0.5*COS(X)-0.25*SIN(X)+SIN(X-3)*H(X-3)’. Make sure that Indep is set to ‘X’. Press @ERASE @DRAW to plot the function. Press @EDIT L @LABEL to see the plot. The resulting graph will look like this: Notice that the signal starts with a relatively small amplitude, but suddenly, at t=3, it switches to an oscillatory signal with a larger amplitude.
OBJ ƒ ƒ ILAP The result is Isolates right-hand side of last expression Obtains the inverse Laplace transform ‘y1*SIN(X-1)+y0*COS(X-1)-(COS(X-3)-1)*Heaviside(X-3)’. Thus, we write as the solution: y(t) = yo cos t + y1 sin t + H(t-3)⋅(1+sin(t-3)).
Again, there is a new component to the motion switched at t=3, namely, the particular solution yp(t) = [1+sin(t-3)]⋅H(t-3), which changes the nature of the solution for t>3. The Heaviside step function can be combined with a constant function and with linear functions to generate square, triangular, and saw tooth finite pulses, as follows: • Square pulse of size Uo in the interval a < t < b: f(t) = Uo[H(t-a)-H(t-b)].
Fourier series Fourier series are series involving sine and cosine functions typically used to expand periodic functions. A function f(x) is said to be periodic, of period T, if f(x+T) = f(t). For example, because sin(x+2π) = sin x, and cos(x+2π) = cos x, the functions sin and cos are 2π-periodic functions. If two functions f(x) and g(x) are periodic of period T, then their linear combination h(x) = a⋅f(x) + b⋅g(x), is also periodic of period T.
Thus, the first three terms of the function are: f(t) ≈ 1/3 – (4/π2)⋅cos (π⋅t)+(2/π)⋅sin (π⋅t). A graphical comparison of the original function with the Fourier expansion using these three terms shows that the fitting is acceptable for t < 1, or thereabouts. But, then, again, we stipulated that T/2 = 1. Therefore, the fitting is valid only between –1 < t < 1.
cn = 1 T 2 ⋅ i ⋅ n ⋅π f (t ) ⋅ exp(− ⋅ t ) ⋅ dt , n = −∞,...,−2,−1,0,1,2,...∞. ∫ T 0 T Function FOURIER provides the coefficient cn of the complex-form of the Fourier series given the function f(t) and the value of n. The function FOURIER requires you to store the value of the period (T) of a T-periodic function into the CAS variable PERIOD before calling the function. The function FOURIER is available in the DERIV sub-menu within the CALC menu („Ö).
Thus, c0 = 1/3, c1 = (π⋅i+2)/π2, c2 = (π⋅i+1)/(2π2). The Fourier series with three elements will be written as g(t) ≈ Re[(1/3) + (π⋅i+2)/π2⋅exp(i⋅π⋅t)+ (π⋅i+1)/(2π2)⋅exp(2⋅i⋅π⋅t)]. A plot of the shifted function g(t) and the Fourier series fitting follows: The fitting is somewhat acceptable for 0
A general expression for cn The function FOURIER can provide a general expression for the coefficient cn of the complex Fourier series expansion.
• First, define a function c(n) representing the general term cn in the complex Fourier series. • Next, define the finite complex Fourier series, F(X,k), where X is the independent variable and k determines the number of terms to be used.
The function @@@F@@@ can be used to generate the expression for the complex Fourier series for a finite value of k. For example, for k = 2, c0 = 1/3,and using t as the independent variable, we can evaluate F(t,2,1/3) to get: This result shows only the first term (c0) and part of the first exponential term in the series. The decimal display format was changed to Fix with 2 decimals to be able to show some of the coefficients in the expansion and in the exponent.
F (0.5, 4, 1/3) = (-0.167070735979,0.) F (0.5, 5, 1/3) = (-0.294394690453,0.) F (0.5, 6, 1/3) = (-0.305652599743,0.
Fourier series for a triangular wave Consider the function x, if 0 < x < 1 g ( x) = 2 − x, if 1 < x < 2 which we assume to be periodic with period T = 2. This function can be defined in the calculator, in ALG mode, by the expression DEFINE(‘g(X) = IFTE(X<1,X,2-X)’) If you started this example after finishing example 1 you already have a value of 2 stored in CAS variable PERIOD. If you are not sure, check the value of this variable, and store a 2 in it if needed.
The calculator returns an integral that cannot be evaluated numerically because it depends on the parameter n. The coefficient can still be calculated by typing its definition in the calculator, i.e., 1 1 i ⋅ 2 ⋅ n ⋅π ⋅ X ⋅ ∫ X ⋅ EXP − ⋅ dX + T 2 0 1 2 i ⋅ 2 ⋅ n ⋅π ⋅ X ⋅ ∫ (2 − X ) ⋅ EXP − ⋅ dX 2 1 T where T = 2 is the period.
Press `` to copy this result to the screen. Then, reactivate the Equation Writer to calculate the second integral defining the coefficient cn, namely, Once again, replacing einπ = (-1)n, and using e2inπ = 1, we get: Press `` to copy this second result to the screen.
Once again, replacing einπ = (-1)n, results in This result is used to define the function c(n) as follows: DEFINE(‘c(n) = - (((-1)^n-1)/(n^2*π^2*(-1)^n)’) i.e., Next, we define function F(X,k,c0) to calculate the Fourier series (if you completed example 1, you already have this function stored): DEFINE(‘F(X,k,c0) = c0+Σ(n=1,k,c(n)*EXP(2*i*π*n*X/T)+ c(-n)*EXP(-(2*i*π*n*X/T))’), To compare the original function and the Fourier series we can produce the simultaneous plot of both functions.
The resulting graph is shown below for k = 5 (the number of elements in the series is 2k+1, i.e., 11, in this case): From the plot it is very difficult to distinguish the original function from the Fourier series approximation. Using k = 2, or 5 terms in the series, shows not so good a fitting: The Fourier series can be used to generate a periodic triangular wave (or saw tooth wave) by changing the horizontal axis range, for example, from –2 to 4.
In this case, the period T, is 4. Make sure to change the value of variable @@@T@@@ to 4 (use: 4 K @@@T@@ `). Function g(X) can be defined in the calculator by using DEFINE(‘g(X) = IFTE((X>1) AND (X<3),1,0)’) The function plotted as follows (horizontal range: 0 to 4, vertical range:0 to 1.2 ): Using a procedure similar to that of the triangular shape in example 2, above, you can find that c0 = 1 3 ⋅ ∫ 1 ⋅ dX = 0.
The simplification of the right-hand side of c(n), above, is easier done on paper (i.e., by hand). Then, retype the expression for c(n) as shown in the figure to the left above, to define function c(n). The Fourier series is calculated with F(X,k,c0), as in examples 1 and 2 above, with c0 = 0.5. For example, for k = 5, i.e., with 11 components, the approximation is shown below: A better approximation is obtained by using k = 10, i.e.
Fourier series applications in differential equations Suppose we want to use the periodic square wave defined in the previous example as the excitation of an undamped spring-mass system whose homogeneous equation is: d2y/dX2 + 0.25y = 0. We can generate the excitation force by obtaining an approximation with k =10 out of the Fourier series by using SW(X) = F(X,10,0.5): We can use this result as the first input to the function LDEC when used to obtain a solution to the system d2y/dX2 + 0.
The latter result can be defined as a function, FW(X), as follows (cutting and pasting the last result into the command): We can now plot the real part of this function. Change the decimal mode to Standard, and use the following: The solution is shown below: Fourier Transforms Before presenting the concept of Fourier transforms, we’ll discuss the general definition of an integral transform.
integration of the form F ( s ) = b ∫ κ (s, t ) ⋅ f (t ) ⋅ dt. a The function κ(s,t) is known as the kernel of the transformation. The use of an integral transform allows us to resolve a function into a given spectrum of components. To understand the concept of a spectrum, consider the Fourier series ∞ f (t ) = a0 + ∑ (an ⋅ cos ω n x + bn ⋅ sin ω n x ), n =1 representing a periodic function with a period T.
A plot of the values An vs. ωn is the typical representation of a discrete spectrum for a function. The discrete spectrum will show that the function has components at angular frequencies ωn which are integer multiples of the fundamental angular frequency ω0. Suppose that we are faced with the need to expand a non-periodic function into sine and cosine components. A non-periodic function can be thought of as having an infinitely large period.
In the calculator, set up and evaluate the following integrals to calculate C(ω) and S(ω), respectively. CAS modes are set to Exact and Real. Their results are, respectively: The continuous spectrum, A(ω) is calculated as: Define this expression as a function by using function DEFINE („à). Then, plot the continuous spectrum, in the range 0 < ω < 10, as: Definition of Fourier transforms Different types of Fourier transforms can be defined.
Fs { f (t )} = F (ω ) = 2 ∞ ⋅ f (t ) ⋅ sin(ω ⋅ t ) ⋅ dt π ∫0 Inverse sine transform ∞ Fs−1{F (ω )} = f (t ) = ∫ F (ω ) ⋅ sin(ω ⋅ t ) ⋅ dt 0 Fourier cosine transform Fc { f (t )} = F (ω ) = Inverse cosine transform 2 ∞ ⋅ f (t ) ⋅ cos(ω ⋅ t ) ⋅ dt π ∫0 ∞ Fc−1 {F (ω )} = f (t ) = ∫ F (ω ) ⋅ cos(ω ⋅ t ) ⋅ dt 0 Fourier transform (proper) F { f (t )} = F (ω ) = ∞ 1 ⋅ ∫ f (t ) ⋅ e −iωt ⋅ dt 2π −∞ Inverse Fourier transform (proper) ∞ F −1{F (ω )} = f (t ) = ∫ F (ω ) ⋅ e −iωt ⋅ dt −∞ Example 1 – Determi
F (ω ) = 1 1 1 1 1 − iω ⋅ = ⋅ ⋅ 2π 1 + iω 2π 1 + iω 1 − iω = 1 1 ω −i⋅ 2 2π 1 + ω 1+ ω 2 which is a complex function. The absolute value of the real and imaginary parts of the function can be plotted as shown below Notes: The magnitude, or absolute value, of the Fourier transform, |F(ω)|, is the frequency spectrum of the original function f(t). For the example shown above, |F(ω)| = 1/[2π(1+ω2)]1/2. The plot of |F(ω)| vs. ω was shown earlier.
convolution: For Fourier transform applications, the operation of convolution is defined as ( f * g )( x) = 1 2π ⋅ ∫ f ( x − ξ ) ⋅ g (ξ ) ⋅ dξ . The following property holds for convolution: F{f*g} = F{f}⋅F{g}. Fast Fourier Transform (FFT) The Fast Fourier Transform is a computer algorithm by which one can calculate very efficiently a discrete Fourier transform (DFT).
Introduction to Random Vibrations, Spectral & Wavelet Analysis – Third Edition,” Longman Scientific and Technical, New York. The only requirement for the application of the FFT is that the number n be a power of 2, i.e., select your data so that it contains 2, 4, 8, 16, 32, 62, etc., points. Examples of FFT applications FFT applications usually involve data discretized from a time-dependent signal. The calculator can be fed that data, say from a computer or a data logger, for processing.
in the command catalog, ‚N). Store the array into variable ΣDAT by using function STOΣ (also available through ‚N). Select Bar in the TYPE for graphs, change the view window to H-VIEW: 0 32, V-VIEW: -10 10, and BarWidth to 1. Press @CANCL $ to return to normal calculator display. To perform the FFT on the array in stack level 1 use function FFT available in the MTH/FFT menu on array ΣDAT: @£DAT FFT. The FFT returns an array of complex numbers that are the arrays of coefficients Xk of the DFT.
Example 2 – To produce the signal given the spectrum, we modify the program GDATA to include an absolute value, so that it reads: << m a b << ‘2^m’ EVAL n << ‘(b-a)/(n+1)’ EVAL Dx << 1 n FOR j ‘a+(j-1)*Dx’ EVAL f ABS NEXT n ARRY >> >> >> >> Store this version of the program under GSPEC (Generate SPECtrum). Run the program with m = 6, a = 0, b = 100. In RPN mode, use: 6#0#100@GSPEC! Press ` when done, to keep an additional copy of the spectrum array.
Except for a large peak at t = 0, the signal is mostly noise. A smaller vertical scale (-0.5 to 0.5) shows the signal as follows: Solution to specific second-order differential equations In this section we present and solve specific types of ordinary differential equations whose solutions are defined in terms of some classical functions, e.g., Bessel’s functions, Hermite polynomials, etc. Examples are presented in RPN mode.
Legendre’s equation An equation of the form (1-x2)⋅(d2y/dx2)-2⋅x⋅ (dy/dx)+n⋅ (n+1) ⋅y = 0, where n is a real number, is known as the Legendre’s differential equation. Any solution for this equation is known as a Legendre’s function. When n is a nonnegative integer, the solutions are called Legendre’s polynomials. Legendre’s polynomial of order n is given by M Pn ( x) = ∑ (−1) m ⋅ m =0 = (2n − 2m)! ⋅x n − 2 m 2 ⋅ m!⋅(n − m)!⋅(n − 2m)! n (2n)! (2n − 2)! ⋅ xn − n ⋅ x n − 2 + ... − ..
Bessel’s equation The ordinary differential equation x2⋅(d2y/dx2) + x⋅ (dy/dx)+ (x2-ν2) ⋅y = 0, where the parameter ν is a nonnegative real number, is known as Bessel’s differential equation. Solutions to Bessel’s equation are given in terms of Bessel functions of the first kind of order ν: (−1) m ⋅ x 2 m , J ν ( x) = x ⋅ ∑ 2 m +ν ⋅ m!⋅Γ(ν + m + 1) m =0 2 ∞ ν where ν is not an integer, and the function Gamma Γ(α) is defined in Chapter 3.
If you want to obtain an expression for J0(x) with, say, 5 terms in the series, use J(x,0,5). The result is ‘1-0.25*x^3+0.015625*x^4-4.3403777E-4*x^6+6.782168E-6*x^86.78168*x^10’. For non-integer values ν, the solution to the Bessel equation is given by y(x) = K1⋅Jν(x)+K2⋅J-ν(x). For integer values, the functions Jn(x) and J-n(x) are linearly dependent, since Jn(x) = (-1)n⋅J-n(x), therefore, we cannot use them to obtain a general function to the equation.
With these definitions, a general solution of Bessel’s equation for all values of ν is given by y(x) = K1⋅Jν(x)+K2⋅Yν(x). In some instances, it is necessary to provide complex solutions to Bessel’s equations by defining the Bessel functions of the third kind of order ν as Hn(1)(x) = Jν(x)+i⋅Yν(x), and Hn(2)(x) = Jν(x)−i⋅Yν(x), These functions are also known as the first and second Hankel functions of order ν.
Un(x) = sin(n⋅arccos(x))/sin(arccos(x)). You can access the function TCHEBYCHEFF through the command catalog (‚N). The first four Chebyshev or Tchebycheff polynomials of the first and second kind are obtained as follows: 0 TCHEBYCHEFF, result: 1, -0 TCHEBYCHEFF, result: 1, 1 TCHEBYCHEFF, result: ‘X’, -1 TCHEBYCHEFF, result: 1, 2 TCHEBYCHEFF, result: ‘2*X^2-1, -2 TCHEBYCHEFF, result: ‘2*X’, 3 TCHEBYCHEFF, result: ‘4*X^3-3*X’, -3 TCHEBYCHEFF, result: ‘4*X^2-1’, i.e., i.e., i.e., i.e., i.e., i.e., i.e., i.e.
is the m-th coefficient of the binomial expansion (x+y)n. It also represents the number of combinations of n elements taken m at a time. This function is available in the calculator as function COMB in the MTH/PROB menu (see also Chapter 17). You can define the following function to calculate Laguerre’s polynomials: When done typing it in the equation writer press use function DEFINE to create the function L(x,n) into variable @@@L@@@ .
0 1 2 3 HERMITE, HERMITE, HERMITE, HERMITE, result: result: result: result: 1, ’2*X’, ’4*X^2-2’, ’8*X^3-12*X’, i.e., i.e., i.e., i.e., H0* H1* H2* H3* = = = = 1. 2x. 4x2-2. 8x3-12x. Numerical and graphical solutions to ODEs Differential equations that cannot be solved analytically can be solved numerically or graphically as illustrated below.
To solve, press: @SOLVE (wait) @EDIT@. The result is 0.2499 ≈ 0.25. Press @@@OK@@@. Solution presented as a table of values Suppose we wanted to produce a table of values of v, for t = 0.00, 0.25, …, 2.00, we will proceed as follows: First, prepare a table to write down your results. Write down in your table the step-by-step results: t v 0.00 0.00 0.25 … … 2.00 Next, within the SOLVE environment, change the final value of the independent variable to 0.25, use : —.
t v 0.00 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 4.000 3.285 2.640 2.066 1.562 1.129 0.766 0.473 0.250 Graphical solution of first-order ODE When we can not obtain a closed-form solution for the integral, we can always plot the integral by selecting Diff Eq in the TYPE field of the PLOT environment as follows: suppose that we want to plot the position x(t) for a velocity function v(t) = exp(-t2), with x = 0 at t = 0.
• • Also, use the following values for the remaining parameters: Init: 0, Final: 5, Step: Default, Tol: 0.0001, Init-Soln: 0 To plot the graph use: @ERASE @DRAW When you observe the graph being plotted, you'll notice that the graph is not very smooth. That is because the plotter is using a time step that may be a bit large for a smooth graph. To refine the graph and make it smoother, use a step of 0.1. Press @CANCL and change the Step : value to 0.1, then use @ERASE @DRAW once more to repeat the graph.
Numerical solution of second-order ODE Integration of second-order ODEs can be accomplished by defining the solution as a vector. As an example, suppose that a spring-mass system is subject to a damping force proportional to its speed, so that the resulting differential equation is: or, d 2x dx = −18.75 ⋅ x − 1.962 ⋅ 2 dt dt x" = - 18.75 x - 1.962 x', subject to the initial conditions, v = x' = 6, x = 0, at t = 0. We want to find x, x' at t = 2.
Press @SOLVE (wait) @EDIT to solve for w(t=2). The solution reads [.16716… .6271…], i.e., x(2) = 0.16716, and x'(2) = v(2) = -0.6271. Press @CANCL to return to SOLVE environment. Solution presented as a table of values In the previous example we were interested only in finding the values of the position and velocity at a given time t. If we wanted to produce a table of values of x and x', for t = 0.00, 0.25, …, 2.00, we will proceed as follows: First, prepare a table to write down your results: t 0.00 0.
Repeat for t = 1.25, 1.50, 1.75, 2.00. Press @@OK@@ after viewing the last result in @EDIT. To return to normal calculator display, press $ or L@@OK@@. The different solutions will be shown in the stack, with the latest result in level 1. The final results look as follows: t 0.00 0.25 0.50 0.75 1.00 x 0.000 0.968 0.748 -0.015 -0.469 x' 6.000 1.368 -2.616 -2.859 -0.607 t 1.25 1.50 1.75 2.00 x -0.354 0.141 0.227 0.167 Graphical solution for a second-order ODE x' 1.281 1.362 0.268 -0.
Notice that the option V-Var: is set to 1, indicating that the first element in the vector solution, namely, x’, is to be plotted against the independent variable t. Accept changes to PLOT SETUP by pressing L @@OK@@. Press „ò (simultaneously, if in RPN mode) to enter the PLOT WINDOW environment. Modify this input form to look like this: To plot the x’ vs. t graph use: @ERASE @DRAW . The plot of x’ vs. t looks like this: To plot the second curve we need to use the PLOT SETUP input form once, more.
Numerical solution for stiff first-order ODE Consider the ODE: dy/dt = -100y+100t+101, subject to the initial condition y(0) = 1. Exact solution This equation can be written as dy/dt + 100 y = 100 t + 101, and solved using an integrating factor, IF(t) = exp(100t), as follows (RPN mode, with CAS set to Exact mode): ‘(100*t+101)*EXP(100*t)’ ` ‘t’ ` RISCH The result is ‘(t+1)*EXP(100*t)’. Next, we add an integration constant, by using: ‘C’ `+ Then, we divide by FI(x), by using: ‘EXP(100*t)’ `/.
Here we are trying to obtain the value of y(2) given y(0) = 1. With the Soln: You can check that a solution takes about 6 seconds, while in the previous first-order example the solution was almost instantaneous. Press $ to cancel the calculation. Final field highlighted, press @SOLVE. This is an example of a stiff ordinary differential equation. A stiff ODE is one whose general solution contains components that vary at widely different rates under the same increment in the independent variable.
contains functions for the numerical solution of ordinary differential equations for use in programming. These functions are described next using RPN mode and system flag 117 set to SOFT menus. The functions provided by the SOLVE/DIFF menu are the following: Function RKF This function is used to compute the solution to an initial value problem for a first-order differential equation using the Runge-Kutta-Fehlbert 4th -5th order solution scheme.
RKF solution x y Actual solution x y 0 0 xinit yinit xfinal yfinal xinit + xfinal yinit + yfinal The following screens show the RPN stack before and after applying function RKF for the differential equation dy/dx = x+y, ε = 0.001, ∆x = 0.1. After applying function RKF, variable @@@y@@@ contains the value 4.3880...
The following screen shots show the RPN stack before and after application of function RRK: The value stored in variable y is 3.00000000004. Function RKFSTEP This function uses an input list similar to that of function RKF, as well as the tolerance for the solution, and a possible step ∆x, and returns the same input list, followed by the tolerance, and an estimate of the next step in the independent variable.
Function RRKSTEP This function uses an input list similar to that of function RRK, as well as the tolerance for the solution, a possible step ∆x, and a number (LAST) specifying the last method used in the solution (1, if RKF was used, or 2, if RRK was used). Function RRKSTEP returns the same input list, followed by the tolerance, an estimate of the next step in the independent variable, and the current method (CURRENT) used to arrive at the next step.
Function RKFERR This function returns the absolute error estimate for a given step when solving a problem as that described for function RKF. The input stack looks as follows: 2: {‘x’, ‘y’, ‘f(x,y)’} 1: ∆x After running this function, the stack will show the lines: 4: {‘x’, ‘y’, ‘f(x,y)’} 3: ε 2: ∆y 1: error Thus, this function is used to determine the increment in the solution, ∆y, as well as the absolute error (error).
The following screen shots show the RPN stack before and after application of function RSBERR: These results indicate that ∆y = 4.1514… and error = 2.762..., for Dx = 0.1. Check that, if Dx is reduced to 0.01, ∆y = -0.00307… and error = 0.000547. Note: As you execute the commands in the DIFF menu values of x and y will be produced and stored as variables in your calculator. The results provided by the functions in this section will depend on the current values of x and y.
Chapter 17 Probability Applications In this Chapter we provide examples of applications of calculator’s functions to probability distributions. The MTH/PROBABILITY.. sub-menu - part 1 The MTH/PROBABILITY.. sub-menu is accessible through the keystroke sequence „´. With system flag 117 set to CHOOSE boxes, the following list of MTH options is provided (see left-hand side figure below). We have selected the PROBABILITY..
To simplify notation, use P(n,r) for permutations, and C(n,r) for combinations. We can calculate combinations, permutations, and factorials with functions COMB, PERM, and ! from the MTH/PROBABILITY.. sub-menu. The operation of those functions is described next: • • • COMB(n,r): Combinations of n items taken r at a time PERM(n,r): Permutations of n items taken r at a time n!: Factorial of a positive integer. For a non-integer, x! returns Γ(x+1), where Γ(x) is the Gamma function (see Chapter 3).
Random number generators, in general, operate by taking a value, called the “seed” of the generator, and performing some mathematical algorithm on that “seed” that generates a new (pseudo)random number. If you want to generate a sequence of number and be able to repeat the same sequence later, you can change the "seed" of the generator by using function RDZ(n), where n is the “seed,” before generating the sequence.
Discrete probability distributions A random variable is said to be discrete when it can only take a finite number of values. For example, the number of rainy days in a given location can be considered a discrete random variable because we count them as integer numbers only. Let X represent a discrete random variable, its probability mass function (pmf) is represented by f(x) = P[X=x], i.e., the probability that the random variable X takes the value x.
probability of getting a success in any given repetition. The cumulative distribution function for the binomial distribution is given by x F (n, p, x) = ∑ f (n, p, x), x = 0,1,2,..., n k =0 Poisson distribution The probability mass function of the Poisson distribution is given by f (λ , x ) = e −λ ⋅ λx , x = 0,1,2,..., ∞ . x! In this expression, if the random variable X represents the number of occurrences of an event or observation per unit time, length, area, volume, etc.
Examples of calculations using these functions are shown next: Continuous probability distributions The probability distribution for a continuous random variable, X, is characterized by a function f(x) known as the probability density function (pdf). The pdf has the following properties: f(x) > 0, for all x, and P[ X < x ] = F ( x ) = ∫ +∞ −∞ ∫ x −∞ f (ξ )dξ . f ( x)dx = 1.
The corresponding (cumulative) distribution function (cdf) would be given by an integral that has no closed-form solution. The exponential distribution The exponential distribution is the gamma distribution with a = 1. Its pdf is given by f ( x) = 1 x ⋅ exp(− ), for β β x > 0, β > 0 , while its cdf is given by F(x) = 1 - exp(-x/β), for x>0, β >0.
(Continuous FUNctions) and define the following functions (change to Approx mode): Gamma pdf: Gamma cdf: 'gpdf(x) = x^(α-1)*EXP(-x/β)/(β^α*GAMMA(α))' 'gcdf(x) = ∫(0,x,gpdf(t),t)' Beta pdf: ' βpdf(x)= GAMMA(α+β)*x^(α-1)*(1-x)^(β-1)/(GAMMA(α)*GAMMA(β))' Beta cdf: ' βcdf(x) = ∫(0,x, βpdf(t),t)' Exponential pdf: 'epdf(x) = EXP(-x/β)/β' Exponential cdf: 'ecdf(x) = 1 - EXP(-x/β)' Weibull pdf: 'Wpdf(x) = α*β*x^(β-1)*EXP(-α*x^β)' Weibull cdf: 'Wcdf(x) = 1 - EXP(-α*x^β)' Use function DEFINE to define all these fu
Some examples of application of these functions, for values of α = 2, β = 3, are shown below. Notice the variable IERR that shows up in the second screen shot. This results from a numerical integration for function gcdf. Continuous distributions for statistical inference In this section we discuss four continuous probability distributions that are commonly used for problems related to statistical inference.
f ( x) = 1 σ 2π exp[− (x − µ)2 ], 2σ 2 where µ is the mean, and σ2 is the variance of the distribution. To calculate the value of f(µ,σ2,x) for the normal distribution, use function NDIST with the following arguments: the mean, µ, the variance, σ2, and, the value x , i.e., NDIST(µ,σ2,x). For example, check that for a normal distribution, f(1.0,0.5,2.0) = 0.20755374. Normal distribution cdf The calculator has a function UTPN that calculates the upper-tail normal distribution, i.e.
The Student-t distribution The Student-t, or simply, the t-, distribution has one parameter ν, known as the degrees of freedom of the distribution. The probability distribution function (pdf) is given by ν +1 Γ( ) ν +1 t2 − 2 f (t ) = ⋅ (1 + ) 2 ,−∞ < t < ∞ ν ν Γ( ) ⋅ πν 2 where Γ(α) = (α-1)! is the GAMMA function defined in Chapter 3. The calculator provides for values of the upper-tail (cumulative) distribution function for the t-distribution, function UTPT, given the parameter ν and the value of t, i.
f ( x) = 1 ν 2 ν 2 ⋅ Γ( ) 2 ⋅x ν −1 2 − x 2 ⋅ e ,ν > 0, x > 0 The calculator provides for values of the upper-tail (cumulative) distribution function for the χ2-distribution using [UTPC] given the value of x and the parameter ν. The definition of this function is, therefore, ∞ t t −∞ UTPC (ν , x) = ∫ f ( x)dx = 1 − ∫ f ( x)dx = 1 − P ( X ≤ x) To use this function, we need the degrees of freedom, ν, and the value of the chi-square variable, x, i.e., UTPC(ν,x). For example, UTPC(5, 2.5) = 0.
νN νN −1 νN + νD νN 2 )⋅( ) ⋅ F 2 Γ( 2 νD f ( x) = νN +νD νN νD νN ⋅ F ( 2 ) ) Γ( ) ⋅ Γ( ) ⋅ (1 − 2 2 νD The calculator provides for values of the upper-tail (cumulative) distribution function for the F distribution, function UTPF, given the parameters νN and νD, and the value of F. The definition of this function is, therefore, ∞ t t −∞ UTPF (νN ,νD, F ) = ∫ f ( F )dF = 1 − ∫ f ( F )dF = 1 − P (ℑ ≤ F ) For example, to calculate UTPF(10,5, 2.5) = 0.
• • Exponential, F(x) = 1 - exp(-x/β) Weibull, F(x) = 1-exp(-αxβ) (Before continuing, make sure to purge variables α and β). To find the inverse cdf’s for these two distributions we need just solve for x from these expressions, i.e., Exponential: Weibull: For the Gamma and Beta distributions the expressions to solve will be more complicated due to the presence of integrals, i.e.
of the complicated nature of function Y(X), it will take some time before the graph is produced. Be patient.) There are two roots of this function found by using function @ROOT within the plot environment. Because of the integral in the equation, the root is approximated and will not be shown in the plot screen. You will only get the message Constant? Shown in the screen. However, if you press ` at this point, the approximate root will be listed in the display.
For the normal, Student’s t, Chi-square (χ2), and F distributions, which are represented by functions UTPN, UTPT, UPTC, and UTPF in the calculator, the inverse cuff can be found by solving one of the following equations: • • • • Normal, Student’s t, Chi-square, F distribution: p p p p = = = = 1 1 1 1 – – – – UTPN(µ,σ2,x) UTPT(ν,t) UTPC(ν,x) UTPF(νN,νD,F) Notice that the second parameter in the UTPN function is σ2, not σ2, representing the variance of the distribution.
To facilitate solution of equations involving functions UTPN, UTPT, UTPC, and UTPF, you may want to create a sub-directory UTPEQ were you will store the equations listed above: Thus, at this point, you will have the four equations available for solution. You needs just load one of the equations into the EQ field in the numerical solver and proceed with solving for one of the variables.
With these four equations, whenever you launch the numerical solver you have the following choices: Examples of solution of equations EQNA, EQTA, EQCA, and EQFA are shown below: Page 17-18
Chapter 18 Statistical Applications In this Chapter we introduce statistical applications of the calculator including statistics of a sample, frequency distribution of data, simple regression, confidence intervals, and hypothesis testing. Pre-programmed statistical features The calculator provides pre-programmed statistical features that are accessible through the keystroke combination ‚Ù (same key as the number 5 key).
Store the program in a variable called LXC. After storing this program in RPN mode you can also use it in ALG mode. To store a column vector into variable ΣDAT use function STOΣ, available through the catalog (‚N), e.g., STOΣ (ANS(1)) in ALG mode. Example 1 – Using the program LXC, defined above, create a column vector using the following data: 2.1 1.2 3.1 4.5 2.3 1.1 2.3 1.5 1.6 2.2 1.2 2.5. In RPG mode, type in the data in a list: {2.1 1.2 3.1 4.5 2.3 1.1 2.3 1.5 1.6 2.2 1.2 2.
Definitions The definitions used for these quantities are the following: Suppose that you have a number data points x1, x2, x3, …, representing different measurements of the same discrete or continuous variable x. The set of all possible values of the quantity x is referred to as the population of x. A finite population will have only a fixed number of elements xi.
(n+1)/2. If you have an even number, n, of elements, the median is the average of the elements located in positions n/2 and (n+1)/2. Although the pre-programmed statistical features of the calculator do not include the calculation of the median, it is very easily to write a program to calculate such quantity by working with lists.
Coefficient of variation The coefficient of variation of a sample combines the mean, a measure of central tendency, with the standard deviation, a measure of spreading, and is defined, as a percentage, by: Vx = (sx/x)100. Sample vs. population The pre-programmed functions for single-variable statistics used above can be applied to a finite population by selecting the Type: Population in the SINGLE-VARIABLE STATISTICS screen.
Suppose that the classes, or bins, will be selected by dividing the interval (xbot, xtop), into k = Bin Count classes by selecting a number of class boundaries, i.e., {xB1, xB2, …, xBk+1}, so that class number 1 is limited by xB1-xB2, class number 2 by xB2- xB3, and so on. The last class, class number k, will be limited by xBk - xB k +1. The value of x corresponding to the middle of each class is known as the class mark, and is defined as xMi = (xBi + xB i+1)/2, for i = 1, 2, …, k.
• Obtain single-variable information using: ‚Ù @@@OK@@@. Use Sample for the Type of data set, and select all options as results. The results for this example were: Mean: 51.0406, Std Dev: .29.5893…, Variance: 875.529… Total: 10208.12, Maximum: 99.35, Minimum: 0.13 This information indicates that our data ranges from values close to zero to values close to 100. Working with whole numbers, we can select the range of variation of the data as (0,100).
of the next row. Thus, for the second class, the cumulative frequency is 18+15 = 33, while for class number 3, the cumulative frequency is 33 + 16 = 49, and so on. The cumulative frequency represents the frequency of those numbers that are smaller than or equal to the upper boundary of any given class. Class No. i < XB1 Class XBi outlier Bound. XB i+1 below range 1 10 20 2 20 30 3 30 40 4 40 50 5 50 60 6 60 70 7 70 80 k=8 80 90 >XBk outliers above range Class mark.
Histograms A histogram is a bar plot showing the frequency count as the height of the bars while the class boundaries shown the base of the bars. If you have your raw data (i.e., the original data before the frequency count is made) in the variable ΣDAT, you can select Histogram as your graph type and provide information regarding the initial value of x, the number of bins, and the bin width, to generate the histogram.
A plot of frequency count, fi, vs. class marks, xMi, is known as a frequency polygon. A plot of the cumulative frequency vs. the upper boundaries is known as a cumulative frequency ogive. You can produce scatterplots that simulate these two plots by entering the proper data in columns 1 and 2 of a new ΣDAT matrix and changing the Type: to SCATTER in the PLOT SETUP window. Fitting data to a function y = f(x) The program 3. Fit data..
• To obtain the data fitting press @@OK@@. The output from this program, shown below for our particular data set, consists of the following three lines in RPN mode: 3: '0.195238095238 + 2.00857142857*X' 2: Correlation: 0.983781424465 1: Covariance: 7.03 Level 3 shows the form of the equation. In this case, y = 0.06924 + 0.00383 x. Level 2 shows the sample correlation coefficient, and level 1 shows the covariance of x-y.
Type of Fitting Actual Model Linearized Model Indep. variable ξ Depend. Variable η Covar. sξη Linear y = a + bx [same] x y sxy Log. y = a + b ln(x) [same] ln(x) y sln(x),y ln(y) = ln(a) + bx x ln(y) sx,ln(y) ln(y) = ln(a) + b ln(x) ln(x) ln(y) sln(x),ln(y) bx Exp.
the program CRMC developed in Chapter 10. Next, save this matrix into the statistical matrix ΣDAT, by using function STOΣ. Finally, launch the data fit application by using: ‚Ù˜˜@@@OK@@@ . The display shows the current ΣDAT, already loaded. Change your set up screen to the following parameters if needed: Press @@@OK@@@, to get: 1: '3.99504833324*EXP(-.579206831203*X)' 2: Correlation: -0.996624999526 3: Covariance: -6.23350666124 The best fit for the data is, therefore, y = 3.995 e-0.58⋅x.
• • • • To access the summary stats… option, use: ‚Ù˜˜˜@@@OK@@@ Select the column numbers corresponding to the x- and y-data, i.e., X-Col: 1, and Y-Col: 2. Using the @ CHK@ key select all the options for outputs, i.e., _ΣX, _ΣY, etc. Press @@@OK@@@ to obtain the following results: ΣX: 24.2, ΣY: 11.72, ΣX2: 148.54, ΣY2: 26.6246, ΣXY: 12.602, NΣ:8 Note: There are two other applications under the STAT menu, namely, 5. and 6. Conf. Interval.. These two applications will be discussed later in the chapter.
which we’ll store in variable %TILE (percent-tile). This program requires as input a value p within 0 and 1, representing the 100p percentile, and a list of values. The program returns the 100p percentile of the list. Example 1 - Determine the 37% percentile of the list { 2 1 0 1 3 5 1 2 3 6 7 9}. In RPN mode, enter 0.27 ` { 2 1 0 1 3 5 1 2 3 6 7 9} ` @%TILE. In ALG mode, enter %TILE(0.27,{2,1,0,1,3,5,1,2,3,6,7,9}. The result is 1.
ΣDAT: places contents of current ΣDATA matrix in level 1 of the stack. „ΣDAT: stores matrix in level 1 of stack into ΣDATA matrix. The ΣPAR sub-menu The ΣPAR sub-menu contains functions used to modify statistical parameters. The parameters shown correspond to the last example of data fitting.
The functions available are the following: TOT: show sum of each column in ΣDATA matrix. MEAN: shows average of each column in ΣDATA matrix. SDEV: shows standard deviation of each column in ΣDATA matrix. MAXΣ: shows maximum value of each column in ΣDATA matrix. MINΣ: shows average of each column in ΣDATA matrix. BINS: used as xs, ∆x, n [BINS], provides frequency distribution for data in Xcol column in ΣDATA matrix with the frequency bins defined as [xs,xs+∆x], [xs,xs+2∆x],…, [xs,xs+n∆x].
The FIT sub-menu The FIT sub-menu contains functions used to fit equations to the data in columns Xcol and Ycol of the ΣDATA matrix. The functions available in this sub-menu are: ΣLINE: provides the equation corresponding to the most recent fitting. LR: provides intercept and slope of most recent fitting. PREDX: used as y @PREDX, given y find x for the fitting y = f(x). PREDY: used as x @PREDY, given x find y for the fitting y = f(x). CORR: provides the correlation coefficient for the most recent fitting.
• Calculate statistics of each column: @)STAT @)1VAR: @TOT @MEAN @SDEV @MAX£ @MIN£ L @VAR @PSDEV @PVAR • • produces produces produces produces produces produces produces produces [38.5 87.5 82799.8] [5.5. 12.5 11828.54…] [3.39… 6.78… 21097.01…] [10 21.5 55066] [1.1 3.7 7.8] [11.52 46.08 445084146.33] [3.142… 6.284… 19532.04…] [9.87… 39.49… 381500696.85…] Data: 1.1 3.7 2.2 5.5 6.8 9.2 10.0 3.7 7.8 8.9 101 5.9 25 12.5 612 15.1 2245 19.9 24743 21.
@CANCL • Determine the fitting equation and some of its statistics: @)STAT @)FIT@ @£LINE @@@LR@@@ 3 @PREDX 1 @PREDY @CORR @@COV@@ L@PCOV • produces produces produces produces produces produces produces '1.5+2*X' Intercept: 1.5, Slope: 2 0.75 3. 50 1.0 23.04 19.74… Obtain summary statistics for data in columns 1 and 2: @)STAT @)SUMS: @@@£X@@ @@@£Y@@ @@£X2@ @@£Y2@ @@£XY@ @@@N£@@ • returns to main display produces 38.5 produces 87.5 produces 280.87 produces 1370.23 produces 619.
L @)STAT @PLOT @SCATR @STATL produce scattergram of y vs. x show line for log fitting Obviously, the log-fit is not a good choice. @CANCL returns to normal display. • Select the best fitting by using: @)STAT @£PAR @)MODL @BESTF shows EXPFIT as the best fit for these data L@)STAT @)FIT @£LINE @CORR 2300 @PREDX 5.2 @PREDY L @)STAT @PLOT @SCATR @STATL • • produces '2.6545*EXP(0.9927*X)' produces 0.99995… (good correlation) produces 6.8139 produces 463.37 produce scattergram of y vs.
Confidence intervals Statistical inference is the process of making conclusions about a population based on information from sample data. In order for the sample data to be meaningful, the sample must be random, i.e., the selection of a particular sample must have the same probability as that of any other possible sample out of a given population.
to estimate is its mean value, µ. We will use as an estimator the mean value of the sample, X, defined by (a rule): X = 1 n ⋅∑ Xi. n i =1 For the sample under consideration, the estimate of µ is the sample statistic x = (2.2+2.5+2.1+2.3+2.2)/5 = 2.36. This single value of X, namely x = 2.36, constitutes a point estimation of the population parameter µ. Estimation of Confidence Intervals The next level of inference from point estimation is interval estimation, i.e.
The one-sided upper and lower 100(1-α) % confidence limits for the population mean µ are, respectively, X+zα⋅σ/√n , and X−zα⋅σ/√n . Thus, a lower, one-sided, confidence interval is defined as (-∞ , X+zα⋅σ/√n), and an upper, one-sided, confidence interval as (X−zα⋅σ/√n,+∞). Notice that in these last two intervals we use the value zα, rather than zα/2. In general, the value zk in the standard normal distribution is defined as that value of z whose probability of exceedence is k, i.e.
is the probability of success, then the mean value, or expectation, of X is E[X] = p, and its variance is Var[X] = p(1-p). If an experiment involving X is repeated n times, and k successful outcomes are recorded, then an estimate of p is given by p’= k/n, while the standard error of p’ is σp’ = √(p⋅(1-p)/n) . In practice, the sample estimate for p, i.e., p’ replaces p in the standard error formula. For a large sample size, n>30, and n⋅p > 5 and n⋅(1-p)>5, the sampling distribution is very nearly normal.
Confidence intervals for sums and differences of mean values If the population variances σ12 and σ22 are known, the confidence intervals for the difference and sum of the mean values of the populations, i.e., µ1±µ2, are given by: 2 2 2 2 (X ± X ) − z ⋅ σ1 + σ 2 , (X ± X ) + z ⋅ σ1 + σ 2 2 1 2 α /2 α /2 1 n1 n2 n1 n2 For large samples, i.e.
reason to believe that the two unknown population variances are different, we can use the following confidence interval (( X 1 ± X 2 ) − tν ,α / 2 ⋅ s X2 1 ± X 2 , ( X 1 ± X 2 ) + tν ,α / 2 ⋅ s X2 1 ± X 2 ) where the estimated standard deviation for the sum or difference is s X1 ± X 2 = s12 s 22 + n1 n2 and n, the degrees of freedom of the t variate, are calculated using the integer value closest to ν = [( S12 / n1 ) + ( S 22 / n2 )] 2 [( S12 / n1 ) /(n1 − 1)] + [( S 22 / n2 ) /(n2 − 1)] Determin
3. Z-INT: 1 p.: Single sample confidence interval for the proportion, p, for large samples with unknown population variance. 4. Z-INT: p1− p2.: Confidence interval for the difference of two proportions, p1-p2, for large samples with unknown population variances. 5. T-INT: 1 µ.: Single sample confidence interval for the population mean, µ, for small samples with unknown population variance. 6. T-INT: µ1−µ2.
The result indicates that a 95% confidence interval has been calculated. The Critical z value shown in the screen above corresponds to the values ±zα/2 in the confidence interval formula (X−zα/2⋅σ/√n , X+zα/2⋅σ/√n ). The values µ Min and µ Max are the lower and upper limits of this interval, i.e., µ Min = X−zα/2⋅σ/√n, and µ Max = X+zα/2⋅σ/√n.
The variable ∆µ represents µ 1 – µ2. Example 3 – A survey of public opinion indicates that in a sample of 150 people 60 favor increasing property taxes to finance some public projects. Determine the 99% confidence interval for the population proportion that would favor increasing taxes. Press ‚Ù—@@@OK@@@to access the confidence interval feature in the calculator. Press ˜˜ @@@OK@@@ to select option 3. Z-INT: µ 1 – µ2.. Enter the following values: When done, press @@@OK@@@.
Press ‚Ù—@@@OK@@@ to access the confidence interval feature in the calculator. Press ˜˜˜@@@OK@@@ to select option 4. Z-INT: p1 – p2.. Enter the following values: When done, press @@@OK@@@. The results, as text and graph, are shown below: Example 5 – Determine a 95% confidence interval for the mean of the population if a sample of 50 elements has a mean of 15.5 and a standard deviation of 5. The population’s standard deviation is unknown.
The figure shows the Student’s t pdf for ν = 50 – 1 = 49 degrees of freedom. Example 6 -- Determine the 99% confidence interval for the difference in means of two populations given the sample data:x1 = 157.8 ,x2 = 160.0, n1 = 50, n2 = 55. The populations standard deviations are s1 = 13.2, s 2 = 24.5. Press ‚Ù—@@@OK@@@ to access the confidence interval feature in the calculator. Press —@@@OK@@@ to select option 6. T-INT: µ1−µ2.. Enter the following values: hen done, press @@@OK@@@.
Confidence intervals for the variance To develop a formula for the confidence interval for the variance, first we introduce the sampling distribution of the variance: Consider a random sample X1, X2 ..., Xn of independent normally-distributed variables with mean µ, variance σ2, and sample mean X. The statistic n 1 Sˆ 2 = ⋅ ∑ (X i − X )2 , n − 1 i =1 is an unbiased estimator of the variance σ2.
In Chapter 17 we use the numerical solver to solve the equation α = UTPC(γ,x). In this program, γ represents the degrees of freedom (n-1), and α represents the probability of exceeding a certain value of x (χ2), i.e., Pr[χ2 > χα2] = α. For the present example, α = 0.05, γ = 24 and α = 0.025. Solving the equation presented above results in χ2n-1,α/2 = χ224,0.025 = 39.3640770266. On the other hand, the value χ2n-1,α/2 = χ224,0.975 is calculated by using the values γ = 24 and α = 0.975.
Procedure for testing hypotheses The procedure for hypothesis testing involves the following six steps: 1. Declare a null hypothesis, H0. This is the hypothesis to be tested. For example, H0: µ1-µ2 = 0, i.e., we hypothesize that the mean value of population 1 and the mean value of population 2 are the same. If H0 is true, any observed difference in means is attributed to errors in random sampling. 2. Declare an alternate hypothesis, H1.
Rejecting a true hypothesis, Pr[Type I error] = Pr[T∈R|H0] = α Not rejecting a false hypothesis, Pr[Type II error] = Pr[T∈A|H1] = β Now, let's consider the cases in which we make the correct decision: Not rejecting a true hypothesis, Pr[Not(Type I error)] = Pr[T∈A|H0] = 1 - α Rejecting a false hypothesis, Pr[Not(Type II error)] = Pr [T∈R|H1] = 1 - β The complement of β is called the power of the test of the null hypothesis H0 vs. the alternative H1.
First, we calculate the appropriate statistic for the test (to or zo) as follows: • If n < 30 and the standard deviation of the population, σ, is known, use the z-statistic: • zo = σ/ n If n > 30, and σ is known, use zo as above. replace s for σ in zo, i.e., use z o = • x − µo x − µo If σ is not known, s/ n If n < 30, and σ is unknown, use the t-statistic to = x − µo , with ν = s/ n n - 1 degrees of freedom.
deviation s = 3.5. We assume that we don't know the value of the population standard deviation, therefore, we calculate a t statistic as follows: to = x − µ o 22.0 − 22.5 = = −0.7142 s/ n 3.5 / 25 The corresponding P-value, for n = 25 - 1 = 24 degrees of freedom is P-value = 2⋅UTPT(24,-0.7142) = 2⋅0.7590 = 1.5169, since 1.5169 > 0.05, i.e., P-value > α, we cannot reject the null hypothesis Ho: µ = 22.0.
• • If using z, If using t, P-value = UTPN(0,1,zo) P-value = UTPT(ν,to) Example 2 -- Test the null hypothesis Ho: µ = 22.0 ( = µo), against the alternative hypothesis, H1: µ >22.5 at a level of confidence of 95% i.e., α = 0.05, using a sample of size n = 25 with a mean x = 22.0 and a standard deviation s = 3.5. Again, we assume that we don't know the value of the population standard deviation, therefore, the value of the t statistic is the same as in the two-sided test case shown above, i.e., to = -0.
Two-sided hypothesis If the alternative hypothesis is a two-sided hypothesis, i.e., H1: µ1-µ2 ≠ δ, The P-value for this test is calculated as • • If using z, If using t, P-value = 2⋅UTPN(0,1, |zo|) P-value = 2⋅UTPT(ν,|to|) with the degrees of freedom for the t-distribution given by ν = n1 + n2 - 2. The test criteria are • • Reject Ho if P-value < α Do not reject Ho if P-value > α. One-sided hypothesis If the alternative hypothesis is a two-sided hypothesis, i.e.
Inferences concerning one proportion Suppose that we want to test the null hypothesis, H0: p = p0, where p represents the probability of obtaining a successful outcome in any given repetition of a Bernoulli trial. To test the hypothesis, we perform n repetitions of the experiment, and find that k successful outcomes are recorded. Thus, an estimate of p is given by p’ = k/n. The variance for the sample will be estimated as sp2 = p’(1-p’)/n = k⋅(n-k)/n3.
Testing the difference between two proportions Suppose that we want to test the null hypothesis, H0: p1-p2 = p0, where the p's represents the probability of obtaining a successful outcome in any given repetition of a Bernoulli trial for two populations 1 and 2. To test the hypothesis, we perform n1 repetitions of the experiment from population 1, and find that k1 successful outcomes are recorded. Also, we find k2 successful outcomes out of n2 trials in sample 2.
Pr[Z> zα] = 1-Φ(zα) = α, or Φ(z α) = 1- α, Reject the null hypothesis, H0, if z0 >zα, and H1: p1-p2 > p0, or if z0 < - zα, and H1: p1-p2
Try the following exercises: Example 1 – For µ0 = 150, σ = 10, x = 158, n = 50, for α = 0.05, test the hypothesis H0: µ = µ0, against the alternative hypothesis, H1: µ ≠ µ0. Press ‚Ù—— @@@OK@@@ to access the hypothesis testing feature in the calculator. Press @@@OK@@@ to select option 1. Z-Test: 1 µ. Enter the following data and press @@@OK@@@: You are then asked to select the alternative hypothesis. Select µ ≠150, and press @@OK@@. The result is: Then, we reject H0: µ = 150, against H1: µ ≠ 150.
Example 2 -- For µ0 = 150, x = 158, s = 10, n = 50, for α = 0.05, test the hypothesis H0: µ = µ0, against the alternative hypothesis, H1: µ > µ0. The population standard deviation, σ, is not known. Press ‚Ù—— @@@OK@@@ to access the hypothesis testing feature in the calculator. Press ——@@@OK@@@ to select option 5. T-Test: 1 µ.: Enter the following data and press @@@OK@@@: Select the alternative hypothesis, H1: µ > 150, and press @@@OK@@@.
variance, test the hypothesis H0: µ1−µ2 = 0, against the alternative hypothesis, H1: µ1−µ2 < 0. Press ‚Ù—— @@@OK@@@ to access the hypothesis testing feature in the calculator. Press —@@@OK@@@ to select option 6. T-Test: µ1−µ2.: Enter the following data and press @@@OK@@@: Select the alternative hypothesis µ1< µ2, and press @@@OK@@@. The result is Thus, we accept (more accurately, we do not reject) the hypothesis: H0: µ1−µ2 = 0, or H0: µ1=µ2, against the alternative hypothesis H1: µ1−µ2 < 0, or H1: µ1=µ2.
Inferences concerning one variance The null hypothesis to be tested is , Ho: σ2 = σo2, at a level of confidence (1α)100%, or significance level α, using a sample of size n, and variance s2.
Inferences concerning two variances The null hypothesis to be tested is , Ho: σ12 = σ22, at a level of confidence (1α)100%, or significance level α, using two samples of sizes, n1 and n2, and variances s12 and s22. The test statistic to be used is an F test statistic defined as s N2 Fo = 2 sD where sN2 and sD2 represent the numerator and denominator of the F statistic, respectively. Selection of the numerator and denominator depends on the alternative hypothesis being tested, as shown below.
Example1 -- Consider two samples drawn from normal populations such that n1 = 21, n2 = 31, s12 = 0.36, and s22 = 0.25. We test the null hypothesis, Ho: σ12 = σ22, at a significance level α = 0.05, against the alternative hypothesis, H1: σ12 ≠ σ22. For a two-sided hypothesis, we need to identify sM and sm, as follows: sM2=max(s12,s22) = max(0.36,0.25) = 0.36 = s12 sm2=min(s12,s22) = min (0.36,0.25) = 0.25 = s22 Also, nM = n1 = 21, nm = n2 = 31, νN = nM - 1= 21-1=20, νD = nm -1 = 31-1 =30.
Suppose that we have n paired observations (xi, yi); we predict y by means of ∧ y = a + b⋅x, where a and b are constant. Define the prediction error as, ei = yi - ∧yi = yi - (a + b⋅xi).
Additional equations for linear regression The summary statistics such as Σx, Σx2, etc.
Let yi = actual data value, ^yi = a + b⋅xi = least-square prediction of the data. Then, the prediction error is: ei = yi - ^yi = yi - (a + b⋅xi).
• Hypothesis testing on the intercept , Α: Null hypothesis, H0: Α = Α0, tested against the alternative hypothesis, H1: Α ≠ Α0. The test statistic is t0 = (a-Α0)/[(1/n)+x2/Sxx]1/2, where t follows the Student’s t distribution with ν = n – 2, degrees of freedom, and n represents the number of points in the sample. The test is carried out as that of a mean value hypothesis testing, i.e.
Example 1 -- For the following (x,y) data, determine the 95% confidence interval for the slope B and the intercept A x y 2.0 5.5 2.5 7.2 3.0 9.4 3.5 10.0 4.0 12.2 Enter the (x,y) data in columns 1 and 2 of ΣDAT, respectively. A scatterplot of the data shows a good linear trend: Use the Fit Data.. option in the ‚Ù menu, to get: 3: '-.86 + 3.24*X' 2: Correlation: 0.989720229749 1: Covariance: 2.025 These results are interpreted as a = -0.86, b = 3.24, rxy = 0.989720229749, and sxy = 2.025.
Confidence intervals for the slope (Β) and intercept (A): • • First, we obtain t n-2,α/2 = t3,0.025 = 3.18244630528 (See chapter 17 for a program to solve for tν,a): Next, we calculate the terms (t n-2,α/2)⋅se/√Sxx = 3.182…⋅(0.1826…/2.5)1/2 = 0.8602… (t n-2,α/2)⋅se⋅[(1/n)+x2/Sxx]1/2 = 3.1824…⋅√0.1826…⋅[(1/5)+32/2.5] 1/2 = 2.65 • Finally, for the slope B, the 95% confidence interval is (-0.86-0.860242, -0.86+0.860242) = (-1.72, -0.00024217) For the intercept A, the 95% confidence interval is (3.24-2.
Example 3 – Test of significance for the linear regression. Test the null hypothesis for the slope H0: Β = 0, against the alternative hypothesis, H1: Β ≠ 0, at the level of significance α = 0.05, for the linear fitting of Example 1. The test statistic is t0 = (b -Β0)/(se/√Sxx) = (3.24-0)/(√0.18266666667/2.5) = 18.95. The critical value of t, for ν = n – 2 = 3, and α/2 = 0.025, was obtained in Example 2, as tn-2,α/2 = t3,0.025 = 3.18244630528.
Then, the vector of coefficients is obtained from b = (XT⋅X)-1⋅XT⋅y, where y is the vector y = [y1 y2 … ym]T. For example, use the following data to obtain the multiple linear fitting y = b0 + b1⋅x1 + b2⋅x2 + b3⋅x3, x1 1.20 2.50 3.50 4.00 6.00 x2 3.10 3.10 4.50 4.50 5.00 x3 2.00 2.50 2.50 3.00 3.50 y 5.70 8.20 5.00 8.20 9.
You should have in your calculator’s stack the value of the matrix X and the vector b, the fitted values of y are obtained from y = X⋅b, thus, just press * to obtain: [5.63.., 8.25.., 5.03.., 8.23.., 9.45..]. Compare these fitted values with below: x1 x2 1.20 3.10 2.50 3.10 3.50 4.50 4.00 4.50 6.00 5.00 the original data as shown in the table x3 2.00 2.50 2.50 3.00 3.50 y 5.70 8.20 5.00 8.20 9.50 y-fitted 5.63 8.25 5.03 8.23 9.
If p = n-1, X = Vn. If p < n-1, then remove columns p+2, …, n-1, n from Vn to form X. If p > n-1, then add columns n+1, …, p-1, p+1, to Vn to form matrix X. In step 3 from this list, we have to be aware that column i (i= n+1, n+2, …, p+1) is the vector [x1i x2i … xni]. If we were to use a list of data values for x rather than a vector, i.e., x = { x1 x2 … xn }, we can easily calculate the sequence { x1i x2i … xni }.
Here is the translation of the algorithm to a program in User RPL language.
As an example, use the following data to obtain a polynomial fitting with p = 2, 3, 4, 5, 6. x y 2.30 179.72 3.20 562.30 4.50 1969.11 1.65 65.87 9.32 31220.89 1.18 32.81 6.24 6731.48 3.45 737.41 9.89 39248.46 1.22 33.45 Because we will be using the same x-y data for fitting polynomials of different orders, it is advisable to save the lists of data values x and y into variables xx and yy, respectively. This way, we will not have to type them all over again in each application of the program POLY.
Selecting the best fitting As you can see from the results above, you can fit any polynomial to a set of data. The question arises, which is the best fitting for the data? To help one decide on the best fitting we can use several criteria: • • • The correlation coefficient, r. This value is constrained to the range – 1 < r < 1. The closer r is to +1 or –1, the better the data fitting. The sum of squared errors, SSE. This is the quantity that is to be minimized by least-square approach. A plot of residuals.
« xyp « x SIZE n « x VANDERMONDE IF ‘pn-1’ THEN n1+ p1+ FOR j x j ^ OBJ ARRY j COL+ NEXT END END y OBJ ARRY X yv « X yv MTREG NUM b « b yv Xb* ABS SQ DUP y ΣLIST n / n 1 LIST SWAP CON Open program Enter lists x and y, and number p Open subprogram1 Determine size of x list Open subprogram 2 Place x in stack, obtain Vn This IF is step 3 in algorithm Place n in stack Calculate p+1 Start loop, j = n-1 to p+1, step = -1 Remove column, drop from s
yv − ABS SQ / NEG 1 + √ “r” TAG SWAP “SSE” TAG » » » » » Calculate SST Calculate SSE/SST Calculate r = [1–SSE/SST ]1/2 Tag result as “r” Exchange stack levels 1 and 2 Tag result as SSE Close sub-program 4 Close sub-program 3 Close sub-program 2 Close sub-program 1 Close main program Save this program under the name POLYR, to emphasize calculation of the correlation coefficient r.
Chapter 19 Numbers in Different Bases In this Chapter we present examples of calculations of number in bases other than the decimal basis. Definitions The number system used for everyday arithmetic is known as the decimal system for it uses 10 (Latin, deca) digits, namely 0-9, to write out any real number. Computers, on the other hand, use a system that is based on two possible states, or binary system. These two states are represented by 0 and 1, ON and OFF, or high-voltage and low-voltage.
With system flag 117 set to SOFT menus, the BASE menu shows the following: With this format, it is evident that the LOGIC, BIT, and BYTE entries within the BASE menu are themselves sub-menus. These menus are discussed later in this Chapter. Functions HEX, DEC, OCT, and BIN Numbers in non-decimal systems are written preceded by the # symbol in the calculator. The symbol # is readily available as „â(the 3 key).
As the decimal (DEC) system has 10 digits (0,1,2,3,4,5,6,7,8,9), the hexadecimal (HEX) system has 16 digits (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F), the octal (OCT) system has 8 digits (0,1,2,3,4,5,6,7), and the binary (BIN) system has only 2 digits (0,1). Conversion between number systems Whatever the number system selected, it is referred to as the binary system for the purpose of using the functions R B and B R.
To see what happens if you select the @DEC@ setting, try the following conversions: The only effect of selecting the DECimal system is that decimal numbers, when started with the symbol #, are written with the suffix d. Wordsize The wordsize is the number of bits in a binary object. By default, the wordsize is 64 bites. Function RCWS (ReCall WordSize) shows the current wordsize. Function STWS (SeT the WordSize) allows the user to reset the wordsize to any number between 0 and 64.
The LOGIC menu The LOGIC menu, available through the BASE (‚ã) provides the following functions: The functions AND, OR, XOR (exclusive OR), and NOT are logical functions. The input to these functions are two values or expressions (one in the case of NOT) that can be expressed as binary logical results, i.e., 0 or 1. Comparisons of numbers through the comparison operators =, ≠, >, <, ≤, and ≥, are logical statements that can be either true (1) or false (0).
XOR (BIN) NOT (HEX) The BIT menu The BIT menu, available through the BASE (‚ã) provides the following functions: Functions RL, SL, ASR, SR, RR, contained in the BIT menu, are used to manipulate bits in a binary integer. The definition of these functions are shown below: RL: Rotate Left one bit, e.g., #1100b #1001b SL: Shift Left one bit, e.g., #1101b #11010b ASR: Arithmetic Shift Right one bit, e.g., #1100010b #110001b SR: Shift Right one bit, e.g., #11011b #1101b RR: Rotate Right one bit, e.g.
Functions RLB, SLB, SRB, RRB, contained in the BIT menu, are used to manipulate bits in a binary integer. The definition of these functions are shown below: RLB: SLB: SRB: RRB: Rotate Left one byte, e.g., #1100b #1001b Shift Left one byte, e.g., #1101b #11010b Shift Right one byte, e.g., #11011b #1101b Rotate Right one byte, e.g., #1101b #1110b Hexadecimal numbers for pixel references Many plot option specifications use pixel references as input, e.g., { #332h #A23h } #Ah 0. 360.
Chapter 20 Customizing menus and keyboard Through the use of the many calculator menus you have become familiar with the operation of menus for a variety of applications. Also, you are familiar with the many functions available by using the keys in the keyboard, whether through their main function, or by combining them with the left-shift („), right-shift (‚) or ALPHA (~) keys. In this Chapter we provide examples of customized menus and keyboard keys that you may find useful in your own applications.
Menu numbers (RCLMENU and MENU functions) Each pre-defined menu has a number attached to it. For example, suppose that you activate the MTH menu („´). Then, using the function catalog (‚N) find function RCLMENU and activate it. In ALG mode simple press ` after RCLMENU() shows up in the screen. The result is the number 3.01. Thus, you can activate the MTH menu by using MENU(3.01), in ALG, or 3.01 MENU, in RPN. Most menus can be activated without knowing their numbers by using the keyboard.
To activate any of those functions you simply need to enter the function argument (a number), and then press the corresponding soft menu key. In ALG mode, the list to be entered as argument of function TMENU or MENU is more complicated: {{“exp”,”EXP(“},{“ln”,”LN(“},{“Gamma”,”GAMMA(“},{“!”,”!(“}} The reason for this is that, in RPN mode, the command names are both soft menu labels and commands.
Menu specification and CST variable From the two exercises shown above we notice that the most general menu specification list include a number of sub-lists equal to the number of items to be displayed in your custom menu. Each sub-list contains a label for the menu key followed by a function, expression, label, or other object that constitutes the effect of the menu key when pressed. Care must be exercised in specifying the menu list in ALG mode versus RPN mode.
Customizing the keyboard Each key in the keyboard can be identified by two numbers representing their row and column. For example, the VAR key (J) is located in row 3 of column 1, and will be referred to as key 31. Now, since each key has up to ten functions associated with it, each function is specified by decimal digits between 0 and 1, according to the following specifications: .0 or 1, unshifted key .2, key combined with .3, key combined with .4, key combined with .5, key combined with .
ASN: Assigns an object to a key specified by XY.Z STOKEYS: Stores user-defined key list RCLKEYS: Returns current user-defined key list DELKEYS: Un-assigns one or more keys in the current user-defined key list, the arguments are either 0, to un-assign all user-defined keys, or XY.Z, to un-assign key XY.Z. Recall current user-defined key list Use command RCLKEYS to see the current user-defined key list. Before any user-defined key assignments, the result should be a list containing the letter S, i.e., {S}.
in the second display line. Pressing for „Ì C for this example, you should recover the PLOT menu as follows: If you have more than one user-defined key and want to operate more than one of them at a time, you can lock the keyboard in USER mode by entering „Ì„Ì before pressing the user-defined keys. With the keyboard locked in USER mode, the specification USR will be shown in the second display line. To unlock the keyboard press „Ì once more.
Chapter 21 Programming in User RPL language User RPL language is the programming language most commonly used to program the calculator. The program components can be put together in the line editor by including them between program containers « » in the appropriate order. Because there is more experience among calculator users in programming in the RPN mode, most of the examples in this Chapter will be presented in the RPN mode.
„´@)HYP @SINH 1#~„x „º „´@)@MTH@ @LIST @ADD@ / [']~„x™ „°@)@MEM@@ @)@DIR@@ @PURGE SINH 1 x SQ ADD / 'x' PURGE ` _______________________ __________ Calculate sinh of level 1 Enter 1 and calculate x2 Calculate (1+x2), then divide Purge variable x Program in level 1 _____________________ To save the program use: [']~„gK Press J to recover your variable menu, and evaluate g(3.5) by entering the value of the argument in level 1 (3.5`) and then pressing @@@g@@@. The result is 1.2485…, i.e., g(3.5) = 1.
would be replaced by the value that the program uses and then completely removed from your variable menu after program execution. From the point of view of programming, therefore, a global variable is a variable that is accessible to the user after program execution. It is possible to use a local variable within the program that is only defined for that program and will not be available for use after program execution.
« → x « x SINH 1 x SQ ADD / » ». When done editing the program press ` . The modified program is stored back into variable @@g@@. Global Variable Scope Any variable that you define in the HOME directory or any other directory or sub-directory will be considered a global variable from the point of view of program development. However, the scope of such variable, i.e.
All these rule may sound confusing for a new calculator user. They all can be simplified to the following suggestion: Create directories and sub-directories with meaningful names to organize your data, and make sure you have all the global variables you need within the proper sub-directory. Local Variable Scope Local variables are active only within a program or sub-program. Therefore, their scope is limited to the program or sub-program where they’re defined.
DO: DO-UNTIL-END construct for loops WHILE: WHILE-REPEAT-END construct for loops TEST: Comparison operators, logical operators, flag testing functions TYPE: Functions for converting object types, splitting objects, etc.
STACK DUP SWAP DROP OVER ROT UNROT ROLL ROLLD PICK UNPICK PICK3 DEPTH DUP2 DUPN DROP2 DROPN DUPDU NIP NDUPN MEM PURGE MEM BYTES NEWOB ARCHI RESTO MEM/DIR PURGE RCL STO PATH CRDIR PGDIR VARS TVARS ORDER BRCH/IF IF THEN ELSE END BRCH/WHILE WHILE REPEAT END TEST == ≠ < > ≤ MEM/ARITH BRCH/START ≥ STO+ START AND STONEXT OR STOx STEP XOR STO/ NOT BRCH/FOR INCR SAME DECR FOR TYPE SINV NEXT SF SNEG STEP CF SCONJ FS? BRCH/DO FC? BRCH DO FS?C IFT UNTIL FC?C IFTE END LININ BRCH/CASE CASE THEN END TYPE OBJ ARRY
LIST/ELEM GET GETI PUT PUTI SIZE POS HEAD TAIL GROB GROB BLANK GOR GXOR SUB REPL LCD LCD SIZE LIST/PROC ANIMATE DOLIST PICT DOSUB NSUB PICT ENDSUB PDIM STREAM LINE REVLIST TLINE SORT BOX SEQ ARC PIXON PIXOF PIX? PVIEW PX C C PX CHARS SUB REPL POS SIZE NUM CHR OBJ STR HEAD TAIL SREPL MODES/FMT STD FIX SCI ENG FM, ML MODES/FLAG SF CF FS? FC? FS?C FS?C FC?C STOF RCLF RESET MODES/KEYS ASN STOKEYS RECLKEYS DELKEYS MODES/MENU MENU CST MODES/ANGLE TMENU DEG RCLMENU RAD GRAD RECT CYLIN SPHERE MODES/MISC B
TIME DATE DATE TIME TIME TICKS ERROR DOERR ERRN ERRM ERR0 LASTARG TIME/ALRM ACK ACKALARM STOALARM RCLALARM DELALARM FINDALARM ERROR/IFERR IFERR THEN ELSE END RUN DBUG SST SST↓ NEXT HALT KILL OFF Shortcuts in the PRG menu Many of the functions listed above for the PRG menu are readily available through other means: • • • • • • Comparison operators (≠, ≤, <, ≥, >) are available in the keyboard.
„@)@IF@@ „@)CASE@ ‚@)@IF@@ ‚@)CASE@ „@)START „@)@FOR@@ ‚@)START „@)@@DO@@ ‚@)@FOR@@ „@)WHILE Notice that the insert prompt ( ) is available after the key word for each construct so you can start typing at the right location. Keystroke sequence for commonly used commands The following are keystroke sequences to access commonly used commands for numerical programming within the PRG menu.
@)STACK DUP SWAP DROP „°@)STACK @@DUP@@ „°@)STACK @SWAP@ „°@)STACK @DROP@ @)@MEM@@ @)@DIR@@ PURGE ORDER „°@)@MEM@@ @)@DIR@@ @PURGE „°@)@MEM@@ @)@DIR@@ @ORDER @)@BRCH@ @)@IF@@ IF THEN ELSE END „°@)@BRCH@ „°@)@BRCH@ „°@)@BRCH@ „°@)@BRCH@ @)@BRCH@ @)CASE@ CASE THEN END „°@)@BRCH@ @)CASE@ @CASE@ „°@)@BRCH@ @)CASE@ @THEN@ „°@)@BRCH@ @)CASE@ @@END@ @)@BRCH@ @)START START NEXT STEP „°@)@BRCH@ @)START @START „°@)@BRCH@ @)START @NEXT „°@)@BRCH@ @)START @STEP @)@BRCH@ @)@FOR@ FOR NEXT STEP „°@)@BRCH@ @)@F
@)@BRCH@ @)WHILE@ WHILE REPEAT END @)TEST@ @)TYPE@ „°@)@BRCH@ @)WHILE@ @WHILE „°)@BRCH@ @)WHILE@ @REPEA „°)@BRCH@ @)WHILE@ @@END@ == AND OR XOR NOT SAME SF CF FS? FC? FS?C FC?C „° @)TEST@ @@@≠@@@ „° @)TEST@ L @@AND@ „° @)TEST@ L @@@OR@@ „° @)TEST@ L @@XOR@ „° @)TEST@ L @@NOT@ „° @)TEST@ L @SAME „° @)TEST@ L L @@@SF@@ „°@)TEST@ L L @@@CF@@ „° @)TEST@ L L @@FS?@ „° @)TEST@ L L @@FC?@ „° @)TEST@ L L @FS?C „° @)TEST@ L L @FC?C OBJ ARRY LIST STR TAG NUM CHR TYPE „°@)TYPE@ @OBJ @ „°@)TYPE@ @ ARRY „°@
@)LIST@ @)PROC@ REVLIST SORT SEQ „°@)LIST@ @)PROC@ @REVLI@ „°@)LIST@ @)PROC@ L @SORT@ „°@)LIST@ @)PROC@ L @@SEQ@@ @)MODES @)ANGLE@ DEG RAD „°L@)MODES @)ANGLE@ @@DEG@@ „°L@)MODES @)ANGLE@ @@RAD@@ @)MODES @)MENU@ CST MENU BEEP „°L@)MODES @)MENU@ @@CST@@ „°L@)MODES @)MENU@ @@MENU@ „°L@)MODES @)MISC@ @@BEEP@ @)@@IN@@ @)@RUN@ INFORM INPUT MSGBOX PVIEW „°L@)@@IN@@ „°L@)@@IN@@ „°L@)@OUT@ „°L@)@OUT@ @INFOR@ @INPUT@ @MSGBO@ @PVIEW@ DBUG SST SST↓ HALT KILL „°LL „°LL „°LL „°LL „°LL @)@RUN@ @)@RUN@ @)@RUN@
As additional programming exercises, and to try the keystroke sequences listed above, we present herein three programs for creating or manipulating lists.
Examples of sequential programming In general, a program is any sequence of calculator instructions enclosed between the program containers “ and ». Subprograms can be included as part of a program. The examples presented previously in this guide (e.g., in Chapters 3 and 8) 6 can be classified basically into two types: (a) programs generated by defining a function; and, (b) programs that simulate a sequence of stack operations. These two types of programs are described next.
where Cu is a constant that depends on the system of units used [Cu = 1.0 for units of the International System (S.I.), and Cu = 1.486 for units of the English System (E.S.)], n is the Manning’s resistance coefficient, which depends on the type of channel lining and other factors, y0 is the flow depth, and S0 is the channel bed slope given as a dimensionless fraction. Note: Values of the Manning’s coefficient, n, are available in tables as dimensionless numbers, typically between 0.001 to 0.5.
You can also separate the input data with spaces in a single stack line rather than using `. Programs that simulate a sequence of stack operations In this case, the terms to be involved in the sequence of operations are assumed to be present in the stack. The program is typed in by first opening the program containers with ‚å. Next, the sequence of operations to be performed is entered. When all the operations have been typed in, press ` to complete the program.
As you can see, y is used first, then we use b, g, and Q, in that order. Therefore, for the purpose of this calculation we need to enter the variables in the inverse order, i.e., (do not type the following): Q ` g `b `y ` For the specific values under consideration we use: 23 ` 32.2 ` 3 `2 ` The program itself will contain only those keystrokes (or commands) that result from removing the input values from the interactive calculation shown earlier, i.e.
Note: SQ is the function that results from the keystroke sequence „º. Save the program into a variable called hv: ³~„h~„v K A new variable @@@hv@@@ should be available in your soft key menu. (Press J to see your variable list.) The program left in the stack can be evaluated by using function EVAL. The result should be 0.228174…, as before. Also, the program is available for future use in variable @@@hv@@@. For example, for Q = 0.5 m3/s, g = 9.806 m/s2, b = 1.5 m, and y = 0.5 m, use: 0.5 # 9.806 #1.5 # 0.
it is always possible to recall the program definition into the stack (‚@@@q@@@) to see the order in which the variables must be entered, namely, → Cu n y0 S0. However, for the case of the program @@hv@@, its definition « * SQ * 2 * SWAP SQ SWAP / » does not provide a clue of the order in which the data must be entered, unless, of course, you are extremely experienced with RPN and the User RPL language.
S 42 , 2 ⋅ S 3 ⋅ ( S 2 ⋅ S1) 2 which indicates the position of the different stack input levels in the formula. By comparing this result with the original formula that we programmed, i.e., hv = Q2 , 2 g (by ) 2 we find that we must enter y in stack level 1 (S1), b in stack level 2 (S2), g in stack level 3 (S3), and Q in stack level 4 (S4). Prompt with an input string These two approaches for identifying the order of the input data are not very efficient.
The result is a stack prompting the user for the value of a and placing the cursor right in front of the prompt :a: Enter a value for a, say 35, then press `. The result is the input string :a:35 in stack level 1.
@SST↓@ Result: a:2 @SST↓@ Result: empty stack, executing →a @SST↓@ Result: empty stack, entering subprogram « @SST↓@ Result: ‘2*a^2+3’ @SST↓@ Result: ‘2*a^2+3’, leaving subprogram » @SST↓@ Result: ‘2*a^2+3’, leaving main program» Further pressing the @SST↓@ soft menu key produces no more output since we have gone through the entire program, step by step. This run through the debugger did not provide any information on why the program is not calculating the value of 2a2+3 for a = 2.
This can be used to execute at once any sub-program called from within a main program. Examples of the application of @@SST@ will be shown later. Fixing the program The only possible explanation for the failure of the program to produce a numerical result seems to be the lack of the command NUM after the algebraic expression ‘2*a^2+3’. Let’s edit the program by adding the missing EVAL function.
stack level 7 to give a title to the input string, and leave stack level 6 empty to facilitate reading the display, we have only stack levels 1 through 5 to define input variables. Input string program for two input values The input string program for two input values, say a and b, looks as follows: « “Enter a and b: “ {“ :a: :b: “ {2 0} V } INPUT OBJ→ » This program can be easily created by modifying the contents of INPTa. Store this program into variable INPT2.
Store the new program back into variable @@@p@@@. Press @@@p@@@ to run the program. Enter values of V = 0.01_m^3 and T = 300_K in the input string, then press `. The result is 49887.06_J/m^3. The units of J/m^3 are equivalent to Pascals (Pa), the preferred pressure unit in the S.I. system. Note: because we deliberately included units in the function definition, the input values must have units attach to them in input to produce the proper result.
Enter values of V = 0.01_m^3, T = 300_K, and n = 0.8_mol. Before pressing `, the stack will look like this: Press ` to get the result 199548.24_J/m^3, or 199548.24_Pa = 199.55 kPa. Input through input forms Function INFORM („°L@)@@IN@@ @INFOR@.) can be used to create detailed input forms for a program. Function INFORM requires five arguments, in this order: 1. A title: a character string describing the input form 2.
The lists in items 4 and 5 can be empty lists. Also, if no value is to be selected for these options you can use the NOVAL command („°L@)@@IN@@ @NOVAL@). After function INFORM is activated you will get as a result either a zero, in case the @CANCEL option is entered, or a list with the values entered in the fields in the order specified and the number 1, i.e.
4. List of reset values: { 120 1 .0001} 5. List of initial values: { 110 1.5 .00001} Save the program into variable INFP1. Press @INFP1 to run the program. The input form, with initial values loaded, is as follows: To see the effect of resetting these values use L @RESET (select Reset all to reset field values): Now, enter different values for the three fields, say, C = 95, R = 2.5, and S = 0.003, pressing @@@OK@@@ after entering each of these new values.
Thus, we demonstrated the use of function INFORM. To see how to use these input values in a calculation modify the program as follows: « “ CHEZY’S EQN” { { “C:” “Chezy’s coefficient” 0} { “R:” “Hydraulic radius” 0 } { “S:” “Channel bed slope” 0} } { } { 120 1 .0001} { 110 1.5 .
« “ CHEZY’S EQN” { { “C:” “Chezy’s coefficient” 0} { “R:” “Hydraulic radius” 0 } { “S:” “Channel bed slope” 0} } { 2 1 } { 120 1 .0001} { 110 1.5 .00001 } INFORM IF THEN OBJ DROP C R S ‘C*(R*S)’ NUM “Q” TAG ELSE “Operation cancelled” MSGBOX END » Running program @INFP2 produces the following input form: Example 3 – Change the field format information list to { 3 0 } and save the modified program into variable INFP3.
Activation of the CHOOSE function will return either a zero, if a @CANCEL action is used, or, if a choice is made, the choice selected (e.g., v) and the number 1, i.e., in the RPN stack: 2: v 1: 1 Example 1 – Manning’s equation for calculating the velocity in an open channel flow includes a coefficient, Cu, which depends on the system of units used. If using the S.I. (Systeme International), Cu = 1.0, while if using the E.S. (English System), Cu = 1.486.
the commands “Operation cancelled” MSGBOX will show a message box indicating that the operation was cancelled. Identifying output in programs The simplest way to identify numerical program output is to “tag” the program results. A tag is simply a string attached to a number, or to any object. The string will be the name associated with the object. For example, earlier on, when debugging programs INPTa (or INPT1) and INPT2, we obtained as results tagged numerical output such as :a:35.
Note: For mathematical operations with tagged quantities, the calculator will "detag" the quantity automatically before the operation. For example, the lefthand side figure below shows two tagged quantities before and after pressing the * key in RPN mode: Examples of tagged output Example 1 – tagging output from function FUNCa Let’s modify the function FUNCa, defined earlier, to produce a tagged output. Use ‚ @FUNCa to recall the contents of FUNCa to the stack.
(Recall that the function SWAP is available by using „°@)STACK @SWAP@). Store the program back into FUNCa by using „ @FUNCa. Next, run the program by pressing @FUNCa . Enter a value of 2 when prompted, and press `. The result is now two tagged numbers a:2. in stack level 2, and F:11. in stack level 1. Note: Because we use an input string to get the input data value, the local variable a actually stores a tagged value ( :a:2, in the example above). Therefore, we do not need to tag it in the output.
Example 3 – tagging input and output from function p(V,T) In this example we modify the program @@@p@@@ so that the output tagged input values and tagged result. Use ‚@@@p@@@ to recall the contents of the program to the stack: “Enter V, T, and n:“ {“ :V: :T: :n:“ {2 0} V } INPUT OBJ→ → V T n ‘(8.31451_J/(K*mol))*(n*T/V)‘ » « Modify it to read: « “Enter V, T and n: “ {“ :V: :T: :n:“ {2 0} V } INPUT OBJ→ → V T n « V T n ‘(8.
To erase any character while editing the program, place the cursor to the right of the character to be erased and use the backspace key ƒ. Store the program back into variable p by using „@@@p@@@. Next, run the program by pressing @@@p@@@. Enter values of V = 0.01_m^3, T = 300_K, and n = 0.8_mol, when prompted.
The result is the following message box: Press @@@OK@@@ to cancel the message box. You could use a message box for output from a program by using a tagged output, converted to a string, as the output string for MSGBOX. To convert any tagged result, or any algebraic or non-tagged value, to a string, use the function →STR available at „°@)TYPE@ @ STR.
Press @@@OK@@@ to cancel message box output. The stack will now look like this: Including input and output in a message box We could modify the program so that not only the output, but also the input, is included in a message box. For the case of program @@@p@@@, the modified program will look like: “Enter V, T and n: “ {“ :V: :T: :n: “ {2 0} V } INPUT OBJ→ → V T n « V →STR “ ” + T →STR “ ” + n →STR “ ” + ‘(8.
You will notice that after typing the keystroke sequence ‚ë a new line is generated in the stack. The last modification that needs to be included is to type in the plus sign three times after the call to the function at the very end of the sub-program. Note: The plus sign (+) in this program is used to concatenate strings. Concatenation is simply the operation of joining individual character strings. To see the program operating: • • • Store the program back into variable p by using „@@@p@@@.
values may be a tedious process. You could have the program itself attach those units to the input and output values. We will illustrate these options by modifying yet once more the program @@@p@@@, as follows. Recall the contents of program @@@p@@@ to the stack by using ‚@@@p@@@, and modify them to look like this: Note: I’ve separated the program arbitrarily into several lines for easy reading. This is not necessarily the way that the program shows up in the calculator’s stack.
we generate a number with units (e.g., 0.01_m^3), but the tag is lost. 4. T ‘1_K’ * :Calculating value of T including S.I. units 5. n ‘1_mol’ * : Calculating value of n including units 6. → V T n : The values of V, T, and n, located respectively in stack levels 3, 2, and 1, are passed on to the next level of sub-programming. To see this version of the program in action do the following: • • • Store the program back into variable p by using [ ][ p ]. Run the program by pressing [ p ].
Message box output without units Let’s modify the program @@@p@@@ once more to eliminate the use of units throughout it. The unit-less program will look like this: « “Enter V,T,n [S.I.]: “ {“ :V: :T: :n: “ {2 0} V } INPUT OBJ→ → V T n « V DTAG T DTAG n DTAG → V T n « “V=” V →STR + “ ”+ “T=” T →STR + “ ” + “n=” n →STR + “ ” + ‘8.31451*n*T/V‘ EVAL →STR “p=” SWAP + + + + MSGBOX » » » And when run with the input data V = 0.01, T = 300, and n = 0.
statement can be true (represented by the numerical value of 1. in the calculator), or false (represented by the numerical value of 0. in the calculator).
The available logical operators are: AND, OR, XOR (exclusive or), NOT, and SAME. The operators will produce results that are true or false, depending on the truth-value of the logical statements affected. The operator NOT (negation) applies to a single logical statements. All of the others apply to two logical statements.
The calculator includes also the logical operator SAME. This is a nonstandard logical operator used to determine if two objects are identical. If they are identical, a value of 1 (true) is returned, if not, a value of 0 (false) is returned. For example, the following exercise, in RPN mode, returns a value of 0: ‘SQ(2)’ ` 4 ` SAME Please notice that the use of SAME implies a very strict interpretation of the word “identical.
The IF…THEN…END construct The IF…THEN…END is the simplest of the IF program constructs. The general format of this construct is: IF logical_statement THEN program_statements END. The operation of this construct is as follows: 1. Evaluate logical_statement. 2. If logical_statement is true, perform program _statements and continue program flow after the END statement. 3. If logical_statement is false, skip program_statements and continue program flow after the END statement.
and save it under the name ‘f1’. Press J and verify that variable @@@f1@@@ is indeed available in your variable menu. Verify the following results: 0 @@@f1@@@ Result: 0 3.5 @@@f1@@@ Result: no action 1.2 @@@f1@@@ Result: 1.44 10 @@@f1@@@ Result: no action These results confirm the correct operation of the IF…THEN…END construct. The program, as written, calculates the function f1(x) = x2, if x < 3 (and not output otherwise).
→ x « IF ‘x<3’ THEN ‘x^2‘ ELSE ‘1-x’ END EVAL ”Done” MSGBOX » » and save it under the name ‘f2’. Press J and verify that variable @@@f2@@@ is indeed available in your variable menu. Verify the following results: 0 @@@f2@@@ Result: 0 1.2 @@@f2@@@ Result: 1.44 3.5 @@@f2@@@ Result: -2.5 10 @@@f2@@@ Result: -9 These results confirm the correct operation of the IF…THEN…ELSE…END construct.
While this simple construct works fine when your function has only two branches, you may need to nest IF…THEN…ELSE…END constructs to deal with function with three or more branches.
→ x « IF ‘x<3‘ THEN ‘x^2‘ ELSE IF ‘x<5‘ THEN ‘1-x‘ ELSE IF ‘x<3*π‘ THEN ‘SIN(x)‘ ELSE IF ‘x<15‘ THEN ‘EXP(x)‘ ELSE –2 END END END END EVAL » » « Store the program in variable @@@f3@@@ and try the following evaluations: 1.5 @@f3@@@ 2.5 @@@f3@@@ 4.2 @@@f3@@@ 5.6 @@@f3@@@ 12 @@@f3@@@ 23 @@@f3@@@ Result: Result: Result: Result: Result: Result: 2.25 (i.e., x2) 6.25 (i.e., x2) -3.2 (i.e., 1-x) -0.631266… (i.e., sin(x), with x in radians) 162754.791419 (i.e., exp(x)) -2. (i.e.
If you are in the BRCH menu, i.e.
As you can see, f3c produces exactly the same results as f3. The only difference in the programs is the branching constructs used. For the case of function f3(x), which requires five expressions for its definition, the CASE construct may be easier to code than a number of nested IF … THEN … ELSE … END constructs. Program loops Program loops are constructs that permit the program the execution of a number of statements repeatedly.
„°@)@BRCH@ @)START @START Within the BRCH menu („°@)@BRCH@) the following keystrokes are available to generate START constructs (the symbol indicates cursor position): • „ @START NEXT : Starts the START…NEXT construct: START • ‚ @START : Starts the START…STEP construct: START STEP The START…NEXT construct The general form of this statement is: start_value end_value START program_statements NEXT Because for this case the increment is 1, in order for the loop to end you should ensure that start_valu
2. A zero is entered, moving n to stack level 2. 3. The command DUP, which can be typed in as ~~dup~, copies the contents of stack level 1, moves all the stack levels upwards, and places the copy just made in stack level 1. Thus, after DUP is executed, n is in stack level 3, and zeroes fill stack levels 1 and 2. 4. The piece of code → n S k stores the values of n, 0, and 0, respectively into local variables n, S, k.
@SST↓@ @SST↓@ @SST↓@ SL1 = 0., (start value of loop index) SL1 = 2.(n), SL2 = 0. (end value of loop index) Empty stack (START – beginning of loop) --- loop execution number 1 for k = 0 @SST↓@ SL1 = 0. (k) @SST↓@ SL1 = 0. (SQ(k) = k2) @SST↓@ SL1 = 0.(S), SL2 = 0. (k2) @SST↓@ SL1 = 0. (S + k2) @SST↓@ SL1 = 1., SL2 = 0. (S + k2) @SST↓@ SL1 = 0.(k), SL2 = 1., SL3 = 0. (S + k2) @SST↓@ SL1 = 1.(k+1), SL2 = 0. (S + k2) @SST↓@ SL1 = ‘k’, SL2 = 1., SL3 = 0. (S + k2) @SST↓@ SL1 = 0.
@SST↓@ Empty stack (NEXT – end of loop) --- loop execution number 3 for k = 2 @SST↓@ SL1 = 2. (k) @SST↓@ SL1 = 4. (SQ(k) = k2) @SST↓@ SL1 = 1.(S), SL2 = 4. (k2) @SST↓@ SL1 = 5. (S + k2) @SST↓@ SL1 = 1., SL2 = 5. (S + k2) @SST↓@ SL1 = 2.(k), SL2 = 1., SL3 = 5. (S + k2) @SST↓@ SL1 = 3.(k+1), SL2 = 5. (S + k2) @SST↓@ SL1 = ‘k’, SL2 = 3., SL3 = 5. (S + k2) @SST↓@ SL1 = 5. (S + k2) [Stores value of SL2 = 3, into SL1 = ‘k’] @SST↓@ SL1 = ‘S’, SL2 = 5.
The START…STEP construct The general form of this statement is: start_value end_value START program_statements increment NEXT The start_value, end_value, and increment of the loop index can be positive or negative quantities. For increment > 0, execution occurs as long as the index is less than or equal to end_value. For increment < 0, execution occurs as long as the index is greater than or equal to end_value.
Use @SST↓@ to step into the program and see the detailed operation of each command. The FOR construct As in the case of the START command, the FOR command has two variations: the FOR…NEXT construct, for loop index increments of 1, and the FOR…STEP construct, for loop index increments selected by the user. Unlike the START command, however, the FOR command does require that we provide a name for the loop index (e.g., j, k, n).
Using a FOR…NEXT loop: « 0 →n S « 0 n FOR k k SQ S + ‘S‘ STO NEXT S “S” →TAG » » Store this program in a variable @@S2@@. Verify the following exercises: J 3 5 10 30 @@@S2@@ @@@S2@@ @@@S2@@ @@@S2@@ Result: Result: Result: Result: S:14 S:55 S:385 S:9455 4 @@@S2@@ Result: 8 @@@S2@@ Result: 20 @@@S2@@ Result: 100 @@@S2@@ Result: S:30 S:204 S:2870 S:338350 You may have noticed that the program is much simpler than the one stored in @@@S1@@.
• • Check out that the program call 0.5 ` 2.5 ` 0.5 ` @GLIS2 produces the list {0.5 1. 1.5 2. 2.5}. To see step-by-step operation use the program DBUG for a short list, for example: J1 # 1.5 # 0.5 ` [‘] @GLIS2 ` „°LL @)@RUN@ @@DBG@ Enter parameters 1 1.5 0.5 Enter the program name in level 1 Start the debugger. Use @SST↓@ to step into the program and see the detailed operation of each command.
Store this program in a variable @@S3@@. Verify the following exercises: J 3 @@@S3@@ Result: S:14 4 @@@S3@@ Result: S:30 5 @@@S3@@ Result: S:55 8 @@@S3@@ Result: S:204 10 @@@S3@@ Result: S:385 20 @@@S3@@ Result: S:2870 30 @@@S3@@ Result: S:9455 100 @@@S3@@ Result: S:338350 Example 3 – generate a list using a DO…UNTIL…END construct Type in the following program « → xs xe dx « xe xs – dx / ABS 1. + xs → n x « xs DO ‘x+dx’ EVAL DUP ‘x’ STO UNTIL ‘x≥xe’ END n →LIST » » » and store it in variable @GLIS3.
loop index that gets modified before the logical_statement is checked at the beginning of the next repetition. Unlike the DO command, if the first evaluation of logical_statement is false, the loop is never executed. Example 1 – calculate the summation S using a WHILE…REPEAT…END construct The following program calculates the summation n S = ∑k2 k =0 Using a WHILE…REPEAT…END loop: 0. → n S « WHILE ‘n≥0‘ REPEAT n SQ S + ‘S‘ STO n 1 – ‘n‘ STO END S “S” →TAG » » « Store this program in a variable @@S4@@.
J1 # 1.5 # 0.5 ` [‘] @GLIS4 ` „°LL @)@RUN@ @@DBG@ Enter parameters 1 1.5 0.5 Enter the program name in level 1 Start the debugger. Use @SST↓@ to step into the program and see the detailed operation of each command. Errors and error trapping The functions of the PRG/ERROR sub-menu provide ways to manipulate errors in the calculator, and trap errors in programs.
ERRM This function returns a character string representing the error message of the most recent error. For example, in Approx mode, if you try 0Y$@ERRM, you get the following string: “Infinite Result” ERR0 This function clears the last error number, so that, executing ERRN afterwards, in Approx mode, will return # 0h. For example, if you try 0Y$@ERR0 @ERRN, you get # 0h. Also, if you try 0Y$@ERR0 @ERRM, you get the empty string “ “.
IF trap-clause THEN error-clause END IF trap-clause THEN error-clause ELSE normal-clause END The operation of these logical constructs is similar to that of the IF … THEN … END and of the IF … THEN … ELSE … END constructs. If an error is detected during the execution of the trap-clause, then the error-clause is executed. Otherwise, the normal-clause is executed.
statement. At this point you will be ready to type the RPL program. The following figures show the RPL> command with the program before and after pressing the ` key.
Chapter 22 Programs for graphics manipulation This chapter includes a number of examples showing how to use the calculator’s functions for manipulating graphics interactively or through the use of programs. As in Chapter 21 we recommend using RPN mode and setting system flag 117 to SOFT menu labels. « » We introduce a variety of calculator graphic applications in Chapter 12. The examples of Chapter 12 represent interactive production of graphics using the calculator’s pre-programmed input forms.
To user-define a key you need to add to this list a command or program followed by a reference to the key (see details in Chapter 20). Type the list { S << 81.01 MENU >> 13.0 } in the stack and use function STOKEYS („°L@)MODES @)@KEYS@ @@STOK@) to user-define key C as the access to the PLOT menu. Verify that such list was stored in the calculator by using „°L@)MODES @)@KEYS@ @@RCLK@. Note: We will not work any exercise while presenting the PLOT menu, its functions or sub-menus.
LABEL (10) The function LABEL is used to label the axes in a plot including the variable names and minimum and maximum values of the axes. The variable names are selected from information contained in the variable PPAR. AUTO (11) The function AUTO (AUTOscale) calculates a display range for the y-axis or for both the x- and y-axes in two-dimensional plots according to the type of plot defined in PPAR. For any of the three-dimensional graphs the function AUTO produces no action.
EQ (3) The variable name EQ is reserved by the calculator to store the current equation in plots or solution to equations (see chapter …). The soft menu key labeled EQ in this menu can be used as it would be if you have your variable menu available, e.g., if you press [ EQ ] it will list the current contents of that variable. ERASE (4) The function ERASE erases the current contents of the graphics window.
Note: the SCALE commands shown here actually represent SCALE, SCALEW, SCALEH, in that order. The following diagram illustrates the functions available in the PPAR menu. The letters attached to each function in the diagram are used for reference purposes in the description of the functions shown below.
INDEP (a) The command INDEP specifies the independent variable and its plotting range. These specifications are stored as the third parameter in the variable PPAR. The default value is 'X'. The values that can be assigned to the independent variable specification are: • • • • • A variable name, e.g., 'Vel' A variable name in a list, e.g., { Vel } A variable name and a range in a list, e.g., { Vel 0 20 } A range without a variable name, e.g., { 0 20 } Two values representing a range, e.g.
CENTR (g) The command CENTR takes as argument an ordered pair (x,y) or a value x, and adjusts the first two elements in the variable PPAR, i.e., (xmin, ymin) and (xmax, ymax), so that the center of the plot is (x,y) or (x,0), respectively. SCALE (h) The SCALE command determines the plotting scale represented by the number of user units per tick mark. The default scale is 1 user-unit per tick mark.
A list of two binary integers {#n #m}: sets the tick annotations in the x- and yaxes to #n and #m pixels, respectively. AXES (k) The input value for the axes command consists of either an ordered pair (x,y) or a list {(x,y) atick "x-axis label" "y-axis label"}. The parameter atick stands for the specification of the tick marking annotations as described above for the command ATICK. The ordered pair represents the center of the plot.
The PTYPE menu within 3D (IV) The PTYPE menu under 3D contains the following functions: These functions correspond to the graphics options Slopefield, Wireframe, YSlice, Ps-Contour, Gridmap and Pr-Surface presented earlier in this chapter. Pressing one of these soft menu keys, while typing a program, will place the corresponding function call in the program. Press L@)@3D@@ to get back to the main 3D menu.
XVOL (N), YVOL (O), and ZVOL (P) These functions take as input a minimum and maximum value and are used to specify the extent of the parallelepiped where the graph will be generated (the viewing parallelepiped). These values are stored in the variable VPAR. The default values for the ranges XVOL, YVOL, and ZVOL are –1 to 1. XXRNG (Q) and YYRNG (R) These functions take as input a minimum and maximum value and are used to specify the ranges of the variables x and y to generate functions z = f(x,y).
The STAT menu within PLOT The STAT menu provides access to plots related to statistical analysis. Within this menu we find the following menus: The diagram below shows the branching of the STAT menu within PLOT. The numbers and letters accompanying each function or menu are used for reference in the descriptions that follow the figure.
The PTYPE menu within STAT (I) The PTYPE menu provides the following functions: These keys correspond to the plot types Bar (A), Histogram (B), and Scatter(C), presented earlier. Pressing one of these soft menu keys, while typing a program, will place the corresponding function call in the program. Press @)STAT to get back to the STAT menu. The DATA menu within STAT (II) The DATA menu provides the following functions: The functions listed in this menu are used to manipulate the ΣDAT statistical matrix.
and slope of a data fitting model, and the type of model to be fit to the data in ΣDAT. XCOL (H) The command XCOL is used to indicate which of the columns of ΣDAT, if more than one, will be the x- column or independent variable column. YCOL (I) The command YCOL is used to indicate which of the columns of ΣDAT, if more than one, will be the y- column or dependent variable column. MODL (J) The command MODL refers to the model to be selected to fit the data in ΣDAT, if a data fitting is implemented.
• • • AXES: when selected, axes are shown if visible within the plot area or volume. CNCT: when selected the plot is produced so that individual points are connected. SIMU: when selected, and if more than one graph is to be plotted in the same set of axes, plots all the graphs simultaneously. Press @)PLOT to return to the PLOT menu.
Three-dimensional graphics The three-dimensional graphics available, namely, options Slopefield, Wireframe, Y-Slice, Ps-Contour, Gridmap and Pr-Surface, use the VPAR variable with the following format: {xleft, xright, ynear, yfar, zlow, zhigh, xmin, xmax, ymin, ymax, xeye, yeye, zeye, xstep, ystep} These pairs of values of x, y, and z, represent the following: • Dimensions of the view parallelepiped (xleft, xright, ynear, yfar, zlow, zhigh) • Range of x and y independent variables (xmin, xmax, ymin, ymax) •
@)PPAR ~„r` @INDEP ~„s` @DEPND 1 \# 10 @XRNG 1 \# 5 @YRNG L { (0,0) {.4 .2} “Rs” “Sr”} @AXES L @)PLOT @ERASE @DRAX L @LABEL L @DRAW @)EDIT L@MENU LL@)PICT @CANCL Show plot parameters Define ‘r’ as the indep.
‘1+SIN(θ)’ ` „ @@EQ@@ @)PPAR { θ 0 6.29} ` @INDEP ~y` @DEPND 3 \# 3 @XRNG 0.5 \# 2.5 @YRNG L { (0,0) {.5 .5} “x” “y”} ` @AXES L @)PLOT @ERASE @DRAX L @LABEL L @DRAW @)EDIT L@MENU LL@)PICT @CANCL Store complex funct. r = f(θ) into EQ Show plot parameters Define ‘θ’ as the indep. Variable Define ‘Y’ as the dependent variable Define (-3,3) as the x-range Define (-0.5,2.
« {PPAR EQ} PURGE ‘√r’ STEQ ‘r’ INDEP ‘s’ DEPND FUNCTION { (0.,0.) {.4 .2} “Rs” “Sr” } AXES –1. 5. XRNG –1. 5. YRNG ERASE DRAW DRAX LABEL PICTURE » Start program Purge current PPAR and EQ Store ‘√r’ into EQ Set independent variable to ‘r’ Set dependent variable to ‘s’ Select FUNCTION as the plot type Set axes information Set x range Set y range Erase & draw plot, axes, and labels Recall graphics screen to stack Store the program in variable PLOT1. To run it, press J, if needed, then press @PLOT1.
Example 3 – A polar plot. Enter the following program: « Start program RAD {PPAR EQ} PURGE Change to radians, purge vars. ‘1+SIN(θ)’ STEQ Store ‘f(θ)’ into EQ { θ 0. 6.29} INDEP Set indep. variable to ‘θ’, with range ‘Y’ DEPND Set dependent variable to ‘Y’ POLAR Select POLAR as the plot type { (0.,0.) {.5 .5} “x” “y”} AXES Set axes information –3. 3. XRNG Set x range –.5 2.
PICT This soft key refers to a variable called PICT that stores the current contents of the graphics window. This variable name, however, cannot be placed within quotes, and can only store graphics objects. In that sense, PICT is like no other calculator variables. PDIM The function PDIM takes as input either two ordered pairs (xmin,ymin) (xmax,ymax) or two binary integers #w and #h. The effect of PDIM is to replace the current contents of PICT with an empty screen.
between those coordinates, turning off pixels that are on in the line path and vice versa. BOX This command takes as input two ordered pairs (x1,y1) (x2, y2), or two pairs of pixel coordinates {#n1 #m1} {#n2 #m2}. It draws the box whose diagonals are represented by the two pairs of coordinates in the input. ARC This command is used to draw an arc. ARC takes as input the following objects: • • • Coordinates of the center of the arc as (x,y) in user coordinates or {#n, #m} in pixels.
PIX?, PIXON, and PIXOFF These functions take as input the coordinates of point in user coordinates, (x,y), or in pixels {#n, #m}. • • • PIX? Checks if pixel at location (x,y) or {#n, #m} is on. PIXOFF turns off pixel at location (x,y) or {#n, #m}. PIXON turns on pixel at location (x,y) or {#n, #m}. PVIEW This command takes as input the coordinates of a point as user coordinates (x,y) or pixels {#n, #m}, and places the contents of PICT with the upper left corner at the location of the point specified.
« DEG 0. 100. XRNG 0. 50. YRNG ERASE (5., 2.5) (95., 47.5) BOX (50., 50.) 10. 0. 360. ARC (50., 50.) 12. –180. 180. ARC 1 8 FOR j (50., 50.) DUP ‘12*COS(45*(j-1))’ NUM ‘12*SIN(45*(j-1))’ NUM R C + LINE NEXT { } PVIEW » Start program Select degrees for angular measures Set x range Set y range Erase picture Draw box from (5,5) to (95,95) Draw a circle center (50,50), r =10. Draw a circle center (50,50), r= 12.
It is suggested that you create a separate sub-directory to store the programs. You could call the sub-directory RIVER, since we are dealing with irregular open channel cross-sections, typical of rivers. To see the program XSECT in action, use the following data sets. Enter them as matrices of two columns, the first column being x and the second one y. Store the matrices in variables with names such as XYD1 (X-Y Data set 1) and XYD2 (X-Y Data set 2).
Data set 1 x 0.4 1.0 2.0 3.4 4.0 5.8 7.2 7.8 9.0 y 6.3 4.9 4.3 3.0 1.2 2.0 3.8 5.3 7.2 Data set 2 x 0.7 1.0 1.5 2.2 3.5 4.5 5.0 6.0 7.1 8.0 9.0 10.0 10.5 11.0 y 4.8 3.0 2.0 0.9 0.4 1.0 2.0 2.5 2.0 0.7 0.0 1.5 3.4 5.0 Note: The program FRAME, as originally programmed (see diskette or CD ROM), does not maintain the proper scaling of the graph.
correspond to the lower right corner of the screen {# 82h #3Fh}, which in user-coordinates is the point (xmax, ymin). The coordinates of the two other corners both in pixel as well as in user-defined coordinates are shown in the figure. Animating graphics Herein we present a way to produce animation by using the Y-Slice plot type. Suppose that you want to animate the traveling wave, f(X,Y) = 2.5 sin(X-Y). We can treat the X as time in the animation producing plots of f(X,Y) vs. Y for different values of X.
Animating a collection of graphics The calculator provides the function ANIMATE to animate a number of graphics that have been placed in the stack. You can generate a graph in the graphics screen by using the commands in the PLOT and PICT menus. To place the generated graph in the stack, use PICT RCL. When you have n graphs in levels n through 1 of the stack, you can simply use the command n ANIMATE to produce an animation made of the graphs you placed in the stack.
The 11 graphics generated by the program are still available in the stack. If you want to re-start the animation, simply use: 11 ANIMATE. (Function ANIMATE is available by using „°L@)GROB L @ANIMA). The animation will be re-started. Press $ to stop the animation once more. Notice that the number 11 will still be listed in stack level 1. Press ƒ to drop it from the stack. Suppose that you want to keep the figures that compose this animation in a variable.
otherwise quiescent water that gets reflected from the walls of a circular tank back towards the center. Press $ to stop the animation. Example 2 - Animating the plotting of different power functions Suppose that you want to animate the plotting of the functions f(x) = xn, n = 0, 1, 2, 3, 4, in the same set of axes.
Graphic objects (GROBs) The word GROB stands for GRaphics OBjects and is used in the calculator’s environment to represent a pixel-by-pixel description of an image that has been produced in the calculator’s screen. Therefore, when an image is converted into a GROB, it becomes a sequence of binary digits (binary digits = bits), i.e., 0’s and 1’s. To illustrate GROBs and conversion of images to GROBS consider the following exercise.
You can also convert equations into GROBs. For example, using the equation writer type in the equation ‘X^2+3’ into stack level 1, and then press 1` „°L@)GROB @ GROB . You will now have in level 1 the GROB described as: As a graphic object this equation can now be placed in the graphics display. To recover the graphics display press š. Then, move the cursor to an empty sector in the graph, and press @)EDIT LL@REPL.
BLANK The function BLANK, with arguments #n and #m, creates a blank graphics object of width and height specified by the values #n and #m, respectively. This is similar to the function PDIM in the GRAPH menu. GOR The function GOR (Graphics OR) takes as input grob2 (a target GROB), a set of coordinates, and grob1, and produces the superposition of grob1 onto grob2 (or PICT) starting at the specified coordinates. The coordinates can be specified as user-defined coordinates (x,y), or pixels {#n #m}.
An example of a program using GROB The following program produces the graph of the sine function including a frame – drawn with the function BOX – and a GROB to label the graph. Here is the listing of the program: « RAD 131 R B 64 R B PDIM -6.28 6.28 XRNG –2. 2. YRNG FUNCTION ‘SIN(X)’ STEQ ERASE DRAX LABEL DRAW (-6.28,-2.) (6.28,2.) BOX PICT RCL “SINE FUNCTION” 1 GROB (-6., 1.
side figure shows the state of stresses when the element is rotated by an angle φ. In this case, the normal stresses are σ’xx and σ’yy, while the shear stresses are τ’xy and τ’yx. The relationship between the original state of stresses (σxx, σyy, τxy, τyx) and the state of stress when the axes are rotated counterclockwise by f (σ’xx, σ’yy, τ’xy, τ’yx), can be represented graphically by the construct shown in the figure below.
with respect to segment AB. The coordinates of point A’ will give the values (σ’xx,τ’xy), while those of B’ will give the values (σ’yy,τ’xy). The stress condition for which the shear stress, τ’xy, is zero, indicated by segment D’E’, produces the so-called principal stresses, σPxx (at point D’) and σPyy (at point E’). To obtain the principal stresses you need to rotate the coordinate system x’-y’ by an angle φn, counterclockwise, with respect to the system x-y.
Modular programming To develop the program that will plot Mohr’s circle given a state of stress, we will use modular programming. Basically, this approach consists in decomposing the program into a number of sub-programs that are created as separate variables in the calculator. These sub-programs are then linked by a main program, that we will call MOHRCIRCL. We will first create a subdirectory called MOHRC within the HOME directory, and move into that directory to type the programs.
INDAT, MOHRC. Before re-ordering the variables, run the program once by pressing the soft-key labeled @MOHRC. Use the following: @MOHRC 25˜ 75˜ 50` Launches the main program MOHRCIRCL Enter σx = 25 Enter σy = 75 Enter τxy = 50, and finish data entry. At this point the program MOHRCIRCL starts calling the sub-programs to produce the figure. Be patient. The resulting Mohr’s circle will look as in the picture to the left.
To find the principal normal values press š until the cursor returns to the intersection of the circle with the positive section of the σ-axis. The values found at that point are φ = 59o, and (σ’xx, τ’xy) = (1.06E2,-1.40E0) = (106, 1.40). Now, we expected the value of τ’xy = 0 at the location of the principal axes. What happens is that, because we have limited the resolution on the independent variable to be ∆φ = 1o, we miss the actual point where the shear stresses become zero.
The result is: Ordering the variables in the sub-directory Running the program MOHRCIRCL for the first time produced a couple of new variables, PPAR and EQ. These are the Plot PARameter and EQuation variables necessary to plot the circle. It is suggest that we re-order the variables in the sub-directory, so that the programs @MOHRC and @PRNST are the two first variables in the soft-menu key labels.
J@MOHRC 12.5˜ 6.25\˜ 5\` Start program PRNST Enter σx = 12.5 Enter σy = -6.25 Enter τxy = -5, and finish data entry. The result is: To find the values of the stresses corresponding to a rotation of 35o in the angle of the stressed particle, we use: $š @TRACE @(x,y)@. Clear screen, show PICT in graphics screen To move cursor over the circle showing φ and (x,y) Next, press ™ until you read φ = 35. The corresponding coordinates are (1.63E0, -1.05E1), i.e., at φ = 35o, σ’xx = 1.63 kPa, and σ’yy = -10.5kPa.
Press @@@OK@@@ to continue program execution.
Chapter 23 Character strings Character strings are calculator objects enclosed between double quotes. They are treated as text by the calculator. For example, the string “SINE FUNCTION”, can be transformed into a GROB (Graphics Object), to label a graph, or can be used as output in a program. Sets of characters typed by the user as input to a program are treated as strings. Also, many objects in program output are also strings.
Examples of application of these functions to strings are shown next: String concatenation Strings can be concatenated (joined together) by using the plus sign +, for example: Concatenating strings is a practical way to create output in programs. For example, concatenating "YOU ARE " AGE + " YEAR OLD" creates the string "YOU ARE 25 YEAR OLD", where 25 is stored in the variable called AGE. The CHARS menu The CHARS sub-menu is accessible through the PRG (programming) menu, i.e., „°.
The operation of NUM, CHR, OBJ , and STR was presented earlier in this Chapter. We have also seen the functions SUB and REPL in relation to graphics earlier in this chapter.
say they line feed character , you will see at the left side of the bottom of the screen the keystroke sequence to get such character ( . for this case) and the numerical code corresponding to the character (10 in this case). Characters that are not defined appear as a dark square in the characters list ( ) and show (None) at the bottom of the display, even though a numerical code exists for all of them. Numerical characters show the corresponding number at the bottom of the display.
Chapter 24 Calculator objects and flags Numbers, lists, vectors, matrices, algebraics, etc., are calculator objects. They are classified according to its nature into 30 different types, which are described below. Flags are variables that can be used to control the calculator properties. Flags were introduced in Chapter 2.
Number Type Example ____________________________________________________________________ 21 Extended Real Number Long Real 22 Extended Complex Number Long Complex 23 Linked Array Linked Array 24 Character Object Character 25 Code Object Code 26 Library Data Library Data 27 External Object External 28 Integer 3423142 29 External Object External 30 External Object External ____________________________________________________________________ Function TYPE This function, available in the PRG/TYPE () sub-menu,
Calculator flags A flag is a variable that can either be set or unset. The status of a flag affects the behavior of the calculator, if the flag is a system flag, or of a program, if it is a user flag. They are described in more detail next. System flags System flags can be accessed by using H @)FLAGS!. Press the down arrow key to see a listing of all the system flags with their number and brief description.
Functions for manipulating calculator flags are available in the PRG/MODES/FLAG menu. The PRG menu is activated with „°.
Chapter 25 Date and Time Functions In this Chapter we demonstrate some of the functions and calculations using times and dates. The TIME menu The TIME menu, available through the keystroke sequence ‚Ó (the 9 key) provides the following functions, which are described next: Setting an alarm Option 2. Set alarm.. provides an input form to let the user set an alarm. The input form looks like in the following figure: The Message: input field allows you to enter a character string identifying the alarm.
Browsing alarms Option 1. Browse alarms... in the TIME menu lets you review your current alarms. For example, after entering the alarm used in the example above, this option will show the following screen: This screen provides four soft menu key labels: EDIT: For editing the selected alarm, providing an alarm set input form NEW: For programming a new alarm PURG: For deleting an alarm OK : Returns to normal display Setting time and date Option 3.
The application of these functions is demonstrated below. DATE: Places current date in the stack DATE: Set system date to specified value TIME: Places current time in 24-hr HH.MMSS format TIME: Set system time to specified value in 24-hr HH.MM.SS format TICKS: Provides system time as binary integer in units of clock ticks with 1 tick = 1/8192 sec ALRM..
Calculating with times The functions HMS, HMS , HMS+, and HMS- are used to manipulate values in the HH.MMSS format. This is the same format used to calculate with angle measures in degrees, minutes, and seconds. Thus, these operations are useful not only for time calculations, but also for angular calculations.
Chapter 26 Managing memory In Chapter 2 of the User’s Guide we introduced the basic concepts and operations for creating and managing variables and directories. In this Chapter we discuss the management of the calculator’s memory in terms of partition of memory and techniques for backing up data. Memory Structure The calculator contains a total of 2.5 MB of memory, out of which 1 MB is used to store the operating system (system memory), and 1.
Memory) segment of calculator’s memory. The RAM memory segment requires continuous electric power supply from the calculator batteries to operate. To avoid loss of the RAM memory contents, a CR2032 backup battery is included. See additional details at the end of this chapter. Port 2 belongs to the calculator’s Flash ROM (Read-Only Memory) segment, which does not require a power supply. Therefore, removing the batteries of the calculators will not affect the calculator’s Flash ROM segment.
Another way to access port memory is by using the LIB menu (‚á, associated with the 2 key). This action produces the following screen: If you have any library active in your calculator it will be shown in this screen. One such library is the @)HP49D (demo) library shown in the screen above. Pressing the corresponding soft-menu key (A) will activate this library. Pressing the port soft menu keys will open that memory port. Additional information on libraries is presented below.
Backing up objects in port memory The operation of backing up an object from user memory into one of the memory ports is similar to the operation of copying a variable from one subdirectory to another (see details in Chapter 2 of the User’s Guide). You can, for example, use the File Manager („¡) to copy and delete backup objects as you would do with normal calculator objects. In addition, there are specific commands for manipulating back up objects, as described next.
RESTORE(: Port_Number : Backup_Name) For example, to restore the HOME directory out of backup object HOME1, use: RESTORE(:1:HOME1) In RPN mode use: : Port_Number : Backup_Name ` RESTORE Note: When you restore a HOME directory backup two things happen: • The backup directory overwrites the current HOME directory. Thus, any data not backed up in the current HOME directory will be lost. • The calculator restarts. The contents of history or stack are lost.
• When a backup object is restored, the calculator performs an integrity check on the restored object by calculating its CRC value. Any discrepancy between the calculated and the stored CRC values result in an error message indicating a corrupted data. Using data in backup objects Although you cannot directly modify the contents of backup objects, you can use those contents in calculator operations. For example, you can run programs stored as backup objects or use data from backup objects to run programs.
0: IRAM 1: ERAM 2: FLASH 3: SD HOME |-- sub-directories When you enter in the SD tree, all objects will appear as backup objects. Therefore, it is not possible to tell what type a given objects by just looking at its name in the Filer. Long names are not supported in the Filer. Thus, all names must be in the form 8.3 characters, similar as used in DOS, i.e., names will have a maximum of 8 characters with 3 characters in the suffix.
• In RPN mode: Type the name of the stored object using port 3 (e.g., :3:VAR1), press „©. With the RCL command, it is possible to recall variables by specifying a path in the command, e.g., in RPN mode: :3: {path} ` RCL. The path, like in a DOS drive, is a series of directory names that locate the position of the variable within a directory tree. However, some variables stored within a backup object cannot be recalled by specifying a path. In this case, the full backup object (e.g.
After installing the library contents in port memory you need to attach the library to the HOME directory. This can be accomplished by rebooting the calculator (turning the calculator off and back on), or by pressing, simultaneously, $C. At this point the library should be available for use. To see the library activation menu use the LIB menu (‚á). The library name will be listed in this menu.
the location of the backup battery in the top compartment at the back of the calculator.
Appendix A Using input forms This example of setting time and date illustrates the use of input forms in the calculator. Some general rules: • Use the arrow keys (š™˜—) to move from one field to the next in the input form. • Use any the @CHOOS soft menu key to see the options available for any given field in the input form. • Use the arrow keys (š™˜—) to select the preferred option for a given field, and press the !!@@OK#@ (F) soft menu key to make the selection.
resulting screen is an input form with input fields for a number of variables (n, I%YR, PV, PMT, FV). In this particular case we can give values to all but one of the variables, say, n = 10, I%YR = 8.5, PV = 10000, FV = 1000, and solve for variable PMT (the meaning of these variables will be presented later). Try the following: 10 @@OK@@ 8.5 @@OK@@ 10000 @@OK@@ ˜1000 @@OK@@ — š @SOLVE! Enter n = 10 Enter I%YR = 8.
!CALC !TYPES !CANCL @@OK@@ Press to access the stack for calculations Press to determine the type of object in highlighted field Cancel operation Accept entry If you press !RESET you will be asked to select between the two options: If you select Reset value only the highlighted value will be reset to the default value. If, instead, you select Rest all, all the fields will be reset to their default values (typically, 0).
(In RPN mode, we would have used 1136.22 ` 2 `/). Press @@OK@@ to enter this new value. The input form will now look like this: Press !TYPES to see the type of data in the PMT field (the highlighted field). As a result, you get the following specification: This indicates that the value in the PMT field must be a real number. Press @@OK@@ to return to the input form, and press L to recover the first menu. Next, press the ` key or the $ key to return to the stack.
Appendix B The calculator’s keyboard The figure below shows a diagram of the calculator’s keyboard with the numbering of its rows and columns. The figure shows 10 rows of keys combined with 3, 5, or 6 columns. Row 1 has 6 keys, rows 2 and 3 have 3 keys each, and rows 4 through 10 have 5 keys each.
keyboard in the space occupied by rows 2 and 3. Each key has three, four, or five functions. The main key functions are shown in the figure below. To operate this main key functions simply press the corresponding key. We will refer to the keys by the row and column where they are located in the sketch above, thus, key (10,1) is the ON key.
Main key functions Keys A through F keys are associated with the soft menu options that appear at the bottom of the calculator’s display. Thus, these keys will activate a variety of functions that change according to the active menu. The arrow keys, —˜š™, are used to move one character at a time in the direction of the key pressed (i.e., up, down, left, or right). The APPS function activates the applications menu. The MODE function activates the calculator’s modes menu.
The left-shift key „ and the right-shift key … are combined with other keys to activate menus, enter characters, or calculate functions as described elsewhere. The numerical keys (0 to 9) are used to enter the digits of the decimal number system. There is a decimal point key (.) and a space key (SPC). The ENTER key is used to enter a number, expression, or function in the display or stack, and The ON key is used to turn the calculator on.
the other three functions is associated with the left-shift „(MTH), rightshift … (CAT ) , and ~ (P) keys. Diagrams showing the function or character resulting from combining the calculator keys with the left-shift „, right-shift …, ALPHA ~, ALPHA-leftshift ~„, and ALPHA-right-shift ~…, are presented next. In these diagrams, the resulting character or function for each key combination is shown in white background.
The CMD function shows the most recent commands, the PRG function activates the programming menus, the MTRW function activates the Matrix Writer, Left-shift „ functions of the calculator’s keyboard The The The The The CMD function shows the most recent commands. PRG function activates the programming menus. MTRW function activates the Matrix Writer. MTH function activates a menu of mathematical function. DEL key is used to delete variables.
The ex key calculates the exponential function of x. The x2 key calculates the square of x (this is referred to as the SQ function). The ASIN, ACOS, and ATAN functions calculate the arcsine, arccosine, and arctangent functions, respectively. The 10x function calculates the anti-logarithm of x. The keys ≠, ≤, and ≥, are used for comparing real numbers.
Right-shift … functions of the calculator’s keyboard Right-shift functions The sketch above shows the functions, characters, or menus associated with the different calculator keys when the right-shift key … is activated. The functions BEGIN, END, COPY, CUT and PASTE are used for editing purposes. The UNDO key is used to undo the last calculator operation. The CHARS function activates the special characters menu. The EQW function is used to start the Equation Writer.
The CAT function is used to activate the command catalog. The CLEAR function clears the screen. The LN function calculates the natural logarithm. The The Σ function is used to enter summations (or the upper case Greek letter sigma). The ∂ function is used to calculate derivatives. The ∫ function is used to calculate integrals. The LOG function calculates the logarithm of base 10. The ARG function calculates the argument of a complex number.
(A through Z). The numbers, mathematical symbols (-, +), decimal point (.), and the space (SPC) are the same as the main functions of these keys. The ~ function produces an asterisk (*) when combined with the times key, i.e., ~*. Alpha ~ functions of the calculator’s keyboard Alpha-left-shift characters The following sketch shows the characters associated with the different calculator keys when the ALPHA ~ is combined with the left-shift key „.
Notice that the ~„ combination is used mainly to enter the lower-case letters of the English alphabet (A through Z). The numbers, mathematical symbols (-, +, ×), decimal point (.), and the space (SPC) are the same as the main functions of these keys. The ENTER and CONT keys also work as their main function even when the ~„ combination is used.
Alpha-right-shift characters The following sketch shows the characters associated with the different calculator keys when the ALPHA ~ is combined with the right-shift key …. "' Alpha ~… functions of the calculator’s keyboard Notice that the ~… combination is used mainly to enter a number of special characters from into the calculator stack.
when the ~… combination is used. The special characters generated by the ~… combination include Greek letters (α, β, ∆, δ, ε, ρ, µ, λ, σ, θ, τ, ω, and Π), other characters generated by the ~… combination are |, ‘, ^, =, <, >, /, “, \, __, ~, !, ?, <<>>, and @.
Appendix C CAS settings CAS stands for Computer Algebraic System. This is the mathematical core of the calculator where the symbolic mathematical operations and functions are programmed. The CAS offers a number of settings can be adjusted according to the type of operation of interest. To see the optional CAS settings use the following: • Press the H button to activate the CALCULATOR MODES input form.
• To recover the original menu in the CALCULATOR MODES input box, press the L key. Of interest at this point is the changing of the CAS settings. This is accomplished by pressing the @@CAS@ soft menu key. The default values of the CAS setting are shown below: • To navigate through the many options in the CAS MODES input form, use the arrow keys: š™˜—.
A variable called VX exists in the calculator’s {HOME CASDIR} directory that takes, by default, the value of ‘X’. This is the name of the preferred independent variable for algebraic and calculus applications. For that reason, most examples in this Chapter use X as the unknown variable. If you use other independent variable names, for example, with function HORNER, the CAS will not work properly. The variable VX is a permanent inhabitant of the {HOME CASDIR} directory.
The same example, corresponding to the RPN operating mode, is shown next: Approximate vs. Exact CAS mode When the _Approx is selected, symbolic operations (e.g., definite integrals, square roots, etc.), will be calculated numerically. When the _Approx is unselected (Exact mode is active), symbolic operations will be calculated as closed-form algebraic expressions, whenever possible.
The keystrokes necessary for entering these values in Algebraic mode are the following: …¹2` R5` The same calculations can be produced in RPN mode. Stack levels 3: and 4: show the case of Exact CAS setting (i.e., the _Numeric CAS option is unselected), while stack levels 1: and 2: show the case in which the Numeric CAS option is selected.
It is recommended that you select EXACT mode as default CAS mode, and change to APPROX mode if requested by the calculator in the performance of an operation. For additional information on real and integer numbers, as well as other calculator’s objects, refer to Chapter 2. Complex vs. Real CAS mode A complex number is a number of the form a+bi, where i, defined by i 2 = −1 is the unit imaginary number (electrical engineers prefer to use the symbol j), and a and b are real numbers.
If you press the OK soft menu key (), then the _Complex option is forced, and the result is the following: The keystrokes used above are the following: R„Ü5„Q2+ 8„Q2` When asked to change to COMPLEX mode, use:F. If you decide not to accept the change to COMPLEX mode, you get the following error message: Verbose vs. non-verbose CAS mode When the _Verbose CAS option is selected, certain calculus applications are provided with comment lines in the main display.
For example, having selected the Step/step option, the following screens show the step-by-step division of two polynomials, namely, (X3-5X2+3X-2)/(X2). This is accomplished by using function DIV2 as shown below. Press ` to show the first step: The screen inform us that the calculator is operating a division of polynomials A/B, so that A = BQ + R, where Q = quotient, and R = remainder. For the case under consideration, A = X3-5X2+3X-2, and B = X-2.
X 2 − 3X + − 3X − 2 8 = X 2 − 3X − 3X − . X −2 X −2 Increasing-power CAS mode When the _Incr pow CAS option is selected, polynomials will be listed so that the terms will have increasing powers of the independent variable. If the _Incr pow CAS option is not selected (default value) then polynomials will be listed so that the terms will have decreasing powers of the independent variable.
When the _Rigorous CAS option is selected, the algebraic expression |X|, i.e., the absolute value, is not simplified to X. If the _Rigorous CAS option is not selected, the algebraic expression |X| is simplified to X. The CAS can solve a larger variety of problems if the rigorous mode is not set. However, the result, or the domain in which the result are applicable, might be more limited.
Notice that, in this instance, soft menu keys E and F are the only one with associated commands, namely: !!CANCL !!@@OK#@ E F CANCeL the help facility OK to activate help facility for the selected command If you press the !!CANCL E key, the HELP facility is skipped, and the calculator returns to normal display.
L produces no additional menu items). The soft menu key commands are the following: @EXIT @ECHO @@ SEE1@@ @@SEE2@ !@@SEE3@ @!MAIN A B C D E F EXIT the help facility Copy the example command to the stack and exit See the first link (if any) in the list of references See the second link (if any) of the list of references See the third link (if any) of the list of references Return to the MAIN command list in the help facility In this case we want to ECHO the example into the stack by pressing @ECHO B.
To navigate quickly to a particular command in the help facility list without having to use the arrow keys all the time, we can use a shortcut consisting of typing the first letter in the command’s name. Suppose that we want to find information on the command IBP (Integration By Parts), once the help facility list is available, use the ~ key (first key in the fourth row from the bottom of the keyboard) followed by the key for the letter i (the same as the key I) , i.e., ~i.
In no event unless required by applicable law will any copyright holder be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the CAS Software (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the CAS Software to operate with any other programs), even if such holder or other party has been advised of the possibility of such damages.
Appendix D Additional character set While you can use any of the upper-case and lower-case English letter from the keyboard, there are 255 characters usable in the calculator. Including special characters like θ, λ, etc., that that can be used in algebraic expressions. To access these characters we use the keystroke combination …± (associated with the EVAL key). The result is the following screen: By using the arrow keys, š™˜—, we can navigate through the collection of characters.
i.e., ~„d~…9, and the code is 240). The display also shows three functions associated with the soft menu keys, f4, f5, and f6. These functions are: @MODIF: Opens a graphics screen where the user can modify highlighted character. Use this option carefully, since it will alter the modified character up to the next reset of the calculator. (Imagine the effect of changing the graphic of the character 1 to look like a 2!).
Greek letters α β δ ε θ λ µ ρ σ τ ω ∆ Π (alpha) (beta) (delta) (epsilon) (theta) (lambda) (mu) (rho) (sigma) (tau) (omega) (upper-case delta) (upper-case pi) ~‚a ~‚b ~‚d ~‚e ~‚t ~‚n ~‚m ~‚f ~‚s ~‚u ~‚v ~‚c ~‚p Other characters ~ ! ? \ @ (tilde) (factorial) (question mark) ) (backward slash) (angle symbol) (at) ~‚1 ~‚2 ~‚3 ~‚5 ~‚6 ~‚` Some characters commonly used that do not have simple keystroke shortcuts are: x (x bar), γ (gamma), η (eta), Ω (upper-case omega).
Appendix E The Selection Tree in the Equation Writer The expression tree is a diagram showing how the Equation Writer interprets an expression. The form of the expression tree is determined by a number of rules known as the hierarchy of operation. The rules are as follows: 1. Operations in parentheses are executed first, from the innermost to the outermost parentheses, and from left to right in the expression. 2. Arguments of functions are executed next, from left to right. 3.
Step A1 Step A2 Step A3 Step A4 Step A5 Step A6 We notice the application of the hierarchy-of-operation rules in this selection. First the y (Step A1). Then, y-3 (Step A2, parentheses). Then, (y-3)x (Step A3, multiplication). Then (y-3)x+5, (Step A4, addition). Then, ((y-3)x+5)(x2+4) (Step A5, multiplication), and finally, ((y-3)x+5)(x2+4)/SIN(4x-2) (Step A6, division).
Step B1 Step B2 Step B3 Step B4 = Step A5 Step B5 = Step A6 We can also follow the evaluation of the expression starting from the 4 in the argument of the SIN function in the denominator. Press the down arrow key ˜, continuously, until the clear, editing cursor is triggered around the y, once more. Then, press the right arrow key until these cursor is over the 4 in the denominator. Then, press the upper-arrow key —to select this 4.
Step C3 Step C4 Step C5 = Step B5 = Step A6 The expression tree for the expression presented above is shown next: The steps in the evaluation of the three terms (A1 through A6, B1 through B5, and C1 through C5) are shown next to the circle containing numbers, variables, or operators.
Appendix F The Applications (APPS) menu The Applications (APPS) menu is available through the G key (first key in second row from the keyboard’s top). The G key shows the following applications: The different applications are described next. Plot functions.. Selecting option 1. Plot functions.. in the APPS will produce the following menu list of graph-related options: The six options shown are equivalent to the keystroke sequences listed below: Equation entry… Graph display.. Table setup..
I/O functions.. Selecting option 2. I/O functions.. in the APPS menu will produce the following menu list of input/output functions These applications are described next: Send to HP 49.. Get from HP 49 Print display Print.. Transfer.. Start Server.. Send data to another calculator Receive data from another calculator Send screen to printer Print selected object from calculator Transfer data to other device Calculator set as a server for communication with computers Constants lib.. Selecting option 3.
Numeric solver.. Selecting option 3. Constants lib.. in the APPS menu produces the numerical solver menu: This operation is equivalent to the keystroke sequence ‚Ï. The numerical solver menu is presented in detail in Chapters 6 and 7. Time & date.. Selecting option 5.Time & date.. in the APPS menu produces the time and date menu: This operation is equivalent to the keystroke sequence ‚Ó. The time and date menu is presented in detail in Chapter 26. Equation writer.. Selecting option 6.Equation writer..
This operation is equivalent to the keystroke sequence ‚O. The equation writer is introduced in detail in Chapter 2. Examples that use the equation writer are available throughout this guide. File manager.. Selecting option 7.File manager.. in the APPS menu launches the file manager application: This operation is equivalent to the keystroke sequence „¡.The file manager is introduced in Chapter 2. Matrix Writer.. Selecting option 8.Matrix Writer..
Text editor.. Selecting option 9.Text editor.. in the APPS menu launches the line text editor: The text editor can be started in many cases by pressing the down-arrow key ˜. If the object in the display is an algebraic object, pressing ˜ will most likely start the Equation Writer. The text editor is introduced in Chapter 2, and presented in detail in Appendix L. Math menu .. Selecting option 10.Math menu..
CAS menu.. Selecting option 11.CAS menu.. in the APPS menu produces the CAS or SYMBOLIC menu: This operation is also available by pressing the Pkey. The CAS or SYMBOLIC menu is introduced in Chapter 5 (algebraic and arithmetic operations). Other functions from the CAS menu are presented in Chapters 4 (complex numbers), 6 (equations solutions), 10 (matrix creation), 11 (matrix operation), 13 (calculus), 14 (multivariate calculus), and 15 (vector analysis).
Appendix G Useful shortcuts Presented herein are a number of keyboard shortcuts commonly used in the calculator: • Adjust display contrast: $ (hold) +, or $ (hold) - • Toggle between RPN and ALG modes: H\@@@OK@@ or H\`. • Set/clear system flag 95 (ALG vs.
• Set/clear system flag 117 (CHOOSE boxes vs. SOFT menus): H @)FLAGS —„ —˜ @ CHK@ • In ALG mode, SF(-117) selects SOFT menus CF(-117) selects CHOOSE BOXES.
• System-level operation (Hold $, release it after entering second or third key): o o o o o o o o • AF: “Cold” restart - all memory erased B: Cancels keystroke C: “Warm” restart - memory preserved D: Starts interactive self-test E: Starts continuous self-test #: Deep-sleep shutdown - timer off A: Performs display screen dump D: Cancels next repeating alarm STAT soft menu: PLOT soft menu: SOLVE soft menu: UTILITY soft menu: 96 81 74, or use ‚(hold) 7 113 Other menus: o o • (hold) (hold) (hold) (hold)
Appendix H The CAS help facility The CAS help facility is available through the keystroke sequence I L@HELP `. The following screen shots show the first menu page in the listing of the CAS help facility. The commands are listed in alphabetical order. Using the vertical arrow keys —˜ one can navigate through the help facility list.
• You can type two or more letters of the command of interest, by locking the alphabetic keyboard. This will take you to the command of interest, or to its neighborhood. Afterwards, you need to unlock the alpha keyboard, and use the vertical arrow keys —˜ to locate the command, if needed. Press @@OK@@ to locate the to activate the command.
Appendix I Command catalog list This is a list of all commands in the command catalog (‚N). Those commands that belong to the CAS (Computer Algebraic System) are listed also in Appendix H. CAS help facility entries are available for a given command if the soft menu key @HELP shows up when you highlight that particular command. Press this soft menu key to get the CAS help facility entry for the command.
Appendix J The MATHS menu The MATHS menu, accessible through the command MATHS (available in the catalog N), contains the following sub-menus: The CMPLX sub-menu The CMPLX sub-menu contains functions pertinent to operations with complex numbers: These functions are described in Chapter 4. The CONSTANTS sub-menu The CONSTANTS sub-menu provides access to the calculator mathematical constants.
The HYPERBOLIC sub-menu The HYPERBOLIC sub-menu contains the hyperbolic functions and their inverses. These functions are described in Chapter 3. The INTEGER sub-menu The INTEGER sub-menu provides functions for manipulating integer numbers and some polynomials. These functions are presented in Chapter 5: The MODULAR sub-menu The MODULAR sub-menu provides functions for modular arithmetic with numbers and polynomials.
The POLYNOMIAL sub-menu The POLYNOMIAL sub-menu includes functions for generating and manipulating polynomials. These functions are presented in Chapter 5: The TESTS sub-menu The TESTS sub-menu includes relational operators (e.g., ==, <, etc.), logical operators (e.g., AND, OR, etc.), the IFTE function, and the ASSUME and UNASSUME commands. Relational and logical operators are presented in Chapter 21 in the context of programming the calculator in User RPL language.
Appendix K The MAIN menu The MAIN menu is available in the command catalog. This menu include the following sub-menus: The CASCFG command This is the first entry in the MAIN menu. This command configures the CAS. For CAS configuration information see Appendix C. The ALGB sub-menu The ALGB sub-menu includes the following commands: These functions, except for 0.MAIN MENU and 11.UNASSIGN are available in the ALG keyboard menu (‚×). Detailed explanation of these functions can be found in Chapter 5.
The DIFF sub-menu The DIFF sub-menu contains the following functions: These functions are also available through the CALC/DIFF sub-menu (start with „Ö). These functions are described in Chapters 13, 14, and 15, except for function TRUNC, which is described next using its CAS help facility entry: The MATHS sub-menu The MATHS menu is described in detail in Appendix J. The TRIGO sub-menu The TRIGO menu contains the following functions: These functions are also available in the TRIG menu (‚Ñ).
The SOLVER sub-menu The SOLVER menu includes the following functions: These functions are available in the CALC/SOLVE menu (start with „Ö). The functions are described in Chapters 6, 11, and 16. The CMPLX sub-menu The CMPLX menu includes the following functions: The CMPLX menu is also available in the keyboard (‚ß). Some of the functions in CMPLX are also available in the MTH/COMPLEX menu (start with „´). Complex number functions are presented in Chapter 4.
The EXP&LN sub-menu The EXP&LN menu contains the following functions: This menu is also accessible through the keyboard by using „Ð. The functions in this menu are presented in Chapter 5. The MATR sub-menu The MATR menu contains the following functions: These functions are also available through the MATRICES menu in the keyboard („Ø). The functions are described in Chapters 10 and 11.
These functions are available through the CONVERT/REWRITE menu (start with „Ú).
Appendix L Line editor commands When you trigger the line editor by using „˜ in the RPN stack or in ALG mode, the following soft menu functions are provided (press L to see the remaining functions): The functions are briefly described as follows: SKIP: Skips characters to beginning of word. SKIP : Skips characters to end of word. DEL: Delete characters to beginning of word. DEL : Delete characters to end of word. DEL L: Delete characters in line. INS: When selected inserts characters at cursor location.
The items show in this screen are self-explanatory. For example, X and Y positions mean the position on a line (X) and the line number (Y). Stk Size means the number of objects in the ALG mode history or in the RPN stack. Mem(KB) means the amount of free memory. Clip Size is the number of characters in the clipboard. Sel Size is the number of characters in the current selection. EXEC: Execute command selected. HALT: Stop command execution.
The SEARCH sub-menu The functions of the SEARCH sub-menu are: Find : Use this function to find a string in the command line. The input form provided with this command is shown next: Replace: Use this command to find and replace a string. The input form provided for this command is: Find next..: Finds the next search pattern as defined in Find Replace Selection: Replace selection with replacement pattern defined with Replace command. Replace/Find Next: Replace a pattern and search for another occurrence.
Goto Line: to move to a specified line. The input form provided with this command is: Goto Position: move to a specified position in the command line. The input form provided for this command is: Labels: move to a specified label in the command line. The Style sub-menu The Style sub-menu includes the following styles: BOL: Bold ITALI: Italics UNDE: Underline INV : Inverse The command FONT allow the user to select the font for the command editor.
Page L-5
Appendix M Index A ABCUV, 5-11 ABS, 11-7 ABS, 3-4 ABS, 4-6 ACK, 25-4 ACKALL, 25-4 ACOS, 3-6 ACOSH, 2-62 ADD, 12-21 ADD, 8-9 Additional character set, D-1 ADDTMOD, 5-12 Alarm functions, 25-4 Alarms, 25-2 ALG menu, 5-3 Algebraic mode, 1-12 Algebraic objects, 5-1 ALOG, 3-5 ALPHA characters, B-8 ALPHA keyboard lock-unlock, G-2 ALPHA-left-shift characters, B-9 ALPHA-right-shift characters, B-10 ALRM menu, 25-3 AMORT, 6-32 AMORTIZATION, 6-11 AND, 19-5 Angle between vectors, 9-16 Angle measure, 1-22 Angle symbol (
BASE menu, 19-1 Base units, 3-21 Batteries, 1-1 Beep, 1-24 BEG, 6-32 BEGIN, 2-26 Bessel's equation, 16-55 Bessel's functions, 16-55 Best data fitting, 18-12 Best polynomial fitting, 18-51 Beta distribution, 17-7 BIG, 12-18 BIN, 3-2 Binary numbers, 19-1 Binary system, 19-3 Binomial distribution, 17-4 BIT menu, 19-6 BLANK, 22-32 BOL, L-4 BOX, 12-43 BOXZ, 12-50 Building a vector, 9-12 BYTE menu, 19-6 C C-->PX, 19-7 C-->R, 4-6 CALC/DIFF menu, 16-4 Calculation with dates, 25-3 Calculations with times, 25-4 Calc
CMD, 2-61 CMDS, 2-25 CMPLX menus, 4-5 CNCT, 22-14 CNTR, 12-50 Coefficient of variation, 18-5 COL-, 10-20 COL+, 10-20 COL→, 10-19 “Cold” calculator restart, G-3 COLLECT, 5-5 Column norm, 11-8 Column vectors, 9-19 COMB, 17-2 Combinations, 17-1 Command catalog list, I-1 Complex CAS mode, C-6 Complex Fourier series, 16-27 COMPLEX mode, 4-1 Complex numbers, 2-2 4-1 Complex vs.
Dates calculations 25-4 DBUG, 21-35 DDAYS, 25-3 Debugging programs, 21-22 DEC, 19-2 Decimal comma, 1-21 Decimal numbers, 19-4 Decimal point, 1-20 Decomposing a vector, 9-12 Decomposing lists, 8-2 Deep-sleep shutdown, G-3 DEFINE, 3-36 Definite integrals, 13-15 DEFN, 12-18 DEG, 3-1 Degrees, 1-22 DEL, 12-47 DEL L, L-1 DEL→, L-1 DELALARM, 25-4 Deleting sub-directories, 2-42 DELKEYS, 20-6 Delta function (Dirac's), 16-15 DEPND, 22-6 DERIV, 13-3 DERIV&INTG menu, 13-3 Derivative directional 15-1 Derivatives, 13-1,
DIV2MOD, 5-12 DIV2MOD, 5-15 Divergence, 15-4 DIVIS, 5-10 DIVMOD, 5-12 DIVMOD, 5-15 DO construct, 21-61 DOERR, 21-64 DOLIST, 8-12 DOMAIN, 13-9 DOSUBS, 8-11 DOT, 9-11 Dot product, 9-11 DOT+ DOT-, 12-45 Double integrals, 14-6 DRAW, 12-21, 22-4 DRAW3DMATRIX, 12-54 Drawing functions programs, 22-22 DRAX, 22-4 DROITE, 4-9 DROP, 9-21 DTAG, 23-1 E e, 3-16, EDIT, 2-33 EDIT, L-1 Editor commands, L-1 EGCD, 5-19 EGDC, 5-11 EGV, 11-46 EGVL, 11-45 Eigenvalues, 11-9, 11-44 Eigenvectors, 11-9, 11-44 Electric units, 3-20
EVAL, 2-5 Exact CAS mode, C-4 EXEC, L-2 EXP, 3-6 EXP2POW, 5-29 EXPAND, 5-5 EXPANDMOD, 5-12 EXPLN, 5-8 EXPLN, 5-29 EXPM, 3-9 Exponential distribution, 17-7 Extrema, 13-12 Extreme points, 13-12 EYEPT, 22-10 F F distribution, 17-12 FACTOR, 2-10 Factorial, 3-14 Factorial symbol(!), G-2 Factoring an expression, 2-24 FACTORMOD, 5-12 FACTORS, 5-10 FANNING, 3-31 Fast 3D plots, 12-35 Fast Fourier transform, 16-49 Fast Replace All, L-3 FCOEF, 5-11 FDISTRIB, 5-29 FFT, 16-49 Fields, 15-1 File manager.. menu..
G GAMMA, 3-15 Gamma distribution, 17-6 GAUSS, 11-53 Gaussian elimination, 11-28 Gauss-Jordan elimination, 11-28 11-37 11-39 GCD, 5-11, 5-19 GCDMOD, 5-12 Geometric mean, 18-3 Geometric mean, 8-16 GET, 10-6 GETI, 8-11 Global variable scope, 21-4 Global variable, 21-2 GOR, 22-32 Goto Line, L-4 GOTO menu, L-2 L-3 Goto Position, L-4 Grades, 1-22 Gradient, 15-1 Graphic objects, 22-30 Graphical solution of ODEs, 16-60 Graphics animation, 22-26 Graphics options, 12-1 Graphics programming, 22-1 Graphs, 12-1 Graphs p
Higher-order derivatives, 13-13 Higher-order partial derivatives, 14-3 HILBERT, 10-14 Histograms, 12-30 HMS-, 25-3 HMS+, 25-3 HMS-->, 25-3 HORNER, 5-11, 5-20 H-VIEW, 12-20 Hyperbolic functions graphs, 1216 Hypothesis testing, 18-34 Hypothesis testing errors, 18-35 Hypothesis testing in linear regression, 18-52 Hypothesis testing in the calculator, 18-42 Hypothesis testing on variances, 18-46 HZIN, 12-50 HZOUT, 12-50 I i, 3-16 I/O functions menu, F-2 I→R, 5-28 IABCUV, 5-11 IBERNOULLI, 5-11 ICHINREM, 5-11 Id
Interactive drawing, 12-43 Interactive input programming, 21-19 Interactive plots with PLOT menu, 22-15 Interactive self-test, G-3 INTVX, 13-14 INV, 4-4 INV, L-4 Inverse cdf’s, 17-14 Inverse cumulative distribution functions, 17-13 Inverse function graph, 12-12 Inverse Laplace transforms, 16-10 Inverse matrix, 11-6 INVMOD, 5-12 IP, 3-14 IQUOT, 5-11 IREMAINDER, 5-11 Irrotational fields, 15-5 ISECT in plots, 12-7 ISOL, 6-1 ISOM, 11-54 ISPRIME? , 5-11 ITALI, L-4 J Jacobian, 14-7 JORDAN, 11-47 K KER, 11-55 K
LEGENDRE, 5-11, 5-22 Legendre's equation, 16-54 Length units, 3-18 LGCD, 5-10 lim, 13-2 Limits, 13-1 LIN, 5-5 LINE, 12-46 Line editor commands, L-1 Line editor properties, 1-26 Linear algebra, 11-1 Linear applications, 11-54 Linear differential equations, 16-4 Linear regression confidence intervals, 18-52 Linear regression hypothesis testing, 18-52 Linear regression additional notes, 18-49 Linear regression prediction error, 18-51 Linear system of equations, 11-16 Linearized relationships, 18-11 LINSOLVE, 1
MATHS/INTEGER menu, J-2 MATHS/MODULAR menu, J-2 MATHS/POLYNOMIAL menu, J-3 MATHS/TESTS menu, J-3 Matrices, 10-1 Matrix, 10-1 Matrix augmented, 11-30 Matrix Jordan-circle decomposition 11-54 Matrix "division", 11-26 Matrix Writer, 10-2 Matrix factorization, 11-49 MATRIX menu, 10-3 Matrix multiplication, 11-2 Matrix operations, 11-1 Matrix quadratic forms, 11-51 Matrix term-by-term multiplication, 11-5, Matrix transpose, 10-1, Matrix writer, 9-3 , MATRIX/MAKE menu, 10-3, Matrix-vector multiplication, 11-3, MA
NEG, 4-6 Nested IF...THEN..ELSE..END, 21-49 NEW, 2-33 NEXt eQuation, 12-6 NEXTPRIME, 5-11 Non-CAS commands, C-13 Non-linear differential equations, 16-4 Non-verbose CAS mode, C-7 NORM menu, 11-6 Normal distribution, 17-10 Normal distribution standard, 17-17 Normal distribution cdf, 17-10 NOT, 19-6 NSUB, 8-12 NUM, 23-1 NUM.SLV, 6-14 NUM.SLV input forms, A-1 Number in bases, 19-1 Number format, 1-17 Numeric CAS mode, C-3 Numeric solver menu, F-3 Numeric vs.
PCAR, 11-44 PCOEF, 5-11, 5-22 PDIM, 22-20 Percentiles, 18-14, PERIOD, 2-35 16-35 PERM, 17-2 Permutation matrix, 11-34 Permutations, 17-1 PEVAL, 5-23 PGDIR, 2-43 Physical constants, 3-28 PICT, 12-8 Pivoting, 11-33 PIX?, 22-22 Pixel coordinates, 22-25 Pixel references, 19-7 PIXOFF, 22-22 PIXON, 22-22 Plane in space, 9-18 PLOT, 12-52 PLOT environment, 12-3 Plot functions menu, F-1 PLOT menu, 22-1 PLOT menu interactive plots, 22-17 PLOT menu (menu 81), G-3 PLOT operations, 12-5 Plot setup, 12-52 PLOT SETUP envi
Program branching, 21-46 Program loops, 21-53 Program-generated plots, 22-17 Programming, 21-1 Programming sequential 21-19 Programming interactive input, 21-19 Programming 21-21 Programming Programming Programming input string prompt, debugging, 21-22 choose box, 21-31 output, 21-33 Programming tagged output, 21-34 Programming message box, 21-37 Programming using units, 21-37 Programming error trapping, 21-64 Programming graphics 22-1 Programming drawing functions, 22-24, Programming modular, 22-36 Pr
Real CAS mode, C-6 Real numbers, C-6 Real numbers vs.
Series, 13-23 Series Maclaurin, 13-23 Series Taylor, 13-23 SERIES, 13-23 Series Fourier, 16-27 Setting time and date, 25-2 SHADE in plots, 12-6 Shortcuts, G-1 SI, 3-29 SIGMA, 13-14 SIGMAVX, 13-14 SIGN, 3-14 SIGN, 4-6 SIGNTAB, 12-52 13-10 SIMP2, 5-10, 5-24 SIMPLIFY, 5-29 Simplify non-rational CAS setting, C10 Simplifying an expression, 2-23 SIN, 3-7 Single-variable statistics, 18-2 Singular value decomposition, 11-8 SINH, 3-9 SIZE, 8-10 SIZE, 10-7 SKIP , L-1 SL, 19-6 , SLB, 19-7 Slope fields, 12-34 Slope fi
Stiff ODEs numerical solution, 16-69 Strings, 23-1 STO, 2-46 STOALARM, 25-4 STOKEYS, 20-6 STREAM, 8-12 String concatenation, 23-2 Student t distribution, 17-11 STURM, 5-11 STURMAB, 5-11 STWS, 19-4 Style menu, L-4 SUB, 10-11 Sub-directories creating, 2-38 Sub-directories deleting, 2-42 Sub-expressions, 2-17 SUBST, 5-5 SUBTMOD, 5-12 SUBTMOD, 5-16 Sum of squared errors (SSE), 18-62 Sum of squared totals (SST), 18-62, Summary statistics, 18-13 SVD, 11-50 SVL, 11-50 SYLVESTER, 11-53 SYMB/GRAPH menu, 12-52 Symbo
Time units, 3-19 Times calculations 25-4 TINC, 3-32 TITLE, 7-15 TLINE, 12-46 TLINE, 22-20 TMENU, 20-1 TOOL menu, 1-6 TOOL menu: CASCMD, 1-7 TOOL menu: CLEAR, 1-7 TOOL menu: EDIT, 1-6 TOOL menu: HELP, 1-7 TOOL menu: PURGE, 1-7 TOOL menu: RCL, 1-7 TOOL menu: VIEW, 1-7 Total differential, 14-5 TPAR, 12-18 TRACE, 11-13 TRAN, 11-14 Transforms Laplace, 16-10 Transpose, 10-1, Triangle solution, 7-10, Triangular wave Fourier series 16-35, TRIG menu, 5-8, Trigonometric functions graphs, 12-16, TRN, 10-8, TRNC, 3-14
Vector elements, 9-7 Vector fields, 15-1 Vector fields curl, 15-5 Vector fields divergence 15-4 VECTOR menu, 9-10 Vector potential, 15-6 Vectors, 9-1 Verbose CAS mode, C-6 Verbose vs.
%, 3-12 %CH, 3-12 %T, 3-12 Σ, 2-28 ΣDAT, 18-5, ∆LIST, 8-9 ΣLIST, 8-9 ΠLIST, 8-9 ΣPAR, 22-13 ARRY, 9-21 ARRY, 9-6 BEG, L-1 COL, 10-18 DATE, 25-3 DEL, L-1 DIAG, 10-13 END, L-1 GROB, 22-31 HMS, 25-3 LCD, 22-32 LIST, 9-23 ROW, 10-22 SKIP, L-1 STK, 3-30 STR, 23-1 TAG, 21-33 TAG, 23-1 TIME, 25-3 UNIT, 3-27 V2, 9-12 V3, 9-13 Page M-20
Limited Warranty hp 49g+ graphing calculator; Warranty period: 12 months 1. 2. 3. 4. HP warrants to you, the end-user customer, that HP hardware, accessories and supplies will be free from defects in materials and workmanship after the date of purchase, for the period specified above. If HP receives notice of such defects during the warranty period, HP will, at its option, either repair or replace products which prove to be defective. Replacement products may be either new or like-new.
7. TO THE EXTENT ALLOWED BY LOCAL LAW, THE REMEDIES IN THIS WARRANTY STATEMENT ARE YOUR SOLE AND EXCLUSIVE REMEDIES. EXCEPT AS INDICATED ABOVE, IN NO EVENT WILL HP OR ITS SUPPLIERS BE LIABLE FOR LOSS OF DATA OR FOR DIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL (INCLUDING LOST PROFIT OR DATA), OR OTHER DAMAGE, WHETHER BASED IN CONTRACT, TORT, OR OTHERWISE.
Asia Pacific L.America Turkey UK Czech Republic South Africa Luxembourg Other European countries Country : Australia Singapore Country : Argentina Brazil Mexico Venezuela Chile Columbia Peru Central America & Caribbean Guatemala Puerto Rico Costa Rica N.
Regulatory information This section contains information that shows how the hp 49g+ graphing calculator complies with regulations in certain regions. Any modifications to the calculator not expressly approved by Hewlett-Packard could void the authority to operate the 49g+ in these regions. USA This calculator generates, uses, and can radiate radio frequency energy and may interfere with radio and television reception.