HP g graphing calculator user’s guide H Edition 1 HP part number F2229AA-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 50g should be thought of as a graphics/programmable hand-held computer.
For symbolic operations the calculator includes a powerful Computer Algebraic System (CAS) that lets you select different modes of operation, e.g., complex numbers vs. real numbers, or exact (symbolic) vs. approximate (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 produce complex figures in very little time.
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.
Chapter 2 - Introducing the calculator ,2-1 Calculator objects ,2-1 Editing expressions on the screen ,2-3 Creating arithmetic expressions ,2-3 Editing arithmetic expressions ,2-6 Creating algebraic expressions ,2-7 Editing algebraic expressions ,2-8 Using the Equation Writer (EQW) to create expressions ,2-10 Creating arithmetic expressions ,2-11 Editing arithmetic expressions ,2-17 Creating algebraic expressions ,2-19 Editing algebraic expressions ,2-21 Creating and editing summations, derivatives, and int
Other flags of interest ,2-66 CHOOSE boxes vs.
Physical constants in the calculator ,3-29 Special physical functions ,3-32 Function ZFACTOR ,3-32 Function F0λ ,3-33 Function SIDENS ,3-33 Function TDELTA ,3-33 Function TINC ,3-34 Defining and using functions ,3-34 Functions defined by more than one expression ,3-36 The IFTE function ,3-36 Combined IFTE functions ,3-37 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
FACTOR ,5-5 LNCOLLECT ,5-5 LIN ,5-5 PARTFRAC ,5-5 SOLVE ,5-5 SUBST ,5-5 TEXPAND ,5-5 Other forms of substitution in algebraic expressions ,5-6 Operations with transcendental functions ,5-7 Expansion and factoring using log-exp functions ,5-7 Expansion and factoring using trigonometric functions ,5-8 Functions in the ARITHMETIC menu ,5-9 DIVIS!,5-9 FACTORS ,5-9 LGCD!,5-10 PROPFRAC ,5-10 SIMP2 ,5-10 INTEGER menu ,5-10 POLYNOMIAL menu ,5-10 MODULO menu ,5-11 Applications of the ARITHMETIC menu ,5-12 Modular ar
The PROOT function ,5-21 The PTAYL function ,5-21 The QUOT and REMAINDER functions ,5-21 The EPSX0 function and the CAS variable EPS ,5-22 The PEVAL function ,5-22 The TCHEBYCHEFF function ,5-22 Fractions ,5-23 The SIMP2 function ,5-23 The PROPFRAC function ,5-23 The PARTFRAC function ,5-23 The FCOEF function ,5-24 The FROOTS function ,5-24 Step-by-step operations with polynomials and fractions ,5-25 The CONVERT Menu and algebraic operations ,5-26 UNITS convert menu (Option 1) ,5-26 BASE convert menu (Optio
Variable EQ ,6-26 The SOLVR sub-menu ,6-26 The DIFFE sub-menu ,6-29 The POLY sub-menu ,6-29 The SYS sub-menu ,6-30 The TVM sub-menu ,6-30 Chapter 7 - Solving multiple equations ,7-1 Rational equation systems ,7-1 Example 1 – Projectile motion ,7-1 Example 2 – Stresses in a thick wall cylinder ,7-2 Example 3 - System of polynomial equations ,7-4 Solution to simultaneous equations with MSLV ,7-4 Example 1 - Example from the help facility ,7-5 Example 2 - Entrance from a lake into an open channel ,7-5 Using t
List size ,8-10 Extracting and inserting elements in a list ,8-10 Element position in the list ,8-11 HEAD and TAIL functions ,8-11 The SEQ function ,8-11 The MAP function ,8-12 Defining functions that use lists ,8-13 Applications of lists ,8-15 Harmonic mean of a list ,8-15 Geometric mean of a list ,8-16 Weighted average ,8-17 Statistics of grouped data ,8-18 Chapter 9 - Vectors ,9-1 Definitions ,9-1 Entering vectors ,9-2 Typing vectors in the stack ,9-2 Storing vectors into variables ,9-3 Using the Matrix
Changing coordinate system ,9-12 Application of vector operations ,9-15 Resultant of forces ,9-15 Angle between vectors ,9-15 Moment of a force ,9-16 Equation of a plane in space ,9-17 Row vectors, column vectors, and lists ,9-18 Function OBJ ,9-19 Function LIST ,9-20 Function DROP ,9-20 Transforming a row vector into a column vector ,9-20 Transforming a column vector into a row vector ,9-21 Transforming a list into a vector ,9-23 Transforming a vector (or matrix) into a list ,9-24 Chapter 10!- Creating
Function VANDERMONDE ,10-13 Function HILBERT ,10-14 A program to build a matrix out of a number of lists ,10-14 Lists represent columns of the matrix ,10-15 Lists represent rows of the matrix ,10-17 Manipulating matrices by columns ,10-17 Function COL ,10-18 Function COL ,10-19 Function COL+ ,10-19 Function COL- ,10-20 Function CSWP ,10-20 Manipulating matrices by rows ,10-21 Function ROW ,10-22 Function ROW ,10-23 Function ROW+ ,10-23 Function ROW- ,10-24 Function RSWP ,10-24 Function RCI ,10-25 Functi
Function TRAN ,11-15 Additional matrix operations (The matrix OPER menu) ,11-15 Function AXL ,11-16 Function AXM ,11-16 Function LCXM ,11-16 Solution of linear systems ,11-17 Using the numerical solver for linear systems ,11-18 Least-square solution (function LSQ) ,11-24 Solution with the inverse matrix ,11-27 Solution by “division” of matrices ,11-27 Solving multiple set of equations with the same coefficient matrix ,11-28 Gaussian and Gauss-Jordan elimination ,11-29 Step-by-step calculator procedure for s
Function QXA ,11-53 Function SYLVESTER ,11-54 Function GAUSS ,11-54 Linear Applications ,11-54 Function IMAGE ,11-55 Function ISOM ,11-55 Function KER ,11-56 Function MKISOM ,11-56 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-7 Graphics of transcendental functions ,12-8 Graph of ln(X) ,12-8 Graph of the exponential function ,12-10 The PPAR variable ,
Fast 3D plots ,12-34 Wireframe plots ,12-36 Ps-Contour plots ,12-38 Y-Slice plots ,12-39 Gridmap plots ,12-40 Pr-Surface plots ,12-41 The VPAR variable ,12-42 Interactive drawing ,12-43 DOT+ and DOT- ,12-44 MARK ,12-44 LINE ,12-44 TLINE ,12-45 BOX ,12-45 CIRCL ,12-45 LABEL ,12-45 DEL ,12-46 ERASE ,12-46 MENU ,12-46 SUB ,12-46 REPL ,12-46 PICT ,12-46 X,Y ,12-47 Zooming in and out in the graphics display ,12-47 ZFACT, ZIN, ZOUT, and ZLAST ,12-47 BOXZ ,12-48 ZDFLT, ZAUTO ,12-48 HZIN, HZOUT, VZIN and VZOUT ,1
The SYMBOLIC menu and graphs ,12-49 The SYMB/GRAPH menu ,12-50 Function DRAW3DMATRIX ,12-52 Chapter 13 - Calculus Applications ,13-1 The CALC (Calculus) menu ,13-1 Limits and derivatives ,13-1 Function lim ,13-2 Derivatives ,13-3 Functions DERIV and DERVX ,13-3 The DERIV&INTEG menu ,13-4 Calculating derivatives with ∂ ,13-4 The chain rule ,13-6 Derivatives of equations ,13-7 Implicit derivatives ,13-7 Application of derivatives ,13-7 Analyzing graphics of functions ,13-8 Function DOMAIN ,13-9 Function TABV
Integration with units ,13-21 Infinite series ,13-22 Taylor and Maclaurin’s series ,13-23 Taylor polynomial and reminder ,13-23 Functions TAYLR, TAYLR0, and SERIES ,13-24 Chapter 14 - Multi-variate Calculus Applications ,14-1 Multi-variate functions ,14-1 Partial derivatives ,14-1 Higher-order derivatives ,14-3 The chain rule for partial derivatives ,14-4 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 Mu
Checking solutions in the calculator ,16-2 Slope field visualization of solutions ,16-3 The CALC/DIFF menu ,16-3 Solution to linear and non-linear equations ,16-4 Function LDEC ,16-4 Function DESOLVE ,16-7 The variable ODETYPE ,16-8 Laplace Transforms ,16-10 Definitions ,16-10 Laplace transform and inverses in the calculator ,16-11 Laplace transform theorems ,16-12 Dirac’s delta function and Heaviside’s step function ,16-15 Applications of Laplace transform in the solution of linear ODEs ,16-17 Fourier seri
Numerical solution of first-order ODE ,16-57 Graphical solution of first-order ODE ,16-59 Numerical solution of second-order ODE ,16-61 Graphical solution for a second-order ODE ,16-63 Numerical solution for stiff first-order ODE ,16-65 Numerical solution to ODEs with the SOLVE/DIFF menu ,16-67 Function RKF ,16-67 Function RRK ,16-68 Function RKFSTEP ,16-69 Function RRKSTEP ,16-70 Function RKFERR ,16-71 Function RSBERR ,16-71 Chapter 17 - Probability Applications ,17-1 The MTH/PROBABILITY..
Chapter 18 - Statistical Applications ,18-1 Pre-programmed statistical features ,18-1 Entering data ,18-1 Calculating single-variable statistics ,18-2 Obtaining frequency distributions ,18-5 Fitting data to a function y = f(x) ,18-10 Obtaining additional summary statistics ,18-13 Calculation of percentiles ,18-14 The STAT soft menu ,18-15 The DATA sub-menu ,18-16 The ΣPAR sub-menu ,18-16 The 1VAR sub menu ,18-17 The PLOT sub-menu ,18-17 The FIT sub-menu ,18-18 The SUMS sub-menu ,18-18 Example of STAT menu o
Paired sample tests ,18-41 Inferences concerning one proportion ,18-41 Testing the difference between two proportions ,18-42 Hypothesis testing using pre-programmed features ,18-43 Inferences concerning one variance ,18-47 Inferences concerning two variances ,18-48 Additional notes on linear regression ,18-50 The method of least squares ,18-50 Additional equations for linear regression ,18-51 Prediction error ,18-52 Confidence intervals and hypothesis testing in linear regression ,18-52 Procedure for infere
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 an object to a user-defined key ,20-6 Operating user-defined keys ,20-7 Un-assigning a user-defined key ,20-7 Assigning multiple user-defined keys ,20-7 Chapter 21 - Programming in User RPL language ,21-1 An example of programming ,21-1 Global and local variables and subprograms ,21-2 Global Variable Scope
“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 operators ,21-43 Logical operators ,21-45 Program branching ,21-46 Branching with IF ,21-47 The IF…THEN…END construct ,21-47 The CASE construct ,21-51 Program loops ,21-53 The START construct ,21-53 The FOR construct ,21-59 The DO construct ,21-61 The WHILE construct ,21-63 Errors and error trapping ,21-64 DOERR ,21-64 ERRN ,21-65 ERRM ,21-65 ERR0 ,21-65 LASTAR
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-21 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-26 Animating a collection of graphics ,22-27 More information on the ANIMATE function ,22-29 Graphic objects (GROBs) ,22-29 The GROB menu ,22-31 A program with plotting and drawing fu
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 Calculating with times ,25-4 Alarm functions ,25-4 Chapter 26 - Managing memory ,26-1 Memory
Storing objects on an SD card ,26-9 Recalling an object from an SD card ,26-10 Evaluating an object on an SD card ,26-10 Purging an object from the SD card ,26-11 Purging all objects on the SD card (by reformatting) ,26-11 Specifying a directory on an SD card ,26-11 Using libraries ,26-12 Installing and attaching a library ,26-12 Library numbers ,26-13 Deleting a library ,26-13 Creating libraries ,26-13 Backup battery ,26-13 Chapter 27 - The Equation Library ,27-1 Solving a Problem with the Equation Librar
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 list ,I-1 Appendix J - MATHS menu ,J-1 Appendix K - MAIN menu ,K-1 Appendix L - Line editor commands ,L-1 Appendix M - Table of Built-In Equations ,M-1 Appendix N - Index ,N-1 Limited Warranty ,LW-1 Service! ,LW-2 Regulatory information ,LW-4 Disposal of Waste Equipment by Users in Private Household in the European Union ,LW-6 Page TOC-25
Chapter 1 Getting started This chapter provides basic information about the operation of your calculator. It is designed to familiarize you with the basic operations and settings before you perform a calculation. Basic Operations The following sections are designed to get you acquainted with the hardware of your calculator. Batteries The calculator uses 4 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: R D XYZ HEX R= 'X' For details on the meaning of these symbols 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.
Each group of 6 entries is called a Menu page. The current menu, known as the TOOL menu (see below), has eight entries arranged in two pages. The next page, containing the next two entries of the menu is available by 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).
This CHOOSE box is labeled BASE MENU and provides a list of numbered functions, from 1. HEX x to 6. B R. This display will constitute the first page of this CHOOSE box menu showing six menu functions. You can navigate through the menu by using the up and down arrow keys, —˜, located in the upper right side of the keyboard, right under the E and Fsoft menu keys.
If you now press ‚ã, instead of the CHOOSE box that you saw earlier, the display will now show six soft menu labels as the first page of the STACK menu: 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.
The TOOL menu The soft menu keys for the menu currently displayed, known as the TOOL menu, are associated with operations related to manipulation of variables (see pages for more information on variables): @EDIT A EDIT the contents of a variable (see Chapter 2 and Appendix L for more information on editing) @VIEW B VIEW the contents of a variable @@ RCL @@ C ReCaLl the contents of a variable @@STO@ D STOre the contents of a variable ! PURGE E PURGE a variable CLEAR F CLEAR the display or st
9 key the TIME choose box is activated. This operation can also be represented as ‚Ó. The TIME choose box is shown in the figure below: 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#@ soft menu key.
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).
Setting the date After setting the time format option, the SET TIME AND DATE input form will look as follows: 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 to see the options for the date format: Highlight your choice by using the up and down arrow keys,— ˜, and press the !!@@OK#@ soft menu key to make the selection.
Introducing 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. 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.
shift key, key (9,1), and the ALPHA key, key (7,1), can be combined with some of the other keys to activate the alternative functions shown in the keyboard.
Press the !!@@OK#@ 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.
To enter this expression in the calculator we will first use the equation writer, ‚O. Please identify the following keys in the keyboard, besides the numeric keypad keys: !@.#*+-/R Q¸Ü‚Oš™˜—` 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.
Change the operating mode to RPN by first pressing the H button. Select the RPN operating mode by either using the \key, or pressing the @CHOOS soft menu key. Press the !!@@OK#@ soft menu key to complete the operation. The display, for the RPN mode looks as follows: 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.
⎛ ⎝ 3 ⋅ ⎜5 − 23 ⎞ ⎟ 3⋅3⎠ 2.5 +e 1 3 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.
Notice how the expression is placed in stack level 1 after pressing `. Pressing the EVAL key at this point will evaluate the numerical value of that expression Note: In RPN mode, pressing ENTER when there is no command 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.
more about reals, see Chapter 2. To illustrate this and other number formats try the following exercises: Θ Standard format: This mode is the most used mode as it shows numbers in the most familiar notation. Press the !!@@OK#@ soft menu key, with the Number format set to Std, to return to the calculator display. Enter the number 123.4567890123456. Notice that this number has 16 significant figures. Press the ` key.
Notice that the Number Format mode is set to Fix followed by a zero (0). This number indicates the number of decimals to be shown after the decimal point in the calculator’s display. Press the !!@@OK#@ soft menu key to return to the calculator display. The number now is shown as: This setting will force all results to be rounded to the closest integer (0 digit displayed after the comma). However, the number is still stored by the calculator with its full 12 significant digit precision.
Press the !!@@OK#@ soft menu key to complete the selection: Press the !!@@OK#@ soft menu key return to the calculator display. The number now is shown as: Notice how the number is rounded, not truncated. Thus, the number 123.4567890123456, for this setting, is displayed as 123.457, and not as 123.
same fashion that we changed the Fixed number of decimals in the example above). Press the !!@@OK#@ soft menu key return to the calculator display. The number now is shown as: This result, 1.23E2, is the calculator’s version of powers-of-ten notation, i.e., 1.235 x 102. In this, so-called, scientific notation, the number 3 in front of the Sci number format (shown earlier) represents the number of significant figures after the decimal point.
Press the !!@@OK#@ soft menu key return to the calculator display. The number now is shown as: 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.
Θ Press the !!@@OK#@ soft menu key return to the calculator display. The number 123.456789012, entered earlier, now is shown as: 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.
key. If using the latter approach, use up and down arrow keys,— ˜, to select the preferred mode, and press the !!@@OK#@ soft menu key to complete the operation. For example, in the following screen, the Radians mode is selected: Coordinate System 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.
from the positive z axis to the radial distance ρ. The Rectangular and Spherical coordinate systems are related by the following quantities: x = ρ ⋅ sin(φ ) ⋅ cos(θ ) ρ = x2 + y2 + z2 y = ρ ⋅ sin(φ ) ⋅ sin(θ ) θ = tan −1 ⎜ ⎟ z = ρ ⋅ cos(φ ) ⎛ y⎞ ⎝ x⎠ ⎛ x2 + y2 ⎞ −1 ⎜ ⎟ φ = tan ⎜ ⎟ z ⎝ ⎠ To change the coordinate system in your calculator, follow these steps: Θ Press the H button. Next, use the down arrow key, ˜, three times.
_Last Stack: Keeps the contents of the last stack entry for use with the functions UNDO and ANS (see Chapter 2). The _Beep option can be useful to advise the user about errors. You may want to deselect this option if using your calculator in a classroom or library. The _Key Click option can be useful as an audible way to check that each keystroke was entered as intended. The _Last Stack option is very useful to recover the last operation in case we need it for a new calculation.
Selecting Display modes The calculator display can be customized to your preference by selecting different display modes. To see the optional display settings use the following: Θ First, press the H button to activate the CALCULATOR MODES input form. Within the CALCULATOR MODES input form, press the @@DISP@ soft menu key to display the DISPLAY MODES input form. Θ Θ Θ Θ To navigate through the many options in the DISPLAY MODES input form, use the arrow keys: š™˜—.
Pressing the @CHOOS soft menu key will provide a list of available system fonts, as shown below: The options available are three standard System Fonts (sizes 8, 7, and 6) and a Browse.. option. The latter will let you browse the calculator memory for 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.
display the DISPLAY MODES input form. Press the down arrow key, ˜, twice, to get to the Stack line. This line shows two properties that can be modified. When these properties are selected (checked) the following effects are activated: _Small Changes font size to small. This maximized the amount of information displayed on the screen. Note, this selection overrides the font selection for the stack display.
times, to get to the EQW (Equation Writer) line. This line shows two properties that can be modified. When these properties are selected (checked) the following effects are activated: _Small Changes font size to small while using the equation editor _Small Stack Disp Shows small font in the stack for textbook style display Detailed instructions on the use of the equation editor (EQW) are presented elsewhere in this manual.
right arrow key (™) to select the underline in front of the options _Clock or _Analog. Toggle the @ @CHK@@ soft menu key until the desired setting is achieved. If the _Clock option is selected, the time of the day and date will be shown in the upper right corner of the display. If the _Analog option is also selected, an analog clock, rather than a digital clock, will be shown in the upper right corner of the display.
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.
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. Complex numbers, are an extension of real numbers that include the unit imaginary number, i 2= -1. A complex number, e.g., 3 + 2i, is written as (3, 2) in the calculator.
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.2 as the mean of a sample, for example. Unit objects, objects of type 13, are numerical values with a physical unit attached to them.
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.
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.
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.
Θ Θ Θ Θ Θ Θ Θ Θ Θ Θ Θ Θ Θ Press the right arrow key, ™, until the cursor is to the right of the x Type Q2 to enter the power 2 for the x Press the right arrow key, ™, until the cursor is to the right of the y Press the delete key, ƒ, once to erase the characters y.
Θ 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 six soft menu keys for the Equation Writer activate the following functions: @EDIT: lets the user edit an entry in the line editor (see examples above) @CURS: highlights expression and adds a graphics cursor to it @BIG: if selected (selection shown by the character in the label) the font used in the writer is the system font 8 (the largest font available) @EVAL: lets you evaluate, symbolically or numerically, an expression highlighted in the equation writer screen (similar to …μ) @FACTO: lets you factor
The result is the expression The cursor is shown as a left-facing key. The cursor indicates the current edition location. Typing a character, function name, or operation will enter the corresponding character or characters in the cursor location. For example, for the cursor in the location indicated above, type now: *„Ü5+1/3 The edited expression looks as follows: Suppose that you want to replace the quantity between parentheses in the denominator (i.e., 5+1/3) with (5+π2/2).
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.
Showing the expression in smaller-size To show the expression in a smaller-size font (which could be useful if the expression is long and convoluted), simply press the @BIG soft menu key. For this case, the screen looks as follows: To recover the larger-font display, press the @BIG 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 soft menu key.
If you want a floating-point (numerical) evaluation, use the NUM function (i.e., …ï). The result is as follows: 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.
A symbolic evaluation once more. Suppose that, at this point, we want to evaluate the left-hand side fraction only. Press the upper arrow key (—) three times to select that fraction, resulting in: Then, press the @EVAL soft menu key to obtain: Let’s try a numerical evaluation of this term at this point.
Editing arithmetic expressions We will show some of the editing features in the Equation Writer as an exercise. We start by entering the following expression used in the previous exercises: 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.
Press the down arrow key (˜) to trigger the clear editing cursor. The screen now looks like this: By using the left arrow key (š) you can move the cursor in the general left direction, but stopping at each individual component of the expression. For example, suppose that we will first will transform the expression π 2/2 into the expression LN(π5/3) . With the clear cursor active, as shown above, press the left-arrow key (š) twice to highlight the 2 in the denominator of π 2/2.
Next, we’ll convert the 2 in front of the parentheses in the denominator into a 2/3 by using: šƒƒ2/3 At this point the expression looks as follows: The final step is to remove the 1/3 in the right-hand side of the expression. This is accomplished by using: —————™ƒƒƒƒƒ The final version will be: In summary, to edit an expression in the Equation Writer you should use the arrow keys (š™—˜) to highlight expression to which functions will be applied (e.g., the LN and square root cases in the expression above).
Use the following keystrokes: 2 / R3 ™™ * ~‚n+ „¸\ ~‚m ™™ * ‚¹ ~„x + 2 * ~‚m * ~‚c ~„y ——— / ~‚t Q1/3 This results in the output: In this example we used several lower-case English letters, e.g., x (~„x), several Greek letters, e.g., λ (~‚n), and even a combination of Greek and English letters, namely, Δy (~‚c~„y). Keep in mind that to enter a lower-case English letter, you need to use the combination: ~„ followed by the letter you want to enter.
Editing algebraic expressions The editing of algebraic equations follows the same rules as the editing of algebraic equations. Namely: Θ Use the arrow keys (š™—˜) to highlight expressions Θ Use the down arrow key (˜), 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. Θ At an editing point, use the delete key (ƒ) to trigger the insertion cursor and proceed with the edition of the expression.
2. θ 3. Δy 4. μ 5. 2 6. x 7. μ in the exponential function 8. λ 9. 3 in the √3 term 10. the 2 in the 2/√3 fraction At any point we can change the clear editing cursor into the insertion cursor by pressing the delete key (ƒ). Let’s use these two cursors (the clear editing cursor and the insertion cursor) to change the current expression into the following: If you followed the exercise immediately above, you should have the clear editing cursor on the number 2 in the first factor in the expression.
Evaluating a sub-expression Since we already have the sub-expression ( ) SIN θ 1 / 3 highlighted, let’s press the @EVAL soft menu key to evaluate this sub-expression. The result is: Some algebraic expressions cannot be simplified anymore. Try the following keystrokes: —D. You will notice that nothing happens, other than the highlighting of the entire argument of the LN function. This is because this expression cannot be evaluated (or simplified) any more according to the CAS rules.
3 in the first term of the numerator. Then, press the right arrow key, ™, to navigate through the expression. Simplifying an expression Press the @BIG soft menu key to get the screen to look as in the previous figure (see above). Now, press the @SIMP soft menu key, to see if it is possible to simplify this expression as it is shown in the Equation Writer. The result is the following screen: This screen shows the argument of the SIN function, namely, 3 θ , transformed LN (θ ) 3 into e .
Press ‚¯to recover the original expression. Next, enter the following keystrokes: ˜˜˜™™™™™™™———‚™ to select the last two terms in the expression, i.e., press the @FACTO soft menu key, to get Press ‚¯to recover the original expression. Now, let’s select the entire expression by pressing the upper arrow key (—) once. And press the @FACTO soft menu key, to get Press ‚¯to recover the original expression.
Next, select the command DERVX (the derivative with respect to the variable X, the current CAS independent variable) by using: ~d˜˜˜ . Command DERVX will now be selected: Press the @@OK@@ soft menu key to get: Next, press the L key to recover the original Equation Writer menu, and press the @EVAL@ soft menu key 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.
Detailed explanation on the use of the help facility for the CAS is presented in Chapter 1. To return to the Equation Writer, press the @EXIT soft menu key. Press the ` key to exit the Equation Writer.
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. Try the following keystrokes: ˜˜šš———‚¨˜˜ ‚™ššš‚¬ The resulting screen is as follows: The functions BEGIN and END are not necessary when operating in the Equation Writer, since we can select strings of characters by using the arrow keys. Functions BEGIN and END are more useful when editing an expression with the line editor.
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 soft menu key): Press ` to exit the Equation Writer. Creating and editing summations, derivatives, and integrals Summations, derivatives, and integrals are commonly used for calculus, probability and statistics applications.
To see the corresponding expression in the line editor, press ‚— and the A soft menu key, to show: This expression shows the general form of a summation typed directly in the stack or line editor: Σ(index = starting_value, ending_value, summation expression) Press ` to return to the Equation Writer. The resulting screen shows the value of the summation, To recover the unevaluated summation use ‚¯. To evaluate the summation again, you can use the D soft menu key. This shows again that 1 π2 .
and the variable of differentiation. To fill these input locations, use the following keystrokes: ~„t™~‚a*~„tQ2 ™™+~‚b*~„t+~‚d The resulting screen is the following: To see the corresponding expression in the line editor, press ‚— and the A soft menu key, to show: This indicates that the general expression for a derivative in the line editor or in ∂variable(function of variables) the stack is: Press ` to return to the Equation Writer.
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 . 0 Press ‚O to activate the Equation Writer. Then press ‚ Á to enter the integral sign.
τ ∫ t ⋅ sin(t ) ⋅ dt = sin(τ ) − τ ⋅ cos(τ ) 0 Double integrals are also possible. For example, which evaluates to 36. Partial evaluation is possible, for example: This integral evaluates to 36. Organizing data in the calculator You can organize data in your calculator by storing variables in a directory tree. To understand the calculator’s memory, we first take a look at the file directory.
@CHDIR: Change to selected directory @CANCL: Cancel action @@OK@@: Approve a selection For example, to change directory to the CASDIR, press the down-arrow key, ˜, and press @CHDIR. This action closes the File Manager window and returns us to normal calculator display. You will notice that the second line from the top in the display now starts with the characters { HOME CASDIR } indicating that the current directory is CASDIR within the HOME directory.
To move between the different soft menu commands, you can use not only the NEXT key (L), but also the PREV key („«). The user is invited to try these functions on his or her own. Their applications are straightforward. The HOME directory The HOME directory, as pointed out earlier, is the base directory for memory operation for the calculator. To get to the HOME directory, you can press the UPDIR function („§) -- repeat as needed -- until the {HOME} spec is shown in the second line of the display header.
This time the CASDIR is highlighted in the screen. To see the contents of the directory press the @@OK@@ soft menu key or `, to get the following screen: The screen shows a table describing the variables contained in the CASDIR directory. These are variables pre-defined in the calculator memory that establish certain parameters for CAS operation (see appendix C). The table above contains 4 columns: • The first column indicate the type of variable (e.g.
Pressing the L key shows one more variable stored in this directory: • • • To see the contents of the variable EPS, for example, use ‚@EPS@. This shows the value of EPS to be .0000000001 To see the value of a numerical variable, we need to press only the soft menu key for the variable. For example, pressing cz followed by `, shows the same value of the variable in the stack, if the calculator is set to Algebraic. If the calculator is set to RPN mode, you need only press the soft menu key for `.
lock the alphabetic keyboard temporarily and enter a full name before unlocking it again. The following combinations of keystrokes will lock the alphabetic keyboard: ~~ locks the alphabetic keyboard in upper case. When locked in this fashion, pressing the „ before a letter key produces a lower case letter, while pressing the ‚ key before a letter key produces a special character.
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. Using the FILES menu Regardless of the mode of operation of the calculator (Algebraic or RPN), we can create a directory tree, based on the HOME directory, by using the functions activated in the FILES menu. Press „¡ to activate the FILES menu. If the HOME directory is not already highlighted in the screen, i.e.
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. Since we have no contents for the new sub-directory at this point, we simply skip this input field by pressing the down-arrow key, ˜, once. The Name input field is now highlighted: This is where we enter the name of the new sub-directory (or variable, as the case may be), as follows: ~~mans` The cursor moves to the _Directory check field.
To move into the MANS directory, press the corresponding soft menu key (A in this case), and ` if in algebraic mode. The directory tree will be shown in the second line of the display as {HOME M NS}. However, there will be no labels associated with the soft menu keys, as shown below, because there are no variables defined within this directory.
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@@.
Press the @@OK@ soft menu key to activate the command, to create the subdirectory: Moving among subdirectories To move down the directory tree, you need to press the soft menu key corresponding to the sub-directory you want to move to. The list of variables in a sub-directory can be produced by pressing the J (VARiables) key. To move up in the directory tree, use the function UPDIR, i.e., enter „§. Alternatively, you can use the FILES menu, i.e., press „¡.
The ‘S2’ string in this form is the name of the sub-directory that is being deleted. The soft menu keys provide the following options: @YES@ Proceed with deleting the sub-directory (or variable) @ALL@ Proceed with deleting all sub-directories (or variables) !ABORT Do not delete sub-directory (or variable) from a list @@NO@@ Do not delete sub-directory (or variable) After selecting one of these four commands, you will be returned to the screen listing the contents of the sub-directory.
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. 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.
Name Contents Type A α 12.5 -0.25 real real A12 Q R z1 p1 3×105 ‘r/(m+r)' [3,2,1] 3+5i << → r 'π*r^2' >> 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 M NS INTRO}. To get to this sub-directory, use the following: „¡ and select the INTRO sub-directory as shown in this screen: Press @@OK@@ to enter the directory.
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@.
Using the STO command A simpler way to create a variable is by using the STO command (i.e., the K key). We provide examples in both the Algebraic and RPN modes, by creating the remaining of the variables suggested above, namely: • Name α Contents -0.25 Type real A12 Q R z1 p1 3×105 ‘r/(m+r)' [3,2,1] 3+5i << → r 'π*r^2' >> real algebraic vector complex program Algebraic mode Use the following keystrokes to store the value of –0.25 into variable α: 0.25\ K ~‚a.
z1: 3+5*„¥ K~„z1` (if needed, accept change to Complex mode) p1: ‚å‚é~„r³„ì* ~„rQ2™™™ K~„p1`. The screen, at this point, will look as follows: 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 α: .25\`³~‚a`. At this point, the screen will look as follows: With –0.25 on the level 2 of the stack and 'α' on the level 1 of the stack, you can use the K key to create the variable.
z1: ³3+5*„¥ ³~„z1 K(if needed, accept change to Complex mode) p1: ‚å‚é~„r³„ì* ~„rQ2™™™ ³ ~„p1™` K. The screen, at this point, will look as follows: You will see six of the seven variables listed at the bottom of the screen: p1, z1, R, Q, A12, α. Checking variables contents As an exercise on peeking into the contents of variables we will use the seven variables entered in the exercise above.
Pressing the soft menu key corresponding to p1 will provide an error message (try L @@@p1@@ `): 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 characters → r indicate that an input, to be referred to as r, is to be provided to the program.
At this point, the screen looks like this: To see the contents of A, use: L @@@A@@@. To run program p1 with r = 5, use: L5 @@@p1@@@. Notice that to run the program in RPN mode, you only need to enter the input (5) and press the corresponding soft menu key. (In algebraic mode, you need to place parentheses to enter the argument). Using the right-shift key ‚ followed by soft menu key labels In Algebraic mode, you can display the content of a variable by pressing J @ and then the corresponding soft menu key.
Notice that this time the contents of program p1 are listed in the screen. To see the remaining variables in this directory, press L: Listing the contents of all variables in the screen Use the keystroke combination ‚˜ to list the contents of all variables in the screen. For example: Press $ to return to normal calculator display. Replacing the contents of variables Replacing the contents of a variable can be thought of as storing a different value in the same variable name.
followed by the variable’s soft menu key. For example, in RPN, if we want to change the contents of variable z1 to ‘a+b⋅i ’, use: ³~„a+~„b*„¥` This will place the algebraic expression ‘a+b⋅i ’ in level 1: in the stack.
Use the up arrow key — to select the sub-directory MANS and press @@OK@@. If you now press „§, the screen will show the contents of sub-directory MANS (notice that variable A is shown in this list, as expected): Press $ @INTRO@ `(Algebraic mode), or $ @INTRO@ (RPN mode) to return to the INTRO directory. Press „¡@@OK@@ to produce the list of variables in {HOME MANS INTRO}. Use the down arrow key (˜) to select variable R, then press @@COPY@.
Next, use the delete key three times, to remove the last three lines in the display: ƒ ƒ ƒ. At this point, the stack is ready to execute the command ANS(1) z1. Press ` to execute this command. Then, use ‚@@z1@, to verify the contents of the variable.
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. We assume, again, that we are within sub-directory {HOME MANS INTRO} and that we want to copy the variables R and Q into sub-directory {HOME MANS}.
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., The reordered list is created by using: „ä )@INTRO @@@@A@@@ @@@z1@@ @@@Q@@@ @@@@R@@@ @@A12@@ ` Then, enter the command ORDER, as done before, 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@@ .
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. Press : I @PURGE@ „ä³ J@@@R!@@ ™ ‚í ³ J@@@Q!@@ At this point, the screen will show the following command ready to be executed: To finish deleting the variables, press `.
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`/.
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.
` (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@ @ @CHK@@ @@OK@@ @@OK@@ . And try the solution again: ƒ³ ~ „t` ‚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. These menu lists are referred to as CHOOSE boxes.
The screen shows flag 117 not set (CHOOSE boxes), as shown here: Press the @ @CHK@@ soft menu key to set flag 117 to soft MENU. The screen will reflect that change: Press @@OK@@ 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@@).
Note: most of the examples in this user guide assume that the current setting of flag 117 is its default setting (that is, not set). If you have set the flag but want to strictly follow the examples in this guide, you should clear the flag before continuing. Selected CHOOSE boxes Some menus will only produce CHOOSE boxes, e.g.
• 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∠∠). The symbol ∠ 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.
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.
Alternatively, in RPN mode, you can separate the operands with a space (#) before pressing the operator key. Examples: 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.
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 „¸.
the inverse trigonometric functions represent angles, the answer from 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.
combination „´. With the default setting of CHOOSE boxes 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..
Hyperbolic functions and their inverses Selecting Option 4. HYPERBOLIC.. , in the MTH menu, and pressing @@OK@@, produces the hyperbolic function menu: The hyperbolic functions are: Hyperbolic sine, SINH, and its inverse, ASINH or sinh-1 Hyperbolic cosine, COSH, and its inverse, ACOSH or cosh-1 Hyperbolic tangent, TANH, and its inverse, ATANH or tanh-1 This menu contains also the functions: EXPM(x) = exp(x) – 1, LNP1(x) = ln(x+1). Finally, option 9. MATH, returns the user to the MTH menu.
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. Also, using the combination ‚˜ will list all menu functions in the screen, e.g.
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: „´ Select MTH menu )@@HYP@ Select the HYPERBOLIC.. menu @@TANH@ Select the TANH function 2.5` 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.
Please notice that MOD is not a function, but rather an operator, i.e., in ALG mode, MOD should be used as y MOD x, and not as MOD(y,x). Thus, the operation of MOD is similar to that of +, -, *, /. 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: The Gamma function Γ(α) PSI: N-th derivative of the digamma function Psi: Digamma function, derivative of the ln(Gamma) The Gamma function is defined by ∞ Γ(α ) = ∫ x α −1e − x dx . This function has 0 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)×(n-2) …3×2×1, with 0! = 1. The factorial function is available in the calculator by using ~‚2.
Examples of these special functions are shown here using both the ALG and RPN modes. As an exercise, verify that GAMMA(2.3) = 1.166711…, PSI(1.5,3) = 1.40909.., and Psi(1.5) = 3.64899739..E-2. These calculations are shown in the following screen shot: 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.
Selecting any of these entries will place the value selected, whether a symbol (e.g., e, i, π, MINR, or MAXR) or a value (2.71.., (0,1), 3.14.., 1E-499, 9.99..E499) in the stack. Please notice that e is available from the keyboard as exp(1), i.e., „¸1`, in ALG mode, or 1` „¸, in RPN mode. Also, π is available directly from the keyboard as „ì. Finally, i is available by using „¥. Operations with units Numbers in the calculator can have units associated with them.
The user will recognize most of these units (some, e.g., dyne, are not used very often nowadays) from his or her physics classes: N = newtons, dyn = dynes, gf = grams – force (to distinguish from gram-mass, or plainly gram, a unit of mass), kip = kilo-poundal (1000 pounds), lbf = pound-force (to distinguish from pound-mass), pdl = poundal. To attach a unit object to a number, the number must be followed by an underscore. Thus, a force of 5 N will be entered as 5_N.
Note: Use the L key or the „«keystroke sequence to navigate through the menus. Available units The following is a list of the units available in the UNITS menu.
SPEED m/s (meter per second), cm/s (centimeter per second), ft/s (feet per second), kph (kilometer per hour), mph (mile per hour), knot (nautical miles per hour), c (speed of light), ga (acceleration of gravity ) MASS kg (kilogram), g (gram), Lb (avoirdupois pound), oz (ounce), slug (slug), lbt (Troy pound), ton (short ton), tonUK (long ton), t (metric ton), ozt (Troy ounce), ct (carat), grain (grain), u (unified atomic mass), mol (mole) FORCE N (newton), dyn (dyne), gf (gram-force), kip (kilopound-force),
ANGLE (planar and solid angle measurements) o (sexagesimal degree), r (radian), grad (grade), arcmin (minute of arc), arcs (second of arc), sr (steradian) LIGHT (Illumination measurements) fc (footcandle), flam (footlambert), lx (lux), ph (phot), sb (stilb), lm (lumem), cd (candela), lam (lambert) RADIATION Gy (gray), rad (rad), rem (rem), Sv (sievert), Bq (becquerel), Ci (curie), R (roentgen) VISCOSITY P (poise), St (stokes) Units not listed Units not listed in the Units menu, but available in the calcul
Converting to base units To convert any of these units to the default units in the SI system, use the function UBASE.
` Convert the units In RPN mode, system flag 117 set to SOFT menus: 1 Enter 1 (no underline) ‚Û Select the UNITS menu „« @)VISC Select the VISCOSITY option @@@P@@ Select the unit P (poise) ‚Û Select the UNITS menu )@TOOLS Select the TOOLS menu @UBASE Select the UBASE function Attaching units to numbers To attach a unit object to a number, the number must be followed by an underscore (‚Ý, key(8,5)). Thus, a force of 5 N will be entered as 5_N.
Notice that the underscore is entered automatically when the RPN mode is active. The result is the following screen: As indicated earlier, if system flag 117 is set to SOFT menus, then the UNITS menu will show up as labels for the soft menu keys. This set up is very convenient for extensive operations with units. The keystroke sequences to enter units when the SOFT menu option is selected, in both ALG and RPN modes, are illustrated next.
Y yotta +24 d deci -1 Z zetta +21 c centi -2 E exa +18 m milli -3 μ micro -6 P peta +15 T tera +12 n nano -9 G giga +9 p pico -12 M mega +6 f femto -15 k,K kilo +3 a atto -18 h,H hecto +2 z zepto -21 D(*) deka +1 y yocto -24 ___________________________________________________ (*) In the SI system, this prefix is da rather than D. Use D for deka in the calculator, however. To enter these prefixes, simply type the prefix using the ~ keyboard.
which shows as 65_(m⋅yd). To convert to units of the SI system, use function UBASE: Note: Recall that the ANS(1) variable is available through the keystroke combination „î(associated with the ` key). To calculate a division, say, 3250 mi / 50 h, enter it as (3250_mi)/(50_h) `: which transformed to SI units, with function UBASE, produces: Addition and subtraction can be performed, in ALG mode, without using parentheses, e.g.
Stack calculations in the RPN mode, do not require you to enclose the different terms in parentheses, e.g., 12_m ` 1.5_yd ` * 3250_mi ` 50_h ` / These operations produce the following output: Also, try the following operations: 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.
UFACT(x,y): UNIT(x,y): factors a unit y from unit object x combines value of x with units of y The UBASE function was discussed in detail in an earlier section in this chapter. To access any of these functions follow the examples provided earlier for UBASE. Notice that, while function UVAL requires only one argument, functions CONVERT, UFACT, and UNIT require two arguments. Try the following exercises.
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. To launch this command you could simply type it in the stack: ~~conlib~` or, you can select the command CONLIB from the command catalog, as follows: First, launch the catalog by using: ‚N~c.
The soft menu keys corresponding to this CONSTANTS LIBRARY screen include the following functions: SI when selected, constants values are shown in SI units ENGL when selected, constants values are shown in English units (*) UNIT when selected, constants are shown with units attached (*) 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.
To see the values of the constants in the English (or Imperial) system, press the @ENGL option: If we de-select the UNITS option (press @UNITS ) only the values are shown (English units selected in this case): To copy the value of Vm to the stack, select the variable name, and press ! , then, press @QUIT@. For the calculator set to the ALG, the screen will look like this: The display shows what is called a tagged value, Vm:359.0394. In here, Vm, is the tag of this result.
Special physical functions Menu 117, triggered by using MENU(117) in ALG mode, or 117 ` MENU in RPN mode, produces the following menu (labels listed in the display by using ‚˜): The functions include: ZFACTOR: gas compressibility Z factor function FANNING: Fanning friction factor for fluid flow DARCY: Darcy-Weisbach friction factor for fluid flow F0λ: Black body emissive power function SIDENS: Silicon intrinsic density TDELTA: Temperature delta function In the second page of this menu (press L) we find the
ZFACTOR(xT, yP), where xT is the reduced temperature, i.e., the ratio of actual temperature to pseudo-critical temperature, and yP is the reduced pressure, i.e., the ratio of the actual pressure to the pseudo-critical pressure. The value of xT must be between 1.05 and 3.0, while the value of yP must be between 0 and 30. Example, in ALG mode: Function F0λ Function F0λ (T, λ) calculates the fraction (dimensionless) of total black-body emissive power at temperature T between wavelengths 0 and λ.
Function TINC Function TINC(T0,ΔT) calculates T0+DT. The operation of this function is similar to that of function TDELTA in the sense that it returns a result in the units of T0. Otherwise, it returns a simple addition of values, e.g., Defining and using functions Users can define their own functions by using the DEF command available thought the keystroke sequence „à (associated with the 2 key).
Press the J key, and you will notice that there is a new variable in your soft menu key (@@@H@@). To see the contents of this variable press ‚@@@H@@. The screen will show now: Thus, the variable H contains a program defined by: << x ‘LN(x+1) + EXP(x)’ >> This is a simple program in the default programming language of the calculator. This programming language is called UserRPL.
The contents of the variable K are: << α β ‘α+β’ >>. Functions defined by more than one expression In this section we discuss the treatment of functions that are defined by two or more expressions. An example of such functions would be ⎧ 2 ⋅ x − 1, f (x) = ⎨ 2 ⎩ x − 1, x < 0⎫ ⎬ x > 0 ⎭ The function IFTE (IF-Then-Else) describes such functions.
Combined IFTE functions To program a more complicated function such as ⎧ − x, x < −2 ⎪ x + 1, − 2 ≤ x < 0 ⎪ g ( x) = ⎨ ⎪ x − 1, 0 ≤ x < 2 ⎪⎩ x2 , x ≥ 2 you can combine several levels of the IFTE function, i.e., ‘g(x) = IFTE(x<-2, -x, IFTE(x<0, x+1, IFTE(x<2, x-1, x^2)))’, Define this function by any of the means presented above, and check that g(-3) = 3, g(-1) = 0, g(1) = 0, g(3) = 9.
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.
Notice that the last entry shows a complex number in the form x+iy. This is so because the number was entered between single quotes, which represents an algebraic expression. To evaluate this number use the EVAL key( μ). Once the algebraic expression is evaluated, you recover the complex number (3.5,1.2). Polar representation of a complex number The result shown above represents a Cartesian (rectangular) representation of the complex number 3.5-1.2i.
On the other hand, if the coordinate system is set to cylindrical coordinates (use CYLIN), entering a complex number (x,y), where x and y are real numbers, will produce a polar representation. For example, in cylindrical coordinates, enter the number (3.,2.). The figure below shows the RPN stack, before and after entering this number: Simple operations with complex numbers Complex numbers can be combined using the four fundamental operations (+-*/).
x1 + iy1 x + iy1 x 2 − iy 2 x1 x 2 + y1 y 2 x y − x1 y 2 = 1 ⋅ = + i ⋅ 2 21 2 2 x 2 + iy 2 x 2 + iy 2 x 2 − iy 2 x2 + y 2 x 2 + y 22 Thus, the inverse function INV (activated with the Y key) is defined as 1 1 x − iy x y = ⋅ = 2 +i⋅ 2 2 x + iy x + iy x − iy x + y x + y2 Changing sign of a complex number Changing the sign of a complex number can be accomplished by using the \ key, e.g.
CMPLX menu through the MTH menu Assuming that system flag 117 is set to CHOOSE boxes (see Chapter 2), the CMPLX sub-menu within the MTH menu is accessed by using: „´9 @@OK@@ .
This first screen shows functions RE, IM, and C R. Notice that the last function returns a list {3. 5.} representing the real and imaginary components of the complex number: The following screen shows functions R C, ABS, and ARG. Notice that the ABS function gets translated to |3.+5.·i|, the notation of the absolute value. 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.
The resulting menu include some of the functions already introduced in the previous section, namely, ARG, ABS, CONJ, IM, NEG, RE, and SIGN. It also includes function i which serves the same purpose as the keystroke combination „¥, i.e., to enter the unit imaginary number i in an expression. The keyboard-base CMPLX menu is an alternative to the MTH-based CMPLX menu containing the basic complex number functions. Try the examples shown earlier using the keyboard-based CMPLX menu for practice.
Note: When using trigonometric functions and their inverses with complex numbers the arguments are no longer angles. Therefore, the angular measure selected for the calculator has no bearing in the calculation of these functions with complex arguments. To understand the way that trigonometric functions, and other functions, are defined for complex numbers consult a book on complex variables.
Function DROITE is found in the command catalog (‚N).
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.
(exponential, logarithmic, trigonometry, hyperbolic, etc.), as you would any real or complex number. To demonstrate basic operations with algebraic objects, let’s create a couple of objects, say ‘π*R^2’ and ‘g*t^2/4’, and store them in variables A1 and A2 (See Chapter 2 to learn how to create variables and store values in them).
‚¹@@A1@@ „¸@@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 4 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: Help facility A help facility accessible via TOOL NEXT CASCMD allows you to browse through all the CAS commands.
FACTOR: LNCOLLECT: LIN: PARTFRAC: SOLVE: SUBST: TEXPAND: 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. A second form of substitution can be accomplished by using the ‚¦ (associated with the I key). For example, in ALG mode, the following entry will substitute the value x = 2 in the expression x+x2. The figure to the left shows the way to enter the expression (the substituted value, x=2, must be enclosed in parentheses) before pressing `.
A different approach to substitution consists in defining the substitution expressions in calculator variables and placing the name of the variables in the original expression. For example, in ALG mode, store the following variables: Then, enter the expression A+B: The last expression entered is automatically evaluated after pressing the ` key, producing the result shown above.
LNCOLLECT, and TEXPAND are also contained in the ALG menu presented earlier. Functions LNP1 and EXPM were introduced in menu HYPERBOLIC, under the MTH menu (See Chapter 2). The only remaining function is EXPLN.
Functions in the ARITHMETIC menu The ARITHMETIC menu contains a number of sub-menus for specific applications in number theory (integers, polynomials, etc.), as well as a number of functions that apply to general arithmetic operations. The ARITHMETIC menu is triggered through the keystroke combination „Þ (associated with the 1 key).
LGCD (Greatest Common Denominator): PROPFRAC (proper fraction) SIMP2: The functions associated with the ARITHMETIC submenus: INTEGER, POLYNOMIAL, MODULO, and PERMUTATION, are the following: INTEGER menu EULER IABCUV IBERNOULLI ICHINREM IDIV2 IEGCD IQUOT IREMAINDER ISPRIME? NEXTPRIME PA2B2 PREVPRIME Number of integers < n, co -prime with n Solves au + bv = c, with a,b,c = integers n-th Bernoulli number Chinese reminder for integers Euclidean division of two integers Returns u,v, such that au + bv = gcd(a
FACTOR FCOEF FROOTS GCD HERMITE HORNER LAGRANGE LCM LEGENDRE PARTFRAC PCOEF PTAYL QUOT RESULTANT REMAINDER STURM STURMAB Factorizes an integer number or a polynomial Generates fraction given roots and multiplicity Returns roots and multiplicity given a fraction Greatest common divisor of 2 numbers or polynomials n-th degree Hermite polynomial Horner evaluation of a polynomial Lagrange polynomial interpolation Lowest common multiple of 2 numbers or polynomials n-th degree Legendre polynomial Partial-fractio
Applications of the ARITHMETIC menu This section is intended to present some of the background necessary for application of the ARITHMETIC menu functions. Definitions are presented next regarding the subjects of polynomials, polynomial fractions and modular arithmetic.
multiplying j times k in modulus n arithmetic is, in essence, the integer remainder of j⋅k/n in infinite arithmetic, if j⋅k>n. For example, in modulus 12 arithmetic we have 7⋅3 = 21 = 12 + 9, (or, 7⋅3/12 = 21/12 = 1 + 9/12, i.e., the integer reminder of 21/12 is 9). We can now write 7⋅3 ≡ 9 (mod 12), and read the latter result as “seven times three is congruent to nine, modulus twelve.” The operation of division can be defined in terms of multiplication as follows, r/ k ≡ j (mod n), if, j⋅k ≡ r (mod n).
Notice that, whenever a result in the right-hand side of the “congruence” symbol produces a result that is larger than the modulo (in this case, n = 6), you can always subtract a multiple of the modulo from that result and simplify it to a number smaller than the modulo. Thus, the results in the first case 8 (mod 6) simplifies to 2 (mod 6), and the result of the third case, 15 (mod 6) simplifies to 3 (mod 6). Confusing? Well, not if you let the calculator handle those operations.
[SPC] entry, and then press the corresponding modular arithmetic function.
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). The modular inverse of a number can be obtained by using the function INVMOD in the MODULO sub-menu of the ARITHMETIC menu.
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.
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).
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. Examples: The Hermite polynomials of orders 3 and 5 are given by: HERMITE(3) = ‘8*X^3-12*X’, And HERMITE(5) = ‘32*x^5-160*X^3+120*X’. The HORNER function The function HORNER produces the Horner division, or synthetic division, of a polynomial P(X) by the factor (X-a).
n ∏(x − x ) n pn −1 ( x) = ∑ k k =1, k ≠ j n j =1 ∏(x k =1, k ≠ j j − xk ) ⋅ y j. For example, for n = 2, we will write: p1 ( x) = ( y − y2 ) ⋅ x + ( y2 ⋅ x1 − y1 ⋅ x2 ) x − x1 x − x2 ⋅ y1 + ⋅ y2 = 1 x1 − x2 x2 − x1 x1 − x2 Check this result with your calculator: LAGRANGE([[ x1,x2],[y1,y2]]) = ‘((y1-y2)*X+(y2*x1-y1*x2))/(x1-x2)’. Other examples: LAGRANGE([[1, 2, 3][2, 8, 15]]) = ‘(X^2+9*X-6)/2’ LAGRANGE([[0.5,1.5,2.5,3.5,4.5][12.2,13.5,19.2,27.3,32.5]]) = ‘-(.1375*X^4+ -.
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 coefficients correspond to decreasing order of the independent variable. For example: PCOEF([-2,–1,0,1,1,2]) = [1. –1. –5. 5. 4. –4. 0.], which represents the polynomial X6 -X5-5X4+5X3+4X2-4X.
Note: you could get the latter result by using PROPFRAC: PROPFRAC(‘(X^3-2*X+2)/(X-1)’) = ‘X^2+X-1 + 1/(X-1)’. The EPSX0 function and the CAS variable EPS The variable ε (epsilon) is typically used in mathematical textbooks to represent a very small number. The calculator’s CAS creates a variable EPS, with default value 0.0000000001 = 10 -10, when you use the EPSX0 function. You can change this value, once created, if you prefer a different value for EPS.
Fractions Fractions can be expanded and factored by using functions EXPAND and FACTOR, from the ALG menu (‚×).
If you have the Complex mode active, the result will be: ‘2*X+(1/2/(X+i)+1/2/(X-2)+5/(X-5)+1/2/X+1/2/(X-i))’ The FCOEF function The function FCOEF is used to obtain a rational fraction, given the roots and poles of the fraction. Note: If a rational fraction is given as F(X) = N(X)/D(X), the roots of the fraction result from solving the equation N(X) = 0, while the poles result from solving the equation D(X) = 0. The input for the function is a vector listing the roots followed by their multiplicity (i.e.
mode selected, then the results would be: [0 –2. 1 –1. – ((1+i*√3)/2) –1. – ((1–i*√3)/2) –1. 3 1. 2 1.]. Step-by-step operations with polynomials and fractions By setting the CAS modes to Step/step the calculator will show simplifications of fractions or operations with polynomials in a step-by-step fashion. This is very useful to see the steps of a synthetic division. The example of dividing X 3 − 5X 2 + 3X − 2 X −2 is shown in detail in Appendix C.
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-29
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 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.
In the first case SOLVEVX could not find a solution. In the second case, SOLVEVX found a single solution, X = 2. The following screens show the RPN stack for solving the two examples shown above (before and after application of SOLVEVX): The equation used as argument for function SOLVEVX must be reducible to a rational expression.
The Symbolic Solver functions presented above produce solutions to rational equations (mainly, polynomial equations). If the equation to be solved for has all numerical coefficients, a numerical solution is possible through the use of the Numerical Solver features of the calculator. Numerical solver menu The calculator provides a very powerful environment for the solution of single algebraic or transcendental equations. To access this environment we start the numerical solver (NUM.SLV) by using ‚Ï.
Polynomial Equations Using the Solve poly… option in the calculator’s SOLVE environment you can: (1) find the solutions to a polynomial equation; (2) obtain the coefficients of the polynomial having a number of given roots; (3) obtain an algebraic expression for the polynomial as a function of X. Finding the solutions to a polynomial equation A polynomial equation is an equation of the form: anxn + an-1xn-1 + …+ a1x + a0 = 0.
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. For example, the number (0.432,-0.389), a complex number, will be written normally as 0.432 - 0.389i, where i is the imaginary unit, i.e., i2 = -1.
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. Also, try generating a polynomial with roots [1 (1,2) (-1,2)], and verify that the resulting polynomial will have complex coefficients.
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'. A different approach to obtaining an expression for the polynomial is to generate the coefficients first, then generate the algebraic expression with the coefficients highlighted. For example, for this case try: ‚Ϙ˜@@OK@@ Select Solve poly… ˜„Ô1‚í3 ‚í2\‚í 1@@OK@@ @SOLVE@ Enter vector of roots ˜@SYMB@ Generate symbolic expression ` Return to stack.
Example 1 – Calculating payment on a loan If $2 million are borrowed at an annual interest rate of 6.5% to be repaid in 60 monthly payments, what should be the monthly payment? For the debt to be totally repaid in 60 months, the future values of the loan should be zero. So, for the purpose of using the financial calculation feature of the calculator we will use the following values: n = 60, I%YR = 6.5, PV = 2000000, FV = 0, P/YR = 12.
payments. Suppose that we use 24 periods in the first line of the amortization screen, i.e., 24 @@OK@@. Then, press @@AMOR@@. You will get the following result: This screen is interpreted as indicating that after 24 months of paying back the debt, the borrower has paid up US $ 723,211.43 into the principal amount borrowed, and US $ 215,963.68 of interest. The borrower still has to pay a balance of US $1,276,788.57 in the next 36 months.
˜ Skip PMT, since we will be solving for it 0 @@OK@@ Enter FV = 0, the option End is highlighted @@CHOOS !—@@OK@@ Change payment option to Begin — š @@SOLVE! Highlight PMT and solve for it The screen now shows the value of PMT as –38,921.47, i.e., the borrower must pay the lender US $ 38,921.48 at the beginning of each month for the next 60 months to repay the entire amount.
™ ‚í ³ ‚@@PYR@@ ™ ‚í ³ ‚@@FV@@. ` Enter a comma Enter name of variable PYR Enter a comma Enter name of variable FV Execute PURGE command The following two screen shots show the PURGE command for purging all the variables in the directory, and the result after executing the command.
³„¸~„x™-S„ì *~„x/3™‚Å 0™ K~e~q` Function STEQ Function STEQ, available through the command catalog, ‚N, will store its argument into variable EQ, e.g., in ALG mode: In RPN mode, enter the equation between apostrophes and activate command STEQ. Thus, function STEQ can be used as a shortcut to store an expression into variable EQ. Press J to see the newly created EQ variable: Then, enter the SOLVE environment and select Solve equation…, by using: ‚Ï@@OK@@.
This, however, is not the only possible solution for this equation. To obtain a negative solution, for example, enter a negative number in the X: field before solving the equation. Try 3\@@@OK@@˜@SOLVE@. The solution is now X: 3.045. Solution procedure for Equation Solve... The numerical solver for single-unknown equations works as follows: Θ It lets the user type in or @CHOOS an equation to solve.
The equation is exx = 1 [σ xx − n ⋅ (σ yy + σ zz )] + α ⋅ ΔT , here exx is the unit E strain in the x-direction, σxx, σyy, and σzz, are the normal stresses on the particle in the directions of the x-, y-, and z-axes, E is Young’s modulus or modulus of elasticity of the material, n is the Poisson ratio of the material, α is the thermal expansion coefficient of the material, and ΔT is a temperature increase.
With the ex: field highlighted, press @SOLVE@ to solve for ex: 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.
Specific energy in an open channel is defined as the energy per unit weight measured with respect to the channel bottom. Let E = specific energy, y = channel depth, V = flow velocity, g = acceleration of gravity, then we write E = y+ V2 . 2g The flow velocity, in turn, is given by V = Q/A, where Q = water discharge, A = cross-sectional area.
Θ Θ Solve for y. 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).
In the next example we will use the DARCY function for finding friction factors in pipelines. Thus, we define the function in the following frame. Special function for pipe flow: DARCY (ε/D,Re) The Darcy-Weisbach equation is used to calculate the energy loss (per unit weight), hf, in a pipe flow through a pipe of diameter D, absolute roughness ε, and length L, when the flow velocity in the pipe is V. The equation is written as hf = f ⋅ L V2 ⋅ .
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.
QD ⎞ ⎛ ⎜ 8Q L ε πD 2 / 4 ⎟⎟ ⎜ h f = 2 5 ⋅ DARCY , ⎜D Nu ⎟ π gD ⎜ ⎟ ⎝ ⎠ 2 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. Enter the input values, and solve for D, The solution is: 0.12, i.e., D = 0.12 m.
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.
Type an equation, say X^2 - 125 = 0, directly on the stack, and press @@@OK@@@ . 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.
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.
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., after briefly flashing the message “Solving for t.” There is a second root to this equation, which can be found by changing the value of t, before solving for it again.
You can also solve more than one equation by solving one equation at a time, and repeating the process until a solution is found. For example, if you enter the following list of equations into variable EQ: { ‘a*X+b*Y = c’, ‘k*X*Y=s’}, the keystroke sequence @)ROOT @)SOLVR, within the SOLVE soft menu, will produce the following screen: The first equation, namely, a*X + b*Y = c, will be listed in the top part of the display. You can enter values for the variables a, b, and c, say: 2 [ a ] 5 [ b ] 19 [ c ].
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. Θ To remove units enter a number without units in a list as the new guess, i.e., use the format { number }. Θ A list of numbers can be given as a guess for a variable.
This function produces the coefficients [an, an-1, … , a2, a1 , a0] of a polynomial anxn + an-1xn-1 + … + a2x2 + a1x + a0, given a vector of its roots [r1, r2, …, rn]. For example, a vector whose roots are given by [-1, 2, 2, 1, 0], will produce the following coefficients: [1, -4, 3, 4, -4, 0]. The polynomial is x5 - 4x4 + 3x3 + 4x2 - 4x. Function PEVAL This function evaluates a polynomial, given a vector of its coefficients, [an, an-1, … , a2, a1 , a0], and a value x0, i.e.
Press J to exit the SOLVR environment. Find your way back to the TVM submenu within the SOLVE sub-menu to try the other functions available. Function TVMROOT This function requires as argument the name of one of the variables in the TVM problem. The function returns the solution for that variable, given that the other variables exist and have values stored previously. For example, having solved a TVM problem above, we can solve for, say, ‘N’, as follows: [ ‘ ] ~n` @TVMRO. The result is 10.
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.
Use command SOLVE at this point (from the S.SLV menu: „Î) After about 40 seconds, maybe more, you get as result a list: { ‘t = (x-x0)/(COS(θ0)*v0)’ ‘y0 = (2*COS(θ0)^2*v0^2*y+(g*x^2(2*x0*g+2*SIN(θ0))*COS(θ0)*v0^2)*x+ (x0^2*g+2*SIN(θ0)*COS(θ0)*v0^2*x0)))/(2*COS(θ0)^2*v0^2)’]} Press μ to remove the vector from the list, then use command OBJ , to get the equations listed separately in the stack. Note: This method worked fine in this example because the unknowns t and y0 were algebraic terms in the equations.
the contents of T1 and T2 to the stack and adding and subtracting them. Here is how to do it with the equation writer: Enter and store term T1: Enter and store term T2: Notice that we are using the RPN mode in this example, however, the procedure in the ALG mode should be very similar.
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 . The result is: These two examples constitute systems of linear equations that can be handled equally well with function LINSOLVE (see Chapter 11). The following example shows function SOLVE applied to a system of polynomial equations.
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.
discharge (m3/s or ft3/s), A is the cross-sectional area (m2 or ft2), Cu is a coefficient that depends on the system of units (Cu = 1.0 for the SI, Cu = 1.486 for the English system of units), n is the Manning’s coefficient, a measure of the channel surface roughness (e.g., for concrete, n = 0.012), P is the wetted perimeter of the cross section (m or ft), So is the slope of the channel bed expressed as a decimal fraction.
μ@@@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.012, S0 = 0.00001, g = 32.2, and Cu = 1.486. Before being able to use MSLV for the solution, we need to enter these values into the corresponding variable names.
Next, we’ll enter variable EQS: LL@@EQS@ , followed by vector [y,Q]: ‚í„Ô~„y‚í~q™ and by the initial guesses ‚í„Ô5‚í 10. Before pressing `, the screen will look like this: Press ` to solve the system of equations. You may, if your angular measure is not set to radians, get the following request: 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 .
The result is a list of three vectors. The first vector in the list will be the equations solved. The second vector is the list of unknowns. The third vector represents the solution. To be able to see these vectors, press the down-arrow key ˜ to activate the line editor. The solution will be shown as follows: The solution suggested is [4.9936.., 20.661…]. This means, y = 4.99 ft, and Q = 20.661… ft3/s. You can use the arrow keys (š™—˜) to see the solution in detail.
The cosine law indicates that: a2 = b2 + c2 – 2⋅b⋅c⋅cos α, b2 = a2 + c2 – 2⋅a⋅c⋅cos β, c2 = a2 + b2 – 2⋅a⋅b⋅cos γ. In order to solve any triangle, you need to know at least three of the following six variables: a, b, c, α, β, γ. Then, you can use the equations of the sine law, cosine law, and sum of interior angles of a triangle, to solve for the other three variables.
‘SIN(α)/a = SIN(β)/b’ ‘SIN(α)/a = SIN(γ)/c’ ‘SIN(β)/b = SIN(γ)/c’ ‘c^2 = a^2+b^2-2*a*b*COS(γ)’ ‘b^2 = a^2+c^2-2*a*c*COS(β)’ ‘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.
Press J, if needed, to get your variables menu. Your menu should show the variables @LVARI! !@TITLE @@EQ@@ . 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`.
Let’s try a simple solution of Case I, using a = 5, b = 3, c = 5. Use the following entries: 5[ a ] a:5 is listed in the top left corner of the display. 3[ b ] b:3 is listed in the top left corner of the display. 5[ c ] c:5 is listed in the top left corner of the display. To solve 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.
Pressing „@@ALL@@ will solve for all the variables, temporarily showing the intermediate results. Press ‚@@ALL@@ to see the solutions: 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.
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.
a b c α( ο) β( ο) γ( ο) 2.5 6.9837 7.2 20.229 75 84.771 8.6933 27 130.38 23.309 A 7.2 8.5 14.26 22.616 21.92 17.5 13.2 90 52.98 37.03 115.5 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 50.78 97.44 210.71 Adding an INFO button to your directory An information button can be useful for your directory to help you remember the operation of the functions in the directory.
An explanation of the variables follows: SOLVEP = a program that triggers the multiple equation solver for the particular set of equations stored in variable PEQ; NAME = a variable storing the name of the multiple equation solver, namely, "vel. & acc. polar coord.
Notice that after you enter a particular value, the calculator displays the variable and its value in the upper left corner of the display. We have now entered the known variables. To calculate the unknowns we can proceed in two ways: a). Solve for individual variables, for example, „[ vr ] gives vr: 0.500. Press L„[ vθ ] to get vθ : 5.750 , and so on. The remaining results are v: 5.77169819031; ar: -14.725; aθ: -13.95; and a: 20.2836911089.; or, b). Solve for all variables at once, by pressing „@ALL!.
Page 7-20
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.
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.
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. Changing sign The sign-change key (\) , when applied to a list of numbers, will change the sign of all elements in the list.
Subtraction, multiplication, and division of lists of numbers of the same length produce a list of the same length with term-by-term operations. Examples: The division L4/L3 will produce an infinity entry because one of the elements in L3 is zero: If the lists involved in the operation have different lengths, an error message is produced (Error: Invalid Dimension). The plus sign (+), when applied to lists, acts a concatenation operator, putting together the two lists, rather than adding them term-by-term.
ABS EXP and LN LOG and ANTILOG SQ and square root SIN, ASIN COS, ACOS TAN, ATAN INVERSE (1/x) Real number functions from the MTH menu Functions of interest from the MTH menu include, from the HYPERBOLIC menu: SINH, ASINH, COSH, ACOSH, TANH, ATANH, and from the REAL menu: %, %CH, %T, MIN, MAX, MOD, SIGN, MANT, XPON, IP, FP, RND, TRNC, FLOOR, CEIL, D R, R D.
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,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. Examples of applications of function RND are shown next: Lists of complex numbers The following exercise shows how to create a list of complex numbers given two lists of the same length, one representing the real parts and one the imaginary parts of the complex numbers. Use L1 ADD i*L2.
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.
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 shown next: SORT and REVLIST can be combined to so
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).
In both cases, you can either type out the MAP command (as in the examples above) or select the command from the CAT menu. The following call to function MAP uses a program instead of a function as second argument: 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.
to replace the plus sign (+) with ADD: 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 DD 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}. Suppose that the sample of interest is the list {1, 5, 3, 1, 2, 1, 3, 4, 2, 1} 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.
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 k =1 = 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.
Thus, the geometric mean of list S is sg = 1.003203… 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.
The class mark data can be stored in variable S, while the frequency count can be stored in variable W, as follows: 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= ∑w k =1 k ⋅ sk n ∑w k =1 n = ∑w k =1 k k ⋅ sk N , n where N = ∑ wk represents the total frequency count.
n V = ∑ wk ⋅ ( s k − s ) 2 k =1 n ∑w k =1 k n = ∑w k =1 k ⋅ (sk − s ) 2 N 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.
where θ is the angle between the two vectors. The cross product produces a vector A×B whose magnitude is |A×B| = |A||B|sin(θ), and its direction is given by the so-called right-hand rule (consult a textbook on Math, Physics, or Mechanics to see this operation illustrated graphically). In terms of Cartesian components, A•B = AxBx+AyBy+AzBz, and A×B = [AyBz-AzBy,AzBx-AxBz,AxByAyBx]. The angle between two vectors can be found from the definition of the dot product as cos(θ) = A•B/|A||B|= eA•eB.
Storing vectors into variables Vectors can be stored into variables. The screen shots below show the vectors u2 = [1, 2], u3 = [-3, 2, -2], v2 = [3,-1], v3 = [1, -5, 2] stored into variables @@@u2@@, @@@u3@@, @@@v2@@, and @@@v3@@, respectively. First, in ALG mode: Then, in RPN mode (before pressing K, repeatedly): Using the Matrix Writer (MTRW) to enter vectors Vectors can also be entered by using the Matrix Writer „²(third key in the fourth row of keys from the top of the keyboard).
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.]].
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. The @-COL@ key will delete the column corresponding to the selected cell of the spreadsheet. The @→STK@@ key will place the contents of the selected cell on the stack.
Summary of Matrix Writer use for entering vectors In summary, to enter a vector using the Matrix Writer, simply activate the writer („²), and place the elements of the vector, pressing ` after each of them. Then, press ``. Make sure that the @VEC and @GO→ @ keys are selected.
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.
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. To replace an element in an array use function PUT (you can find it in the function catalog ‚N, or in the PRG/LIST/ELEMENTS sub-menu – the later was introduced in Chapter 8).
Simple operations with vectors To illustrate operations with vectors we will use the vectors A, u2, u3, v2, and v3, stored in an earlier exercise. Changing sign To change the sign of a vector use the key \, e.g., Addition, subtraction Addition and subtraction of vectors require that the two vector operands have the same length: Attempting to add or subtract vectors of different length produces an error message (Invalid Dimension), e.g., v2+v3, u2+u3, A+v3, etc.
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 . In the ALG mode, enter the function name followed by the vector argument.
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. Attempts to calculate the dot product of two vectors of different length produce an error message: Cross product Function CROSS is used to calculate the cross product of two 2-D vectors, of two 3-D vectors, or of one 2-D and one 3-D vector.
In the RPN mode, application of function V will list the components of a vector in the stack, e.g., V (A) will produce the following output in the RPN stack (vector A is listed in stack level 6:). Building a two-dimensional vector Function V2 is used in the RPN mode to build a vector with the values in stack levels 1: and 2:.
When the rectangular, or Cartesian, coordinate system is selected, the top line of the display will show an XYZ field, and any 2-D or 3-D vector entered in the calculator is reproduced as the (x,y,z) components of the vector.
The figure below shows the transformation of the vector from spherical to Cartesian coordinates, with x = ρ sin(φ) cos(θ), y = ρ sin (φ) cos (θ), z = ρ cos(φ). For this case, x = 3.204, y = 1.494, and z = 3.536. If the CYLINdrical system is selected, the top line of the display will show an R∠ Z field, and a vector entered in cylindrical coordinates will be shown in its cylindrical (or polar) coordinate form (r,θ,z).
equivalent (r,θ,z) with r = ρ sin φ, θ = θ, z = ρ cos φ. For example, the following figure shows the vector entered in spherical coordinates, and transformed to polar coordinates. For this case, ρ = 5, θ = 25o, and φ = 45o, while the transformation shows that r = 3.563, and z = 3.536. (Change to DEG): Next, let’s change the coordinate system to spherical coordinates by using function SPHERE from the VECTOR sub-menu in the MTH menu.
Suppose that you want to find the angle between vectors A = 3i-5j+6k, B = 2i+j-3k, you could try the following operation (angular measure set to degrees) in ALG mode: 1 - Enter vectors [3,-5,6], press `, [2,1,-3], press `.
Thus, M = (10i+26j+25k) m⋅N. We know that the magnitude of M is such that |M| = |r||F|sin(θ), where θ is the angle between r and F. We can find this angle as, θ = sin-1(|M| /|r||F|) by the following operations: 1 – ABS(ANS(1))/(ABS(ANS(2))*ABS(ANS(3)) calculates sin(θ) 2 – ASIN(ANS(1)), followed by NUM(ANS(1)) calculates θ These operations are shown, in ALG mode, in the following screens: Thus the angle between vectors r and F is θ = 41.038o.
Next, we calculate vector P0P = r as ANS(1) – ANS(2), i.e., Finally, we take the dot product of ANS(1) and ANS(4) and make it equal to zero to complete the operation N•r =0: 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 this section we will showing you ways to transform: a column vector into a row vector, a row vector into a column vector, a list into a vector, and a vector (or matrix) into a list. We first demonstrate these transformations using the RPN mode. In this mode, we will use functions OBJ , LIST, ARRY and DROP to perform the transformation. To facilitate accessing these functions we will set system flag 117 to SOFT menus (see Chapter 1).
If we now apply function OBJ once more, the list in stack level 1:, {3.}, will be decomposed as follows: Function LIST This function is used to create a list given the elements of the list and the list length or size. In RPN mode, the list size, say, n, should be placed in stack level 1:. The elements of the list should be located in stack levels 2:, 3:, …, n+1:. For example, to create the list {1, 2, 3}, type: 1` 2` 3` 3` „°@)TYPE! ! LIST@.
3 - Use function ARRY to build the column vector These three steps can be put together into a UserRPL program, entered as follows (in RPN mode, still): ‚å„°@)TYPE! @OBJ @ 1 + ! ARRY@ `³~~rxc` K 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 + RRY >> This variable, @@RXC@@, can now be used to directly transform a row vector to a column vector.
2 - Use function OBJ to decompose the list in stack level 1: 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 pre
This variable, @@CXR@@, can now be used to directly transform a column vector to a row vector. In RPN mode, enter the column vector, and then press @@CXR@@. Try, for example: [[1],[2],[3]] ` @@CXR@@. After having defined variable @@CXR@@, we can use it in ALG mode to transform a row vector into a column vector.
A new variable, @@LXV@@, will be available in the soft menu labels after pressing J: Press ‚@@LXV@@ to see the program contained in the variable LXV: << OBJ 1 LIST RRY >> This variable, @@LXV@@, can now be used to directly transform a list into a vector. In RPN mode, enter the list, and then press @@LXV@@. Try, for example: {1,2,3} ` @@LXV@@. After having defined variable @@LXV@@, we can use it in ALG mode to transform a list into a vector.
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.
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. Note: The calculator also includes Function TRAN in the MATRICES/ OPERATIONS sub-menu: For example, in ALG mode: Function CON The function takes as argument a list of two elements, corresponding to the number of row and columns of the matrix to be generated, and a constant value.
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. For example, to create a 4×4 identity matrix in ALG mode use: You can also use an existing square matrix as the argument of function IDN, e.g., The resulting identity matrix will have the same dimensions as the argument matrix.
vector’s dimension, in the latter the number of rows and columns of the matrix. The following examples illustrate the use of function RDM: Re-dimensioning a vector into a matrix The following example shows how to re-dimension a vector of 6 elements into a matrix of 2 rows and 3 columns in ALG mode: In RPN mode, we can use [1,2,3,4,5,6] ` {2,3} ` RDM to produce the matrix shown above.
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).
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. For example, keeping the matrix that we inherited from the previous example, enter the matrix: [[1,2,3],[4,5,6],[7,8,9]] .
In RPN mode, with the 3×3 matrix in the stack, we simply have to activate function DI G to obtain the same result as above. Function DIAG→ Function DIAG→ takes a vector and a list of matrix dimensions {rows, columns}, and creates a diagonal matrix with the main diagonal replaced with the proper vector elements.
⎡1 ⎢ ⎢1 ⎢1 ⎢ ⎢M ⎢1 ⎣ x1 x2 x3 M xn x12 L x1n −1 ⎤ ⎥ x 22 L x 2n −1 ⎥ x32 L x3n −1 ⎥ ⎥ M O M ⎥ x n2 L x nn −1 ⎥⎦ For example, the following command in ALG mode for the list {1,2,3,4}: In RPN mode, enter {1,2,3,4} ` V NDERMONDE. Function HILBERT Function HILBERT creates the Hilbert matrix corresponding to a dimension n. By definition, the n×n Hilbert matrix is Hn = [hjk]n×n, so that h jk = 1 j + k −1 The Hilbert matrix has application in numerical curve fitting by the method of linear squares.
entered in the display as you perform those keystrokes. First, we present the steps necessary to produce program CRMC. Lists represent columns of the matrix The program @CRMC allows you to put together a p×n matrix (i.e., p rows, n columns) out of n lists of p elements each.
~„n # „´@)MATRX! @)COL! @COL! ` 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 see the contents of the program use J ‚@CRMC.
Lists represent rows of the matrix The previous program can be easily modified to create a matrix when the input lists will become the rows of the resulting matrix. The only change to be performed is to change COL→ for ROW→ in the program listing.
Both approaches will show the same functions: When system flag 117 is set to SOFT menus, the COL menu is accessible through „´!)MATRX ) !)@@COL@ , or through „Ø!)@CREAT@ !)@@COL@ . Both approaches will show the same set of functions: The operation of these functions is presented below. Function →COL Function →COL takes as argument a matrix and decomposes it into vectors corresponding to its columns. An application of function COL in ALG mode is shown below.
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., it is no longer available in the stack. Function COL→ Function COL→ has the opposite effect of Function →COL, i.e., given n vectors of the same length, and the number n, function COL builds a matrix by placing the input vectors as columns of the resulting matrix. Here is an example in ALG mode.
In RPN mode, enter the matrix first, then the vector, and the column number, before applying function COL+. The figure below shows the RPN stack before and after applying function COL+. Function COLFunction COL- takes as argument a matrix and an integer number representing the position of a column in the matrix. Function returns the original matrix minus a column, as well as the extracted column shown as a vector.
In RPN mode, function CSWP lets you swap the columns of a matrix listed in stack level 3, whose indices are listed in stack levels 1 and 2. For example, the following figure shows the RPN stack before and after applying function CSWP to matrix A in order to swap columns 2 and 3: As you can see, the columns that originally occupied positions 2 and 3 have been swapped. Swapping of columns, and of rows (see below), is commonly used when solving systems of linear equations with matrices.
When system flag 117 is set to SOFT menus, the ROW menu is accessible through „´!)MATRX !)@@ROW@ , or through „Ø!)@CREAT@ !)@@ROW@ . Both approaches will show the same set of functions: The operation of these functions is presented below. Function →ROW Function →ROW takes as argument a matrix and decomposes it into vectors corresponding to its rows. An application of function ROW in ALG mode is shown below. The matrix used has been stored earlier in variable A.
matrix does not survive decomposition, i.e., it is no longer available in the stack. Function ROW→ Function ROW→ has the opposite effect of the function →ROW, i.e., given n vectors of the same length, and the number n, function ROW builds a matrix by placing the input vectors as rows of the resulting matrix. Here is an example in ALG mode. The command used was: ROW ([1,2,3],[4,5,6],[7,8,9],3) In RPN mode, place the n vectors in stack levels n+1, n, n-1,…,2, and the number n in stack level 1.
Function ROWFunction ROW- takes as argument a matrix and an integer number representing the position of a row in the matrix. The function returns the original matrix, minus a row, as well as the extracted row shown as a vector. Here is an example in the ALG mode using the matrix stored in A: In RPN mode, place the matrix in the stack first, then enter the number representing a row location before applying function ROW-. The following figure shows the RPN stack before and after applying function ROW-.
As you can see, the rows that originally occupied positions 2 and 3 have been swapped. Function RCI Function RCI stands for multiplying Row I by a Constant value and replace the resulting row at the same location. The following example, written in ALG mode, takes the matrix stored in A, and multiplies the constant value 5 into row number 3, replacing the row with this product. This same exercise done in RPN mode is shown in the next figure.
In RPN mode, enter the matrix first, followed by the constant value, then by the row to be multiplied by the constant value, and finally enter the row that will be replaced.
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. They can also be raised to a real power.
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.
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 general term in the product, cij, is defined as p cij = ∑ aik ⋅ bkj , for i = 1,2,K, m; j = 1,2,K, n.
(another row vector). For the calculator to identify a row vector, you must use double brackets to enter it: 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. This function is available through Function catalog (‚N), or through the MATRICES/OPERATIONS sub-menu („Ø).
In algebraic mode, the keystrokes are: [enter or select the matrix] Q [enter the power] `. In RPN mode, the keystrokes are: [enter or select the matrix] † [enter the power] Q`. Matrices can be raised to negative powers. In this case, the result is equivalent to 1/[matrix]^ABS(power). The identity matrix In Chapter 9 we introduce the identity matrix as the matrix I = [δij]n×n, where δij is the Kronecker’s delta function. Identity matrices can be obtained by using function IDN described in Chapter 9.
To verify the properties of the inverse matrix, consider the following multiplications: Characterizing a matrix (The matrix NORM menu) The matrix NORM (NORMALIZE) menu is accessed through the keystroke sequence „´ (system flag 117 set to CHOOSE boxes): This menu contains the following functions: These functions are described next. Because many of these functions use concepts of matrix theory, such as singular values, rank, etc.
Function ABS Function ABS calculates what is known as the Frobenius norm of a matrix. For a matrix A = [aij] m×n, the Frobenius norm of the matrix is defined as A F = n m ∑∑ a i =1 j =1 2 ij If the matrix under consideration in a row vector or a column vector, then the Frobenius norm , ||A||F , is simply the vector’s magnitude. Function ABS is accessible directly in the keyboard as „Ê.
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.
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. The corresponding numbers for the inverse matrix, INV(A33), are shown to the right: Since RNRM(A33) > CNRM(A33), then we take ||A33|| = RNRM(A33) = 21. Also, since CNRM(INV(A33)) < RNRM(INV(A33)), then we take ||INV(A33)|| = CNRM(INV(A33)) = 0.261044... Thus, the condition number is also calculated as CNRM(A33)*CNRM(INV(A33)) = COND(A33) = 6.
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 a11 a 21 a31 a12 , a 22 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.
MAD and RSD are related to the solution of systems of linear equations and will be presented in a subsequent section in this Chapter. In this section we’ll discuss only functions AXL and AXM. Function AXL Function AXL converts an array (matrix) into a list, and vice versa: Note: the latter operation is similar to that of the program CRMR presented in Chapter 10.
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.
⎡ a11 ⎢a A = ⎢ 21 ⎢ M ⎢ ⎣an1 a12 L a1m ⎤ ⎡ x1 ⎤ ⎡ b1 ⎤ ⎥ ⎥ ⎢ ⎢b ⎥ a22 L a2 m ⎥ x2 ⎥ ⎢ x= b = ⎢ 2⎥ ⎢M⎥ ⎢M⎥ M O M ⎥ ⎥ ⎢ ⎥ ⎢ ⎥ an 2 L anm ⎦ n×m ⎣ xm ⎦ m×1 , ⎣bn ⎦ n×1 , 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@@@.
This system has the same number of equations as of unknowns, and will be referred to as a square system. In general, there should be a unique solution to the system. The solution will be the point of intersection of the three planes in the coordinate system (x1, x2, x3) represented by the three equations. To enter matrix A you can activate the Matrix Writer while the A: field is selected.
To check that the solution is correct, enter the matrix A and multiply times this solution vector (example in algebraic mode): 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.
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 right- and leftarrow keys to move about the vector: 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.99999999992 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 ——, to highlight the A: field. • Press L @CALC@ `, to copy matrix A onto the stack. • Press @@@OK@@@ to return to the numerical solver environment. • Press ˜ ˜@CALC@ `, to copy solution vector X onto the stack. • Press @@@OK@@@ to return to the numerical solver environment. • Press ` 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.
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.
[[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 ⎥⎥. ⎢⎣3 − 1 − 2⎥⎦ Gaussian and Gauss-Jordan elimination Gaussian elimination is a procedure by which the square matrix of coefficients belonging to a system of n linear equations in n unknowns is reduced to an upper-triangular matrix (echelon form) through a series of row operations. This procedure is known as forward elimination.
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.
an expression = 0. Thus, the last set of equations is interpreted to be the following equivalent set of equations: X +2Y+3Z = 7, 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.
6⎞ ⎛2 4 ⎡X ⎤ ⎡ 14 ⎤ ⎜ ⎟ ⎢ ⎥ A = ⎜ 3 − 2 1 ⎟, x = ⎢ Y ⎥, b = ⎢⎢ − 3⎥⎥. ⎜ 4 2 − 1⎟ ⎢⎣ Z ⎥⎦ ⎢⎣− 4⎥⎦ ⎝ ⎠ To obtain a solution to the system matrix equation using Gaussian elimination, we first create what is known as the augmented matrix corresponding to A, i.e., 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.
Multiply row 2 by –1/8: 8\Y2 @RCI! Multiply row 2 by 6 add it to row 3, replacing it: 6#2#3 @RCIJ! If you were performing these operations by hand, you would write the following: A aug A aug ⎛2 4 6 14 ⎞ ⎛ 1 2 3 7 ⎞ ⎜ ⎟ ⎜ ⎟ = ⎜ 3 − 2 1 − 3⎟ ≅ ⎜ 3 − 2 1 − 3⎟ ⎜ 4 2 −1 − 4⎟ ⎜ 4 2 −1 − 4⎟ ⎝ ⎠ ⎝ ⎠ ⎛1 2 3 7 ⎞ ⎛1 2 3 7 ⎞ ⎜ ⎟ ⎜ ⎟ ≅ ⎜ 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
Multiply row 3 by –1/7: 7\Y 3 @RCI! Multiply row 3 by –1, add it to row 2, replacing it: 1\ # 3 #2 @RCIJ! 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: Aaug ⎛ 1 2 0 1 ⎞ ⎛ 1 0 0 − 1⎞ ⎜ ⎟ ⎜ ⎟ ≅ ⎜ 0 1 0 1 ⎟ ≅ ⎜ 0 1 0 1 ⎟.
While performing pivoting in a matrix elimination procedure, you can improve the numerical solution even more by selecting as the pivot the element with the largest absolute value in the column and row of interest. This operation may require exchanging not only rows, but also columns, in some pivoting operations. When row and column exchanges are allowed in pivoting, the procedure is known as full pivoting.
Now we are ready to start the Gauss-Jordan elimination with full pivoting. We will need to keep track of the permutation matrix by hand, so take your notebook and write the P matrix shown above. 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.
Having filled up with zeros the elements of column 1 below the pivot, now we proceed to check the pivot at position (2,2). We find that the number 3 in position (2,3) will be a better pivot, thus, we exchange columns 2 and 3 by using: 2#3 ‚N@@@OK@@ 1 0 0 -1/16 3 25/8 1/2 41/16 2 -1 0 -25/8 0 1 0 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.
2 Y \#3#1@RCIJ 1 0 0 -1/16 1 0 0 0 1 33/16 -1 1 0 0 1 1 0 0 0 1 0 Finally, we eliminate the –1/16 from position (1,2) by using: 16 Y # 2#1@RCIJ 1 0 0 0 1 0 0 0 1 2 -1 1 0 1 0 0 0 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.
A aug ( I ) ⎡1 2 3 1 0 0⎤ ⎢ ⎥ = ⎢3 − 2 1 0 1 0⎥. ⎢⎣4 2 − 1 0 0 1⎥⎦ 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.
The result (A-1)n×n = C n×n /det(A n×n), is a general result that applies to any non-singular matrix A. A general form for the elements of C can be written based on the Gauss-Jordan algorithm. 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.
LINSOLVE([X-2*Y+Z=-8,2*X+Y-2*Z=6,5*X-2*Y+Z=-12], [X,Y,Z]) 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.
The diagonal matrix that results from a Gauss-Jordan elimination is called a row-reduced echelon form. Function RREF ( Row-Reduced Echelon Form) The result 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 ].
of a matrix, while the corresponding eigenvalues are the components of a vector. For example, in ALG mode, the eigenvectors and eigenvalues of the matrix listed below are found by applying function EGV: The result shows the eigenvalues as the columns of the matrix in the result list. To see the eigenvalues we can use: GET(ANS(1),2), i.e., get the second element in the list in the previous result. The eigenvalues are: In summary, λ1 = 0.29, x1 = [ 1.00,0.79,–0.91]T, λ2 = 3.16, x2 = [1.00,-0.51, 0.
• A list with the eigenvectors corresponding to each eigenvalue of matrix A (stack level 2) • A vector with the eigenvectors of matrix A (stack level 4) For example, try this exercise in RPN mode: [[4,1,-2],[1,2,-1],[-2,-1,0]] JORD N The output is the following: 4: ‘X^3+-6*x^2+2*X+8’ 3: ‘X^3+-6*x^2+2*X+8’ 2: { } 1: { } The same exercise, in ALG mode, looks as in the following screen shots: Function MAD This function, although not available in the EIGEN menu, also provides information related to the
Notice that the equation (x⋅I-A)⋅p(x)=m(x)⋅I is similar, in form, to the eigenvalue equation A⋅x = λ⋅x. As an example, in RPN mode, try: [[4,1,-2] [1,2,-1][-2,-1,0]] M D The result is: 4: -8. 3: [[ 0.13 –0.25 –0.38][-0.25 0.50 –0.25][-0.38 –0.25 –0.
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. For example, in RPN mode: [[-1,2,5][3,1,-2][7,6,5]] LU produces: 3:[[7 0 0][-1 2.86 0][3 –1.57 –1] 2: [[1 0.86 0.
decomposition, while the vector s represents the main diagonal of the matrix S used earlier. For example, in RPN mode: [[5,4,-1],[2,-3,5],[7,2,8]] SVD 3: [[-0.27 0.81 –0.53][-0.37 –0.59 –0.72][-0.89 3.09E-3 0.46]] 2: [[ -0.68 –0.14 –0.72][ 0.42 0.73 –0.54][-0.60 0.67 0.44]] 1: [ 12.15 6.88 1.42] Function SVL Function SVL (Singular VaLues) returns the singular values of a matrix An×m as a vector s whose dimension is equal to the minimum of the values n and m.
Function QR In RPN, function QR produces the QR factorization of a matrix An×m returning a Qn×n orthogonal matrix, a Rn×m upper trapezoidal matrix, and a Pm×m permutation matrix, in stack levels 3, 2, and 1. The matrices A, P, Q and R are related by A⋅P = Q⋅R. For example, [[ 1,-2,1][ 2,1,-2][ 5,2,1]] QR produces 3: [[-0.18 0.39 0.90][-0.37 –0.88 0.30][-0.91 0.28 –0.30]] 2: [[ -5.48 –0.37 1.83][ 0 2.42 –2.20][0 0 –0.
This menu includes functions AXQ, CHOLESKY, GAUSS, QXA, and SYLVESTER. Function AXQ In RPN mode, function AXQ produces the quadratic form corresponding to a matrix An×n in stack level 2 using the n variables in a vector placed in stack level 1. Function returns the quadratic form in stack level 1 and the vector of variables in stack level 1.
such that x = P⋅y, by using Q = x⋅A⋅xT = (P⋅y)⋅A⋅ (P⋅y)T = y⋅(PT⋅A⋅P)⋅yT = y⋅D⋅yT. Function SYLVESTER Function SYLVESTER takes as argument a symmetric square matrix A and returns a vector containing the diagonal terms of a diagonal matrix D, and a matrix P, so that PT⋅A⋅P = D.
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-56
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.
Θ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). Press @ADD to get you into the equation writer. You will be prompted to fill the right-hand side of an equation Y1(x) = .
<< →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: ˜ Launches the line editor ‚˜ Moves cursor to the end of the line ššš-0.
Θ Θ Θ Θ Θ Θ Θ Θ Θ 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 x-axis, which is essentially the root. Place the cursor exactly at the root and press @ISECT. You will get the same message as before, namely SIGN REVERSAL, before getting the result I-SECT: 1.6635….
Note: the stack will show all the graph operations performed, properly identified. Θ Θ Enter the PLOT environment by pressing, simultaneously if in RPN mode, „ñ. Notice that the highlighted field in the PLOT environment now contains the derivative of Y1(X). Press L@@@OK@@@ to return to return to normal calculator display. Press ‚@@EQ@@ to check the contents of EQ. You will notice that it contains a list instead of a single expression.
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. Graphics of transcendental functions In this section we use some of the graphics features of the calculator to show the typical behavior of the natural log, exponential, trigonometric and hyperbolic functions.
10 by using 1\@@@OK@@ 10@@@OK@@@. Next, press the soft key labeled @AUTO to let the calculator determine the corresponding vertical range. After a couple of seconds this range will be shown in the PLOT WINDOW-FUNCTION window. At this point we are ready to produce the graph of ln(X). Press @ERASE @DRAW to plot the natural logarithm function. 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 L to recover the current graphic menu.
Next, press ‚@@@X@@@ to see the contents of this variable. A value of 10.275 is placed in the stack. This value is determined by our selection for the horizontal display range. We selected a range between -1 and 10 for X. To produce the graph, the calculator generates values between the range limits using a constant increment, and storing the values generated, one at a time, in the variable @@@X@@@ as the graph is drawn. For the horizontal range ( –1,10), the increment used seems to be 0.275.
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. Press the down-arrow key, , to launch the stack editor, and use the up- and down-arrow keys to view the full contents of PPAR. The screen will show the following values: PPAR stands for Plot PARameters, and its contents include two ordered pairs of real numbers, (-8.,-1.10797263281) and (2.,7.
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. This can be verified in the calculator by typing and evaluating the following expressions in the Equation Writer: LN(EXP(X)) and EXP(LN(X)). They should both evaluate to X. When a function f(x) and its inverse f -1(x) are plotted simultaneously in the same set of axes, their graphs are reflections of each other about the line y = x.
Summary of FUNCTION plot operation In this section we present information regarding the PLOT SETUP, PLOTFUNCTION, and PLOT WINDOW screens accessible through the left-shift key combined with the soft-menu keys A through D. Based on the graphing examples presented above, the procedure to follow to produce a FUNCTION plot (i.e., one that plots one or more functions of the form Y = F(X)), is the following: „ô, simultaneously if in RPN mode: Access to the PLOT SETUP window.
Θ Θ Use @CANCL to cancel any changes to the PLOT SETUP window and return to normal calculator display. Press @@@OK@@@ to save changes to the options in the PLOT SETUP window and return to normal calculator display. „ñ, simultaneously if in RPN mode: Access to the PLOT window (in this case it will be called PLOT –FUNCTION window). Soft menu key options: Θ Use @EDIT to edit the highlighted equation. Θ Use @@ADD@! to add new equations to the plot.
Θ Θ Θ Θ Enter lower and upper limits for horizontal view (H-View), and press @AUTO, while the cursor is in one of the V-View fields, to generate the vertical view (V-View) range automatically. Or, Enter lower and upper limits for vertical view (V-View), and press @AUTO, while the cursor is in one of the H-View fields, to generate the horizontal view (H-View) range automatically.
„ó, simultaneously if in RPN mode: Plots the graph based on the settings stored in variable PPAR and the current functions defined in the PLOT – FUNCTION screen. If a graph, different from the one you are plotting, already exists in the graphic display screen, the new plot will be superimposed on the existing plot. This may not be the result you desire, therefore, I recommend to use the @ERASE @DRAW soft menu keys available in the PLOT SETUP, PLOTFUNCTION or PLOT WINDOW screens.
TANH(X) ATANH(X) TAN & ATAN -5 5 AUTO -1.2 1.2 AUTO -5 5 -2.5 2.5 Generating a table of values for a function The combinations „õ(E) and „ö(F), pressed simultaneously if in RPN mode, let’s the user produce a table of values of functions. For example, we will produce a table of the function Y(X) = X/(X+10), in the range -5 < X < 5 following these instructions: Θ Θ Θ Θ We will generate values of the function f(x), defined above, for values of x from –5 to 5, in increments of 0.5.
the corresponding values of f(x), listed as Y1 by default. You can use the up and down arrow keys to move about in the table. You will notice that we did not have to indicate an ending value for the independent variable x. Thus, the table continues beyond the maximum value for x suggested early, namely x = 5. Some options available while the table is visible are @ZOOM, @@BIG@, and @DEFN: Θ Θ Θ The @DEFN, when selected, shows the definition of the independent variable.
We will try to plot the function f(θ) = 2(1-sin(θ)), as follows: Θ First, make sure that your calculator’s angle measure is set to radians. Θ Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP window. Θ Change TYPE to Polar, by pressing @CHOOS ˜ @@@OK@@@. Θ Press ˜ and type: ³2* „ Ü1-S~‚t @@@OK@@@. Θ Θ Θ Θ 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 L@CANCL to return to the PLOT WINDOW screen. Press L@@@OK@@@ to return to normal calculator display. In this exercise we entered the equation to be plotted directly in the PLOT SETUP window. We can also enter equations for plotting using the PLOT window, i.e., simultaneously if in RPN mode, pressing „ñ. For example, when you press „ñ after finishing the previous exercise, you will get the equation ‘2*(1-SIN(θ))’ highlighted.
The calculator has the ability of plotting one or more conic curves by selecting Conic as the function TYPE in the PLOT environment. Make sure to delete the variables PPAR and EQ before continuing. For example, let's store the list of equations { ‘(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.
Note: The H-View and V-View ranges were selected to show the intersection of the two curves. There is no general rule to select those ranges, except based on what we know about the curves. For example, for the equations shown above, we know that the circle will extend from -3+1 = -2 to 3+1 = 4 in x, and from -3+2=-1 to 3+2=5 in y. In addition, the ellipse, which is centered at the origin (0,0), will extend from -2 to 2 in x, and from -√3 to √3 in y.
which involve constant values x0, y0, v0, and θ0, we need to store the values of those parameters in variables. To develop this example, create a sub-directory called ‘PROJM’ for PROJectile Motion, and within that sub-directory store the following variables: X0 = 0, Y0 = 10, V0 = 10 , θ0 = 30, and g = 9.806. Make sure that the calculator’s angle measure is set to DEG. Next, define the functions (use „à): X(t) = X0 + V0*COS(θ0)*t Y(t) = Y0 + V0*SIN(θ0)*t – 0.
Note: Through these settings we are indicating that the parameter t will take values of t = 0, 0.1, 0.2, …, etc., until reaching the value of 2.0. Θ Press @AUTO. This will generate automatic values of the H-View and V-View ranges based on the values of the independent variable t and the definitions of X(t) and Y(t) used. The result will be: Θ Θ Press @ERASE @DRAW to draw the parametric plot. Press @EDIT L @LABEL @MENU to see the graph with labels.
parameters. The other variables contain the values of constants used in the definitions of X(t) and Y(t). You can store different values in the variables and produce new parametric plots of the projectile equations used in this example. If you want to erase the current picture contents before producing a new plot, you need to access either the PLOT, PLOT WINDOW, or PLOT SETUP screens, by pressing, „ñ , „ò, or „ô (the two keys must be pressed simultaneously if in RPN mode). Then, press @ERASE @DRAW.
Plotting the solution to simple differential equations The plot of a simple differential equation can be obtained by selecting Diff Eq in the TYPE field of the PLOT SETUP environment as follows: suppose that we want to plot x(t) from the differential equation dx/dt = exp(-t2), with initial conditions: x = 0 at t = 0. The calculator allows for the plotting of the solution 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).
Θ Θ Θ Θ Θ Θ 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.
Θ Θ Θ 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. If you want to interrupt the plot, press $ , once. Then press @CANCEL .
[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. A matrix will be shown at the ΣDAT field.
accommodate the maximum value in column 1 of ΣDAT. Bar plots are useful when plotting categorical (i.e., non-numerical) data. Suppose that you want to plot the data in column 2 of the ΣDAT matrix: Θ Θ Θ Θ Θ Θ Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP window. Press ˜˜ to highlight the Col: field and type 2 @@@OK@@@, followed by L@@@OK@@@. Press „ò, simultaneously if in RPN mode, to access to the PLOT SETUP window. Change V-View to read V-View: 0 6 Press @ERASE @DRAW.
Θ Press @ERASE @DRAW to draw the bar plot. Press @EDIT L @LABEL @MENU to see the plot unencumbered by the menu and with identifying labels (the cursor will be in the middle of the plot, however): Θ Θ Press LL@)PICT to leave the EDIT environment. Press @CANCL to return to the PLOT WINDOW environment. $ , or L@@@OK@@@, to return to normal calculator display. Then, press To plot y vs. z, use: Θ Θ Θ Θ Θ Θ Θ Θ Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP window.
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). For example, to visualize the solution to the differential equation y’ = f(x,y) = x+y, use the following: Θ Θ Θ Θ Θ Θ Θ Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP window.
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. Try also a slope field plot for the function y’ = f(x,y) = - (y/x)2, by using: Θ Θ Θ Θ Θ Θ Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP window. Change TYPE to Slopefield. Press ˜ and type ‘− (Y/X)^2’ @@@OK@@@. Press @ERASE @DRAW to draw the slope field plot.
Note: 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, although, the times utilized for graphic generation are relatively fast. 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. The result is a wireframe picture of the surface with the reference coordinate system shown at the lower left corner of the screen.
Θ Θ Θ Θ Θ Θ 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. Wireframe plots Wireframe plots are plots of three-dimensional surfaces described by z = f(x,y). Unlike Fast 3D plots, wireframe plots are static plots. The user can choose the viewpoint for the plot, i.e.
Θ Press @EDIT L @LABEL @MENU to see the graph with labels and ranges. This particular version of the graph is limited to the lower part of the display. We can change the viewpoint to see a different version of the graph. Θ Θ Θ Θ Press LL@)PICT @CANCL to return to the PLOT WINDOW environment. Change the eye coordinate data to read : XE:0 YE:-3 ZE:3 Press @ERASE @DRAW to see the surface plot. Press @EDIT L @LABEL @MENU to see the graph with labels and ranges.
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 @EDIT L@)MENU @LABEL to see the plot unencumbered by the menu and with identifying labels. Press LL@)PICT to leave the EDIT environment. Press @CANCL to return to the PLOT WINDOW environment. $ , or L@@@OK@@@, to return to normal calculator display.
Θ Press @EDIT!L @LABEL @MENU to see the graph with labels and ranges. Θ Θ Press LL@)PICT@CANCL to return to the PLOT WINDOW environment. Press $ , or L@@@OK@@@, to return to normal calculator display. Try also a Ps-Contour plot for the surface z = f(x,y) = sin x cos y. Θ Θ Θ Θ Θ Press „ô, simultaneously if in RPN mode, to access the PLOT SETUP window. Press ˜ and type ‘SIN(X)*COS(Y)’ @@@OK@@@. Press @ERASE @DRAW to draw the slope field plot.
Θ Θ Θ Θ Θ Θ Θ 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. Change 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 Press @ERASE @DRAW to draw the three-dimensional surface.
Θ Θ Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP window. Change TYPE to Gridmap. Press ˜ and type ‘SIN(X+i*Y)’ @@@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.
Note: The equations x = x(X,Y), y = y(X,Y), z=z(X,Y) represent a parametric description of a surface. X and Y are the independent parameters. Most textbooks will use (u,v) as the parameters, rather than (X,Y). Thus, the parametric description of a surface is given as x = x(u,v), y = y(u,v), z=z(u,v).
Interactive drawing Whenever we produce a two-dimensional graph, we find in the graphics screen a soft menu key labeled @)EDIT. Pressing @)EDIT produces a menu that include the following options (press L to see additional functions): Through the examples above, you have the opportunity to try out functions LABEL, MENU, PICT , and REPL. Many of the remaining functions, such as DOT+, DOT-, LINE, BOX, CIRCL, MARK, DEL, etc., can be used to draw points, lines, circles, etc.
Next, we illustrate the use of the different drawing functions on the resulting graphics screen. They require use of the cursor and the arrow keys (š™— ˜) to move the cursor about the graphics screen. DOT+ and DOTWhen DOT+ is selected, pixels will be activated wherever the cursor moves leaving behind a trace of the cursor position. When DOT- is selected, the opposite effect occurs, i.e., as you move the cursor, pixels will be deleted.
should have a straight angle traced by a horizontal and a vertical segments. The cursor is still active. To deactivate it, without moving it at all, press @LINE. The cursor returns to its normal shape (a cross) and the LINE function is no longer active. TLINE (Toggle LINE) Move the cursor to the second quadrant to see this function in action. Press @TLINE. A MARK is placed at the start of the toggle line. Move the cursor with the arrow keys away from this point, and press @TLINE.
DEL This command is used to remove parts of the graph between two MARK positions. Move the cursor to a point in the graph, and press @MARK. Move the cursor to a different point, press @MARK again. Then, press @@DEL@. The section of the graph boxed between the two marks will be deleted. 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.
X,Y This command copies the coordinates of the current cursor position, in user coordinates, 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 can always return to the very last zoom window by using @ZLAST. BOXZ Zooming in and out of a given graph can be performed by using the soft-menu 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.
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. ZTRIG Zooms the graph so that the x scale incorporates a range from about –3π to +3π, the preferred range for trigonometric functions. Note: None of these functions are programmable.
SOLVER.. „Î (the 7 key) Ch. 6 TRIGONOMETRIC.. ‚Ñ (the 8 key) Ch. 5 EXP&LN.. „Ð (the 8 key) Ch. 5 The SYMB/GRAPH menu The GRAPH sub-menu within the SYMB menu includes the following functions: DEFINE: same as the keystroke sequence „à (the 2 key) GROBADD: pastes two GROBs first over the second (See Chapter 22) PLOT(function): plots a function, similar to „ô PLOTADD(function): adds this function to the list of functions to plot, similar to „ô Plot setup..
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,+ ∞).
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. Right at zero (0+0) F is infinite, for X = e, F = 1/e. F increases before reaching this value, as indicated by the upward arrow, and decreases after this value (X=e) becoming slightly larger than zero (+:0) as X goes to infinity.
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.
To calculate one-sided limits, add +0 or -0 to the value to the variable. A “+0” means limit from the right, while a “-0” means limit from the left.
in ALG mode. Recall that in RPN mode the arguments must be entered before the function is applied. The DERIV&INTEG menu The functions available in this sub-menu are listed below: 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).
be differentiated. Thus, to calculate the derivative d(sin(r),r), use, in ALG mode: ‚¿~„r„ÜS~„r` In RPN mode, this expression must be enclosed in quotes before entering it into the stack. The result in ALG mode is: In the Equation Writer, when you press ‚¿, the calculator provides the following expression: The insert cursor ( ) will be located right at the denominator awaiting for the user to enter an independent variable, say, s: ~„s.
To evaluate the derivative in the Equation Writer, press the up-arrow key —, four times, to select the entire expression, then, press @EVAL. The derivative will be evaluated in the Equation Writer as: Note: The symbol ∂ is used formally in mathematics to indicate a partial derivative, i.e., the derivative of a function with more than one variable. However, the calculator does not distinguish between ordinary and partial derivatives, utilizing the same symbol for both.
Derivatives of equations You can use the calculator to calculate derivatives of equations, i.e., expressions in which derivatives will exist in both sides of the equal sign. Some examples are shown below: 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.
Analyzing graphics of functions In Chapter 11 we presented some functions that are available in the graphics screen for analyzing graphics of functions of the form y = f(x). These functions include (X,Y) and TRACE for determining points on the graph, as well as functions in the ZOOM and FCN menu. The functions in the ZOOM menu allow the user to zoom in into a graph to analyze it in more detail. These functions are described in detail in Chapter 12.
Θ 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 corresponding to the domain D = { -1,5 } is R = f (X ) = 1 X 2 +1 ⎧ 2 26 ⎫ , ⎨ ⎬. 26 2 ⎩ ⎭ 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.
Θ Level 3: the function f(VX) Θ 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.
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. Evaluate the function at those points to verify that indeed f(-1) > f(11/3). Higher order derivatives Higher order derivatives can be calculated by applying a derivative function several times, e.g.
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., C = constant.
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. Symbolically, ∫ b a f ( x)dx = F (b) − F (a ), where f(x) = dF/dx. The PREVAL(f(x),a,b) function of the CAS can simplify such calculation by returning f(b)-f(a) with x being the CAS variable VX.
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.
The following example shows the evaluation of a definite integral in the Equation Writer, step-by-step: ʳʳʳʳʳ Notice that the step-by-step process provides information on the intermediate steps followed by the CAS to solve this integral. First, CAS identifies a square root integral, next, a rational fraction, and a second rational expression, to come up with the final result.
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 . If we use step-by- step calculation in the Equation Writer, this is the sequence of variable substitutions: This second step shows the proper substitution to use, u = x2-1.
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. The differential of a product of two functions, y = u(x)v(x), is given by dy = u(x)dv(x) +du(x)v(x), or, simply, d(uv) = udv - vdu. Thus, the integral of udv = d(uv) - vdu, is written as ∫ udv = ∫ d (uv) − ∫ vdu .
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.
Using the calculator, we proceed as follows: Alternatively, you can evaluate the integral to infinity from the start, e.g., Integration with units An integral can be calculated with units incorporated into the limits of integration, as in the example shown below that uses ALG mode, with the CAS set to Approx mode. The left-hand side figure shows the integral typed in the line editor before pressing `. The right-hand figure shows the result after pressing `.
Some notes in the use of units in the limits of integrations: 1 – The units of the lower limit of integration will be the ones used in the final result, as illustrated in the two examples below: 2 - Upper limit units must be consistent with lower limit units. Otherwise, the calculator simply returns the unevaluated integral. For example, 3 – The integrand may have units too.
Taylor and Maclaurin’s series A function f(x) can be expanded into an infinite series around a point x=x0 by using a Taylor’s series, namely, ∞ f ( x) = ∑ n=0 f ( n ) ( xo ) ⋅ ( x − xo ) n , n! where f(n)(x) represents the n-th derivative of f(x) with respect to x, f(0)(x) = f(x). If the value x0 is zero, the series is referred to as a Maclaurin’s series, i.e.
where ξ is a number near x = x0. Since ξ is typically unknown, instead of an estimate of the residual, we provide an estimate of the order of the residual in reference to h, i.e., we say that Rk(x) has an error of order hn+1, or R ≈ O(hk+1). If h is a small number, say, h<<1, then hk+1 will be typically very small, i.e., hk+1<
increment h. The list returned as the first output object includes the following items: 1 - Bi-directional limit of the function at point of expansion, i.e., lim f ( x) x→ a 2 - An equivalent value of the function near x = a 3 - Expression for the Taylor polynomial 4 - Order of the residual or remainder Because of the relatively large amount of output, this function is easier to handle in RPN mode. For example: Drop the contents of stack level 1 by pressing ƒ, and then enter μ, to decompose the list.
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 f ( x + h, y ) − f ( x, y ) = lim . h → 0 ∂x h 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 ∂2 f ∂ ⎛ ∂f ⎞ ∂ 2 f ∂ ⎛ ∂f ⎞ = ⎜ ⎟, 2 = ⎜⎜ ⎟⎟, 2 ∂x ⎝ ∂x ⎠ ∂y ∂y ⎝ ∂y ⎠ ∂x ∂2 f ∂ ⎛ ∂f ⎞ ∂ 2 f ∂ ⎛ ∂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.
β ∫∫ φ (r ,θ )dA = ∫α ∫ R' g (θ ) f (θ ) φ (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.
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’]. Consider as an example the function φ(X,Y,Z) = X2 + XY + XZ, we’ll apply function HESS to this scalar field in the following example in RPN mode: Thus, the gradient is [2X+Y+Z, X, X]. Alternatively, one can use function DERIV as follows: DERIV(X^2+X*Y+X*Z,[X,Y,Z]), to obtain the same result.
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., divF = ∇ • F = ∂f ∂g ∂h + + ∂x ∂y ∂z Function DIV can be used to calculate the divergence of a vector field.
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 ⎠ ⎝ ∂z ∂x ⎠ ⎝ ∂y ∂z ⎠ 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.
(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., d2x/dt2, where x = x(t), would be written as ‘d1d1x(t)’, while (dx/dt)2 would be written ‘d1x(t)^2’.
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. Slope field visualization of solutions Slope field plots, introduced in Chapter 12, are used to visualize the solutions to a differential equation of the form dy/dx = f(x,y). A slope field plot shows a number of segments tangential to the solution curves, y = f(x).
These functions are briefly described next. They will be described in more detail in later parts of this Chapter.
Both of these inputs must be given in terms of the default independent variable for the calculator’s CAS (typically ‘X’). The output from the function is the general solution of the ODE. The function LDEC is available through in the CALC/DIFF menu. The examples are shown in the RPN mode, however, translating them to the ALG mode is straightforward. Example 1 – To solve the homogeneous ODE: d3y/dx3-4⋅(d2y/dx2)-11⋅(dy/ dx)+30⋅y = 0, enter: 0 ` 'X^3-4*X^2-11*X+30' ` LDEC μ.
The solution, shown partially here in the Equation Writer, is: Replacing the combination of constants accompanying the exponential terms with simpler values, the expression can be simplified to y = K1⋅e–3x + K2⋅e5x + K3⋅e2x + (450⋅x2+330⋅x+241)/13500. We recognize the first three terms as the general solution of the homogeneous equation (see Example 1, above). If yh represents the solution to the homogeneous equation, i.e., yh = K1⋅e–3x + K2⋅e5x + K3⋅e2x.
2x1’(t) + x2’(t) = 0. In algebraic form, this is written as: A⋅x’(t) = 0, where ⎡1 2 ⎤ A=⎢ ⎥ . The ⎣2 1 ⎦ system can be solved by using function LDEC with arguments [0,0] and matrix A, as shown in the following screen using ALG mode: The solution is given as a vector containing the functions [x1(t), x2(t)]. Pressing ˜ will trigger the Matrix Writer allowing the user to see the two components of the vector. To see all the details of each component, press the @EDIT! soft menu key.
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. Press @ODETY to obtain the string “1st order linear”. Example 2 -- Solve the second-order ODE: d2y/dx2 + x (dy/dx) = exp(x).
y ( x) = ∫ ⋅ ex + C dx + C 0 x Performing the integration by hand, we can only get it as far as: ex y ( x) = ∫ ⋅ 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. Solve d2y/dt2 + 5y = 2 cos(t/2), with initial conditions y(0) = 1.2, y’(0) = -0.5.
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. Use of the Laplace transform converts the linear ODE involving f(t) into an algebraic equation.
Laplace transform and inverses in the calculator The calculator provides the functions LAP and ILAP to calculate the Laplace transform and the inverse Laplace transform, respectively, of a function f(VX), where VX is the CAS default independent variable, which you should set to ‘X’. Thus, the calculator returns the transform or inverse transform as a function of X. The functions LAP and ILAP are available under the CALC/DIFF menu.
Example 3 – Determine the inverse Laplace transform of F(s) = sin(s). Use: ‘SIN(X)’ ` ILAP. The calculator takes a few seconds to return the result: ‘ILAP(SIN(X))’, meaning that there is no closed-form expression f(t), such that f(t) = L -1{sin(s)}. Example 4 – Determine the inverse Laplace transform of F(s) = 1/s3. Use: ‘1/X^3’ ` ILAP μ. The calculator returns the result: ‘X^2/2’, which is interpreted as L -1{1/s3} = t2/2. Example 5 – Determine the Laplace transform of the function f(t) = cos (a⋅t+b).
Example 2 – As a follow up to Example 1, the acceleration a(t) is defined as a(t) = d2r/dt2. If the initial velocity is vo = v(0) = dr/dt|t=0, then the Laplace transform of the acceleration can be written as: A(s) = L{a(t)} = L{d2r/dt2}= s2⋅R(s) - s⋅ro – v o. Θ Differentiation theorem for the n-th derivative. Let f (k)o = dkf/dxk|t = 0, and fo = f(0), then L{dnf/dtn} = sn⋅F(s) – sn-1⋅fo −…– s⋅f(n-2)o – f (n-1) o. Θ Linearity theorem. L{af(t)+bg(t)} = a⋅L{f(t)} + b⋅L{g(t)}.
L {∫ t 0 } f (u ) g (t − u )du = L{( f * g )(t )} = 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). To find F(s) = L{f(t)}, and G(s) = L{g(t)}, use: ‘SIN(X)’ ` LAP μ. Result, ‘1/(X^2+1)’, i.e., F(s) = 1/(s2+1). Also, ‘EXP(X)’ ` LAP. Result, ‘1/(X-1)’, i.e., G(s) = 1/(s-1). Thus, L{(f*g)(t)} = F(s)⋅G(s) = 1/(s2+1)⋅1/(s-1) = 1/((s-1)(s2+1)) = 1/(s3-s2+s-1).
f ∞ = lim f (t ) = lim[ s ⋅ F ( s)]. t →∞ s →0 Dirac’s delta function and Heaviside’s step function In the analysis of control systems it is customary to utilize a type of functions that represent certain physical occurrences such as the sudden activation of a switch (Heaviside’s step function, H(t)) or a sudden, instantaneous, peak in an input to the system (Dirac’s delta function, δ(t)). These belong to a class of functions known as generalized or symbolic functions [e.g., see Friedman, B.
y y (x _ x 0 ) H(x _ x 0 ) 1 x0 x You can prove that L{H(t)} = 1/s, from which it follows that L{Uo⋅H(t)} = Uo/s, x0 x where Uo is a constant. Also, L -1{1/s}=H(t), and L -1{ Uo /s}= Uo⋅H(t). Also, using the shift theorem for a shift to the right, L{f(t-a)}=e–as⋅L{f(t)} = e–as⋅F(s), we can write L{H(t-k)}=e–ks⋅L{H(t)} = e–ks⋅(1/s) = (1/s)⋅e–ks. 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)}.
Applications of Laplace transform in the solution of linear ODEs At the beginning of the section on Laplace transforms we indicated that you could use these transforms to convert a linear ODE in the time domain into an algebraic equation in the image domain. The resulting equation is then solved for a function F(s) through algebraic methods, and the solution to the ODE is found by using the inverse Laplace transform on F(s). The theorems on derivatives of a function, i.e.
The result is ‘H=((X+1)*h0+a)/(X^2+(k+1)*X+k)’. To find the solution to the ODE, h(t), we need to use the inverse Laplace transform, as follows: OBJ ƒ ƒ Isolates right-hand side of last expression ILAP μ Obtains the inverse Laplace transform The result is . Replacing X with t in this expression and simplifying, results in h(t) = a/(k-1)⋅e-t +((k-1)⋅ho -a)/(k-1)⋅e-kt. Check what the solution to the ODE would be if you use the function LDEC: ‘a*EXP(-X)’ ` ‘X+k’ ` LDEC μ The result is: , i.e.
Note: ‘SIN(3*X)’ ` LAP μ produces ‘3/(X^2+9)’, i.e., L{sin 3t}=3/(s2+9). 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 + 2⋅Y(s) = 3/(s2+9). Use the calculator to solve for Y(s), by writing: ‘X^2*Y-X*y0-y1+2*Y=3/(X^2+9)’ ` ‘Y’ ISOL The result is ‘Y=((X^2+9)*y1+(y0*X^3+9*y0*X+3))/(X^4+11*X^2+18)’.
Note: Using the two examples shown here, we can confirm what we indicated earlier, i.e., that function ILAP uses Laplace transforms and inverse transforms to solve linear ODEs given the right-hand side of the equation and the characteristic equation of the corresponding homogeneous ODE. Example 3 – Consider the equation d2y/dt2+y = δ(t-3), where δ(t) is Dirac’s delta function. Using Laplace transforms, we can write: L{d2y/dt2+y} = L{δ(t-3)}, L{d2y/dt2} + L{y(t)} = L{δ(t-3)}.
Notes: [1]. An alternative way to obtain the inverse Laplace transform of the expression ‘(X*y0+(y1+EXP(-(3*X))))/(X^2+1)’ is by separating the expression into partial fractions, i.e.
The result is: ‘SIN(X-3)*Heaviside(X-3) + cC1*SIN(X) + cC0*COS(X)’. Please notice that the variable X in this expression actually represents the variable t in the original ODE. Thus, the translation of the solution in paper may be written as: y (t ) = Co ⋅ cos t + C1 ⋅ sin t + sin(t − 3) ⋅ H (t − 3) When comparing this result with the previous result for y(t), we conclude that cCo = yo, cC1 = y1.
Use of the function H(X) with LDEC, LAP, or ILAP, is not allowed in the calculator. You have to use the main results provided earlier when dealing with the Heaviside step function, i.e., L{H(t)} = 1/s, L -1{1/s}=H(t), L{H(t-k)}=e–ks⋅L{H(t)} = e–ks⋅(1/s) = ⋅(1/s)⋅e–ks and L -1{e–as ⋅F(s)}=f(t-a)⋅H(t-a). Example 2 – The function H(t-to) when multiplied to a function f(t), i.e., H(t-to)f(t), has the effect of switching on the function f(t) at t = to.
where H(t) is Heaviside’s step function. Using Laplace transforms, we can write: L{d2y/dt2+y} = L{H(t-3)}, L{d2y/dt2} + L{y(t)} = L{H(t-3)}. The last term in this expression is: L{H(t-3)} = (1/s)⋅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) = (1/s)⋅e–3s. Change CAS mode to Exact, if necessary.
Example 4 – Plot the solution to Example 3 using the same values of yo and y1 used in the plot of Example 1, above. We now plot the function y(t) = 0.5 cos t –0.25 sin t + (1+sin(t-3))⋅H(t-3). In the range 0 < t < 20, and changing the vertical range to (-1,3), the graph should look like this: 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.
f(t) = Uo⋅[1-(t-a)/(b-1)]⋅[H(t-a)-H(t-b)]. Examples of the plots generated by these functions, for Uo = 1, a = 2, b = 3, c = 4, horizontal range = (0,5), and vertical range = (-1, 1.5), are shown in the figures below: 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).
The following exercises are in ALG mode, with CAS mode set to Exact. (When you produce a graph, the CAS mode will be reset to Approx. Make sure to set it back to Exact after producing the graph.) Suppose, for example, that the function f(t) = t2+t is periodic with period T = 2.
Function FOURIER An alternative way to define a Fourier series is by using complex numbers as follows: f (t ) = +∞ ∑c n = −∞ n ⋅ exp( 2inπt ), T where cn = 1 T ∫ T 0 f (t ) ⋅ exp( 2 ⋅ i ⋅ n ⋅π ⋅ t ) ⋅ dt , n = −∞,...,−2,−1,0,1,2,...∞. 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.
Next, we move to the CASDIR sub-directory under HOME to change the value of variable PERIOD, e.g., „ (hold) §`J @)CASDI `2 K @PERIOD ` Return to the sub-directory where you defined functions f and g, and calculate the coefficients (Accept change to Complex mode when requested): 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)].
The fitting is somewhat acceptable for 0
cn = (i⋅n⋅π+2)/(n2⋅π2). The result is Putting together the complex Fourier series Having determined the general expression for cn, we can put together a finite complex Fourier series by using the summation function (Σ) in the calculator as follows: Θ 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.
Or, in the calculator entry line as: 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))’), where T is the period, T = 2. The following screen shots show the definition of function F and the storing of T = 2: The function @@@F@@@ can be used to generate the expression for the complex Fourier series for a finite value of k.
Accept change to Approx mode if requested. The result is the value –0.40467…. The actual value of the function g(0.5) is g(0.5) = -0.25. The following calculations show how well the Fourier series approximates this value as the number of components in the series, given by k, increases: F (0.5, 1, 1/3) = (-0.303286439037,0.) F (0.5, 2, 1/3) = (-0.404607622676,0.) F (0.5, 3, 1/3) = (-0.192401031886,0.) 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.
periodicity in the graph of the series. This periodicity is easy to visualize by expanding the horizontal range of the plot to (-0.5,4): 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.
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 + 0 2 T ⎝ ⎠ 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.
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.
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.
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.25y = SW(X), where SW(X) stands for Square Wave function of X. The second input item will be the characteristic equation corresponding to the homogeneous ODE shown above, i.e., ‘X^2+0.25’ . With these two inputs, function LDEC produces the following result (decimal format changed to Fix with 3 decimals). Pressing ˜ allows you to see the entire expression in the Equation writer.
The solution is shown below: Fourier Transforms Before presenting the concept of Fourier transforms, we’ll discuss the general definition of an integral transform. In general, an integral transform is a transformation that relates a function f(t) to a new function F(s) by an integration of the form b F ( s ) = ∫ κ ( s, t ) ⋅ f (t ) ⋅ dt. The function κ(s,t) is known as the a kernel of the transformation.
The amplitudes An will be referred to as the spectrum of the function and will be a measure of the magnitude of the component of f(x) with frequency fn = n/T. The basic or fundamental frequency in the Fourier series is f0 = 1/T, thus, all other frequencies are multiples of this basic frequency, i.e., fn = n⋅f0. Also, we can define an angular frequency, ωn = 2nπ/T = 2π⋅fn = 2π⋅ n⋅f0 = n⋅ω0, where ω0 is the basic or fundamental angular frequency of the Fourier series.
and S (ω ) = ∞ 1 ⋅ ∫ f ( x) ⋅ sin(ω ⋅ x) ⋅ dx. 2π −∞ The continuous spectrum is given by A(ω ) = [C (ω )] 2 + [ S (ω )] 2 The functions C(ω), S(ω), and A(ω) are continuous functions of a variable ω, which becomes the transform variable for the Fourier transforms defined below. Example 1 – Determine the coefficients C(ω), S(ω), and the continuous spectrum A(ω), for the function f(x) = exp(-x), for x > 0, and f(x) = 0, x < 0.
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. The following are the definitions of the sine, cosine, and full Fourier transforms and their inverses used in this Chapter.
The continuous spectrum, F(ω), is calculated with the integral: 1 2π = lim ε →∞ ∫ ∞ 0 e −(1+iω )t dt = lim ε →∞ 1 2π ∫ ε 0 e −(1+iω )t dt 1 ⎡1 − exp(−(1 + iω )t ) ⎤ ⎥= 1 + iω 2π ⎢⎣ ⎦ 1 1 . 2π 1 + iω ⋅ This result can be rationalized by multiplying numerator and denominator by the conjugate of the denominator, namely, 1-iω. The result is now: 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.
Properties of the Fourier transform Linearity: If a and b are constants, and f and g functions, then F{a⋅f + b⋅g} = a F{f }+ b F{g}. Transformation of partial derivatives. Let u = u(x,t). If the Fourier transform transforms the variable x, then F{∂u/∂x} = iω F{u}, F{∂2u/∂x2} = -ω2 F{u}, F{∂u/∂t} = ∂F{u}/∂t, F{∂2u/∂t2} = ∂2F{u}/∂t2 Convolution: For Fourier transform applications, the operation of convolution is defined as ( f * g )( x) = 1 2π ⋅ ∫ f ( x − ξ ) ⋅ g (ξ ) ⋅ dξ .
the number of operations using the FFT is reduced by a factor of 10000/664 ≈ 15. The FFT operates on the sequence {xj} by partitioning it into a number of shorter sequences. The DFT’s of the shorter sequences are calculated and later combined together in a highly efficient manner. For details on the algorithm refer, for example, to Chapter 12 in Newland, D.E., 1993, “An Introduction to Random Vibrations, Spectral & Wavelet Analysis – Third Edition,” Longman Scientific and Technical, New York.
The figure below is a box plot of the data produced. To obtain the graph, first copy the array just created, then transform it into a column vector by using: OBJ 1 + ARRY (Functions OBJ and ARRY are available 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.
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.
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 + ... − .. 2 2 ⋅ (n!) 2 ⋅ 1!⋅(n − 1)!(n − 2)! n where M = n/2 or (n-1)/2, whichever is an integer. Legendre’s polynomials are pre-programmed in the calculator and can be recalled by using the function LEGENDRE given the order of the polynomial, n. The function LEGENDRE can be obtained from the command catalog (‚N) or through the menu ARITHMETIC/POLYNOMIAL menu (see Chapter 5).
where ν is not an integer, and the function Gamma Γ(α) is defined in Chapter 3. If ν = n, an integer, the Bessel functions of the first kind for n = integer are defined by (−1) m ⋅ x 2 m . 2m+n ⋅ m!⋅(n + m)! m =0 2 ∞ J n ( x) = x n ⋅ ∑ Regardless of whether we use ν (non-integer) or n (integer) in the calculator, we can define the Bessel functions of the first kind by using the following finite series: Thus, we have control over the function’s order, n, and of the number of elements in the series, k.
Yν(x) = [Jν(x) cos νπ – J−ν(x)]/sin νπ, for non-integer ν, and for n integer, with n > 0, by Yn ( x) = x x n ∞ (−1) m−1 ⋅ (hm + hm+ n ) 2 m ⋅ J n ( x) ⋅ (ln + γ ) + ⋅ ∑ 2 m+ n ⋅x π 2 π m =0 2 ⋅ m!⋅(m + n)! 2 − x −n π (n − m − 1)! 2 m ⋅x 2 m−n ⋅ m! m =0 2 n −1 ⋅∑ where γ is the Euler constant, defined by γ = lim[1 + r →∞ 1 1 1 + + ... + − ln r ] ≈ 0.57721566490..., 2 3 r and hm represents the harmonic series hm = 1 + 1 1 1 + + ...
The modified Bessel functions of the second kind, Kν(x) = (π/2)⋅[I-ν (x)−Iν (x)]/sin νπ, are also solutions of this ODE. You can implement functions representing Bessel’s functions in the calculator in a similar manner to that used to define Bessel’s functions of the first kind, but keeping in mind that the infinite series in the calculator need to be translated into a finite series.
Laguerre’s equation Laguerre’s equation is the second-order, linear ODE of the form x⋅(d2y/dx2) +(1−x)⋅ (dy/dx) + n⋅y = 0. Laguerre polynomials, defined as L0 ( x) = 1, Ln ( x) = e x d n (x n ⋅ e−x ) ⋅ , n = 1,2,... n! dx n , are solutions to Laguerre’s equation. Laguerre’s polynomials can also be calculated with: (−1) m m! m =0 n Ln ( x ) = ∑ ⎛n⎞ ⋅ ⎜⎜ ⎟⎟ ⋅ x m . ⎝m⎠ n ( n − 1) 2 ( −1) n n = 1− n ⋅ x + ⋅ x − ... + ....
L 2(x) = 1-2x+ 0.5x2 L 3(x) = 1-3x+1.5x2-0.16666…x3. Weber’s equation and Hermite polynomials Weber’s equation is defined as d2y/dx2+(n+1/2-x2/4)y = 0, for n = 0, 1, 2, … A particular solution of this equation is given by the function , y(x) = exp(-x2/4)H*(x/√2), where the function H*(x) is the Hermite polynomial: H 0 * = 1, H n * ( x) = (−1) n e x 2 d n − x2 (e ), n = 1,2,.. dx n In the calculator, the function HERMITE, available through the menu ARITHMETIC/POLYNOMIAL.
First, create the expression defining the derivative and store it into variable EQ. The figure to the left shows the ALG mode command, while the right-hand side figure shows the RPN stack before pressing K. Then, enter the NUMERICAL SOLVER environment and select the differential equation solver: ‚Ϙ @@@OK@@@ . Enter the following parameters: To solve, press: @SOLVE (wait) @EDIT@. The result is 0.2499 ≈ 0.25. Press @@@OK@@@.
@@OK@@ @INIT+—.75 @@OK@@ ™™@SOLVE (wait) @EDIT (Changes initial value of t to 0.5, and final value of t to 0.75, solve for v(0.75) = 2.066…) @@OK@@ @INIT+—1 @@OK@@ ™ ™ @SOLVE (wait) @EDIT (Changes initial value of t to 0.75, and final value of t to 1, solve for v(1) = 1.562…) 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@@.
Θ Θ Θ Θ Θ Θ Θ Θ Θ Θ „ô (simultaneously, if in RPN mode) to enter PLOT environment Highlight the field in front of TYPE, using the —˜keys. Then, press @CHOOS, and highlight Diff Eq, using the —˜keys. Press @@OK@@. Change field F: to ‘EXP(- t^2)’ Make sure that the following parameters are set to: H-VAR: 0, V-VAR: 1 Change the independent variable to t . Accept changes to PLOT SETUP: L @@OK@@ „ò (simultaneously, if in RPN mode).
LL@)PICT To recover menu and return to PICT environment. @(X,Y)@ To determine coordinates of any point on the graph. Use the š™ keys to move the cursor around the plot area. At the bottom of the screen you will see the coordinates of the cursor as (X,Y), i.e., the calculator uses X and Y as the default names for the horizontal and vertical axes, respectively. Press L@CANCL to recover the menu and return to the PLOT WINDOW environment. Finally, press $ to return to normal display.
time t = 2, the input form for the differential equation solver should look as follows (notice that the Init: value for the Soln: is a vector [0, 6]): 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.
(Changes initial value of t to 0.75, and final value of t to 1, solve again for w(1) = [-0.469 -0.607]) 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 x x' 1.25 -0.354 1.281 1.50 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.
Press LL @PICT @CANCL $ to return to normal calculator display. 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)’.
Here we are trying to obtain the value of y(2) given y(0) = 1. With the Soln: Final field highlighted, press @SOLVE. 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. 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.
Note: The option Stiff is also available for graphical solutions of differential equations. Numerical solution to ODEs with the SOLVE/DIFF menu The SOLVE soft menu is activated by using 74 MENU in RPN mode. This menu is presented in detail in Chapter 6. One of the sub-menus, DIFF, 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. (See note in page 16-75).
The value of the solution, yfinal, will be available in variable @@@y@@@. This function is appropriate for programming since it leaves the differential equation specifications and the tolerance in the stack ready for a new solution. Notice that the solution uses the initial conditions x = 0 at y = 0.
contain only the value of ε, and the step Δx will be taken as a small default value. After running function @@RKF@@, the stack will show the lines: 2: {‘x’, ‘y’, ‘f(x,y)’ ‘∂f/∂x’ ‘∂f/vy’ } { ε Δx } 1: The value of the solution, yfinal, will be available in variable @@@y@@@. This function can be used to solve so-called “stiff” differential equations. The following screen shots show the RPN stack before and after application of function RRK: The value stored in variable y is 3.00000000004.
These results indicate that (Δx)next = 0.34049… 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.
These results indicate that (Δx)next = 0.00558… and that the RKF method (CURRENT = 1) should be used. Function RKFERR This function returns the absolute error estimate for a given step when solving a problem as that described for function RKF.
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.
function (pmf) is represented by f(x) = P[X=x], i.e., the probability that the random variable X takes the value x. The mass distribution function must satisfy the conditions that f(x) >0, for all x, and ∑ f ( x) = 1.0 all x A cumulative distribution function (cdf) is defined as F ( x) = P[ X ≤ x] = ∑ f (k ) k≤x Next, we will define a number of functions to calculate discrete probability distributions.
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., then the parameter l represents the average number of occurrences per unit time, length, area, volume, etc.
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.
f ( x) = 1 β ⋅ exp(− x β ), for x > 0, β > 0 , while its cdf is given by F(x) = 1 - exp(-x/β), for x>0, β >0. The beta distribution The pdf for the gamma distribution is given by f ( x) = Γ(α + β ) ⋅ x α −1 ⋅ (1 − x) β −1 , for 0 < x < 1, α > 0, β > 0 Γ(α ) ⋅ Γ( β ) As in the case of the gamma distribution, the corresponding cdf for the beta distribution is also given by an integral with no closed-form solution.
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 functions. Next, enter the values of α and β, e.g., 1K~‚a` 2K ~‚b` Finally, for the cdf for Gamma and Beta cdf’s, you need to edit the program definitions to add NUM to the programs produced by function DEFINE. For example, the Gamma cdf, i.e.
Continuous distributions for statistical inference In this section we discuss four continuous probability distributions that are commonly used for problems related to statistical inference. These distributions are the normal distribution, the Student’s t distribution, the Chi-square (χ2) distribution, and the F-distribution. The functions provided by the calculator to evaluate probabilities for these distributions are contained in the MTH/ PROBABILITY menu introduced earlier in this chapter.
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., UTPN(x) = P(X>x) = 1 - P(X
ν +1 f (t ) = Γ( ν 2 ) Γ( ) ⋅ πν 2 ⋅ (1 + t2 ν ) ν +1 − 2 ,−∞ < t < ∞ 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.e., UTPT(ν,t). The definition of this function is, therefore, t ∞ UTPT (ν , t ) = ∫ f (t )dt = 1 − ∫ f (t )dt = 1 − P (T ≤ t ) t −∞ For example, UTPT(5,2.5) = 2.7245…E-2.
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.
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: Weibull: For the Gamma and Beta distributions the expressions to solve will be more complicated due to the presence of integrals, i.e., • Gamma, • Beta, p=∫ p=∫ x 0 x 0 1 z ⋅ z α −1 ⋅ exp(− )dz β β Γ(α ) α Γ(α + β ) ⋅ z α −1 ⋅ (1 − z ) β −1 dz Γ(α ) ⋅ Γ( β ) A numerical solution with the numerical solver will not be feasible because of the integral sign involved in the expression. However, a graphical solution is possible.
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. Two roots are shown in the righthand figure below.
Notice that the second parameter in the UTPN function is σ2, not σ2, representing the variance of the distribution. Also, the symbol ν (the lower-case Greek letter no) is not available in the calculator. You can use, for example, γ (gamma) instead of ν. The letter γ is available thought the character set (‚±). For example, to obtain the value of x for a normal distribution, with μ = 10, σ2 = 2, with p = 0.25, store the equation ‘p=1-UTPN(μ,σ2,x)’ into variable EQ (figure in the left-hand side below).
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. Examples of the UTPT, UTPC, and UPTF are shown below: Notice that in all the examples shown above, we are working with p = P(Xx) = α.
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.
Example 1 -- For the data stored in the previous example, the single-variable statistics results are the following: Mean: 2.13333333333, Std Dev: 0.964207949406, Variance: 0.929696969697 Total: 25.6, Maximum: 4.5, Minimum: 1.1 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.
Examples of calculation of these measures, using lists, are available in Chapter 8. The median is the value that splits the data set in the middle when the elements are placed in increasing order. If you have an odd number, n, of ordered elements, the median of this sample is the value located in position (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.
The range of the sample is the difference between the maximum and minimum values of the sample. Since the calculator, through the pre-programmed statistical functions provides the maximum and minimum values of the sample, you can easily calculate the range. 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.
Definitions To understand the meaning of these parameters we present the following definitions: Given a set of n data values: {x1, x2, …, xn} listed in no particular order, it is often required to group these data into a series of classes by counting the frequency or number of values corresponding to each class. (Note: the calculators refers to classes as bins).
Θ Θ Θ Θ Generate the list of 200 number by using RDLIST(200) in ALG mode, or 200 ` @RDLIST@ in RPN mode. Use program LXC (see above) to convert the list thus generated into a column vector. Store the column vector into ΣDAT, by using function STOΣ. 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.
to calculate for uniform-size classes (or bins), and the class mark is just the average of the class boundaries for each class. Finally, the cumulative frequency is obtained by adding to each value in the last column, except the first, the frequency in the next row, and replacing the result in the last column 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.
« DUP SIZE 1 GET freq k « {k 1} 0 CON cfreq « ‘freq(1,1)’ EVAL ‘cfreq(1,1)’ STO 2 k FOR j ‘cfreq(j-1,1) +freq(j,1)’ EVAL ‘cfreq (j,1)’ STO NEXT cfreq » » » Save it under the name CFREQ. Use this program to generate the list of cumulative frequencies (press @CFREQ with the column vector of frequencies in the stack). The result, for this example, is a column vector representing the last column of the table above.
Θ Press @CANCEL to return to the previous screen. Change the V-view and Bar Width once more, now to read V-View: 0 30, Bar Width: 10. The new histogram, based on the same data set, now looks like this: 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.
Θ Θ Θ First, enter the two rows of data into column in the variable ΣDAT by using the matrix writer, and function STOΣ. To access the program 3. Fit data.., use the following keystrokes: ‚Ù˜˜@@@OK@@@ The input form will show the current ΣDAT, already loaded. If needed, change your set up screen to the following parameters for a linear fitting: To obtain the data fitting press @@OK@@.
Where sx, sy are the standard deviations of x and y, respectively, i.e. s x2 = 1 n ∑ ( xi − x ) 2 n − 1 i=1 s y2 = 1 n ∑ ( yi − y ) 2 n − 1 i=1 The values sxy and rxy are the "Covariance" and "Correlation," respectively, obtained by using the "Fit data" feature of the calculator. Linearized relationships Many curvilinear relationships "straighten out" to a linear form. For example, the different models for data fitting provided by the calculator can be linearized as described in the table below. Indep.
The general form of the regression equation is η = A + Bξ. Best data fitting The calculator can determine which one of its linear or linearized relationship offers the best fitting for a set of (x,y) data points. We will illustrate the use of this feature with an example. Suppose you want to find which one of the data fitting functions provides the best fit for the following data: x y 0.2 3.16 0.5 2.73 1 2.12 1.5 1.65 2 1.29 4 0.47 5 0.29 10 0.
X-Col, Y-Col: these options apply only when you have more than two columns in the matrix ΣDAT. By default, the x column is column 1, and the y column is column 2. _ΣX _ ΣY…: summary statistics that you can choose as results of this program by checking the appropriate field using [ CHK] when that field is selected. Many of these summary statistics are used to calculate statistics of two variables (x,y) that may be related by a function y = f(x).
B. If n⋅p is an integer, say k, calculate the mean of the k-th and (k-1) th ordered observations. Note: Integer rounding rule, for a non-integer x.yz…, if y ≥ 5, round up to x+1; if y < 5, round up to x. This algorithm can be implemented in the following program typed in RPN mode (See Chapter 21 for programming information): « SORT DUP SIZE p X n « n p * k « IF k CEIL k FLOOR - NOT THEN X k GET X k 1 + GET + 2 / ELSE k 0 RND X SWAP GET END » » » which we’ll store in variable %TILE (percent-tile).
The DATA sub-menu The DATA sub-menu contains functions used to manipulate the statistics matrix ΣDATA: The operation of these functions is as follows: Σ+ : add row in level 1 to bottom of ΣDATA matrix. Σ- : removes last row in ΣDATA matrix and places it in level of 1 of the stack. The modified ΣDATA matrix remains in memory. CLΣ : erases current ΣDATA matrix. ΣDAT: places contents of current ΣDATA matrix in level 1 of the stack. „ΣDAT: stores matrix in level 1 of stack into ΣDATA matrix.
ΣPAR: shows statistical parameters. RESET: reset parameters to default values INFO: shows statistical parameters The MODL sub-menu within ΣPAR This sub-menu contains functions that let you change the data-fitting model to LINFIT, LOGFIT, EXPFIT, PWRFIT or BESTFIT by pressing the appropriate button. The 1VAR sub menu The 1VAR sub menu contains functions that are used to calculate statistics of columns in the ΣDATA matrix.
The functions included are: BARPL: produces a bar plot with data in Xcol column of the ΣDATA matrix. HISTP: produces histogram of the data in Xcol column in the ΣDATA matrix, using the default width corresponding to 13 bins unless the bin size is modified using function BINS in the 1VAR sub-menu (see above). SCATR: produces a scatterplot of the data in Ycol column of the ΣDATA matrix vs. the data in Xcol column of the ΣDATA matrix. Equation fitted will be stored in the variable EQ.
ΣX^2 : provides the sum of squares of values in Xcol column. ΣY^2 : provides the sum of squares of values in Ycol column. ΣX*Y: provides the sum of x⋅y, i.e., the products of data in columns Xcol and Ycol. NΣ : provides the number of columns in the ΣDATA matrix. Example of STAT menu operations Let ΣDATA be the matrix shown in next page. Θ Θ Θ Type the matrix in level 1 of the stack by using the Matrix Writer.
Θ @)STAT @)£PAR @RESET resets statistical parameters L @)STAT @PLOT @SCATR @STATL produces scatterplot draws data fit as a straight line @CANCL returns to main display Determine the fitting equation and some of its statistics: @)STAT @)FIT@ @£LINE @@@LR@@@ 3 @PREDX 1 @PREDY @CORR @@COV@@ L@PCOV Θ produces '1.5+2*X' produces Intercept: 1.5, Slope: 2 produces 0.75 produces 3. 50 produces 1.0 produces 23.04 produces 19.
Θ Fit data using columns 1 (x) and 3 (y) using a logarithmic fitting: L @)STAT @)£PAR 3 @YCOL @)MODL @LOGFI select Ycol = 3, and select Model = Logfit 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.
L @)STAT @PLOT @SCATR @STATL Θ Θ produce scattergram of y vs. x show line for log fitting To return to STAT menu use: L@)STAT To get your variable menu back use: J. 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.
Θ Θ Θ Θ Point estimation: when a single value of the parameter θ is provided. Confidence interval: a numerical interval that contains the parameter θ at a given level of probability. Estimator: rule or method of estimation of the parameter θ. Estimate: value that the estimator yields in a particular application. Example 1 -- Let X represent the time (hours) required by a specific manufacturing process to be completed. Given the following sample of values of X: 2.2 2.5 2.1 2.3 2.2.
Θ The parameter α is known as the significance level. Typical values of α are 0.01, 0.05, 0.1, corresponding to confidence levels of 0.99, 0.95, and 0.90, respectively. Confidence intervals for the population mean when the population variance is known Let ⎯X be the mean of a random sample of size n, drawn from an infinite population with known standard deviation σ. The 100(1-α) % [i.e., 99%, 95%, 90%, etc.
Small samples and large samples The behavior of the Student’s t distribution is such that for n>30, the distribution is indistinguishable from the standard normal distribution. Thus, for samples larger than 30 elements when the population variance is unknown, you can use the same confidence interval as when the population variance is known, but replacing σ with S. Samples for which n>30 are typically referred to as large samples, otherwise they are small samples.
Estimators for the mean and standard deviation of the difference and sum of the statistics S1 and S2 are given by: μˆ S ± S = X 1 ± X 2 , 1 2 σˆ S ± S = 1 2 σ S21 n1 + σ S22 n2 In these expressions, ⎯X1 and ⎯X2 are the values of the statistics S1 and S2 from samples taken from the two populations, and σS12 and σS22 are the variances of the populations of the statistics S1 and S2 from which the samples were taken.
In this case, the centered confidence intervals for the sum and difference of the mean values of the populations, i.e., μ1±μ2, are given by: (( X 1 ± X 2 ) − tν ,α / 2 ⋅ s 2p , ( X 1 ± X 2 ) + tν ,α / 2 ⋅ s 2p ) where ν = n1+n2-2 is the number of degrees of freedom in the Student’s t distribution. In the last two options we specify that the population variances, although unknown, must be equal.
These options are to be interpreted as follows: 1. Z-INT: 1 μ.: Single sample confidence interval for the population mean, μ, with known population variance, or for large samples with unknown population variance. 2. Z-INT: μ1−μ2.: Confidence interval for the difference of the population means, μ1- μ2, with either known population variances, or for large samples with unknown population variances. 3. Z-INT: 1 p.
Press @HELP to obtain a screen explaining the meaning of the confidence interval in terms of random numbers generated by a calculator. To scroll down the resulting screen use the down-arrow key ˜. Press @@@OK@@@ when done with the help screen. This will return you to the screen shown above. To calculate the confidence interval, press @@@OK@@@. The result shown in the calculator is: The result indicates that a 95% confidence interval has been calculated.
Example 2 -- Data from two samples (samples 1 and 2) indicate that ⎯x1 = 57.8 and ⎯x2 = 60.0. The sample sizes are n1 = 45 and n2 = 75. If it is known that the populations’ standard deviations are σ1 = 3.2, and σ2 = 4.5, determine the 90% confidence interval for the difference of the population means, i.e., μ1- μ 2. Press ‚Ù—@@@OK@@@to access the confidence interval feature in the calculator. Press ˜@@@OK@@@ to select option 2. Z-INT: μ 1 – μ2.. Enter the following values: When done, press @@@OK@@@.
When done, press @@@OK@@@. The results, as text and graph, are shown below: Example 4 -- Determine a 90% confidence interval for the difference between two proportions if sample 1 shows 20 successes out of 120 trials, and sample 2 shows 15 successes out of 100 trials. 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@@@.
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. Press ‚Ù—@@@OK@@@ to access the confidence interval feature in the calculator. Press — — @@@OK@@@ to select option 5. T-INT: μ. Enter the following values: When done, press @@@OK@@@.
These results assume that the values s1 and s2 are the population standard deviations. If these values actually represent the samples’ standard deviations, you should enter the same values as before, but with the option _pooled selected. The results now become: 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 ...
The confidence interval for the population variance σ2 is therefore, [(n-1)⋅S2/ χ2n-1,α/2 ; (n-1)⋅S2/ χ2n-1,1-α/2]. where χ2n-1,α/2 , and χ2n-1,1-α/2 are the values that a χ2 variable, with ν = n-1 degrees of freedom, exceeds with probabilities α/2 and 1- α /2, respectively. The one-sided upper confidence limit for σ2 is defined as (n-1)⋅S2/ χ2n-1,1-α.
Hypothesis testing A hypothesis is a declaration made about a population (for instance, with respect to its mean). Acceptance of the hypothesis is based on a statistical test on a sample taken from the population. The consequent action and decisionmaking are called hypothesis testing. The process of hypothesis testing consists on taking a random sample from the population and making a statistical hypothesis about the population.
Notes: 1. For the example under consideration, the alternate hypothesis H1: μ1-μ2 ≠ 0 produces what is called a two-tailed test. If the alternate hypothesis is H1: μ1-μ2 > 0 or H1: μ1-μ2 < 0, then we have a one-tailed test. 2. The probability of rejecting the null hypothesis is equal to the level of significance, i.e., Pr[T∈R|H0]=α. The notation Pr[A|B] represents the conditional probability of event A given that event B occurs.
The value of β, i.e., the probability of making an error of Type II, depends on α, the sample size n, and on the true value of the parameter tested. Thus, the value of β is determined after the hypothesis testing is performed. It is customary to draw graphs showing β, or the power of the test (1- β), as a function of the true value of the parameter tested. These graphs are called operating characteristic curves or power function curves, respectively.
The criteria to use for hypothesis testing is: Θ Θ Reject Ho if P-value < α Do not reject Ho if P-value > α. The P-value for a two-sided test can be calculated using the probability functions in the calculator as follows: Θ If using z, P-value = 2⋅UTPN(0,1,|zo|) Θ If using t, P-value = 2⋅UTPT(ν,|to|) Example 1 -- Test the null hypothesis Ho: μ = 22.5 ( = μo), against the alternative hypothesis, H1: μ ≠22.5, at a level of confidence of 95% i.e., α = 0.
Next, we use the P-value associated with either zο or tο , and compare it to α to decide whether or not to reject the null hypothesis. The P-value for a two-sided test is defined as either P-value = P(z > |zo|), or, P-value = P(t > |to|). The criteria to use for hypothesis testing is: Θ Θ Reject Ho if P-value < α Do not reject Ho if P-value > α. Notice that the criteria are exactly the same as in the two-sided test. The main difference is the way that the P-value is calculated.
values ⎯x1 and ⎯x2, and standard deviations s1 and s2.
The criteria to use for hypothesis testing is: Θ Reject Ho if P-value < α Θ Do not reject Ho if P-value > α. Paired sample tests When we deal with two samples of size n with paired data points, instead of testing the null hypothesis, Ho: μ1-μ2 = δ, using the mean values and standard deviations of the two samples, we need to treat the problem as a single sample of the differences of the paired values.
where Φ(z) is the cumulative distribution function (CDF) of the standard normal distribution (see Chapter 17). Reject the null hypothesis, H0, if z0 >zα/2, or if z0 < - zα/2. In other words, the rejection region is R = { |z0| > zα/2 }, while the acceptance region is A = {|z0| < zα/2 }. One-tailed test If using a one-tailed test we will find the value of S , from Pr[Z> zα] = 1-Φ(zα) = α, or Φ(z α) = 1- α, Reject the null hypothesis, H0, if z0 >zα, and H1: p>p0, or if z0 < - zα, and H1: p
Two-tailed test If using a two-tailed test we will find the value of z α/2, from Pr[Z> zα/2] = 1-Φ(zα/2) = α/2, or Φ(z α/2) = 1- α/2, where Φ(z) is the cumulative distribution function (CDF) of the standard normal distribution. Reject the null hypothesis, H0, if z0 >zα/2, or if z0 < - zα/2. In other words, the rejection region is R = { |z0| > zα/2 }, while the acceptance region is A = {|z0| < zα/2 }.
1. Z-Test: 1 μ.: Single sample hypothesis testing for the population mean, μ, with known population variance, or for large samples with unknown population variance. 2. Z-Test: μ1−μ2.: Hypothesis testing for the difference of the population means, μ1- μ2, with either known population variances, or for large samples with unknown population variances. 3. Z-Test: 1 p.: Single sample hypothesis testing for the proportion, p, for large samples with unknown population variance. 4. Z-Test: p1− p2.
Then, we reject H0: μ = 150, against H1: μ ≠ 150. The test z value is z0 = 5.656854. The P-value is 1.54×10-8. The critical values of ±zα/2 = ±1.959964, corresponding to critical ⎯x range of {147.2 152.8}. This information can be observed graphically by pressing the soft-menu key @GRAPH: 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.
We reject the null hypothesis, H0: μ0 = 150, against the alternative hypothesis, H1: μ > 150. The test t value is t0 = 5.656854, with a P-value = 0.000000393525. The critical value of t is tα = 1.676551, corresponding to a critical ⎯x = 152.371. Press @GRAPH to see the results graphically as follows: Example 3 – Data from two samples show that⎯x1 = 158, ⎯x1 = 160, s1 = 10, s2 = 4.5, n1 = 50, and n2 = 55. For α = 0.
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. The test t value is t0 = -1.341776, with a P-value = 0.09130961, and critical t is –tα = -1.659782. The graphical results are: These three examples should be enough to understand the operation of the hypothesis testing pre-programmed feature in the calculator.
The test criteria are the same as in hypothesis testing of means, namely, Θ Reject Ho if P-value < α Θ Do not reject Ho if P-value > α. Please notice that this procedure is valid only if the population from which the sample was taken is a Normal population. Example 1 -- Consider the case in which σo2 = 25, α=0.05, n = 25, and s2 = 20, and the sample was drawn from a normal population.
The following table shows how to select the numerator and denominator for Fo depending on the alternative hypothesis chosen: ____________________________________________________________________ Alternative Test Degrees hypothesis statistic of freedom ____________________________________________________________________ Fo = s22/s12 νN = n2-1, νD = n1-1 H1: σ12 < σ22 (one-sided) H1: σ12 > σ22 (one-sided) H1: σ12 ≠σ22 (two-sided) Fo = s12/s22 Fo = sM2/sm2 νN = n1-1, νD = n2-1 νN = nM-1,νD = nm-1 sM2=m
Therefore, the F test statistics is Fo = sM2/sm2=0.36/0.25=1.44 The P-value is P-value = P(F>Fo) = P(F>1.44) = UTPF(νN, νD,Fo) = UTPF(20,30,1.44) = 0.1788… Since 0.1788… > 0.05, i.e., P-value > α, therefore, we cannot reject the null hypothesis that Ho: σ12 = σ22. Additional notes on linear regression In this section we elaborate the ideas of linear regression presented earlier in the chapter and present a procedure for hypothesis testing of regression parameters.
We get the, so-called, normal equations: n n i =1 i =1 ∑ y i = a ⋅ n + b ⋅ ∑ xi n ∑x i =1 i n n i =1 i =1 ⋅ y i = a ⋅ ∑ xi + b ⋅ ∑ xi2 This is a system of linear equations with a and b as the unknowns, which can be solved using the linear equation features of the calculator. There is, however, no need to bother with these calculations because you can use the 3. Fit Data … option in the ‚Ù menu as presented earlier. Notes: Θ a,b are unbiased estimators of Α, Β.
From which it follows that the standard deviations of x and y, and the covariance of x,y are given, respectively, by sx = S xx sy = n −1 , S yy n − 1 , and Also, the sample correlation coefficient is rxy = sxy = S xy S xx ⋅ S yy S yx n −1 . In terms of ⎯x, ⎯y, Sxx, Syy, and Sxy, the solution to the normal equations is: a = y − bx , b= S xy S xx = s xy s x2 Prediction error The regression curve of Y on x is defined as Y = Α + Β⋅x + ε.
Θ Confidence limits for regression coefficients: For the slope (Β): b − (t n-2,α/2)⋅se/√Sxx < Β < b + (t n-2,α/2)⋅se/√Sxx, For the intercept (Α): a − (t n-2,α/2)⋅se⋅[(1/n)+⎯x2/Sxx]1/2 < Α < a + (t n-2,α/2)⋅se⋅[(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. Θ Hypothesis testing on the slope, Β: Null hypothesis, H0: Β = Β0, tested against the alternative hypothesis, H1: Β ≠ Β0.
a+b⋅x+(t n-2, α /2)⋅se⋅[1+(1/n)+(x0 -⎯x)2/Sxx]1/2. Procedure for inference statistics for linear regression using the calculator 1) Enter (x,y) as columns of data in the statistical matrix ΣDAT. 2) Produce a scatterplot for the appropriate columns of ΣDAT, and use appropriate H- and V-VIEWS to check linear trend. 3) Use ‚Ù˜˜@@@OK@@@, to fit straight line, and get a, b, sxy (Covariance), and rxy (Correlation). 4) Use ‚Ù˜@@@OK@@@, to obtain ⎯x, ⎯y, sx, sy.
1: Covariance: 2.025 These results are interpreted as a = -0.86, b = 3.24, rxy = 0.989720229749, and sxy = 2.025. The correlation coefficient is close enough to 1.0 to confirm the linear trend observed in the graph. From the Single-var… option of the ‚Ù menu we find: ⎯x = 3, sx = 0.790569415042,⎯y = 8.86, sy = 2.58804945857. Next, with n = 5, calculate S xx = (n − 1) ⋅ s x2 = (5 − 1) ⋅ 0.790569415042 2 = 2.5 s e2 = n −1 2 ⋅ s y ⋅ (1 − rxy2 ) = n−2 5 −1 ⋅ 2.5880...2 ⋅ (1 − 0.9897...2 ) = 0.1826...
Example 2 -- Suppose that the y-data used in Example 1 represent the elongation (in hundredths of an inch) of a metal wire when subjected to a force x (in tens of pounds). The physical phenomenon is such that we expect the intercept, A, to be zero. To check if that should be the case, we test the null hypothesis, H0: Α = 0, against the alternative hypothesis, H1: Α ≠ 0, at the level of significance α = 0.05. The test statistic is t0 = (a-0)/[(1/n)+⎯x2/Sxx]1/2 = (-0.86)/ [(1/5)+32/2.5] ½ = -0.44117.
Multiple linear fitting Consider a data set of the form x1 x2 x3 … xn y x11 x21 x31 … xn1 y1 x12 x22 x32 … xn2 y2 x13 x32 x33 … xn3 y3 . . . . . . . . . . x1,m-1 x 2,m-1 x 2,m x 3,m-1 x 3,m x n,m-1 x n,m ym-1 x1,m . … … ym Suppose that we search for a data fitting of the form y = b0 + b1⋅x1 + b2⋅x2 + b3⋅x3 + … + bn⋅xn.
x1 x2 x3 y 1.20 2.50 3.50 4.00 6.00 3.10 3.10 4.50 4.50 5.00 2.00 2.50 2.50 3.00 3.50 5.70 8.20 5.00 8.20 9.50 With the calculator, in RPN mode, you can proceed as follows: First, within your HOME directory, create a sub-directory to be called MPFIT (Multiple linear and Polynomial data FITting) , and enter the MPFIT subdirectory. Within the sub-directory, type this program: « X y « X TRAN X * INV X TRAN * y * » » and store it in a variable called MTREG (MulTiple REGression).
Compare these fitted values with the original data as shown in the table below: x1 x2 x3 y y-fitted 1.20 2.50 3.50 4.00 6.00 3.10 3.10 4.50 4.50 5.00 2.00 2.50 2.50 3.00 3.50 5.70 8.20 5.00 8.20 9.50 5.63 8.25 5.03 8.22 9.45 Polynomial fitting Consider the x-y data set {(x1,y1), (x2,y2), …, (xn,yn)}. Suppose that we want to fit a polynomial or order p to this data set. In other words, we seek a fitting of the form y = b0 + b1⋅x + b2⋅x2 + b3⋅x3 + … + bp⋅xp.
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 }. Then, we can transform this list into a vector and use the COL menu to add those columns to the matrix Vn until X is completed.
« 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 MTREG NUM » » » Open program Enter lists x and y, and p (levels 3,2,1) Open subprogram 1 Determine size of x list Open subprogram 2 Place x in stack, obtain Vn This IF implements step 3 in algorithm Place n in stack Calculate p+1 Start loop j = n-1, n-2, …, p+1, step = -1 Remove column and drop it from stack Close FOR-STEP loop Calculate
x 2.30 3.20 4.50 1.65 9.32 1.18 6.24 3.45 9.89 1.22 y 179.72 562.30 1969.11 65.87 31220.89 32.81 6731.48 737.41 39248.46 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. Thus, proceed as follows: { 2.3 3.2 4.5 1.65 9.32 1.18 6.24 3.45 9.89 1.22 } ` ‘xx’ K {179.72 562.
Θ Θ Θ 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. This is a plot of the error corresponding to each of the original data points. If these errors are completely random, the residuals plot should show no particular trend.
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 yv − ABS SQ / NEG 1 + √ “r” TAG SWAP 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 stack Close FOR-STEP loop Calculate n+1 Calculate p+1 Start loop with j = n, n+1, …, p+1.
“SSE” TAG » 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. Using the POLYR program for values of p between 2 and 6 produce the following table of values of the correlation coefficient, r, and the sum of square errors, SSE: p 2 3 4 5 6 r 0.9971908 0.9999768 0.9999999 0.9999999 0.9999998 SSE 10731140.01 88619.36 7.48 8.92 432.
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.
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. Changing the wordsize will affect the way that binary integer operations are performed.
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).
AND (BIN) OR (BIN) 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 #11000b 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.
The BYTE menu The BYTE menu, available through the BASE (‚ã) provides the following functions: 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: Rotate Left one byte, e.g., #1100b #110000000000b SLB: Shift Left one byte, e.g., #1101b #110100000000b SRB: Shift Right one byte, e.g., #11011b #0b RRB: Rotate Right one byte, e.g.
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 („), rightshift (‚) 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.
You can try using this list with TMENU or MENU in RPN mode to verify that you get the same menu as obtained earlier in ALG mode. 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.
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 0.01 or 0.11, not applicable .2, key combined with „ .21, key simultaneous with „ .
The functions available are: ASN: STOKEYS: RCLKEYS: DELKEYS: Assigns an object to a key specified by XY.Z Stores user-defined key list Returns current user-defined key list 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.
Operating user-defined keys To operate this user-defined key, enter „Ì before pressing the C key. Notice that after pressing „Ì the screen shows the specification 1USR 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.
To un-assign all user-defined keys use: ALG mode: DELKEYS(0) RPN mode: 0 DELKEYS Check that the user-key definitions were removed by using function RCLKEYS.
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.
„´ @LIST @ADD@ ADD Calculate (1+x2), / [']~„x™ / 'x' then divide „°@)@MEM@@ @)@DIR@@ @PURGE PURGE 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.2485.
use a local variable within the program that is only defined for that program and will not be available for use after program execution. The previous program could be modified to read: « → x « x SINH 1 x SQ ADD / » » The arrow symbol (→) is obtained by combining the right-shift key ‚ with the 0 key, i.e., ‚é. Also, notice that there is an additional set of programming symbols (« ») indicating the existence of a sub-program, namely « x SINH 1 x SQ ADD / », within the main program.
« → 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.
START: FOR: DO: WHILE: TEST: TYPE: LIST: ELEM: PROC: GROB: PICT: CHARS: MODES: FMT: ANGLE: FLAG: KEYS: MENU: MISC: IN: OUT: TIME: ALRM: ERROR: IFERR: RUN: START-NEXT-STEP construct for branching FOR-NEXT-STEP construct for loops DO-UNTIL-END construct for loops WHILE-REPEAT-END construct for loops Comparison operators, logical operators, flag testing functions Functions for converting object types, splitting objects, etc.
Functions listed by sub-menu The following is a listing of the functions within the PRG sub-menus listed by submenu.
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 „@)@FOR@ „ @)@@DO@@ „@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 „°@)LIST@ @)PROC@ @REVLI@ SORT „°@)LIST@ @)PROC@ L @SORT@ SEQ „°@)LIST@ @)PROC@ L @@SEQ@@ @)MODES @)ANGLE@ DEG „°L@)MODES @)ANGLE@ @@DEG@@ RAD „°L@)MODES @)ANGLE@ @@RAD@@ @)MODES @)MENU@ CST „°L@)MODES @)MENU@ @@CST@@ MENU „°L@)MODES @)MENU@ @@MENU@ BEEP „°L@)MODES @)MISC@ @@BEEP@ INFORM „°L@)@@IN@@ @INFOR@ INPUT „°L@)@@IN@@ @INPUT@ MSGBOX „°L@)@OUT@ @MSGBO@ PVIEW „°L@)@OUT@ @PVIEW@ DBUG „°LL @)@RUN@ @@DBG@ SST „°LL @)@RUN@ @@SST@ SST↓ „°LL @)@RUN@ @SST↓@
functions from the MTH menu. Specifically, you can use functions for list operations such as SORT, ΣLIST, etc., available through the MTH/LIST menu. 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: empty stack, executing →a Result: empty stack, entering subprogram « @SST↓@ @SST↓@ Result: ‘2*a^2+3’ Result: ‘2*a^2+3’, leaving subprogram » @SST↓@ Result: ‘2*a^2+3’, leaving main program» @SST↓@ 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.
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. The program, after editing, should read as follows: « “Enter a: “ {“ :a: “ {2 0} V } INPUT OBJ→ → a « ‘2*a^2+3‘ NUM » » Store it again in variable FUNCa, and run the program again with a = 2. This time, the result is 11, i.e., 2*22+3 = 11.
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. Application: evaluating a function of two variables Consider the ideal gas law, pV = nRT, where p = gas pressure (Pa), V = gas volume(m3), n = number of moles (gmol), R = universal gas constant = 8.
`. 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.
3. Field format information: { } (an empty list, thus, default values used) 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.
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: 1: v 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.
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.
« “Enter a: “ {“ :a: “ {2 0} V } INPUT OBJ→ → a « ‘2*a^2+3‘ EVAL ”F” →TAG a SWAP» » (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.
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.
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. Before pressing ` for input, the stack will look like this: After execution of the program, the stack will look like this: In summary: The common thread in the three examples shown here is the use of tags to identify input and output variables.
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: “ {“ OBJ→ → V T n « V →STR “ :V: :T: :n: “ {2 0} V } INPUT ” + 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@@@.
Incorporating units within a program As you have been able to observe from all the examples for the different versions of program @@@p@@@ presented in this chapter, attaching units to input 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.
2. ‘1_m^3’ : The S.I. units corresponding to V are then placed in stack level 1, the tagged input for V is moved to stack level 2. 3. * : By multiplying the contents of stack levels 1 and 2, 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.
Press @@@OK@@@ to cancel message box output. 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.
operators are used to make a statement regarding the relative position of two or more real numbers. Depending on the actual numbers used, such a 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).
Logical operators Logical operators are logical particles that are used to join or modify simple logical statements. The logical operators available in the calculator can be easily accessed through the keystroke sequence: „° @)TEST@ L. 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.
p 1 1 0 0 q 1 0 1 0 p XOR q 0 1 1 0 The calculator includes also the logical operator SAME. This is a non-standard 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.
Branching with IF In this section we presents examples using the constructs IF…THEN…END and IF…THEN…ELSE…END. 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.
With the cursor in front of the IF statement prompting the user for the logical statement that will activate the IF construct when the program is executed. Example: Type in the following program: « → x « IF ‘x<3’ THEN ‘x^2‘ EVAL END ”Done” MSGBOX » » 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 1.2 @@@f1@@@ Result: 1.44 3.
Example: Type in the following program: « → 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.
IF x<3 THEN x2 ELSE 1-x END 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.
A complex IF construct like this is called a set of nested IF … THEN … ELSE … END constructs. A possible way to evaluate f3(x), based on the nested IF construct shown above, is to write the program: « → 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@@@ Result: 2.25 (i.e., x2) 2.5 @@@f3@@@ Result: 6.25 (i.e., x2) 4.
program_statements, and passes program flow to the statement following the END statement. The CASE, THEN, and END statements are available for selective typing by using „°@)@BRCH@ @)CASE@ . If you are in the BRCH menu, i.e.
5.6 @@f3c@ Result: -0.631266… (i.e., sin(x), with x in radians) 12 @@f3c@ Result: 162754.791419 (i.e., exp(x)) 23 @@f3c@ Result -2. (i.e., -2) 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.
Commands involved in the START construct are available through: „°@)@BRCH@ @)START @START Within the BRCH menu („°@)@BRCH@) the following keystrokes are available to generate START constructs (the symbol indicates cursor position): Θ „ @START: Starts the START…NEXT construct: START NEXT Θ ‚ @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
1. This program needs an integer number as input. Thus, before execution, that number (n) is in stack level 1. The program is then executed. 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.
„°LL @)@RUN@ @@DBG@ @SST↓@ @SST↓@ @SST↓@ @SST↓@ @SST↓@ @SST↓@ @SST↓@ Start the debugger. SL1 = 2. SL1 = 0., SL2 = 2. SL1 = 0., SL2 = 0., SL3 = 2. (DUP) Empty stack (-> n S k) Empty stack (« - start subprogram) 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.
@SST↓@ @SST↓@ @SST↓@ @SST↓@ SL1 = 1. (S + k2) [Stores value of SL2 = 2, into SL1 = ‘k’] SL1 = ‘S’, SL2 = 1. (S + k2) Empty stack [Stores value of SL2 = 1, into SL1 = ‘S’] 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.
3 5 10 30 @@@S1@@ @@@S1@@ @@@S1@@ @@@S1@@ Result: S:14 Result: S:55 Result: S:385 Result: S:9455 4 8 20 100 @@@S1@@ @@@S1@@ @@@S1@@ @@@S1@@ Result: S:30 Result: S:204 Result: S:2870 Result: S:338350 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.
J1 # 1.5 # 0.5 ` Enter parameters 1 1.5 0.5 [ ‘ ] @GLIST ` Enter the program name in level 1 „°LL @)@RUN@ @@DBG@ Start the debugger. 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.
To avoid an infinite loop, make sure that start_value < end_value. Example – calculate the summation S using a FOR…NEXT construct The following program calculates the summation n S = ∑k2 k =0 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@@.
Example – generate a list of numbers using a FOR…STEP construct Type in the program: « → xs xe dx « xe xs – dx / ABS 1. + → n « xs xe FOR x x dx STEP n →LIST » » » and store it in variable @GLIS2. Θ Θ 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 ` Enter parameters 1 1.5 0.
The following program calculates the summation n S = ∑k2 k =0 Using a DO…UNTIL…END loop: « 0. → n S « DO n SQ S + ‘S‘ STO n 1 – ‘n‘ STO UNTIL ‘n<0‘ END S “S” →TAG » » Store this program in a variable @@S3@@.
The WHILE construct The general structure of this command is: WHILE logical_statement REPEAT program_statements END The WHILE statement will repeat the program_statements while logical_statement is true (non zero). If not, program control is passed to the statement right after END. The program_statements must include a loop index that gets modified before the logical_statement is checked at the beginning of the next repetition.
and store it in variable @GLIS4. Θ Θ Check out that the program call 0.5 ` 2.5 ` 0.5 ` @GLIS4 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 ` Enter parameters 1 1.5 0.5 [‘] @GLIS4 ` Enter the program name in level 1 „°LL @)@RUN@ @@DBG@ Start the debugger. Use @SST↓@ to step into the program and see the detailed operation of each command.
If you enter “TRY AGAIN” ` @DOERR, produces the following message: TRY AGAIN Finally, 0` @DOERR, produces the message: Interrupted ERRN This function returns a number representing the most recent error. For example, if you try 0Y$@ERRN, you get the number #305h. This is the binary integer representing the error: Infinite Result ERRM This function returns a character string representing the error message of the most recent error.
These are the components of the IFERR … THEN … END construct or of the IFERR … THEN … ELSE … END construct. Both logical constructs are used for trapping errors during program execution. Within the @)ERROR sub-menu, entering „@)IFERR, or ‚@)IFERR, will place the IFERR structure components in the stack, ready for the user to fill the missing terms, i.e.
User RPL programming in algebraic mode While all the programs presented earlier are produced and run in RPN mode, you can always type a program in User RPL when in algebraic mode by using function RPL>. This function is available through the command catalog. As an example, try creating the following program in algebraic mode, and store it into « → X ‘2.5-3*X^2’ » variable P2: First, activate the RPL> function from the command catalog (‚N).
Whereas, using RPL, there is no problem when loading this program in algebraic mode: Page 21-68
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.
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. To see which options are available, press @!MODL.
Θ 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. Generating plots with programs Depending on whether we are dealing with a two-dimensional graph defined by a function, by data from ΣDAT, or by a three-dimensional function, you need to set up the variables PPAR, ΣPAR, and /or VPAR before generating a plot in a program.
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.
@)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 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.
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. Radius of arc as r (user coordinates) or #k (pixels). Initial angle θ1 and final angle θ2.
Θ Θ Θ 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. You can also use an empty list as argument, in which case the picture is centered in the screen.
(50., 50.) 12. –180. 180. ARC Draw a circle center (50,50), r= 12. 1 8 FOR j Draw 8 lines within the circle (50., 50.) DUP Lines are centered as (50,50) ‘12*COS(45*(j-1))’ NUM Calculate x, other end at 50 + x ‘12*SIN(45*(j-1))’ NUM Calculates y, other end at 50 + y R C Convert x y to (x,y), complex num.
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.
(xmin, ymax). The maximum coordinates in terms of pixels 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).
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.
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. You can create a list of these figures, let’s call it WLIST, by using: 11 „°@)TYPE@ @ LIST ³ ~~wlist~ K Press J to recover your list of variables.
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.
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. When we produce a graph in the calculator, the graph become the contents of a special variable called PICT. Thus, to see the last contents of PICT, you could use: PICT RCL(„°L@)PICT @PICT „©).
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. The equation ‘X^2-5’ is placed in the graph, for example: Thus, GROBs can be used to document graphics by placing equations, or text, in the graphics display.
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.
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.
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. In Mohr’s circle, the angle between segments AC and D’C measures 2φn. The stress condition for which the shear stress, τ’xy, is a maximum, is given by segment F’G’.
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. The next step is to create the main program and sub-programs within the subdirectory. The main program MOHRCIRCL uses the following sub-programs: Θ INDAT: Requests input of σx, σy, τxy from user, produces a list σL = {σx, σy, τxy} as output.
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. Because this view of PICT is invoked through the function PVIEW, we cannot get any other information out of the plot besides the figure itself. To obtain additional information out of the Mohr’s circle, end the program by pressing $. Then, press š to recover the contents of PICT in the graphics environment.
information tell us is that somewhere between φ = 58o and φ = 59o, the shear stress, τ’xy, becomes zero. To find the actual value of φn, press $. Then type the list corresponding to the values {σx σy τxy}, for this case, it will be { 25 75 50 } [ENTER] Then, press @CC&r. The last result in the output, 58.2825255885o, is the actual value of φn.
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. This can be accomplished by creating the list { MOHRCIRCL PRNST } using: J„ä@MOHRC @PRNST ` And then, ordering the list by using: „°@)@MEM@@ @)@DIR@@ @ORDER. After this call to the function ORDER is performed, press J.
To find the values of the stresses corresponding to a rotation of 35o in the angle of the stressed particle, we use: $š Clear screen, show PICT in graphics screen @TRACE @(x,y)@. 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.
Since program INDAT is used also for program @PRNST (PRiNcipal STresses), running that particular program will now use an input form, for example, The result, after pressing @@@OK@@@, is the following: Page 22-41
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.
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.
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. Letters show the code α (i.e.
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 rray 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.
The functions contained within the FLAG menu are the following: The operation of these functions is as follows: SF Set a flag CF Clear a flag FS? Returns 1 if flag is set, 0 if not set FC? Returns 1 if flag is clear (not set), 0 if flag is set FS?C Tests flag as FS does, then clears it FC?C Tests flag as FC does, then clears it STOF Stores new system flag settings RCLF Recalls existing flag settings RESET Resets current field values (could be used to reset a flag) User flags For programmin
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: DATE: TIME: TIME: TICKS: Places current date in the stack Set system date to specified value Places current time in 24-hr HH.MMSS format Set system time to specified value in 24-hr HH.MM.SS format 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 we introduced the basic concepts of, and operations for, creating and managing variables and directories. In this Chapter we discuss the management of the calculator’s memory, including the 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.5 MB is used for calculator operation and data storage (user’s memory).
Port 1 (ERAM) can contain up to 128 KB of data. Port 1, together with Port 0 and the HOME directory, constitute the calculator’s RAM (Random Access 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.
Checking objects in memory To see the objects stored in memory you can use the FILES function („¡). The screen below shows the HOME directory with five directories, namely, TRIANG, MATRX , MPFIT, GRPHS, and CASDIR. Additional directories can be viewed by moving the cursor downwards in the directory tree. Or you can move the cursor upwards to select a memory port. When a given directory, sub-directory or port is selected, press @@@OK@@@ to see the contents of the selected object.
Backup objects Backup objects are used to copy data from your home directory into a memory port. The purpose of backing up objects in memory port is to preserve the contents of the objects for future usage. Backup objects have the following characteristics: Θ Backup objects can only exist in port memory (i.e.
Backing up and restoring HOME You can back up the contents of the current HOME directory in a single back up object. This object will contain all variables, key assignments, and alarms currently defined in the HOME directory. You can also restore the contents of your HOME directory from a back up object previously stored in port memory. The instructions for these operations follow.
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. Storing, deleting, and restoring backup objects To create a backup object use one of the following approaches: Θ Use the File Manager („¡) to copy the object to port.
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. To run backup-object programs or use data from backup objects you can use the File Manager („¡) to copy backup object contents to the screen.
To remove an SD card, turn off the HP 50g, press gently on the exposed edge of the card and push in. The card should spring out of the slot a small distance, allowing it now to be easily removed from the calculator. Formatting an SD card Most SD cards will already be formatted, but they may be formatted with a file system that is incompatible with the HP 50g. The HP 50g will only work with cards in the FAT16 or FAT32 format. You can format an SD card from a PC, or from the calculator.
Accessing objects on an SD card Accessing an object from the SD card is similar to when an object is located in ports 0, 1, or 2. However, Port 3 will not appear in the menu when using the LIB function (‚á). The SD files can only be managed using the Filer, or File Manager („¡). When starting the Filer, the Tree view will appear as follows if you have an SD card inserted: Long names of files on an SD card are supported in the Filer, but are displayed as 8.3 characters, as in DOS, i.e.
Note that if the name of the object you intend to store on an SD card is longer than eight characters, it will appear in 8.3 DOS format in port 3 in the Filer once it is stored on the card. Recalling an object from an SD card To recall an object from the SD card onto the screen, use function RCL, as follows: Θ In algebraic mode: Press „©, type the name of the stored object using port 3 (e.g., :3:V R1), press `. Θ In RPN mode: Type the name of the stored object using port 3 (e.g., :3:V R1), press „©.
Note that in the case of objects with long files names, you can specify the full name of the object, or its truncated 8.3 name, when evaluating an object on an SD card. Purging an object from the SD card To purge an object from the SD card onto the screen, use function PURGE, as follows: Θ In algebraic mode: Press I @PURGE, type the name of the stored object using port 3 (e.g., :3:V R1), press `. Θ In RPN mode: Type the name of the stored object using port 3 (e.g., :3:V R1), press I @PURGE.
This will store the object previously on the stack onto the SD card into the directory named PROGS into an object named PROG1. Note: If PROGS does not exist, the directory will be automatically created. You can specify any number of nested subdirectories. For example, to refer to an object in a third-level subdirectory, your syntax would be: :3:”DIR1/DIR2/DIR3/NAME” Note that pressing ~ …/ produces the forward slash character.
Library numbers If you use the LIB menu (‚á) and press the soft menu key corresponding to port 0, 1 or 2, you will see library numbers listed in the soft menu key labels. Each library has a three or four-digit number associated with it. (For example, the two libraries that make up the Equation Library are in port 2 and are numbered 226 and 227.) These numbers are assigned by the library creator, and are used for deleting a library.
will indicate when this battery needs replacement. The diagram below shows the location of the backup battery in the top compartment at the back of the calculator.
Chapter 27 The Equation Library The Equation Library is a collection of equations and commands that enable you to solve simple science and engineering problems. The library consists of more than 300 equations grouped into 15 technical subjects containing more than 100 problem titles. Each problem title contains one or more equations that help you solve that type of problem. Appendix M contains a table of the groups and problem titles available in the Equation Library.
7. For each known variable, type its value and press the corresponding menu key. If a variable is not shown, press L to display further variables. 8. Optional: supply a guess for an unknown variable. This can speed up the solution process or help to focus on one of several solutions. Enter a guess just as you would the value of a known variable. 9. Press ! followed by the menu key of the variable for which you are solving. If you want to solve all the equations in the selected title, press ! ##ALL#.
Using the menu keys The actions of the unshifted and shifted variable menu keys for both solvers are identical. Notice that the Multiple Equation Solver uses two forms of menu labels: black and white. The L key displays additional menu labels, if required. In addition, each solver has special menu keys, which are described in the following table. You can tell which solver is started by looking at the special menu labels.
Browsing in the Equation Library When you select a subject and title in the Equation Library, you specify a set of one or more equations. You can get the following information about the equation set from the Equation Library catalogs: The equations themselves and the number of equations. The variables used and their units. (You can also change the units.) A picture of the physical system (for most equation sets).
Viewing variables and selecting units After you select a subject and title, you can view the catalog of names, descriptions, and units for the variables in the equation set by pressing #VARS#. The table below summarizes the operations available to you in the Variable catalogs. Operations in Variable catalogs Key L Action Toggles between the catalog of descriptions and the catalog of units.
Press to store the picture in PICT, the graphics memory. Then you can use © PICT (or © PICTURE) to view the picture again after you have quit the Equation Library. Press a menu key or to view other equation information. Using the Multiple-Equation Solver The Equation Library starts the Multiple-Equation Solver automatically if the equation set contains more than one equation.
%ALL% Makes all variables not user-defined, but does not specify their values. Solve for all !%ALL% Creates variables if necessary and solves for all that are not user-defined (or as many as possible). Progress catalog … %ALL% Shows information about the last solution. Undefined all User-defined MUSER Sets states to user-defined for variable or list of variables on the stack.
Meanings of Menu Labels Label Meaning !!!!!!!!!X0!!!!!!!!! Value x0 is not defined by you and not used in the last solution. It can change with the next solution. !!!!!!!X0!!ëëëë!!! Value x0 is not defined by you, but it was found in the last solution. It can change in the next solution. $$X0$$ Value x0 is defined by you and not used in the last solution. It cannot change in the next solution (unless you solve only for this variable).
For example, the following three equations define initial velocity and acceleration based on two observed distances and times. The first two equations alone are mathematically sufficient for solving the problem, but each equation contains two unknown variables. Adding the third equation allows a successful solution because it contains only one of the unknown variables.
6. Press !MSOLV! to launch the solver with the new set of equations. To change the title and menu for a set of equations 1. Make sure that the set of equations is the current set (as they are used when the Multiple-Equation Solver is launched). 2. Enter a text string containing the new title onto the stack. 3. Enter a list containing the variable names in the order you want them to appear on the menu. Use a "" to insert a blank label.
Constant? The initial value of a variable may be leading the rootfinder in the wrong direction. Supply a guess in the opposite direction from a critical value. (If negative values are valid, try one.) Checking solutions The variables having a šmark in their menu labels are related for the most recent solution. They form a compatible set of values satisfying the equations used.
Not related. A variable may not be involved in the solution (no mark in the label), so it is not compatible with the variables that were involved. Wrong direction. The initial value of a variable may be leading the rootfinder in the wrong direction. Supply a guess in the opposite direction from a critical value. (If negative values are valid, try one.
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.
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@@ Enter n = 10 8.5 @@OK@@ Enter I%YR = 8.
!CALC Press to access the stack for calculations !TYPES Press to determine the type of object in highlighted field !CANCL Cancel operation @@OK@@ 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. There are 4 arrow keys located on the right-hand side of the keyboard in the space occupied by rows 2 and 3.
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), right-shift … (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. The ABS function calculates the absolute value of a real number, or the magnitude of a complex number or of a vector.
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.
is used mainly to enter the upper-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 ~ function produces an asterisk (*) when combined with the times key, i.e., ~*.
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. The CLEAR, OFF, , , comma (,), key enters and OFF keys also work as their main function even when the ~… combination is used.
~… 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)/(X-2). 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 + 8 − 3X − 2 = 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.
Rigorous CAS setting 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 E CANCeL the help facility !!@@OK#@ F 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.
Notice that there are six commands associated with the soft menu keys in this case (you can check that there are only six commands because pressing the L produces no additional menu items).
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.
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!). @ECHO1: Copies the highlighted character to the command line or equation writer (EQW) and exits the character set screen (i.e.
Greek letters α (alpha) ~‚a β (beta) ~‚b δ (delta) ~‚d ε (epsilon) ~‚e θ (theta) ~‚t λ (lambda) ~‚n μ (mu) ~‚m ρ (rho) ~‚f σ (sigma) ~‚s τ (tau) ~‚u ω (omega) ~‚v Δ (upper-case delta) ~‚c Π (upper-case pi) ~‚p Other characters ~ (tilde) ~‚1 ! (factorial) ~‚2 ? (question mark) ) ~‚3 \ (backward slash) ~‚5 (angle symbol) ~‚6 (at) ~‚` @ Some characters commonly used that do not have simple keystroke shortcuts are: ⎯x (x bar), γ (gamma), η (eta), Ω (upper-
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… „ñ Plot window.. „ò Graph display..
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 Calculator Send data to another calculator (or to a PC with an infrared port) Get from Calculator Receive data from another calculator (or to a PC with an infrared port) Print display Send screen to printer Print.. Print selected object from calculator Transfer.. Transfer data to other device Start Server..
The Constants Library is discussed in detail in Chapter 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 ‚Ó.
Equation writer.. Selecting option 6.Equation writer.. in the APPS menu opens the 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.. in the APPS menu launches the matrix writer: This operation is equivalent to the keystroke sequence „².The Matrix Writer is presented in detail in Chapter 10. 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.
This operation is equivalent to the keystroke sequence „´. The MTH menu is introduced in Chapter 3 (real numbers). Other functions from the MTH menu are presented in Chapters 4 (complex numbers), 8 (lists), 9 (vectors), 10 (matrix creation), 11 (matrix operation), 16 (fast Fourier transforms), 17 (probability applications), and 19 (numbers in different bases). CAS menu.. Selecting option 11.CAS menu..
Note that flag –117 should be set if you are going to use the Equation Library. Note too that the Equation Library will only appear on the APPS menu if the two Equation Library files are stored on the calculator. The Equation Library is explained in detail in chapter 27.
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 $ (hold) AF: “Cold” restart - all memory erased o $ (hold) B: Cancels keystroke o $ (hold) C: “Warm” restart - memory preserved o $ (hold) D: Starts interactive self-test o $ (hold) E: Starts continuous self-test o $ (hold) #: Deep-sleep shutdown - timer off o $ (hold) A: Performs display screen dump o $ (hold) D: Cancels next repeating alarm Menus not accessible through keyboard: In RPN, enter menu_numbe
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.
These functions are also available in the TRIG menu (‚Ñ). Description of these functions is included in Chapter 5. 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 (‚ß).
The sub-menus INTEGER, MODULAR, and POLYNOMIAL are presented in detail in Appendix J. 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.
The GOTO sub-menu The functions in the GOTO sub-menu are the following: 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.
Page L-5
Appendix M Table of Built-In Equations The Equation Library consists of 15 subjects corresponding to the sections in the table below) and more than 100 titles. The numbers in parentheses below indicate the number of equations in the set and the number of variables in the set. There are 315 equations in total using 396 variable.
3: Fluids (29, 29) 1: Pressure at Depth (1, 4) 3: Flow with Losses (10, 17) 2: Bernoulli Equation (10, 15) 4: Flow in Full Pipes (8, 19) 4: Forces and Energy (31, 36) 1: Linear Mechanics (8, 11) 5: ID Elastic Collisions (2, 5) 2: Angular Mechanics (12, 15) 6: Drag Force (1, 5) 3: Centripetal Force (4, 7) 7: Law of Gravitation (1, 4) 4: Hooke’s Law (2, 4) 8: Mass–Energy Relation (4, 9) 5: Gases (18, 26) 1: Ideal Gas Law (2, 6) 5: Isentropic Flow (4, 10) 2: Ideal Gas State Change (1, 6) 6: Real
9: Optics (11, 14) 1: Law of Refraction (1, 4) 4: Spherical Reflection (3, 5) 2: Critical Angle (1, 3) 5: Spherical Refraction (1, 5) 3: Brewster’s Law (2, 4) 6: Thin Lens (3, 7) 10: Oscillations (17, 17) 1: Mass–Spring System (1, 4) 4: Torsional Pendulum (3, 7) 2: Simple Pendulum (3, 4) 5: Simple Harmonic (4, 8) 3: Conical Pendulum (4, 6) 11: Plane Geometry (31, 21) 1: Circle (5, 7) 4: Regular Polygon (6, 8) 2: Ellipse (5, 8) 5: Circular Ring (4,7) 3: Rectangle (5, 8) 6: Triangle (6, 107) 1
Appendix N Index A ABCUV 5-10 ABS 3-4, 4-6, 11-8 ACK 25-4 ACKALL 25-4 ACOS 3-6 ADD 8-9, 12-20 Additional character set D-1 ADDTMOD 5-11 Alarm functions 25-4 Alarms 25-2 ALG menu 5-3 Algebraic objects 5-1 ALOG 3-5 ALPHA characters B-9 ALPHA keyboard lock-unlock G-2 Alpha-left-shift characters B-10 Alpha-right-shift characters B-12 ALRM menu 25-3 AMORT 6-31 AMORTIZATION 6-10 AND 19-5 Angle between vectors 9-15 Angle Measure 1-23 Angle symbol (∠) G-2 Angle units 22-27, 22-29, 22-33 Angular measure G-2 ANIMATE
Bar plots 12-29 BASE menu 19-1 Base units 3-22 Beep 1-25 BEG 6-31 BEGIN 2-27 Bessel’s equation 16-52 Bessel’s functions 16-53 Best data fitting 18-13, 18-62 Best polynomial fitting 18-62 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, 12-45 BOXZ 12-48 Building a vector 9-12 BYTE menu 19-7 C C PX 19-7 C R 4-6 CALC/DIFF menu 16-3 Calculation with dates 25-3 Calculations with times 25-4 Calculator constants
Clock display 1-30 CMD 2-62 CMDS 2-25 CMPLX menus 4-5 CNCT 22-13 CNTR 12-48 Coefficient of variation 18-5 COL+ 10-19 COL 10-19 "Cold" calculator restart G-3 COLLECT 5-4 Column norm 11-7 Column vectors 9-18 COL- 10-20 COMB 17-2 Combinations 17-1 Command catalog list I-1 Complex CAS mode C-6 Complex Fourier series 16-26 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-22 Decimal numbers 19-4 decimal point 1-22 Decomposing a vector 9-11 Decomposing lists 8-2 Deep-sleep shutdown G-3 DEFINE 3-36 Definite integrals 13-15 DEFN 12-18 DEG 3-1 Degrees 1-23 DEL 12-46 DEL L L-1 DEL L-1 DELALARM 25-4 Deleting subdirectories 2-43 DELKEYS 20-6 Delta function (Dirac’s) 16-15 DEPND 22-6 DERIV 13-3 DERIV&INTEG menu 13-4 Derivative directional 15-1 Derivatives 13-1, 13-3 Derivatives extrema 1
DISTRIB 5-28 DIV 15-4 DIV2 5-10 DIV2MOD 5-11, 5-14 Divergence 15-4 DIVIS 5-9 DIVMOD 5-11, 5-14 DO construct 21-61 DOERR 21-64 DOLIST 8-11 DOMAIN 13-9 DOSUBS 8-11 DOT 9-11 Dot product 9-11 DOT+ DOT- 12-44 Double integrals 14-8 DRAW 12-20, 22-4 DRAW3DMATRIX 12-52 Drawing functions programs 22-22 DRAX 22-4 DROITE 4-9 DROP 9-20 DTAG 23-1 E e 3-16 EDIT L-1 Editor commands L-1 EGCD 5-18 EGDC 5-10 EGV 11-46 EGVL 11-46 Eigenvalues 11-45 eigenvalues 11-10 Eigenvectors 11-45 eigenvectors 11-10 Electric units 3-20 E
ERRN 21-65 Error trapping in programming 21-64 Errors in hypothesis testing 18-36 Errors in programming 21-64 EULER 5-10 Euler constant 16-54 Euler equation 16-51 Euler formula 4-1 EVAL 2-5 Exact CAS mode C-4 EXEC L-2 EXP 3-6 EXP2POW 5-28 EXPAND 5-4 EXPANDMOD 5-11 EXPLN 5-8, 5-28 EXPM 3-9 Exponential distribution 17-6 Extrema 13-12 Extreme points 13-12 EYEPT 22-10 F F distribution 17-12 FACTOR 2-11 Factorial 3-15 Factorial symbol (!) G-2 Factoring an expression 2-24 FACTORMOD 5-11 FACTORS 5-9 FANNING 3-32
Function, table of values 12-17, 12-25 Functions, multi-variate 14-1 Fundamental theorem of algebra 6-7 G GAMMA 3-15 Gamma distribution 17-6 GAUSS 11-54 Gaussian elimination 11-14, 11-29 Gauss-Jordan elimination 11-33, 11-38, 11-40, 11-43 GCD 5-11, 5-18 GCDMOD 5-11 Geometric mean 8-16, 18-3 GET 10-6 GETI 8-11 Global variable 21-2 Global variable scope 21-4 GOR 22-32 Goto Line L-4 GOTO menu L-2, L-4 Goto Position L-4 Grades 1-23 Gradient 15-1 Graphic objects 22-29 Graphical solution of ODEs 16-57 Graphics a
HELP 2-26 HERMITE 5-11, 5-18 HESS 15-2 Hessian matrix 15-2 HEX 3-2, 19-2 Hexadecimal numbers 19-7 Higher-order derivatives 13-13 Higher-order partial derivatives 14-3 HILBERT 10-14 Histograms 12-29 HMS- 25-3 HMS+ 25-3 HMS 25-3 HORNER 5-11, 5-19 H-VIEW 12-19 Hyperbolic functions graphs 12-16 Hypothesis testing 18-35 Hypothesis testing errors 18-36 Hypothesis testing in linear regression 18-52 Hypothesis testing in the calculator 18-43 HZIN 12-48 HZOUT 12-48 I i 3-16 I/O functions menu F-2 I R 5-27 IABCUV 5
Integrals step-by-step 13-16 Integration by partial fractions 13-20 Integration by parts 13-19 Integration change of variable 13-19 Integration substitution 13-18 Integration techniques 13-18 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-5, L-4 Inverse cdf’s 17-13 Inverse cumulative distribution functions 17-13 Inverse function graph 12-11 Inverse Laplace transforms 16-10 Inverse matrix 11-6 INVMOD 5-11 IP 3-1
Left-shift functions B-5 LEGENDRE 5-11, 5-20 Legendre’s equation 16-51 Length units 3-19 LGCD 5-10 lim 13-2 Limits 13-1 LIN 5-5 LINE 12-44 Line editor commands L-1 Line editor properties 1-28 Linear Algebra 11-1 Linear Applications 11-54 Linear differential equations 16-4 Linear regression additional notes 1850 Linear regression confidence intervals 18-52 Linear regression hypothesis testing 18-52 Linear regression prediction error 18-52 Linear system of equations 11-18 Linearized relationships 18-12 LINSOL
Mass units 3-20 Math menu..
Multiple integrals 14-8 Multiple linear fitting 18-57 Multiple-Equation Solver 27-6 Multi-variate calculus 14-1 MULTMOD 5-11 N NDIST 17-10 NEG 4-6 Nested IF...THEN..ELSE..END 21-49 NEW 2-34 NEXTPRIME 5-10 Non-CAS commands C-13 Non-linear differential equations 16-4 Non-verbose CAS mode C-7 NORM menu 11-7 Normal distribution 17-10 Normal distribution cdf 17-10 Normal distribution standard 17-17 NOT 19-5 NSUB 8-11 NUM 23-1 NUM.SLV input forms A-1 NUM.
Partial fractions integration 13-20 Partial pivoting 11-34 PASTE 2-27 PCAR 11-45 PCOEF 5-11, 5-21 PDIM 22-20 Percentiles 18-14 PERIOD 2-37, 16-34 PERM 17-2 Permutation matrix 11-50, 11-51 Permutations 17-1 PEVAL 5-22 PGDIR 2-44 Physical constants 3-29 PICT 12-8 Pivoting 11-34 PIX? 22-22 Pixel coordinates 22-25 Pixel references 19-7 PIXOFF 22-22 PIXON 22-22 Plane in space 9-17 PLOT 12-50 PLOT environment 12-3 Plot functions menu F-1 PLOT menu (menu 81) G-3 PLOT menu interactive plots 22-15 PLOT menu 22-1 PLO
17-6 Probability distributions discrete 17-4 Probability distributions for statistical inference 17-9 Probability mass function 17-4 Program branching 21-46 Program loops 21-53 Program-generated plots 22-17 Programming 21-1 Programming choose box 21-31 Programming debugging 21-22 Programming drawing commands 22-19 Programming drawing functions 22-24 Programming error trapping 21-64 Programming graphics 22-1 Programming input forms 21-27 Programming input string prompt 21-21 Programming interactive input 21-
RCLMENU 20-1 RCWS 19-4 RDM 10-9 RDZ 17-3 RE 4-6 Real CAS mode C-6 Real numbers C-6 Real numbers vs. Integer numbers C-5 Real objects 2-1 Real part 4-1 RECT 4-3 REF.
SEARCH menu L-2 Selection tree in Equation Writer E-1 SEND 2-34 SEQ 8-11 Sequential programming 21-15 Series Fourier 16-26 Series Maclaurin 13-23 Series Taylor 13-23 Setting time and date 25-2 SHADE in plots 12-6 Shortcuts G-1 SI 3-30 SIGMA 13-14 SIGMAVX 13-14 SIGN 3-14, 4-6 SIGNTAB 12-50, 13-10 SIMP2 5-10, 5-23 SIMPLIFY 5-29 Simplify non-rational CAS setting C-10 Simplifying an expression 2-24 SIN 3-7 Single-variable statistics 18-2 Singular value decomposition 11-9, 11-50 SINH 3-9 SIZE 8-10, 10-7 SKIP L-
Stiff differential equations 16-67 Stiff ODE 16-66 Stiff ODEs numerical solution 16-67 STOALARM 25-4 STOKEYS 20-6 STREAM 8-11 String 23-1 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 Subdirectories creating 2-39 Subdirectories deleting 2-43 SUBST 5-5 SUBTMOD 5-11, 5-15 Sum of squared errors (SSE) 18-63 Sum of squared totals (SST) 18-63 Summary statistics 18-13 SVD 11-50 SVL 11-51 SYLVESTER 11-54 SYMB/GRAPH menu 12-50 Symbolic CAS mode C-3
TINC 3-34 TITLE 7-14 TLINE 12-45, 22-20 TMENU 20-1 TOOL menu CASCMD 1-7 CLEAR 1-7 EDIT 1-7 HELP 1-7 PURGE 1-7 RCL 1-7 VIEW 1-7 TOOL menu 1-7 Total differential 14-5 TPAR 12-17 TRACE 11-14 TRAN 11-15 Transforms Laplace 16-10 Transpose 10-1 Triangle solution 7-9 Triangular wave Fourier series 16-34 TRIG menu 5-8 Trigonometric functions graphs 12-16 TRN 10-7 TRNC 3-14 Truth plots 12-28 TSTR 25-3 TVM menu 6-30 TVMROOT 6-31 Two-dimensional plot programs 22-14 Two-dimensional vector 9-12 TYPE 24-2 U UBASE 3-22 U
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-7 Verbose vs.
! 17-2 % 3-12 %CH 3-12 %T 3-12 ARRY 9-6, 9-20 BEG L-1 COL 10-18 DATE 25-3 DIAG 10-12 END L-1 GROB 22-31 HMS 25-3 LCD 22-32 LIST 9-20 ROW 10-22 STK 3-30 STR 23-1 TAG 21-33, 23-1 TIME 25-3 UNIT 3-28 V2 9-12 V3 9-12 ΣDAT 18-7 ΔDLIST 8-9 ΣPAR 22-13 ΠPLIST 8-9 ΣSLIST 8-9 Page N-20
Limited Warranty HP 50g graphing calculator; Warranty period: 12 months 1. 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. 2.
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. Some countries, States or provinces do not allow the exclusion or limitation of incidental or consequential damages, so the above limitation or exclusion may not apply to you. 8.
Switzerland Turkey UK Czech Republic South Africa Luxembourg Other European countries Asia Pacific L.America +420-5-41422523 Country : Telephone numbers Australia Singapore +61-3-9841-5211 +61-3-9841-5211 Country : Telephone numbers Argentina 0-810-555-5520 Sao Paulo 3747-7799; ROTC 0800-157751 Mx City 5258-9922; ROTC 01800-472-6684 0800-4746-8368 800-360999 9-800-114726 0-800-10111 Brazil Mexico N.
Regulatory information Federal Communications Commission Notice This equipment has been tested and found to comply with the limits for a Class B digital device, pursuant to Part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference in a residential installation. This equipment generates, uses, and can radiate radio frequency energy and, if not installed and used in accordance with the instructions, may cause harmful interference to radio communications.
This device complies with Part 15 of the FCC Rules. Operation is subject to the following two conditions: (1) this device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. For questions regarding your product, contact: Hewlett-Packard Company P. O.
This compliance is indicated by the following conformity marking placed on the product: xxxx* This marking is valid for non-Telecom prodcts and EU harmonized Telecom products (e.g. Bluetooth). This marking is valid for EU non-harmonized Telecom products.