HP 50g User Manual

HP  g gr aphing calc ulator user ’s guide H Ed i ti on 1 HP part number F2 2 2 9AA-9 0006
Notice REG ISTER Y OUR PRODU CT A T: ww w .regis ter .hp.com TH IS MANUAL AND ANY E XAMPLE S CONT AINE D HEREIN ARE PR O VID E D “ AS IS” AND ARE SUB JECT T O CHANGE WITHOUT NOT ICE . HEWLET T -P ACKARD COMP ANY MAKE S NO W ARR ANTY OF ANY KIND WI TH REG ARD T O TH IS MANU AL , INCL UD ING, BUT NOT LIMITED T O, THE IMPLI ED W ARR ANTIE S OF MERCHANT ABI LITY , N ON -INFR IN GEMENT AN D FI TNE SS FOR A P ART IC ULAR P URP OSE. HEWLETT -P A CKAR D CO . SHALL NOT BE LIABLE FOR A NY ERR ORS OR FOR INCID EN T AL OR CON SEQUENT IAL D AMA GES I N CONNE CT ION WI TH T HE F URNISHING, P ERF ORMA NCE, OR US E OF TH IS MANUAL OR THE EX AMPLE S CONT AI NED HEREI N. © 2003, 2006 H e w lett -P ack ar d Dev elopment Compan y , L.P . Repr oduction , adaptati on, or tr a nslati on of this manual is pr ohibited w ithout pr ior w r it t en permissi on of Hew lett - P ack ar d Compan y , e x cept as allow e d under the cop yr igh t la w s. Hew lett -P ack ar d Compan y 16 3 9 9 W est Bern ar do Dr i ve MS 8- 600 San Di ego , CA 9 212 7 -18 9 9 US A Pr inting His tor y E dition 1 Apr il 2006
Pref ace Y ou ha ve in y our hands a compact s ymboli c and numer ical computer that w ill fac ilitate calc ulati on and mathematical anal ysis o f pr oblems in a var iety of disc iplines, f r om elementary mathematic s to adv anced engineer ing and sc ience subjec ts. Although r ef err e d to as a calc ulator , because of its compact fo rmat r ese mbling t y pi cal hand-held calc ulating de v ice s, the HP 5 0g should be thought of as a gr aphic s/pr ogr ammable hand-held com puter . T he HP 50g can be oper ated in two diff er en t calc ulating modes , the Rever se Po l i s h N o t a t i o n (RPN) mode and the Algeb r aic (AL G) mode (see page 1-13 f or additional details). The RPN mode was incor por ated into calc ulators to mak e calc ulati ons mor e eff ic ie nt . In this mode , the oper ands in an oper ati on (e .g., ‘ 2 ’ and ‘ 3 ’ in the oper ation ‘ 2 3 ’) ar e enter ed into the calculator sc r een, r ef err ed to as the stack , and then the oper ator (e .g ., ‘ ’ in the ope rati on ‘ 2 3 ’) is enter ed to complete the operati on. T he AL G mode, on the other hand , mimics the w ay y ou t y pe arithmeti c e xpr essio ns in paper . T hus , the oper ati on ‘ 2 3 ’, i n AL G mode , w i ll be ente re d in the calc ulator b y pre ssing the k ey s ‘ 2 ’, ‘ ’ , and ‘ 3 ’ , in that or der . T o complete the oper ati on we us e the ENTER ke y . Example s of appli cations o f the differ ent func tions and oper ations in this calc ulator ar e illus tr ated in this user ’s guide in both modes . T his guide contains e x amples that illustr ate the use of the basi c calculator func tions and oper ations . The c hapter s ar e or gani z ed b y subj ect in or der of diff ic ulty . Starting w ith the setting of calc ulator modes and displa y opti ons, and contin uing with r eal and comple x number calc ulations, oper ations w ith lists, v ector s, and matr ices , detailed e x ample s of gr aph a pplicati ons, u se o f str ings , basic pr ogr amming, gr aphic s pr ogr amming , str ing manipulati on , ad vanced calc ulus and mu ltiv ar iate calc ulu s applicati ons , adv anced diffe r ential equati ons appli cations (inc luding Laplace tr ansfor m, and F our ier se ri es and tr ansf orms) , and pr obability and statis tic appli cations .
F or s ymboli c oper ati ons the calc ulator inc ludes a po werf ul Co mputer A lgebrai c S y ste m (CAS) that lets y ou select diff er ent modes o f oper ation , e .g ., complex number s vs . r eal numbers , or e x act (s y mbolic) v s . appr o x imate (numer ical) mode . T he displa y can be adju sted to pr ov ide te xtbook - type e xp r essi ons, which ca n b e u sefu l wh en w ork in g wi th ma trice s, ve ctor s, frac tion s, s umm at ion s, d eri va tives, a nd in teg r a ls. The hig h- spe ed grap hics of the calc ulato r pr oduce com ple x fi gur es in v ery little time . T hanks to the infr a r ed por t , the RS2 3 2 por t , and the USB port and cable pr o vi ded wi th yo ur calculator , you can connec t yo ur calculator w i th other calc ulator s or comput ers . T his allo ws f or f ast and eff ic ien t ex change o f pr ogr ams and data with othe r calculat ors or computer s. T he calculat or pr o v ides a fla sh memor y car d por t to f ac ilitate sto rage and e xc hange of data w ith other user s. T he pr ogr amming capabiliti es of the calc ulator allo w yo u or other us ers to de velop e ffi c ien t applicati ons f or spec if ic purpo ses . Whether it is ad v anced mathematical appli cations , spec ifi c pr oblem soluti on, or data logging, t he pr ogr amming languages a vaila ble in y our calc ulator mak e it into a v ery ve rsatile compu ting de vi ce . W e hope y our cal c ulator w ill become a f aithful com panio n for y our sc hool and pr of essi onal appli cations .
Pa g e TO C - 1 T abl e o f contents Chapter 1 - Getting started ,1-1 Basic Operations ,1-1 Batteries ,1-1 Turning the calculator on an d off ,1-2 Adjusting the display contrast ,1-2 Contents of the calculator’s display ,1-2 Menus ,1-3 SOFT menus vs. CHOOSE boxes ,1-4 Selecting SOFT menus or CHOOSE boxes ,1-5 The TOOL menu ,1-7 Setting time and date ,1-7 Introducing the calculator’s keyboard ,1-11 Selecting calculator modes ,1-12 Operating Mode ,1-13 Number Format and decimal dot or comma ,1-17 Angle Measure ,1-23 Coordinate System ,1-24 Beep, Key Click, and Last Stack ,1-25 Selecting CAS settings ,1-26 Selecting Display modes ,1-27 Selecting the display font ,1-27 Selecting properties of the line editor ,1-28 Selecting properties of the Stack ,1-28 Selecting properties of the equation writer (EQW) ,1-29 Selecting the size of the header ,1-30 Selecting the clock display ,1-30
Pa g e TO C - 2 Chapter 2 - Introducing the calculator ,2-1 Calculator objects ,2-1 Editing expressions on the screen ,2-3 Creating arithmetic exp ressions ,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 exp ressions ,2-11 Editing arithmetic expressions ,2-17 Creating algebraic expressions ,2-19 Editing algebraic expressions ,2-21 Creating and editing summations, derivatives, and integrals ,2-29 Organizing data in the calculator ,2-33 Functions for manipulation of variables ,2-34 The HOME directory ,2-35 The CASDIR sub-directory ,2-35 Typing directo ry and variable names ,2-37 Creating subdirectories ,2-39 Moving among subdirectories ,2-43 Deleting subdirectories ,2-43 Variables ,2-47 Creating variables ,2-47 Checking variables contents ,2-52 Replacing the contents of variables ,2-55 Copying variables ,2-56 Reordering variables in a directory ,2-59 Moving variables using the FILES menu ,2-60 Deleting variable s ,2-61 UNDO and CMD functions ,2-62 Flags ,2-64 Example of flag setting: general solutions vs. principal value ,2-65
Pa g e TO C - 3 Other flags of interest ,2-66 CHOOSE boxes vs. Soft MENU ,2-67 Selected CHOOSE boxes ,2-69 Chapter 3 - Calculation with real numbers ,3-1 Checking calculato rs settings ,3-1 Checking calculator mode ,3-2 Real number calculations ,3-2 Changing sign of a number, var iable, or expression ,3-3 The inverse function ,3-3 Addition, subtraction, multiplication, division ,3-3 Using parentheses ,3-4 Absolute value function ,3-4 Squares and square roots ,3-5 Powers and roots ,3-5 Base-10 logarithms and powers of 10 ,3-5 Using powers of 10 in entering data ,3-6 Natural logarithms and exponential function ,3-6 Trigonometric f unctions ,3-6 Inverse tri gonometric functions ,3-6 Differences between functions and operators ,3-7 Real number functions in the MTH menu ,3-7 Hyperbolic functions and their inver ses ,3-9 Real number functions ,3-11 Special functions ,3-14 Calculator constants ,3-16 Operations with units ,3-17 The UNITS menu ,3-17 Available units ,3-19 Converting to base units ,3-22 Attaching units to numbers ,3-23 Operations with units ,3-25 Units manipulation tools ,3-27
Pa g e TO C - 4 Physical constants in the calc ulator ,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 Simple operations with complex numbers ,4-4 Changing sign of a complex number ,4-5 Entering the unit imaginary number ,4-5 The CMPLX menus ,4-5 CMPLX menu through the MTH menu ,4-6 CMPLX menu in keyboard ,4-7 Functions applied to complex numbers ,4-8 Functions from the MTH menu ,4-9 Function DRO ITE: equation of a straight li ne ,4-9 Chapter 5 - Algebraic and arithmetic operations ,5-1 Entering algebraic objects ,5-1 Simple operations with algebraic objects ,5-1 Functions in the ALG menu ,5-3 COLLECT ,5-4 EXPAND ,5-4
Pa g e TO C - 5 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 arithmetic ,5-12 Finite arithmetic rings in the calculator ,5-14 Polynomials ,5-17 Modular arithmetic with p olynomials ,5-17 The CHINREM function ,5-17 The EGCD function ,5-18 The GCD function ,5-18 The HERMITE function ,5-18 The HORNER function ,5-19 The variable VX ,5-19 The LAGRANGE function ,5-19 The LCM function ,5-20 The LEGENDRE function ,5-20 The PCOEF function ,5-21
Pa g e TO C - 6 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 func tion ,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 (Option 2) ,5-27 TRIGONOMETRIC convert menu (Option 3) ,5-27 MATRICES convert menu (Option 5) ,5-27 REWRITE convert menu (Option 4) ,5-27 Chapter 6 - Solution to single equations ,6-1 Symbolic solution of algebraic equations ,6-1 Function ISOL ,6-1 Function SOLVE ,6-2 Function SOLVEVX ,6-3 Function ZEROS ,6-4 Numerical solver menu ,6-5 Polynomial Equations ,6-6 Financial calculations ,6-9 Solving equations with one unknown through NUM.SLV ,6-13 The SOLVE soft menu ,6-26 The ROOT sub-menu ,6-26 Function ROOT ,6-26
Pa g e TO C - 7 Variable EQ ,6-26 The SOLVR sub-menu ,6-26 The DIFFE sub-menu ,6-29 The POLY sub-menu ,6-29 The SYS su b-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 the Multiple Equation Solver (MES) ,7-9 Application 1 - Solution of triangles ,7-9 Application 2 - Velocity an d acceleration in polar coordinates ,7-17 Chapter 8 - Operations with lists ,8-1 Definitions ,8-1 Creating and storing lists ,8-1 Composing and decomposing lists ,8-2 Operations with lists of numbers ,8-2 Changing sign ,8-3 Addition, subtraction, multiplication, division ,8-3 Real number functions from the keyboard ,8-4 Real number functions from the MTH menu ,8-5 Examples of functions that use two arguments ,8-6 Lists of complex numbers ,8-7 Lists of algebraic objects ,8-8 The MTH/LIST menu ,8-8 Manipulating elements of a list ,8-10
Pa g e TO C - 8 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 group ed 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 Writer (MTRW) to enter vectors ,9-3 Building a vector with  ARRY ,9-6 Identifying, extracting, and inserting vector elements ,9-7 Simple operations with vectors ,9-9 Changing sign ,9-9 Addition, subtraction ,9-9 Multiplication by a scalar, and division by a scalar ,9-9 Absolute value function ,9-10 The MTH/VECTOR menu ,9-10 Magnitude ,9-10 Dot product ,9-11 Cross product ,9-11 Decomposing a vector ,9-11 Building a two-dimensional vector ,9-12 Building a three-dimensional vector ,9-12
Pa g e TO C - 9 Changing coordi nate 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 vector s, 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 and manipulating matrices ,10-1 Definitions ,10-1 Entering matrices in the stack ,10-2 Using the Matrix Writer ,10-2 Typing in the matrix directly into the stack ,10-3 Creating matrices with ca lculat or functions ,10-3 Functions GET and PUT ,10-6 Functions GETI and PUTI ,10-6 Function SIZE ,10-7 Function TRN ,10-7 Function CON ,10-8 Function IDN ,10-9 Function RDM ,10-9 Function RANM ,10-11 Function SUB ,10-11 Function REPL ,10-12 Function  DIAG ,10-12 Function DIAG  ,10-13
Pa g e TO C - 1 0 Function VANDERMONDE ,10-13 Function HILBERT ,10-14 A program to build a matrix out of a nu mber 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 Function RCIJ ,10-25 Chapter 11 - Matrix Operations and Linear Algebra ,11-1 Operations with matrices ,11 -1 Addition and subtraction ,11-2 Multiplication ,11- 2 Characterizing a matrix (The matrix NORM menu) ,11-7 Function ABS ,11-8 Function SNRM ,11-8 Functions RNRM and CNRM ,11-9 Function SRAD ,11-10 Function COND ,11-10 Function RANK ,11- 11 Function DET ,11-12 Function TRACE ,11-14
Pa g e TO C - 1 1 Function TRAN ,11-15 Additional matrix operations (The matri x 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 fo r solving linear systems ,11-38 Solution to linear systems using calculator functions ,11-41 Residual errors in linear syste m solutions (Function RSD) ,11-44 Eigenvalues and eigenvectors ,11-45 Function PCAR ,11-45 Function EGVL ,11-46 Function EGV ,11- 46 Function JORDAN ,11- 47 Function MAD ,11- 48 Matrix factorization ,11-49 Function LU ,11- 50 Orthogonal matrices and singular value decomposition ,11-50 Function SVD ,11-50 Function SVL ,11- 51 Function SCHUR ,11-51 Function LQ ,11-51 Function QR ,11-52 Matrix Quadratic Forms ,11-52 The QUADF menu ,11-52 Function AXQ ,11-53
Pa g e TO C - 1 2 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 optio ns 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 ,12-11 Inverse functions and their graphs ,12-11 Summary of FUNCTION plot operation ,12-13 Plots of trigonometric and hyperbolic functions ,12-16 Generating a table of values for a fu nction ,12-17 The TPAR variable ,12-17 Plots in polar coordinates ,12-18 Plotting conic curves ,12-20 Parametric plots ,12-22 Generating a table for parametric equations ,12-25 Plotting the solution to simple differential equations ,12-26 Truth plots ,12-28 Plotting histograms, bar plots, and scatter plots ,12-29 Bar plots ,12-29 Scatter plots ,12-31 Slope fields ,12-33
Pa g e TO C - 1 3 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 ,12-48 CNTR ,12-48 ZDECI ,12-48 ZINTG ,12-48 ZSQR ,12-49 ZTRIG ,12-49
Pa g e TO C - 1 4 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 Derivative s ,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 TABVAL ,13-9 Function SIGNTAB ,13-10 Function TABVAR ,13-10 Using derivatives to calculate extreme points ,13-12 Higher order derivatives ,13-13 Anti-derivatives and integrals ,13-14 Functions INT, INTVX, RISC H, SIGMA and SIGMAVX ,13-14 Definite integrals ,13-15 Step-by-step evaluation of derivatives and integrals ,13-16 Integrating an equation ,13-17 Techniques of integration ,13-18 Substitution or change of variables ,13-18 Integration by parts and differentials ,13-19 Integration by partial fractions ,13-20 Improper integrals ,13-20
Pa g e TO C - 1 5 Integration with units ,13-21 Infinite series ,13-22 Taylor and Maclaurin’s se ries ,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 Multiple integrals ,14-8 Jacobian of coordinate transformation ,14-9 Double integral in polar coordinates ,14-9 Chapter 15 - Vector Analysis Applications ,15-1 Definitions ,15-1 Gradient and directiona l derivative ,15-1 A program to calculate the gradient ,15-2 Using function HESS to obtain the gradient ,15-2 Potential of a gradient ,15-3 Divergence ,15-4 Laplacian ,15-4 Curl ,15-5 Irrotational fields and potential function ,15-5 Vector potential ,15-6 Chapter 16 - Differential Equations ,16-1 Basic operations with differential equations ,16-1 Entering differential equations ,16-1
Pa g e TO C - 1 6 Checking solutions in the calc ulator ,16-2 Slope field visualizati on 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-1 0 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 series ,16-26 Function FOURIER ,16-28 Fourier series for a quadratic function ,16-28 Fourier series for a triangular wave ,16-34 Fourier series for a square wave ,16-38 Fourier series applications in differential equations ,16-40 Fourier Transforms ,16-42 Definition of Fourier transforms ,16-45 Properties of the Fourier transform ,16-47 Fast Fourier Transform (FFT) ,16-47 Examples of FFT applications ,16-48 Solution to specific second-order differential equations ,1 6-51 The Cauchy or Euler equation ,16-51 Legendre’s equation ,16-51 Bessel’s equation ,16-52 Chebyshev or Tchebycheff polynomial s ,16-55 Laguerre’s equation ,16-56 Weber’s equation and Hermite polynomials ,16-57 Numerical and graphical solutions to ODEs ,16-57
Pa g e TO C - 1 7 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 RK F ,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.. sub-menu - part 1 ,17-1 Factorials, combinations, and permutations ,17-1 Random numbers ,17-2 Discrete probability distributions ,17-3 Binomial distribution ,17-4 Poisson distribution ,17- 5 Continuous probability distributions ,17-6 The gamma distribution ,17-6 The exponential distribution ,17-6 The beta distribution ,17-7 The Weibull distribution ,17-7 Functions for continuous distributions ,17-7 Continuous distributions for sta tistical inference ,17-9 Normal distribution pdf ,17-9 Normal distribution cdf ,17-10 The Student-t distribution ,17-10 The Chi-square distribution ,17-11 The F distribution ,17-12 Inverse cumulative distribution functions ,17-13
Pa g e TO C - 1 8 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 operations ,18-19 Confidence intervals ,18-22 Estimation of Confidence Intervals ,18-23 Definitions ,18-2 3 Confidence intervals for the population mean when the population vari- ance is known ,18-24 Confidence intervals for the population mean when the population vari- ance is unknown ,18-24 Confidence interval for a pr oportion ,18-25 Sampling distribution of differences and sums of statistics ,18-25 Confidence intervals for sums and differences of mean values ,18-26 Determining confidence intervals ,18-27 Confidence intervals for the variance ,18-33 Hypothesis testing ,18-35 Procedure for testing hypotheses ,18-35 Errors in hypothesis testing ,18-36 Inferences concerning one mean ,18-37 Inferences concerning two means ,18-39
Pa g e TO C - 1 9 Paired sample tests ,18-41 Inferences concerning one proportion ,18- 41 Testing the difference betw een 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 e r ror ,1 8-52 Confidence intervals and hypothesis testing in linear regression ,18-52 Procedure for infer ence statistics for linear regression using the calcula- tor ,18-54 Multiple linear fitting ,18-57 Polynomial fitting ,18-59 Selecting the best fitting ,18-62 Chapter 19 - Numbers in Different Bases ,19-1 Definitions ,19-1 The BASE menu ,19-1 Functions HEX, DEC, OCT, and BIN ,19-2 Conversion between number systems ,19-3 Wordsize ,19-4 Operations with binary integers ,19-4 The LOGIC menu ,19-5 The BIT menu ,19-6 The BYTE menu ,19-7 Hexadecimal numbers for pixel references ,19-7 Chapter 20 - Customizing menus and keyboard ,20-1 Customizing menu s ,20-1 The PRG/MODES/MENU menu ,20-1 Menu numbers (RCLMENU and MENU functions) ,20-2
Pa g e TO C - 2 0 Custom menus (MENU and TMENU functions) ,20-2 Menu specification and CST variable ,20-4 Customizing the keybo ard ,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 ,21-4 Local Variable Scope ,21-5 The PRG menu ,21-5 Navigating through RPN sub-menus ,21-6 Functions listed by su b-menu ,21-7 Shortcuts in the PRG menu ,21-9 Keystroke sequence for commonly used commands ,21-10 Programs for generating lists of numbers ,21-13 Examples of sequential programming ,21-15 Programs generated by defining a function ,21-15 Programs that simulate a sequence of stack operations ,21-17 Interactive input in programs ,21-19 Prompt with an input string ,21-21 A function with an input string ,21-22 Input string for two or three input values ,21-24 Input through input forms ,21-27 Creating a choose box ,21-31 Identifying output in programs ,21-33 Tagging a numerical result ,21-33 Decomposing a tagged numerical result into a number and a tag ,21-33
Pa g e TO C - 2 1 “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-6 4 ERRN ,21-65 ERRM ,21-65 ERR0 ,21-65 LASTARG ,21-65 Sub-menu IFERR ,21-65 User RPL programming in algebraic mode ,21-67 Chapter 22 - Programs for graphics manipulation ,22-1 The PLOT menu ,22-1 User-defined key for the PLOT menu ,22-1 Description of the PLOT menu ,22-2 Generating plots with programs ,22-14 Two-dimensional graphics ,22-14 Three-dimensional graphics ,22-15 The variable EQ ,22-15 Examples of interactive plots using the PLOT menu ,22-15
Pa g e TO C - 2 2 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 functions ,22-33 Modular programming ,22-35 Running the program ,22-36 A program to calculate princip al stresses ,22-38 Ordering the variables in the sub-directory ,22-38 A second example of Mohr’s circle calculations ,22-39 An input form for the Mohr’s circle program ,22-40 Chapter 23 - Charactor strings ,23-1 String-related functions in the TYPE sub-menu ,23-1 String concatenation ,23-2 The CHARS menu ,23-2 The characters list ,23-3
Pa g e TO C - 23 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 Structure ,26-1 The HOME directory ,26-2 Port memory ,26-2 Checking objects in memory ,26-3 Backup objects ,26-4 Backing up objects in port memory ,26-4 Backing up and restoring HOME ,26-5 Storing, deleting, and restoring backup objects ,26-6 Using data in backup objects ,26-7 Using SD cards ,26-7 Inserting and removing an SD card ,26-7 Formatting an SD card ,26-8 Accessing objects on an SD card ,26-9
Pa g e TO C - 24 Storing objects on an SD ca rd ,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 Library ,27-1 Using the Solver ,27-2 Using the menu keys ,27-3 Browsing in the Equation Library ,27-4 Viewing equations ,2 7-4 Viewing variables and selecting units ,27-5 Viewing the picture ,27-5 Using the Multiple-Equation Solver ,27-6 Defining a set of equations ,27-8 Interpreting results from the Multiple-Equation Solver ,27-10 Checking solutions ,27-11 Appendices Appendix A - Using input forms ,A-1 Appendix B - The calculator’s keyboard ,B-1 Appendix C - CAS settings ,C-1 Appendix D - Additional character set ,D-1 Appendix E - The Selection Tree in the Equation Writer ,E-1
Pa g e TO C - 2 5 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
Pa g e 1 - 1 Chapter 1 G e t ting started T his chapte r pr ov ides basi c inf ormatio n about the oper ation of y our calculator . It is desi gned to familiar i z e y ou w ith the basic oper ations and se ttings b e fo r e y ou perfor m a calc ulation . Basic Operations T he follo w ing secti ons ar e designed t o get y ou acquainted w ith the hard w ar e of y our calc ulator . Batt er ies T he calculat or uses 4 AAA (LR03) batter ie s as main po w er and a CR20 3 2 lithium battery for memo r y bac k up . Bef or e us ing the calculat or , pleas e install the batt er ies acco rding t o the fo llo w ing pr ocedure . T o install the main batteries a. Make sur e th e calculator is OFF . Slide up the batter y compartment co ve r as illus tr ated . b . Insert 4 ne w AAA (LR03) batt eri es int o the main compar tmen t . Make sur e each battery is inserted in the indi cated dir ecti on. T o install the backup battery a. Mak e sure the calculator is OFF . Pr ess do wn the holde r . P ush the plate to the sho w n direc tion and lift it .
Pa g e 1 - 2 b . Insert a ne w CR203 2 lithium batter y . Make sur e its positi ve ( ) si de is fac ing up . c. R eplace the plate and p u sh it to the ori ginal place. After installi ng the bat ter i es, pr ess [ON] to turn the po wer on . Wa rn i n g : When the lo w battery icon is displa y ed, y ou need to r eplace the batteri es as soon as pos sible. Ho we v er , av oid re mov ing the back up battery and main batteri es at the same tim e to a vo id data lost . T urning the calculator on and off The $ ke y is located at the lo wer le f t cor ner of the k ey boar d . P r ess it once to turn y our ca l culator on. T o tur n the calc ulator off , pr ess the r igh t -shift k e y @ (fir st k e y in the second r o w fr om the bottom of the k ey b oar d), follo wed b y the $ ke y . Notice that the $ k ey has a OFF label pr inted in the upper ri ght cor ner a s a r emi nder o f the OFF c ommand . Adjusting th e displa y contrast Y ou c an adj us t the d ispl a y cont r as t b y hol ding t he $ k e y while pr essin g the or - k ey s. T he $ (hold) k ey combinati on pr oduces a dark er displa y . The $ (hold) - k e y combination pr oduces a lighter displa y Contents of the calculator ’s displa y T urn y our calc ulator on once mor e . The displa y should look a s indicated belo w .
Pa g e 1 - 3 At the top o f the display y ou will ha v e two lines o f infor mation that de sc ribe the settings o f the calculator . The f irs t line sho ws the c har acter s: R D XYZ HE X R= 'X' F or details on the meaning of the se s y mbols see C hapter 2 . T he second line sho ws the c harac ter s: { HOME } indicating that the HOME dir ectory is the c urr ent file dir ectory in the calculat or’s memo r y . In Chapt er 2 y ou w ill lear n that y ou can sa ve dat a in y our calc ulato r by st or ing them in f iles or v ari ables. V ari ables can be or gani z ed into direc tor ies and su b-direc tor ies . Ev en tually , yo u may c r eate a br anching tr ee of fi le dir ector i es, similar to thos e in a computer hard dr iv e . Y ou can then na v igate thr ough the file dir ectory tree to select an y direc tor y o f inter est . As you na v igate thr ough the file dir ectory t he second line of the display w i ll c hange to r eflect the pr oper file dir e c tory and sub-dir ectory . At the bottom of the dis play y ou wi ll find a number o f labels, name ly , @EDIT @ VIEW @@ RCL @ @ @@STO@ ! PURGE !CLEAR assoc iated w ith the six soft menu k eys , F1 thr ough F6: ABCDEF T he six la bels display ed in the low er part of the sc r een w ill change depending on w hic h menu is displa y ed. But A w i l l a l w a y s b e a s s o c i a t e d w i t h t h e f i r s t displa y ed label , B w ith the second display ed label, and so on. M enus T he si x labels ass oc iated w ith the k e y s A thr ough F f or m par t o f a menu of f uncti ons. Since the calc ulator has only si x s oft menu k e y s, it onl y displa y 6 labels at an y point in time . How e v er , a menu can hav e mor e than six entr ies.
Pa g e 1 - 4 E ach gr oup of 6 entr i es is called a Menu page . The c ur r ent menu , know n as the T OOL menu (s ee belo w) , has e ight en tri es ar ranged in tw o pages. T he next page , containing the ne xt two entr ies o f the menu is av ailable b y pr essing the L (NeXT menu) k e y . This k ey is the thir d ke y fr om the left in the thir d r o w of k e y s in the ke yboar d. Pr ess L once mor e to r eturn to the main T OOL me nu , or pr ess the I k e y (thir d k e y in second r o w of k ey s f rom the t op of the keyb oa rd ) . T he T OOL menu is descr i bed in detain in the ne xt s ectio n. At this po int w e wi ll illus tr ate some pr operties of men us that y ou w ill find u sef ul while us ing y our calc ulat or . SOF T m enus v s. CHOOSE bo x es Menus, or S OFT menus, assoc iate lab els in the lo wer par t of the scr e en w ith the si x so ft menu k e y s ( A thr ough F ) . B y pr essing the appr opri ate soft me nu k e y , the functi on sho wn in the a ssoc iated label gets acti vat ed. F or e x ample, w ith the T OOL menu acti ve , pr es sing the @CLEAR key ( F ) acti vates functi on CLEAR , w hic h er ases (c lears u p) the contents of the scr een. T o see this func tion in acti on, ty pe a number , say 123` , and then pr es s the F key . S OFT men us ar e typ icall y us ed to se lect fr om among a n umber of r elated func tions . Ho we v er , S OFT men us ar e not the onl y w a y to acces s collecti ons of r elated f unctions in the calc ulator . The alter nati v e wa y w ill be r efe rr ed to as CHOO SE box es. T o see an e x ample of a c hoos e bo x, ac ti vat e the T OOL menu (pr ess I ), and then pr ess the k ey str ok e combinati on ‚ã (associated w i th the 3 k e y) . T his w ill pr ov ide the f ollo w ing CHOO SE bo x:
Pa g e 1 - 5 T his CHOOSE bo x is labeled B ASE MENU and pr o v ide s a list of n umber ed fu nct ion s, from 1 . H EX x to 6. B  R. T his displa y wi ll constitute the f irs t page of this CHOOSE bo x menu sho w ing si x menu f uncti ons. Y ou can nav igat e thr ough the menu b y using the up and do w n arr o w k e y s, —˜ , located in the u pper r ight side of the k ey board , right under the E and F sof t menu k e ys. T o acti v ate an y gi v en f unction , f irst , highli ght the func tion name b y using the u p and do wn ar r o w ke ys , —˜ , or b y pres sing the number corr esponding to the func tion in the CHOO SE bo x . After the f uncti on name is selected , pr es s the @@@OK@@@ sof t menu k ey ( F ) . Thus, if you wan ted to use fun ction R  B (Real t o Binary) , y ou could pr ess 6F . If y ou w ant to mov e t o the top of the c urr ent menu page in a CHOOSE bo x, u se „— . T o mov e t o the bottom of the c urr ent pa ge , use „˜ . T o mov e to the top of the entir e menu , us e ‚— . T o mov e to the bottom of the entir e menu , use ‚˜ . Selec ting S OFT menus or CHOOSE bo xes Y ou can selec t the f ormat in w hic h y our menu s w ill be displa y ed by c hanging a setting in the calc ulator s y stem f lags (A s y stem f lag is a calculat or var iable that contr ols a certain calc ulator oper ati on or mode. F or mor e infor matio n about flag s, se e Chapte r 2 4) . S y stem f lag 117 can be set t o pr oduce eit her S OFT menus or CHOOSE bo x es. T o access this flag us e: H @) FLAGS —„ —˜ Y our calc ulator w ill sho w the f ollo w ing sc r een, hi ghlighting the line starting w ith the numbe r 117 : B y def ault , the line w ill look a s sho wn a bo ve . The hi ghlighted line (117 CHOO SE box es) indicates that CHOO SE bo xes ar e the c u r r ent menu display set ting. If y o u pr efer to use S OFT menu k ey s, press the @  @CHK@@ soft men u k e y ( C ) , f ollo w ed by @@@OK@@@ ( F ). P r e s s @@@OK@@@ ( F ) o n ce m o re to re t ur n t o normal calc ulator displa y .
Pa g e 1 - 6 If y ou no w pr es s ‚ã , instead of the CHOO SE bo x that y ou sa w earli er , the displa y w ill no w show six s oft menu la bels as the f irst page of the S T A CK menu: T o na vi gate thr ough the func tions of this me nu , pr ess the L k e y to m o ve to the ne xt page , or „« (ass oc iated w ith the L k e y ) t o m o v e t o t h e p r e v i o u s page . The f ollo w ing f igur es sho w the differ ent pages o f the B ASE me nu accessed by pr essing the L key t wic e : Pr essing the L k e y once mor e w ill tak es us bac k to the f irst menu page . T o r e ve rt to the CHOOSE bo xe s setting , use: H @) FLAGS —„ —˜ @  @CHK@@ @@@OK@@@ @@@OK@@@ . Not e: W ith the S O F T menu se t ting for s yst em flag 117 , the k e y str ok e combinati on ‚ (hold) ˜ , will sho w a list of the f uncti ons in the c urr ent soft menu . F or ex ample, f or the tw o f irst page s in the B ASE men u , y ou w ill get: Notes: 1. The T OOL menu , ob tained by pr essing I , wi ll alw a ys produce a S OFT menu . 2 . Mos t of the e x amples in this U ser’s Manual ar e sho w n using both S OFT menu s and CHOOSE bo xe s. Pr ogramming appli cations ( Chapter s 21 and 2 2) use ex clus i vely S O FT me nus . 3 . A dditional inf ormati on on S O FT men us vs . CHOO SE box es is pr esented in Cha pter 2 o f this guide .
Pa g e 1 - 7 The T OOL m enu T he soft menu k e y s for the men u c ur r ent ly displ ay ed , kno w n as t he T OOL men u , ar e assoc iat ed with oper ations r elated to manipulation o f var iables (s ee pages for more in forma tion o n variabl es) : @EDIT A EDIT the conten ts of a var ia ble (see Chapter 2 and Appendi x L for mor e infor mation on editing) @VIEW B VIEW the contents o f a var iable @@ RCL @@ C ReC aLl the con tents of a var iable @@STO@ D S T Or e the contents of a var ia ble ! PURGE E PURG E a va r iab le CLEAR F CLEAR the display o r stac k The calc ulator has onl y si x soft menu k ey s, and can onl y displa y 6 labels at an y point in ti me. Ho w ev er , a menu can ha ve mor e than si x entr ie s. E a c h gr oup of 6 entr ies is called a Menu page. T he T OOL menu has eight entr ies arr anged in two pages. T he next page , containing the ne xt t w o en tri es of the menu ar e av aila ble b y pr essin g the L (NeX T menu) ke y . T his k ey is the thir d ke y fr om the left in the third r ow of k e y s in the ke y board . In th is cas e , onl y the f ir st tw o so ft menu k e y s ha v e commands ass oc i ated w ith them. T hese commands are: @CASCM A CAS CMD: CAS C oMm anD , used to launc h a command fr om the CAS b y sele cting from a l ist @HELP B HELP fac ilit y de scr ibing the commands av ailable Pr es sing the L k ey will show the or i ginal T O OL menu . Another w ay t o r ecov er the T OOL m en u is to pr ess the I k e y (thir d ke y fr om the lef t in the second r o w of ke y s fr om the top of the ke yboar d) . Setting time and date The calc ulator has an inter nal r eal time c lock . This c lock can be continuousl y displa yed on the sc r een and be used for alar ms as well as r unning scheduled tasks. T his secti on w ill sho w not onl y ho w to set time and date , but also the basic s of using CHOOSE bo xes and ent er ing data in a dialog bo x . Dialog bo xes on y our c alc ulator are similar to a computer di alog box . T o set time and date we us e the TIME c hoose bo x av ailable as an alter nativ e fun ction for t he 9 k e y . B y comb inin g the r i ght-shi ft button , ‚ , w ith the
Pa g e 1 - 8 9 k ey the T IME choo se bo x is acti vat ed . This oper ation can als o be r epr esented as ‚Ó . Th e TIM E ch oo se box i s sh o wn in th e figu re b el ow: As indicated abov e, the TIME men u pr o vi des f our differ ent options , number ed 1 thr ough 4. Of inter es t to us as this poin t is option 3 . Se t time , date .. . U sing the do wn ar r o w ke y , ˜ , highli ght this option and pr es s the !!@@OK #@ soft menu k ey . Th e fo ll ow i ng input f orm (see A ppendi x 1- A ) f or adju sting time and date is s hown : Settin g the ti me of the da y Using the number k e y s, 1234567890 , st ar t b y adju sting the hour o f the day . Suppose that w e change the hour t o 11, b y pr essing 11 as the ho ur fi eld in the SET T IME AND D A TE input f or m is highli ghted . T his r esults i n the number 11 being ent er ed in the lo w er line of the input f or m: Pr es s the !!@@OK#@ so ft menu k ey to e ffect the change . The v alue of 11 is no w sho w n in the hour fi eld, and the minute f ield is a utomaticall y highli ghted:
Pa g e 1 - 9 Let ’s change the minute f ield to 2 5, by pr ess ing: 25 !!@@OK#@ . T he seco nds f ield is no w highli ghted . Suppose that y ou w ant to c hange the seconds fi eld to 4 5, u se: 45 !!@@OK #@ T he time for mat f ield is no w highlighted . T o c h a n g e t h i s f i e l d f r o m i t s c u r r e n t set ting y ou ca n either pr ess t he W k e y (the second k e y fr om the left in the f ifth r o w of k e y s fr om the bottom of the k ey boar d) , or pr es s the @ CHOOS soft men u k e y ( B ). Θ If using the W k e y , the setting in the time fo rmat f ield w ill c hange to eith er of the f ollo wing opti ons: o AM : indi cates that dis play ed time is AM time o P M : indicat es that displa y ed time is P M time o 2 4 -hr : indicate s that that the time display ed us es a 2 4 hour for mat w her e18:00, f or e x ample , r epr esen ts 6pm T he last se lected opti on w ill become the set opti on f or the time fo rmat b y using this pr ocedure . Θ If using the @CHOOS soft menu k ey , the f ollo w ing options ar e av ailable . Use the up and do w n arr o w k ey s , — ˜ , to select among the se thr ee options ( AM, P M, 2 4 -hour time) . Pr ess the !!@@OK#@ so ft menu k e y to mak e the sele ction .
Pa g e 1 - 1 0 Setting th e date After s etting the time for mat option , the SET T IME AND D A TE input for m w ill look as f ollo w s: T o set the date , f irst set the date f ormat . The de fault f or mat is M/D/Y (month/ day/y ear). T o modif y this f or mat , pre ss the do w n arr o w ke y . T his w ill hi ghlight the date f or mat as sho wn belo w: Use the @CHOOS so ft menu k ey t o see the options f or the date for mat: Highli ght y our ch oi ce by u sing the up and do wn ar r o w k e ys , — ˜ , and pr ess the !!@@ OK #@ soft menu k e y to mak e the selec tion .
P age 1-11 Intr oduc ing the calc ulator ’s k e yboar d The f igur e below sh ow s a di agram of the calculator ’s k ey boar d w ith the number ing of its ro ws and columns. T h e f i g u r e s h o w s 1 0 r o w s o f k e y s c o m b i n e d w i t h 3 , 5 , o r 6 c o l u m n s . R o w 1 has 6 ke ys , r ow s 2 and 3 hav e 3 ke y s each , and ro ws 4 thr ough 10 ha v e 5 k ey s ea c h . Ther e are 4 ar r ow k ey s located on the r ight-hand side of the k ey b oar d in the s pace o cc upi ed by r o ws 2 and 3 . E ach k ey has thr ee, f our , or fi ve f uncti ons. Th e m ain k ey f unction corr espond to the most pr ominent label in the k e y . Also , the left -shift k e y , k e y (8,1) , the r ight-
P age 1-12 shift ke y , k e y (9 ,1) , and the ALPHA k e y , ke y (7 ,1) , can be combined w ith some of the other k e y s to acti vat e the alternati ve func tions sho w n in the k e yboar d . F or e x ample , the P key , key(4,4 ) , has the follo wing si x func tions as soc iated wi th i t: P Main functi on , to acti vate the S Y MBoli c menu „´ Left-shif t f uncti on, t o acti vat e the MTH (Math) menu … N R ight-shift function , to acti vate the CA T alog functi on ~p ALPHA functi on , to enter the upper -case letter P ~„p ALPHA-Left-Shift functi on, to en ter the low er-cas e letter p ~…p ALPHA-R ight-Shift functi on , to enter the s ymbol P Of the six f unctions ass oc iated w ith the k ey onl y the fir st four ar e s ho wn in the k ey b oar d itself . T his is the w ay that the k ey l ooks in the k e yboar d: Notice that the color and the position o f the labels in the k ey , namel y , SY M B , MTH , CA T and P , indi cate w hich is the main func tion ( SY M B ), and w hic h of the other thr ee functi ons is a ssoc iated w ith the le f t-shift „ ( MTH) , r ight-shif t … ( CA T ) , and ~ ( P ) k ey s. F or detailed inf ormation on the calc ulator k e yboar d o per a ti on r ef er ee to Appen di x B . Selec ting calculator modes This sec tion assumes that y ou ar e no w at least par ti all y familiar w ith the use of choos e and dialog box es (if y ou ar e not , please r efer to Cha pter 2) . Pr ess the H b u t t on (second k ey f r om the left on the s econd ro w o f ke ys fr om the top) to show the f ollo win g CA L CULA T OR M ODE S input for m:
Pa g e 1 - 1 3 Pr ess the !!@ @OK#@ so ft menu k e y to r etur n to nor mal displa y . Example s of s electing diffe r ent calc ulator modes ar e show n next . Oper at ing Mode T he calculator o ffer s two oper a ting mode s: the Algebr aic mode , and the Re v ers e P olish Notati on ( RPN ) mode . The de fa ult mode is the A lgebr aic mode (as indi cated in the f igur e abo v e) , ho we v er , user s of ear lie r HP calculator s may be mor e famili ar w ith the RPN mode. T o selec t an oper ating mode , fir st open the CAL CUL A T OR MODE S input f orm b y pre ssing the H button . T he Oper ating M ode f ie ld w ill be highli ghte d. Select the A lgebrai c or RPN oper ating mode b y either u sing the \ key (second f r om left in the f ifth r o w fr om the k e yboar d bottom) , or pr essing the @CHOOS s oft menu k e y . If using the latter appr oac h, u se up and do wn arr o w keys, — ˜ , to s elect the mode , and pr ess the !!@@OK#@ soft me nu k e y to complet e the oper ation . T o illustr ate the differ ence bet w een these two oper ating modes we w ill c alc ulate the f ollo w ing expr essi on in both modes: 5 . 2 3 23 3 3 1 5 3 e ⋅ − ⋅ ⎟ ⎠ ⎞ ⎜ ⎝ ⎛
Pa g e 1 - 1 4 T o enter this e xpre ssion in the calc ulator w e w ill f irs t use the equation w r iter , ‚O . P lease identify the f ollo w ing k e y s in the k e yboar d , besi des the nume ri c k e y pad ke y s: !@.#* -/R Q¸Ü‚Oš™˜—` T he equation w rite r is a displa y mode in whi ch y ou can build mathematical e xpre ssi ons using e xplic it mathematical not ation inc luding fr acti ons, de ri vati v es, integr als , r oots, et c. T o us e the equation w rit er f or wr iting the expr essi on s hown a bove, us e th e fol l owin g keyst roke s: ‚OR3*!Ü5- 1/3*3 ——————— /23Q3™™ !¸2.5` Afte r pr essi ng ` the calc ulat or dis play s the e xpr essi on : √ (3*(5-1/(3*3))/23^3 EXP(2.5)) Pr es sing ` again will pr ov ide the f ollo w ing v alue . Accept A ppr o x . mode on, i f a s ked, by pre ss in g !!@@OK#@ . [ Note : The integer v alu es us ed abov e , e .g., 3, 5, 1, r epr esen t ex act value s. T he EXP( 2 . 5), how e v er , cannot be e xpr essed a s an e x act v alue , ther ef or e , a s w itc h to Appr o x mode is r equir ed]: Y ou could als o t y pe the expr es sion dir ectl y int o the display w i thou t using the equation w r iter , as follo ws: R!Ü3.*!Ü5.-1./ !Ü3.*3.™™ /23.Q3 !¸2.5` to obtai n the same r esult .
Pa g e 1 - 1 5 Change the oper ating mode to RPN by f irst pr es sing the H butto n. S elec t the RPN oper ating mode b y either u sing the \ k ey , or pr essing the @CHOOS sof t m e n u k e y . P r e s s t h e !!@@ OK#@ so f t me nu k e y to complet e the oper ation . T he displa y , for the RPN mode looks as f ollo w s: Notice that the displa y sho w s se ver a l le v els of output labeled , fr om bottom to top , as 1, 2 , 3, etc. This is re ferr ed to as the stack o f the calculat or . The diffe r ent le ve ls are r efer r ed to as the st ack le vels , i .e ., stac k lev el 1, stack le v el 2 , etc. In RPN mode , instead o f wr iting an operati on suc h as 3 2 b y pr essing 3 2` , w e wr ite the oper ands fir st , in the p r oper order , and then the oper ator , i.e ., 3`2 . As y ou enter the operands , the y occ up y diffe r ent stac k lev els . Enter ing 3` puts the number 3 in stac k lev el 1. Ne xt , enter ing 2 pushes the 3 up w ar ds to occu py s tac k lev el 2 . F inally , by pr essing , we ar e telling the calc ulator t o apply the ope rator , or pr ogr am, to the objec ts occ up y ing lev els 1 and 2 . The r esult , 5, is then placed in le vel 1. Let's try some other simple oper ations bef or e tr y ing the mor e complicated e xpre ssi on used ear lier fo r the algebr aic oper ating mode: 12 3/3 2 123`32/ 4 2 4`2Q 3 √ 2 7 27`3@» Notice the po sitio n of the y and the x in the last tw o oper ations . T he base in the e xponential ope rati on is y (stac k le ve l 2) while the e xponent is x (st ack le v el 1) bef or e the k ey Q is pr essed . Similarl y , in the cu bic r oot operati on , y (s tack le vel 2) is the quantity under the r oot sign , and x (stack le vel 1) is the r oot . T ry the follo w ing ex er c ise in v ol vi ng 3 fac tor s: (5 3) × 2 5`3 Calc ulate s (5 3) fir st . 2X Comple tes the calc ulation . Let's try no w the expr ession pr oposed ear lier :
Pa g e 1 - 1 6 3.` Ent er 3 in le v el 1 5.` Ent er 5 in le v el 1, 3 mov es to y 3.` Ent er 3 in le v el 1, 5 mov es to lev el 2 , 3 t o lev el 3 3.* P lace 3 and multipl y , 9 appears in le v el 1 Y 1/(3 × 3) , las t value in le v . 1; 5 in lev el 2 ; 3 in lev el 3 - 5 - 1/(3 × 3) , occ upi es le v el 1 no w ; 3 in lev el 2 * 3 × (5 - 1/(3× 3)), occ upi es le v el 1 no w . 23.` Enter 2 3 in lev el 1, 14.6 6 6 66 mo ves t o lev el 2 . 3.Q Ent er 3, calculat e 2 3 3 into le v el 1. 14.66 6 in le v . 2 . / (3 × (5-1/(3× 3)))/2 3 3 into lev el 1 2.5 Enter 2 .5 le vel 1 !¸ e 2. 5 , goes int o le ve l 1, lev el 2 sho ws pr ev ious value . (3 × (5 - 1/(3× 3)))/2 3 3 e 2. 5 = 12 .18 3 6 9 , into le v . 1. R √ ((3× (5 - 1/( 3 × 3)))/2 3 3 e 2. 5 ) = 3 .4 90 515 6, int o 1. Although RPN r equire s a little bit mor e thought than the algebr ai c (AL G) mode , ther e ar e multiple adv antages in using RPN . F or e x ample , in RPN mode yo u can see the equatio n unfolding s tep b y step . T his is ex tremel y usef ul to detect a pos sible input er r or . Als o , as y ou become mor e eff ic ient in this mode and learn mor e of the tr icks , y ou w ill be able to calc ulate expr ession fas ter and w ill muc h less k ey str ok es . Consi der , for e xample the calc ulation o f (4 × 6 - 5 )/(1 4 × 6 - 5). In RPN mode y ou can wr ite: 4 ` 6 * 5 - ` 1 / ob v iou sly , e v en In RPN mode, y ou can enter an e xpr essi on in the same or der as the algebr aic mode b y using the E quation w riter . F or ex ample, ‚OR3.*!Ü5.- 1/3.*3. ——————— /23.Q3™™ !¸2.5` T he r esulting e xpr essi on is sho w n in stac k lev el 1 as follo ws : 5 . 2 3 23 3 3 1 5 3 e ⋅ − ⋅ ⎟ ⎠ ⎞ ⎜ ⎝ ⎛
Pa g e 1 - 1 7 Notice ho w the e xp r essi on is placed in stac k le ve l 1 after pre ssing ` . Pr essing the EV AL ke y at this point w i ll ev aluate the numer ical value o f that e xpr es sion Note: In RPN mode , pre ssing ENTER when ther e is n o command line w ill e xec ut e the D UP f uncti on whi ch cop ies the cont ents of stac k le vel 1 o f the stac k onto le v el 2 (and pu shes all the other s tack le v els one le ve l up) . T his is e xtr emel y usef ul as sho wed in the pr ev ious e x ample . T o sel ect betw een the AL G v s. RPN oper ating mode , y ou can also s et/c lear s y stem f lag 9 5 thr ough the follo wing k ey str ok e sequence: H @FLAGS 9 ˜ ˜ ˜ ˜ @  CHK@@ ` Alternati vel y , y ou can use one of the f ollo w ing shortcuts: Θ In AL G mode, CF(-9 5) se lects RPN mode Θ In RPN mode , 95 \` SF selec ts AL G mode F or more inf ormati on on calc ulator’s s y ste m flags see C hapter 2 . Number F ormat and decimal dot or comma Changing the number f ormat allo ws y ou to c ustomi z e the w ay r eal numbers ar e displa y ed by the calc ulator . Y ou w ill find this f eatur e extr emely u sef ul in oper ations w ith pow ers of tens or to limit the number of dec imals in a r esult . T o selec t a number fo rmat , f irst open the CAL CUL A T OR MODE S input f or m by pr essing the H button . The n, us e the do wn ar r o w k ey , ˜ , to select the option Number fo rmat . T he def ault value is Std , or St an d ar d format . In t he standar d format , the calculat or w ill show f loating-point number s w ith the max imum pr ec ision allo wed b y the calc ulator (12 si gnifi cant digits). T o learn
Pa g e 1 - 1 8 mor e about r e al s, see C hapter 2 . T o illustr ate this and other numbe r for mats try the f ollo w ing ex er c ises: Θ Standar d format : T his mode is the most us ed mode as it sho ws nu mbers in the mos t famili ar notation . Pr es s the !!@@ OK#@ so ft menu k e y , w ith the Number for mat set to Std , to re turn to the calc ulator displa y . Enter the number 12 3 .4 5 6 7 8 9012 34 5 6 . Notice that this number has 16 si gnifi cant f i gure s. Pr ess the ` ke y . Th e num be r is r ounded to the maximum 12 signif icant f igur es , and is displa y ed as fo llo w s: In the standar d for mat of dec imal displa y , intege r numbers ar e sho wn w ith no dec imal z er os w hatsoe v er . Numbers w ith diff er ent dec imal f igur es w ill be adju sted in the displa y so that onl y thos e dec imal fi gur es that ar e necessar y w ill be sho wn . More e xamples of number s in standard f ormat ar e sho wn ne xt: Θ F ix ed f ormat with no decimals : Pr ess the H but ton . Next , use the do wn arr o w k e y , ˜ , t o select the opti on Number fo rmat . Pr ess the @ CHOOS soft menu k ey , and selec t the option Fix e d w ith the arr o w do w n k ey ˜ .
Pa g e 1 - 1 9 Notice that the Number F or mat mode is set t o Fix f ollo wed b y a z er o ( 0 ). T his number indicat es the number of dec imals to be sho w n af t er the dec imal point in the calc ulator’s displa y . Pr ess the !!@@OK#@ soft m enu ke y to r eturn to the calc ulator displa y . T he number no w is sho wn as: T his setting wi ll fo rc e all r esults to be r ounded to the clo sest in teger (0 digit displa y ed after the comma) . Ho we ver , the number is still st or ed by the calc ulator w ith its full 12 si gnifi cant digit pr ecisi on . As w e change the number of dec imals to be displa y ed, y ou will see the additional di gits being sho wn again . Θ Fi x ed format wi th dec imals : T his mode is mainly u sed w hen w orking w ith limit ed pr ec isio n. F or e x ample , if y ou ar e doing f inanc ial calc ulation , u sing a FIX 2 mode is con v enien t as it can easil y r epr esent monet ary units to a 1/100 pr ec ision . Pr ess the H button . Ne xt , us e the do wn ar r o w k e y , ˜ , to select the option Number f ormat . Pr ess the @CHOOS soft men u k e y , and select t he option Fixe d w ith the ar r o w do w n k ey ˜ . Pr ess the ri ght ar r ow k e y , ™ , to highlight the z er o in f r ont o f the option Fix . Pr ess the @CHOO S soft me nu k e y and, u sing the up and do w n arr ow keys, —˜ , selec t , say , 3 decimals .
Pa g e 1 - 2 0 Pres s the !!@@OK#@ soft menu k ey to complete the sel ec tion: Pr ess the !!@@OK#@ soft menu k e y r eturn to the calc ulator displa y . The number no w is s h ow n as: Notice ho w the number is r ounded, not tr uncated . Th us , the number 12 3 .4 5 6 7 8 9 012 3 4 5 6, f or this setting , is displa y ed as 12 3 .4 5 7 , and not as 12 3 .4 5 6 becau se the digit afte r 6 is > 5 Θ Scientific format T he sc ie ntif ic f ormat is mainl y used w hen so lv ing pr oblems in the ph y sical sc iences wher e numbers ar e usuall y r epr esented as a number w ith limited pr ec ision multipli ed by a po wer o f ten. T o set this f orm at, s tart b y pre ssing the H button . Ne xt , us e the do wn arr o w k e y , ˜ , t o select the opti on Number fo rmat . Pr ess the @ CHOOS soft menu k ey and se lect the opti on Scient ific w ith the arr ow do wn k ey ˜ . K eep the number 3 in f r ont o f the Sc i . (T his number can be c hanged in the
Pa g e 1 - 2 1 same fa shion that w e c hanged the Fixe d number o f dec imals in the exa mp l e ab ove ) . Pr es s the !!@@OK#@ soft menu k ey r eturn to the calc ulator displa y . The number no w is s h ow n as: T his re sult , 1.2 3E2 , is the calculat or’s v ersio n of po w ers-o f- ten notatio n, i. e. , 1.2 3 5 x 10 2 . In this , so -called , sc ientif i c notation , the number 3 in fr ont of the Sc i number fo rmat (sho wn earli er ) r epre sents the number of signif icant f igur es after the dec imal point . S c ien tifi c notati on al wa y s inc ludes one integer f igur e as show n abo v e . F or this case , theref ore , the number of signif ican t fi gur es is f our . Θ Engineering f ormat T he engineering f ormat is v ery similar to the sc ie ntifi c f ormat , ex cept that the po w ers of t en ar e multiples of thr ee. T o set this for mat , start by pr essing the H button . Ne xt , use the do w n arr o w ke y , ˜ , to select the optio n Number for mat . Pr ess the @CHOOS sof t menu k ey and s elect the opti on Engineer ing w ith the arr o w do w n k ey ˜ . K eep the numbe r 3 in fr ont of the Eng . (T his number can be c hanged in the same f ashion that we c hanged the Fixe d number o f dec imals in an ear lier e x ample).
Pa g e 1 - 2 2 Pr es s the !!@@OK#@ soft menu k ey re turn to the calc ulator dis pla y . The n umber no w is s h ow n as: Becau se this number has thr ee fi gur es in the inte ger part, it is sho wn w ith fo ur signif icati v e fi gur es and a z ero po wer o f ten , while using the Engineer ing f ormat . F or e xample , the number 0.00 2 5 6, w ill be sho w n as: Θ Decimal c omma v s. dec imal point Dec imal poin ts in floating-po int number s can be r eplaced by co mmas, if the us er is mor e famili ar w ith suc h notati on. T o re place dec imal points f or commas , c hange the FM option in the CAL CULA T OR MODE S input for m to commas , as f ollo w s (Notice that w e ha v e changed the Numbe r F or mat to Std ): Θ Pr ess the H button . Ne xt , us e the dow n ar r o w k ey , ˜ , once, and the r ight arr ow k ey , ™ , hi ghlighti ng the option __FM, . T o select com mas, pr ess the @  @ CHK@@ s oft menu k e y . The input f or m will loo k as f ollo ws :
Pa g e 1 - 23 Θ Pr ess the !!@@OK#@ so ft menu k e y r eturn t o the calc ulato r displa y . The n umber 12 3 .4 5 6 7 8 9012 , enter ed earlier , no w is sho w n as: Angle M easur e T r igonometr i c func tions , for e xample , r equir e arguments r epr ese nting plane angles . T he calculat or pr ov ides thr ee differ ent Angle Measur e modes fo r wo rk in g wit h a ng l es, n am e ly: Θ Degr ee s : The r e ar e 360 degree s ( 360 o ) in a comple te c ir c umfer ence, or 90 degr ees ( 90 o ) in a r ight angle . This r e presentatio n is mainly us ed when doing ba sic geometry , mechani cal or stru ctur al engineer ing, and sur v e y ing. Θ R adians : T her e ar e 2 π r adians ( 2 π r ) in a complete c irc umfer ence , or π /2 r adians ( π /2 r ) in a r igh t angle . Th is notati on is mainl y used w hen sol v ing mathemati cs and ph y sic s pr oblems . This is the defa ult mode of the calc ulator . Θ Gr ades : The r e are 40 0 grades ( 40 0 g ) in a complete c i r c umfer ence , or 100 gr ades ( 100 g ) in a ri ght angle . T his not ation is similar to the degr ee mode , and wa s introdu ced in or der to “ simplify” the degr ee notation but is seld om used now . T he angle measur e affects the tr ig func tions lik e SI N, C OS , T AN and a ssoc i ated fu nct ion s. T o c hange the angle measur e mode, u se the f ollo w ing pr ocedure: Θ Pr es s the H but to n. Ne xt , use the do wn ar r o w ke y , ˜ , tw ice . Sele ct the Angle Measur e mode by eithe r using the \ k e y (second f r om left in the f ifth r ow f r om the k e yboar d bottom) , or pr essing the @CHOOS soft m enu
Pa g e 1 - 24 k e y . If u sing the lat t er appr oach , use u p and dow n arr ow k ey s , — ˜ , to se lect the pr ef err ed mode , and pr ess the !!@@OK#@ soft menu k e y to complete the ope r ation . F or e xample , in the follo w ing scr een, the R adians mode is selec ted: Coor dinate S y stem The coo r di na te sy ste m sel ectio n a ffect s th e way vect ors a nd c omp lex nu mbe rs ar e displa ye d and enter ed. T o lea r n mor e about comple x numbers and v ectors , see Chapter s 4 and 9 , re specti v ely . T w o - an d thr ee -d imensi onal v ector components and comple x numbers can be r epr esen ted in an y of 3 coo rdinat e sy stems: T he Carte sian ( 2 dimensional) or R ectangular ( 3 dimensional), C y lindri cal (3 dimensi onal) or P olar ( 2 dimensional), and Spher ical (only 3 dimensi onal) . In a Cartesi an or R ectangular coor d inat e s ys tem a point P w ill hav e thr ee linear coor dinates (x ,y ,z) measured f ro m the or igin along each o f three mu tually perpendi c ular ax es (in 2 d mode , z is as sumed to be 0) . I n a C y lindri cal or P olar coor dinate s ys tem the coor dinates of a point ar e giv en b y (r , θ ,z) , w her e r is a r adial distance measur ed fr om the or igin on the xy plane , θ is the angle that the r adial distance r f orms w ith the positi ve x ax is -- measur ed as po sitiv e in a count er c lockw ise dir e c ti on --, and z is the same as the z coor dinate in a Cartesi an s ys tem (in 2 d mode , z is as sumed to be 0) . T he Re ctangular and P olar sy stems ar e r elated b y the fo llow ing quantitie s: In a Spher ical coor dinate s ys tem the coor dinates of a po int are gi ven b y ( ρ,θ,φ ) wher e ρ is a radi al distance measur ed fr om the or igin of a C ar t esian s yst em, θ is an angle r epr esenting the angle for med by the pr ojec tion o f the linear distance ρ onto the xy ax is (same as θ in P olar coordinat es) , and φ is the angle 2 2 ) cos( y x r r x = ⋅ = θ ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ = ⋅ = − x y r y 1 tan ) sin( θ θ z z =
Pa g e 1 - 25 fr om the positi v e z ax is to the r adial dis tance ρ . T he Rec tangular and Spher ical coor dinate sy stems ar e re lated by the fo llo wi ng quantities: T o c hange the coordinat e s ys tem in y our calculat or , follo w these s teps: Θ Pr ess the H button . Ne xt, u se the do wn ar r ow k ey , ˜ , three time s. Select the Angle Measure mode b y either u sing the \ key ( se c on d fro m left in the fift h r o w fr om the k e y boar d bottom), or pr es sing the @ CHOOS soft menu k ey . If using the latt er appr oach , us e up and do w n arr ow k ey s, — ˜ , to se lect the pr efer r ed mode , and pr ess the !!@@OK # @ soft menu k ey to complete the oper ation . F or e xample , in the f ollo w ing sc reen , the P olar coor dinate mode is selec ted: Beep, K e y Clic k , and Last Stack T he last line of the CAL CUL A T OR M ODE S input f orm inc lude the options: _Beep _K ey Cli ck _L ast Stac k B y choo sing the c heck mar k ne xt to each o f these opti ons, the corr esponding option is ac ti vat ed. T hese optio ns ar e desc r ibed next: _Beep : W hen selec ted, , the calc ulator beeper is acti v e . This oper ation main l y app lies to err or m essages, but a lso some user fun c tions lik e BEEP . _K e y Cl ic k : When selec ted, eac h k ey str ok e produ ces a “ cli ck ” sound. ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ = ⋅ = ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ = ⋅ ⋅ = = ⋅ ⋅ = − − z y x z x y y z y x x 2 2 1 1 2 2 2 tan ) cos( tan ) sin( ) sin( ) cos( ) sin( φ φ ρ θ θ φ ρ ρ θ φ ρ
Pa g e 1 - 26 _L ast S tac k : K eeps the conten ts of the last st ack en tr y f or us e with the f unct ions UNDO and ANS (see C hapter 2). Th e _Beep option can be us ef ul to adv ise the user a bout err ors . Y ou may w ant to des elect this option if u sing yo ur calc ulator in a cla ssr oom or libr ary . Th e _K ey Cli ck opti on can be usef ul as an audible w a y to chec k that eac h k ey str oke w as enter ed as intended. Th e _Last S tack o p t i o n i s v e r y u s e f u l t o r e c o v e r t h e l a s t o p e r a t i o n i n c a s e w e need it f or a new calc ulatio n. T o selec t , or dese lect , an y of these thr ee options , fi rst pr ess the H butto n. Ne xt , Θ Us e the dow n arr o w ke y , ˜ , four times t o select the _L ast S tac k option . Use the @  @CHK@@ sof t menu ke y to chan ge the selection . Θ Pr es s the left ar r o w k ey š to select the _K e y Clic k option . Use the @ @CHK@@ soft menu ke y to c ha nge the sel ection. Θ Pr ess the le ft arr o w k e y š to select the _Beep opti on . Use the @  @CHK@@ sof t menu k e y to c hange the selection . Pre ss the !!@@OK # @ soft menu k ey to complete the oper ation . Selec ting CA S settings CA S stands f or C omputer A lgebrai c S y stem . T his is the mathemati cal cor e of the calc ulator w here the s ymboli c mathemati cal operati ons and f uncti ons ar e pr ogr ammed and per f ormed . The CA S off ers a n umber of settings can be adju sted accor ding to the t y pe of oper ation of inter est . Thes e are: Θ T he def ault independent var i able Θ Numer ic v s. s ymbo lic mode Θ Appr ox imate vs . Ex act mode Θ V e rbose vs. N on - verb ose mo de Θ S tep-by-s tep mode f or oper ations Θ Inc r easing po w er fo rmat f or pol yn omials Θ Rig oro us mo d e Θ Simplif icati on of non -r ational e xpr essi ons Details on the se lecti on of CA S settings ar e pre sented in A ppendix C.
Pa g e 1 - 27 Selec ting Displa y modes T he calculator dis play can be c ustomi z ed to y our pr ef er ence b y selecting dif f erent disp lay mod es . T o see the op tional di splay sett ings use the follow ing : Θ F irst , pr es s the H bu tton to acti v ate the CAL CULA T OR MODE S input f or m. W ithin the CAL CUL A T OR MODE S input fo rm , pr ess the @@DISP@ sof t me nu ke y to displa y the DISPLA Y MODE S input f orm . Θ T o na vi gate thr ough the many opti ons in the DISP L A Y MODE S input fo rm , use the ar r o w k e ys : š™˜— . Θ T o selec t or dese lect an y of the se ttings show n abo v e , that r equir e a c heck mark , selec t the underline be for e the option of inter est , and toggle the @  @CHK@@ soft menu k ey until the r ight setting is ac hie ved . When an opti on is selec ted , a chec k mark w ill be sho wn in the under line (e .g ., the T e xtbook option in the Stack : line abo ve). Unse lected options w ill sho w no c heck mark in the under line pr eceding the opti on of inter est (e .g ., the _Small, _F ull page , and _Indent options in the Ed i t : li ne abov e) . Θ T o selec t the F ont for the dis play , highligh t the fi eld in fr ont of the Fo n t : option in the DI SPLA Y MODE S input fo rm , and us e the @CHOOS soft me nu k ey . Θ A fter hav ing selec ted and unselec ted all the optio ns that y ou want in the DISPLA Y MODE S input fo rm , pres s the @@@OK@@@ soft menu k e y . This w ill tak e y ou bac k to the CAL CULA T OR MODE S input f orm . T o re turn to nor mal calc ulato r displa y at this point , pr ess the @@@OK@@@ soft menu k ey once mor e . Selec ting the displa y font Changing the f ont displa y allo ws y ou t o hav e the calculat or look and feel c han ged t o y our o wn liking . B y using a 6 -pi xel f ont , f or e x ample , y ou can displa y up to 9 s tac k lev els! F ollo w thes e instruc tions t o select yo ur display f ont: F irst , pr es s the H bu tton to ac tiv ate the CAL CUL A T OR MODE S input f or m. W ithin the CAL CUL A T OR MODE S input f orm , pr ess the @@DISP@ sof t menu k e y to displa y the DISPLA Y MOD E S input f or m. T he Fo n t : fi eld is highl ighted , and t he option Ft8_0:s ys tem 8 is selected. T his is the default v alue of the display f ont .
Pa g e 1 - 2 8 Pr essing the @ CHOOS so ft menu k e y w ill pr o vi de a list of a v ailable s y ste m fonts , as sho w n belo w: T he options a vaila ble ar e thr ee standar d Sys t e m Fo n t s (si z es 8, 7 , and 6 ) and a Br o wse .. opti on. T he latter w ill let y ou br o w se the calc ulator memory f or additional f onts that y ou may ha v e cr eated (s ee Chapte r 2 3) or do wnloaded into the calc ulator . Pr acti ce changing the displa y f onts to si z es 7 and 6 . P r ess the OK soft menu k e y to eff ect the selecti on . When done w ith a font s election , pr ess the @@@OK@@@ sof t menu k e y to go back to the CAL CULA T OR MODE S in put fo rm . T o re turn to nor mal calc ulator displa y at this po int , pre ss the @@@OK@@@ soft men u k e y once mor e and see ho w the stac k display c hange to accommodate the diff er ent font . Selec ting pr operties of t he line editor F irst , pr es s the H bu tton to ac tiv ate the CAL CUL A T OR MODE S input f or m. W ithin the CAL CUL A T OR MODE S input f orm , pres s the @@DIS P@ soft men u k e y to displa y the DISPLA Y MODE S input f orm . Pr ess the do wn ar r o w k e y , ˜ , once , to get to the Ed i t line . T his line sho ws thr ee pr operties that can be modif ied. When thes e pr oper ti es ar e selec ted (chec k ed) the f ollo w ing eff ects ar e acti v ated: _Small Changes f ont si z e to small _F ull page Allo ws to place the c urs or after the end o f the line _Inde nt Auto intend c ursor w hen entering a carriage r eturn Detailed instructions on the use of the line editor ar e presented in C hapter 2 in this guide . Selec ting pr operties of th e Stack F irst , pr es s the H bu tton to ac tiv ate the CAL CUL A T OR MODE S input f or m. W ithin the CAL CUL A T OR MODE S input f orm , pr ess the @@DISP@ sof t menu k e y to
Pa g e 1 - 2 9 displa y the DISPLA Y MODE S input f orm . Pr ess the do wn ar r ow k e y , ˜ , tw i ce , to get to the Stack line . This line show s two pr operties that can be modif ied . When thes e pr oper ti es ar e selec ted (chec k ed) the f ollo w ing eff ects ar e acti v ated: _Small Changes f ont si z e to small . T his max imi z ed the amount of informat ion displ a yed on th e scr een. Note, this sel ection o ver r ides the f ont selec tion f or the stac k display . _T e xtbook Display mathe matical e xpre ssions in gr aphical mathematical notati on T o illustr ate the se settings , either in algebr a i c or RPN mode , use the equati on wr i ter to type the f ollo w ing definite integral: ‚O…Á0™„虄¸\x™x` In Algebr aic mode , the follo wing s cr e e n show s the r esult of thes e k e ys tr ok es w ith neithe r _Small nor _T extbook ar e selected: W ith the _Small option selected onl y , the display looks as sho wn belo w : W ith the _T e xtbook op tion selected ( def ault value) , regardless of whether the _Small optio n is selected or not , the dis play sho ws the f ollo wing r esult: Selec ting pr operties of th e equation w riter (EQW) F irst , pr es s the H bu tton to ac tiv ate the CAL CUL A T OR MODE S input f or m. W ithin the CAL CUL A T OR MODE S input fo rm , pr ess the @@DISP@ sof t me nu k ey to displa y the DISPLA Y MODE S input for m. Pr ess the do wn arr ow k ey , ˜ , thr ee
Pa g e 1 - 3 0 times , to ge t to the EQW (E quati on W rit er ) line . This line sho w s tw o pr oper ti es that can be modif ied . When thes e properti es ar e select ed (chec k ed) the fo llo w ing eff ects ar e acti vated: _Small Changes f ont si z e to small w hile using the equati on edito r _Small S tac k Disp Sho w s small font in the s tack f or te xtbook sty le display Detailed instr ucti ons on the use of the equation editor (E QW) are pr esented else w her e in this manual . F or the ex ample of the integr al , pr es ented abo v e , selecting the _Small S tac k Disp in the EQ W line of the DISPLA Y MODE S input for m pr oduces the f ollo w ing displa y : Selec ting the si ze of the header F irst , pr es s the H bu tton to ac tiv ate the CAL CUL A T OR MODE S input f or m. W ithin the CAL CUL A T OR MODE S input f orm , pr ess the @@DISP@ sof t menu k e y to displa y the DISP L A Y MODE S input f orm . Pr es s the do wn ar r o w k e y , ˜ , four times , to get to the Heade r line . T he value 2 is assigned to the H eader fi el d by def ault . T his means that the top part of the dis play w ill cont ain two l ines, one sho w ing the c urr ent settings of the calc ulator , and a second one sho w ing the c urr ent sub dir ectory w ithin the calc ulator ’s memory (Thes e lines w er e desc r ibed earli er in the manual) . T he user can se lec t to change this setting to 1 or 0 to r educe the number o f header lines in the display . Selec ting the cloc k displa y F irst , pr es s the H bu tton to ac tiv ate the CAL CUL A T OR MODE S input f or m. W ithin the CAL CUL A T OR MODE S input f orm , pr ess the @@DISP@ sof t menu k e y to displa y the DISP L A Y MODE S input f orm . Pr es s the do wn ar r o w k e y , ˜ , four times , to get to the Header line . T he He ade r f ield will be hi ghlighted . Use the ∫ ∞ − 0 dX e X
Pa g e 1 - 3 1 r ight arr ow k ey ( ™ ) to select the under line in fr ont of the options _C lock or _Analog . T oggle the @  @CHK@@ soft menu k e y until the desir ed setting is ac hie v ed. If the _Cloc k option is se lected , the time of the da y and date w ill be sho wn in the upper ri ght corner of the display . If the _Analog opti on is also s elected, an analog c loc k, r ather than a digit al c lock , w ill be sho w n in the upper ri ght cor ner of the displa y . If the _Cloc k option is not s elected , or the header is not pr esent , or too small , the d ate and time of day w ill not be sho wn in the displa y .
Pa g e 2- 1 Chapter 2 Intr oducing th e calculator In this c hapter we present a n umb er of basi c oper ations of the calculator inc luding the use of the E quation W r iter and the manipulation of data obj ects in the calc ulator . Stud y the ex amples in this chapt er to get a good gr asp of the capab ilities of the calc ulator f or futur e applicati ons. Calculator objec ts An y number , expr es sion , char acter , var iable , etc ., that can be c r eated and manipulated in the calc ulator is r ef err ed to as an obj ect . So me of the most use ful ty pe of obj ects ar e listed be low . Real . Thes e objec t r epr esents a number , po siti ve or negati v e , w ith 12 signif i cant digits and an e xponent r anging fr om - 4 99 to 4 9 9 . ex ample of r eals are: 1., -5 . , 5 6.415 64 1. 5E4 5, -5 5 5 .7 4E -9 5 When enter ing a r eal number , yo u can u se the V k ey to enter the e xponent and the \ k ey to c hange the sign of the e xponent or mantissa. Note that r eal mus t be enter ed w ith a dec imal point , ev en if the number does not hav e a fr ac tional part . Other w ise the number is tak en as an int eger number , w hic h is a differ ent calculat or obj ects. R eals beha ve as y ou wo uld e xpect a number to w hen us ed in a mathemati cal oper ation . Integers . T hese ob jects r epre sent int eger numbers (number s w ithout fr actional part) and do not hav e limits (e x cept the memory of the calc ulator ). Example o f i nte g ers are : 1 , 5646541 12 , - 4 13 1 6 546 7 354646 7 6 54654 8 7 . N ote h o w thes e numbers do n ot hav e a dec imal poin t . Due to their s tor age for mat , integer number s ar e alw a ys maintain f ull prec ision in their calc ulation . F or e x ample , an op e rati on such as 3 0/14, w ith integer number s, w i ll r eturn 15/7 and not 2 .14 2…. T o for ce a r eal (or floating-po int) r esult , use f uncti on  NUM ‚ï . Integers ar e used fr equentl y in CAS - based func tions as the y ar e designed to k eep full pr ecisi on in the ir operati on . If the appr o ximate mode ( AP PR O X) is select ed in th e CAS (s ee Appendi x C) , integers w ill be automaticall y conv erted to r ea ls . If y ou ar e not planning to use
Pa g e 2- 2 the CA S, it mi ght be a good i dea to s w itch dir ectl y into appr o x imate mode . R efe r to Appendi x C f or mor e details . Mi x ing integers and reals together or mi s takin g an integer for a r eal is a common occ urr ence . Th e calc ulator w ill det ect su ch mi x ing o f obj ects and ask y ou if y ou w ant to s w itch t o appr o x imate mode . Complex numbers , ar e an e xtensio n of r eal numbe rs that inc lude the unit imaginar y n umber , i 2 = -1. A comple x number , e .g ., 3 2i , is w ritt en as (3, 2) in the calc ulator . Comple x number s can be displa y ed in either C artesian o r polar mode depending on the setting selec ted. Not e that complex n umbers ar e alw ay s stor ed in Cartesian mode and that onl y the d i splay is aff ected . T his allo ws the calc ulator to k eep as much pr ec isio n as possible dur ing calculati ons. Most mathemati cs func tions w ork on comple x number s. T her e is no need to use a spec ial “ comple x “ functi on to add comple x numbers , y ou can u se the same functi on that on reals or intege rs . V ect or and matri x oper ations utili z e objects o f type 3, real arr a ys , and , if needed , type 4 , complex ar ra y s . Obj ects ty pe 2 , strings , ar e simply lines o f te xt (enc losed be t w een quote s) pr oduced w ith the alphanumer ic k ey boar d . A list is jus t a collecti on of obj ects enc losed betw een c ur ly br ac k ets and separ ated b y space s in RPN mode (the space k ey is labe led # ), o r b y commas in algebr aic mode . L ists, ob jec ts of type 5, can be ve r y us ef ul whe n pr ocessing collec tions o f number s. F or ex ample, the columns o f a table can be enter ed as lists . If pr efer r ed , a table can be enter ed as a matr i x or arr a y . Obj ects type 8 ar e pr ogra ms in Us er RP L language . The se ar e simpl y sets o f instr ucti ons enclos ed between the s ymbols << >>. Asso c iated w ith pr ograms ar e object s types 6 and 7 , Global and Local Nam es , res pe ct ively . The se na m es, or va riab le s , ar e used t o stor e any ty pe of objec ts . T he concept of global or local names is r elated to the scope or r each of the v ari able in a gi ven pr ogr am. An alg ebr aic object , or simpl y , an algebraic (obj ect of t y pe 9), is a v ali d algebr aic e xpr essi on enc losed w ithin quotati on or ti ck mar ks.
Pa g e 2- 3 Binary integ ers , obje cts of t ype 10 , are used i n some computer sc ienc e applicati ons. Graphics objec ts , ob jec ts of type 11, st or e graphi cs pr oduced by the calc ulator . T agg ed objects , obj ects of t y pe 12 , ar e us ed in the output of man y pr ograms t o identify r esults . F or ex ample, in the tagged objec t: Mean: 2 3 .2 , the w ord Mean: is the tag used to i dentify the number 23 . 2 as the mean of a sample , fo r exa mp l e. Unit objec ts , objects of t y pe 13, ar e numer ical v alues w ith a ph y sical unit attached to them . Directories , objec ts of type 15, ar e memor y locati ons us ed to organi z e y our v ari ables in a similar f ashi on as fo lders ar e used in a personal com puter . Libr aries , obj ects o f t y pe 16 , ar e pr ogr ams r esi ding in memory por ts that ar e access ible within an y direc tory (or sub-direc tory) in y our calculat or . The y re se m bl e built-in functi ons , objec ts of ty pe 18, and built-in commands , obj ects of type 19 , in the wa y the y are u sed . Editing e xpres sions on th e s c r een In this secti on w e pr esent e xamples of expr es sion editing dir ectly into the calc ulator dis play (algebr a i c history or RPN stac k) . Creating ar ithmetic expr essions F or this e xample , w e selec t the Algebr aic oper ating mode and select a Fix fo rmat w ith 3 dec imals fo r the displa y . W e ar e go ing to ent er the ar ithmetic ex p ress io n : T o ente r this expr essi on use the f ollo w ing k e ys tr ok es: 5.*„Ü1. 1./7.5™/ „ÜR3.-2.Q3 3 0 . 2 0 . 3 5 . 7 0 . 1 0 . 1 0 . 5 − ⋅
Pa g e 2- 4 T he r esulting e xpr essi on is: 5.*(1. 1./7.5)/( √ 3.-2.^3). Press ` to get the e xpr essi on in the displa y as fo llo ws: Notice that , if your CA S is s et to EXA CT (see Appe ndi x C) and you en ter y our e xpr es sion us ing integer number s for in teger v alues , the r esult is a s y mbolic quantity , e . g ., 5*„Ü1 1/7.5™/ „ÜR3-2Q3 Bef or e pr oducing a r esult , y ou w ill be ask ed to change to Appr o x imate mode . Accept the change t o get the follo wing r esult (sho w n in F i x dec imal mode w ith thr ee dec imal places – see C hapter 1): In th is case , when the e xp r ession i s enter ed di r e c tly into the stack . A s soon as y ou pr ess ` , the calc ulator w ill attempt t o calculat e a value f or the e xp r ession . If t he e xpression is enter ed between quotes, ho we ver , the calculator w ill repr oduce the expr ession as ent er ed. In the f ollo w ing ex ample, w e ent er the same e xpr essi on as abov e, but using quote s. F or this case w e set the oper ating mode to Algebr aic , the CA S mode to Ex act (deselec t _Appr ox ), and the display set ting to T extbook . The k e ys tr ok es to enter the e xpre ssion ar e the fo llo w ing: ³5*„Ü1 1/7.5™/ „ÜR3-2Q3` T he r esult w ill be sho wn as f ollo w s:
Pa g e 2- 5 T o e valuat e the e xpr essi on w e can us e the EV AL functi on , as f ollo ws: μ„î` As in the pr ev ious e xample , yo u wi ll be ask ed to appr ov e c hanging the CAS setti ng to Appr o x . Once this is done , y ou w ill get the same r esult as bef or e . An alte rnati v e wa y to e valuat e the e xpr essi on enter ed earli er between qu otes is b y using the opti on …ï . T o r eco v er the expr ession f r om the e xis ting st ack , us e the fo llo w ing k e y str ok es: ƒƒ…ï W e w ill no w ent er the e xpr essi on us ed abo ve w hen the calc ulator is se t to the RPN oper ating mode . W e also set the CA S to Ex act and the dis play to T extbook . The k e y str ok es to enter the e xpre ssion betw een quotes are the s ame used earli er , i .e ., ³5*„Ü1 1/7.5™/ „ÜR3-2Q3` R esulting in the output Press ` once mor e to keep two copi es of the e xpr essi on av ailable in the stac k f or ev aluation . W e f ir st e valuate the e xpr essi on using the f unctio n EV A L , and ne xt using the functi on  NUM . Her e ar e the step s explained in det ail: F irs t , ev aluate the expr essi on using func tion EV AL. The r esulting expr ession is semi-s y mbolic in the s ense that ther e ar e floating-po int components to the r esult , as w ell as a √ 3 . Next , w e s witc h stac k locations and e valuat e using functi on  NUM: ™ Ex change s tac k lev els 1 and 2 (the S W AP command) …ï Evaluate using fun ction  NUM
Pa g e 2- 6 T his lat t er r esult is pur el y numer ical , so that the two r esults in the stac k, although r epr esenting the same e xpr essi on, seem diff er ent . T o ver ify that they ar e not, w e subtr act the tw o values and e v aluate this differ ence using f uncti on EV AL: - Subtr act le v el 1 fr om lev el 2 μ Evalua te usin g funct i on EV A L Th e re su l t i s ze ro (0 . ) . Editing arithmetic e xpr essions Suppos e that we ent er ed the fo llo wing e xpr es sion , between q uotes , w ith the calc ulato r in RPN mode and the CAS se t to EX A CT : r ather than the intended e xpre ssi on: . T he incorr ect e xpr es sion was e nt ered by us in g : ³5*„Ü1 1/1.75™/ „ÜR5-2Q3` T o enter the line editor use „˜ . T he display no w look s as f ollo ws: Not e : A v oid mi xi ng integer and r eal data to av o id confli cts in the calc ulations . F or many ph ysi cal sc ience and engineer ing appli cations , inc luding numer ical soluti on of equati on, s tatisti cs appli cations , etc., the APP RO X mode (see Appendi x C) w orks better . F or mathematical appli catio ns, e .g ., calc ulus , vec tor anal ysis , algebra , etc ., the EX A CT mode is pre fer r ed . Become acquainted w ith oper ations in bo th modes and lear n ho w to s witc h fr om one to the other fo r differ ent type s of oper ations (s ee Appendi x C) . 3 2 3 5 . 7 1 1 5 − ⋅
Pa g e 2- 7 T he editing cur sor is sho wn a s a blinking left arr o w ov er the f irs t char acter in the line to be edited. Since the editing in this case consists of r emov ing some c har acte rs and r eplac ing them w ith others , w e w ill use the r i ght and left ar r o w keys, š™ , to mo ve the c urs or to the a ppr opri ate place f or editing , and the delete k ey , ƒ , to eliminate charac ters. T he follo wing k e y str oke s will complet e the editing for this cas e: Θ Pr ess the r ight ar r ow k e y , ™ , until the c urso r is immediatel y to the r igh t of the dec imal point in the ter m 1.7 5 Θ Pr es s the delete k e y , ƒ , tw ice to er ase the char acters 1. Θ Pr es s the ri ght arr ow k e y , ™ , once, to mo ve the curs or to the ri ght of the 7 Θ T ype a dec imal p o int w ith . Θ Pr ess the r ight ar r ow k e y , ™ , until the c urso r is immediatel y to the r igh t of t he √ 5 Θ Pr es s the delete k e y , ƒ , once to era se the Char acter 5 Θ T ype a 3 wi t h 3 Θ Press ` to retur n to the stac k T he edited e xpr essi on is no w a vail able in the stac k. E diting of a line o f input w hen the calc ulator is in A lgebrai c oper ating mode is e x actly the same as in the RPN mode. Y ou can r epeat this e xample in Algebr aic mode to v er i f y this a sser ti on. Creating algebraic e xpressions Algebr aic e xpre ssions inc lude not onl y numbers , but also v ar iable name s. As an e xample , we w ill enter the f ollo w ing algebr aic e xpr essi on: b L y R R x L 2 1 2
Pa g e 2- 8 W e set the calc ulator oper ating mode to Algebr aic , the CA S to Exac t , and the displa y to T e xtbook . T o ente r this algebr aic e xpr es sion w e us e the foll ow ing keys tro kes : ³2*~l*R„Ü1 ~„x/~r™/ „ Ü ~r ~„y™ 2*~l/~„b Press ` to get the follo w ing resul t: Enter ing this e xpr essi on when the calc ulator is s et in the RPN mode is e xactl y the same as this A lgebr aic mode e xe r c ise . Editing algebr aic ex pressions E diting of an algebr aic e xpr essi on w ith the line editor is ve r y similar to that of an ar ithmetic e xpr essi on (see e xe rc ise abo v e) . Suppose that w e wan t to modify the e xpression enter ed ab o v e to r ead T o edit this algebr aic e xpr essi on using the line edit or use „˜ . T his acti v ates the l ine editor , sho wing the e xpr essi on to be edit ed as f ollo w s: T he editing c urs or is sho w n as a blinking left arr o w ov er the fir st char acter in the line to be edite d . As in an ear lier ex er cis e on line editing, w e w ill use the r ight and left arr o w k e ys , š™ , to mo v e the cu rsor to the appr opr iate place fo r editing, and the delet e k ey , ƒ , to eliminate char acters . T he follo wing k e y str oke s will complet e the editing for this cas e: b L x R R x L 2 1 2 2
Pa g e 2- 9 Θ Pr es s the ri ght arr ow k e y , ™ , until the c ursor is to the r ight of the x Θ Ty p e Q2 to enter the pow er 2 for the x Θ Pr es s the ri ght arr ow k e y , ™ , until the c ursor is to the r ight of the y Θ Pr es s the delete k e y , ƒ , once to era se the c harac ter s y. Θ Ty p e ~„x to enter an x Θ Pr es s the ri ght arr o w k e y , ™ , 4 times to mo ve the cu rsor t o the ri ght of the * Θ Ty p e R to enter a sq u ar e r oot sy mbol Θ Ty p e „Ü to enter a set of p a r entheses (the y come in pair s) Θ Pr es s the r ight ar r o w k e y , ™ , once , and the delete k ey , ƒ , once , to delete the r ight par enthe sis of the set inserted abo ve Θ Pr es s the ri ght arr o w k e y , ™ , 4 times to mo ve the cu rsor t o the ri ght of the b Θ Ty p e „Ü to enter a second set of par entheses Θ Pr es s the delete k ey , ƒ , once , to delet e the left par enthesis of the s et inserted abo v e . Θ Press ` to r eturn t o normal calc ulator displa y . The r esult is show n ne xt: Notice that the e xpr es sion has been e xpanded to include t erms suc h as |R|, the abs olute value , and SQ (b ⋅ R) , the s quar e of b ⋅ R . T o see if w e can simplify this re sult , use F A CT OR(ANS(1)) in AL G mode: Θ Press „˜ to acti vate the line editor once mor e. T he re sult is now :
Pa g e 2- 1 0 Θ Pr essing ` once more to r eturn to normal display . T o see the entir e e xpr essi on in the sc r een, w e can change the optio n _Small Stack Di sp in the DIS P L A Y M ODE S input f or m (see Chapter 1) . After eff ecting this change , the display w ill look as follo ws: Using the Equation W riter (E QW ) to create e xpressions T he equation w rit er is an extr emel y po w erful tool that not onl y let yo u enter or see an equati on, bu t also allo ws y ou to modif y and w ork/appl y functi ons on all or part of the eq uation . The equati on w rit er (E QW) , ther ef or e , allo w s y ou to perfor m complex mathe matical oper ations , dir ectl y , or in a step-b y-step mode , as y ou w ould do on paper w hen sol v ing, f or ex ample , calc ulus pr oblems . T he E quati on W rit er is launc hed by pr essing the k ey str ok e combinati on … ‚O (the thir d ke y in the fourth r o w fr om the top in the ke yboar d) . T he r esulting sc r een is the fo llo w ing: Not e : T o use Gr eek letter s and other char acter s in algebrai c e xpr essi ons us e the CHAR S menu . This men u is acti vat ed by the k e ys tr ok e combinati on …± . Details ar e pr esent ed in A ppendi x D .
Pa g e 2- 1 1 T he six s oft menu k ey s f or the E quation W rit er acti vat e the follo wing f uncti ons: @EDIT : lets the u ser edit an entry in the line editor (see e x amples abo ve) @CURS : hi ghlights e xpr essi on and adds a graphi cs c urs or to it @BIG : if se lected (se lecti on sho wn b y the char acter in the label) the f ont us ed in the w riter is the s y stem f ont 8 (the large st fo nt av ailable) @EVAL : le ts y ou ev aluate , s y mbolicall y or numer icall y , an expr essi on highlighted in the equation w riter s cr een (similar to …μ ) @FACTO : le ts y ou f actor an e xpr es sion hi ghligh ted in the eq uation w r iter s cr een (if fa ctor ing is po ssible) @SIMP : le ts y ou simplif y an e xpr essi on highlighted in the equati on wr iter sc r een (as mu ch as it can be simplif ied accor ding to the algebrai c rule s of the CA S) If y ou pr ess the L k e y , tw o m or e soft m enu options show up as show n bel o w : T he six s oft menu k ey s f or the E quation W rit er acti vat e the follo wing f uncti ons: @CMDS : allo ws acces s to the collecti on of CA S commands listed in alphabeti cal or der . T his is usef ul to inse rt CAS commands in an e xpr essi on av ailable in the E quation W riter . @HELP : ac ti vate s the calc ulator’s CA S help fac ilit y t o pro vi de infor mation and e xam ples of CA S commands. Some e xample s for the u se o f the Eq uation W rit er ar e sho wn belo w . Creating ar ithmetic expr essions Enter ing arithmeti c e xpr essi ons in the E quati on W rit er is very similar to ent er ing an arit hmetic e xpr es sion in the st ack enc losed in q uotes . The main diff er ence is that in the Eq uation W r iter the e xpr essi ons produced ar e wr it ten in “te xtbook” styl e instead of a line -entry style . Thu s, w hen a di visi on sign (i .e., / ) is enter ed in the E quati on W rit er , a f r acti on is gener ated and the c ursor placed in the numer ator . T o mo ve t o the denominat or y ou mu st us e the dow n arr o w k e y . F or ex ample , try the follo wing k e y str ok es in the E quation W r iter s cr een: 5/5 2
Pa g e 2- 1 2 T he r esult is the e xpr essi on T he c ursor is sho w n as a left-fac ing ke y . T he c urso r indicat es the c ur ren t edition location . T yp ing a char act er , functi on name , or oper ation w ill enter the cor re sponding char acter or c har acter s in the cur sor location . F or e xample , for the c ursor in the location indi cated abo v e , type no w : *„Ü5 1/3 T he ed ited e xpr essi on looks as follo ws: Suppose that y ou w ant to repla ce the quantit y betw een parentheses in the denominato r (i .e ., 5 1/3) w ith (5 π 2 /2) . F irst , w e use the delete k e y ( ƒ ) delete the c urr ent 1/3 expr essi on, and the n we r eplace that fr actio n w ith π 2 /2 , as fo llo ws: ƒƒƒ„ìQ2 When w e hit this point the sc r een looks as f ollo w s: In or der to insert the denominator 2 in the e xpr essi on, w e need to highli ght the entir e π 2 e xpr essi on. W e do this b y pr essing the r ight arr o w ke y ( ™ ) once . At that point , we enter the f ollo wing k ey str oke s: /2 The e x pr ession no w looks as f ollo ws:
Pa g e 2- 1 3 Suppos e that no w y ou w ant to add the fr ac tion 1/3 to this entir e expr ession , i .e ., y ou wan t to en ter the e xpr es sion: F i r st , w e need to hi ghlight the entir e f ir st ter m b y using ei ther the r ight ar r o w ( ™ ) or the upper arr o w ( — ) ke ys , r epeatedly , until the entir e e xpr essio n is highli ghted , i .e., s ev en times, pr oduc ing: Once the e xpr essi on is highli ghted a s sho wn a bov e, ty pe 1/3 to add the fr acti on 1/3 . R esulting in: NO TE : Alter nati v ely , fr om the or iginal positi on of the c u r sor (t o the r ight o f the 2 in th e denomina tor of π 2 /2) , w e can us e the k e ys tr ok e combinati on ‚— , interpr ete d as ( ‚ ‘ ). 3 1 ) 2 5 ( 2 5 5 2 ⋅ π
Pa g e 2- 1 4 Sho wing the expression in smaller -siz e T o sho w the expr es sion in a smaller -si z e font ( whi c h could be u sef ul if the e xpr essi on is long and con vo luted), simply pr ess the @BIG soft menu k ey . F or this case, the scr een lo oks as follo ws: T o r ecov er the larger -font displa y , pr ess the @BIG soft me nu k e y once mor e. Ev aluating the expr ession T o e valuat e the expr essi on (or parts of the e xpr essi on) w ithin the E quati on W r iter , highlight the par t that y ou w ant to e valuate and pr ess the @EVAL sof t menu k ey . F or ex ample , to ev aluate the entir e e xpre ssio n in this e xer c is e , fir st , highli ght the entir e e xpre ssion , b y pre ssing ‚ ‘ . Then , pr ess the @EVAL s oft menu k e y . If y our calculator is set to Ex act CAS mode (i .e ., the _A ppr o x CAS mode is not c heck ed) , then y ou w ill get the f ollo w ing s y mbolic r esult: If y ou w ant to r ecov er the une valuated e xpr essi on at this time , use the f uncti on UNDO , i.e ., …¯ (the fir st k e y in the thir d r ow o f k e ys fr om the top of the k e yboar d) . The r eco ve re d expr es sion is sho wn hi ghlighted as be for e:
Pa g e 2- 1 5 If y ou w ant a floating-po int (numer ical) e v aluation , us e the  NUM fu nct ion (i .e ., …ï ) . T he r esult is as follo ws: Use the function UNDO ( …¯ ) on c e m ore t o rec ov er t h e o ri g in a l ex p ress io n : Ev aluating a sub-e xpression Suppos e that y ou w ant to ev a luat e only the e xpre ssio n in pare ntheses in the denominator o f the fir st f rac tion in the e xpr essi on abo v e . Y ou hav e t o use the arr ow k ey s t o select that partic ular su b-e xpre ssio n. Her e is a wa y to do it: ˜ Hi ghlights onl y the fir st fr action ˜ Hi ghlights the n umer ator of the f irs t fr acti on ™ Hi ghlights denominato r of the fir st f r action ˜ Hi ghlights f irs t term in denominator o f fir st fr action ™ Hi ghlights second t erm in denominator o f firs t fr acti on ˜ Hi ghlights f irs t fact or in second ter m in denominator of f irst f r acti on ™ Hi ghlights e xpres sion in par enthese s in denominator of f irst f r action Since this is the sub-e xpr essi on w e want e v aluated, w e can now pr es s the @EVAL soft men u k e y , re sulting in:
Pa g e 2- 1 6 A s ymboli c ev aluation once mor e. Suppo se that , at this point , w e want to e valuate the left-hand side fr acti on onl y . Pr ess the upper ar r o w ke y ( — ) thr ee times to selec t that fr acti on, r esulting in: Then , pres s the @EVAL so f t menu k ey to obtain: Let ’s tr y a numer ical ev aluation o f this term at this po int . Use …ï to obtain: Let ’s highli ght the fr acti on to the ri ght , and obtain a numeri cal ev aluati on of that ter m too , and sh ow the sum of thes e tw o dec imal v alues in small-f ont f orm at b y using : ™ …ï C , w e get: T o highli ght and ev aluate the e xpres sion in the E quati on W rit er we use: — D , r esulting in:
Pa g e 2- 1 7 Editing arithmetic e xpr essions W e w ill show s ome of the editing featur es in the E quation W riter as an e x erc ise . W e start b y enter ing the follo wi ng expr essi on used in the pr e v iou s ex er c ises: And w ill use the editing f eatur es of the E quati on E ditor to tr ansfo rm it into the fo llo w ing expr essio n: In the pr e v iou s ex erc ises w e used the arr o w k e ys t o highligh t sub-e xpr essi ons f or e valuati on. In this ca se , w e w ill u se them to tri gger a spec ial editing cur sor . After y ou hav e f inished enter ing the ori ginal e xpr essi on, the t y ping c ursor (a left- pointing ar ro w) w ill be located to the r ight of the 3 in the denominator of the second f rac tion as show n her e:
Pa g e 2- 1 8 Pr es s the do wn ar r o w k e y ( ˜ ) to tri gger the c lear editing c ursor . The s cr e en no w looks like this: B y using the le f t ar r o w ke y ( š ) y ou ca n mo ve the c urs or in the gener al left dir ecti on , but stopp ing at each indi vi dual component of the e xpr essi on . F or e xam ple , suppose that w e will f irst w ill transf orm the e x pr essi on π 2 /2 into the ex p ress io n LN( π 5 /3) . With the c lear c urs or acti v e , as sho wn a bo ve , pre ss the left -ar r o w k ey ( š ) tw ice t o highlight the 2 in the den ominator of π 2 /2 . Ne xt , pr ess the delet e k ey ( ƒ ) once to change the c ursor in to the ins ertion c ursor . Press ƒ once mor e to delete the 2 , and then 3 to enter a 3. At th is point, the sc r een looks as f ollow s: Ne xt , pr ess the do w n arr ow k ey ( ˜ ) t o tri gger the clear editing c u r sor highli ghting the 3 in the denominator o f π 2 /3 . Pr ess the le ft arr o w k e y ( š ) once to hi ghlight the expo nent 2 in the expr essi on π 2 /3 . Ne xt , pre ss the delete key ( ƒ ) once to change the c ursor into the insertion c urs or . Pres s ƒ once mor e to delete the 2 , and then 5 to ent er a 5 . Pr ess the upper ar r o w k ey ( — ) three time s to highli ght the e xpr essi on π 5 /3 . Then , t y pe ‚¹ to apply th e LN f uncti on to this e xpr essi on . The s cr een no w looks lik e this: Ne xt , we ’ll change the 5 w ithin the par enthes es to a ½ b y using thes e k ey str ok es: šƒƒ1/2 Ne xt , we hi ghlight the entir e e xpr ession in par e ntheses an inser t the sq uare r oot s ymbol b y using: ————R
Pa g e 2- 1 9 Ne xt , we ’ll conv ert the 2 in f r ont of the parenth eses in the denominator into a 2/3 by using: šƒƒ2/3 At this point the e xpr essi on looks as f ollo w s: T he final step is to r emo ve the 1/3 in the r i ght-hand side of the e xpr ession . T his is accomplished by u sing: —————™ƒƒƒƒƒ T he final v ersi on w ill be: In summar y , to edit an e xpres sion in the Equati on W r iter y ou should use the arr o w k e y s ( š™—˜ ) to highli ght e xp r essi on to w hic h func tions w ill be applied (e .g., the LN and squar e r oot cases in the e xpre ssio n abo ve). Use the do wn ar r o w k e y ( ˜ ) in an y location , r epeatedl y , to tri gger the c lear editing c ursor . In this mod e , use the left or r ight ar r o w k e y s ( š™ ) to mo ve fr om term to ter m in an e xpr essi on . When y ou r eac h a point that y ou need to edit , use the delete k ey ( ƒ ) to tr igger the ins ertion c urs or and pr oceed w ith the editi on of the e xpr essi on . Creating algebraic e xpressions An algebr aic e xpr essi on is v er y similar t o an arithmeti c e xpr essi on, e x cept that English and Gr eek letter s ma y be inc luded . T he pr ocess o f cr eating an algebr aic e xpr essi on , ther efo r e , follo ws the same i dea as that of cr eating an ar ithmetic e xpr es sion , ex cept that use of the alphabeti c k e yboar d is included . T o illustr ate the use of the E quati on W riter to en ter an algebrai c equation w e w ill use the f ollo w ing ex ample . Suppose that w e want t o enter the expr ession: ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ Δ ⋅ ⋅ − 3 / 1 2 3 2 θ μ λ μ y x LN e
Pa g e 2- 2 0 Use t he fo llow ing k ey str ok es: 2 / R3 ™™ * ~‚n „¸\ ~‚m ™™ * ‚¹ ~„x 2 * ~‚m * ~‚c ~„y ——— / ~‚t Q1/3 T his re sults in the output: In this e xample w e us ed se ve ral lo we r -case English lett ers , e .g., x ( ~„x ), se ver a l Gr eek letters, e .g., λ ( ~‚n ) , and e v en a combinati on of Gr eek and English letters , namely , Δ y ( ~‚c~„y ) . K eep in mind that to enter a lo w er -case English lett er , you need to u se the combinati on: ~„ fo llo w ed by the letter y ou want to ent er . Also , y ou can alw ay s cop y spec ial c har acter s b y using the CHAR S menu ( …± ) if yo u don’t want to memor i z e the k e y str ok e combinati on that pr oduces it . A lis ting of commonl y us ed ~‚ k e y str ok e combinati ons w as list ed in an earlie r secti on . The e xpres sion tree T he expr essi on tr ee is a diagr am sho w ing ho w the E quati on W r iter inte rpr ets an e xpre ssi on. See Appendi x E for a detailed e x ample . The CURS func tion Th e CU RS fu nc tio n ( @ CURS ) in the E quati on W riter men u (the B key) c onve r t s the displa y into a gra phical dis play and pr oduce s a gra phical c urso r that can be contr olled wi th the arr o w k e y s ( š™—˜ ) f or select ing sub- e xpr es sion s. T he sub-e xpr essi on s elected w ith @CURS will be sho w n fr amed in the gr aphi cs displa y . After selec ting a sub-e xpr essi on y ou can pr ess ` to sho w the sel ected sub- expr essi on highligh ted in the E quati on wr iter . The f ollo win g f igur es sho w differ ent sub-e xpr essio ns select ed w ith and the cor r esponding E quation W riter s cr een after pr essing ` .
Pa g e 2- 2 1 Editing algebr aic ex pressions T he editing o f algebrai c equati ons follo ws the same r ules as the editing of algebr aic equati ons. Namely : Θ Us e the arr ow k ey s ( š™—˜ ) t o highli ght e xpr essi ons Θ Use the do w n arr o w k ey ( ˜ ), repeatedl y , to tr igger the cl ear editing c ursor . In this mode , use the left or r i ght arr ow k ey s ( š™ ) to mov e fr om t erm to te rm in an e xpr essi on . Θ At an editing point , use the delete k ey ( ƒ ) to tr igger the insertio n c ursor and pr oceed with the editi on of the e xpr es sion . T o see the c lear editing c ursor in ac tion , let’s s tart with the algebr aic e xpr essio n that w e enter ed in the e x er c ise abo ve: Pr es s the do wn ar r o w ke y , ˜ , at its cur r ent locati on to tr igger the clear editing c ursor . The 3 in the e xponent of θ w ill be highli ghted . Use the le ft arr o w k e y , š , to mo ve f r om element to eleme nt in the e xpres sion . T he or der of selection of the c lear editing c urs or in this ex ample is the fo llo w ing (pr ess the le ft arr o w key , š , r e peatedl y) : 1. T he 1 in the 1/3 e xponent
Pa g e 2- 22 2. θ 3. Δ y 4. μ 5. 2 6. x 7. μ in the e xponential f unction 8. λ 9. 3 i n t h e √ 3 ter m 10. the 2 in the 2/ √ 3 fr acti on At an y po int we can c hange the clear editing c urs or into the insertio n cur sor b y pr essing the dele te k e y ( ƒ ). Let’s us e these two c urs ors (the c lear editing c ursor and the inse r ti on c ursor ) to change the c urr ent ex pre ssion int o the fo llo w ing: If y ou f ollo w ed the e xe r c ise immedi ately a bo ve , y ou should hav e the c lear editing c urso r on the number 2 i n th e fi rst fa ct or i n t h e exp res si on. Fol l ow t h ese k e y str ok es to edit the e xpr essio n: ™ ~‚2 Enters the f actorial f or the 3 in the squa r e r o ot (enter ing the fac tor ial ch anges the cur sor to the selec tion c u r sor ) ˜˜™™ Selects the μ in the e xponenti al func tio n /3*~‚f Modifi es e xponential f uncti on argument ™™™™ Selects Δ y R P laces a sq uare roo t s ymbol on Δ y (this oper ation also c hanges the c urs or to the selec tion c u r sor ) ˜˜™—— S Select θ 1/3 and en ter the S IN func tion The r esulting scr een is the follo w ing:
Pa g e 2- 23 Ev aluating a sub-e xpression Since w e alr eady ha ve the sub-e xpre ssi on highli ghted , let ’s pr ess the @EVAL soft menu k e y to ev aluate this sub-e xpr essi on. T he r esult is: Some algebr aic ex pre ssions cannot be simplif ied an ymor e. T r y the fo llow ing keys tro kes : —D . Y ou w ill notice that nothing happens , other than the highli ghting of the e ntir e ar gument of the LN functi on . This is because this e xpre ssi on cannot be ev aluated (or simplif ied) an y mor e accor ding to the CA S rule s. T r y ing the k ey str ok es: —D again does not pr oduce an y changes on the e xpr ession . Another s equence of —D keys tro kes , h oweve r , m o di fie s the e xpr es sion as f ollo ws: One mor e appli cation of the —D ke ys tr ok es pr oduces mor e change s: T his expr es sion does not f it in the E quatio n W rite r sc r een. W e can see the entir e e xpr essi on by u sing a smaller -si z e f ont . Pr ess the @ BIG so ft menu k e y to get: Ev en w ith the large r -si z e font , it is possible to na v igate thr ough the e ntir e e xpre ssi on b y using the clear editing c urs or . T r y the f ollo w ing k e ys tr ok e sequen ce: C˜˜˜˜ , to set the c lear editing cur sor atop the f actor () 3 / 1 θ SIN
Pa g e 2- 24 3 in the f irst te rm of the numer ator . Then , pr ess the r ight ar r o w k e y , ™ , to nav igate thr ough the expr essi on. Simplifying an e x pr ession Pr ess the @ BIG soft menu k e y to get the sc r een to look as in the pre vi ous f igur e (see abo ve). Now , pre ss the @SIMP soft menu k ey , to see if it is possible to simplify this e xpr essio n as it is sho wn in the E quati on W r iter . T he r esult is the fo llo w ing sc reen: T his scr een sho ws the ar gument of the S IN f unction , namely , , tr ansfor med into . T his may not s eem lik e a simplificati on , but it is in the sens e that the c ubi c r oot functi on has been r eplaced by the in ver se f unctions e x p-LN . Factoring an e xpression In this e xer cis e we w i ll try factor ing a poly nomial e xpre ssion . T o continue the pr ev ious e xer cis e , pre ss the ` ke y . T hen , launc h the E quation W r iter again b y pr essing the ‚O ke y . T ype the equati on: XQ2™ 2*X*~y ~y Q2™- ~‚a Q2™™ ~‚b Q2 re su l t i ng i n Let ’s selec t the fir st 3 te rms in the e xpr es sion and attempt a f actor ing of this sub- ex p ress io n : ‚—˜‚™‚™ . This pr oduces: No w , pr ess the @FACTO soft menu k e y , to get 3 θ 3 ) ( θ LN e
Pa g e 2- 2 5 Press ‚¯ to r ecov er the or iginal e xpre ssion . Ne xt , enter the f ollo w ing keys tro kes : ˜ ˜˜™™™™™™™———‚™ to sele c t the last two ter ms in the expr ession , i .e ., pr ess the @ FACTO soft menu k e y , to g e t Press ‚¯ to reco v er the ori ginal e xpre ssion . No w , let’s select the entir e e xpre ssi on b y pres sing the upper arr o w ke y ( — ) once . And pre ss the @FACTO soft menu k ey , to get Press ‚¯ to r ecov er the ori ginal e xpr essi on. Using the CMDS menu k ey W ith the ori ginal pol y nomial e xpre ssion u sed in the pr ev i ous e x er c ise s till sele cted , p r ess th e L key to s h o w t h e @CMDS an d @HELP s oft menu k e y s. T hese two commands bel ong to the second part of the soft menu a v ailable w ith the E quati on W rit er . Let’s try this e xample a s an applicati on of the @CMD S soft m enu key: Pre ss t he @CMDS so ft menu k ey to get the list of CA S commands: Not e : Pr essi ng the @EVAL or the @SIMP soft menu k e ys , while the en tir e ori ginal e xpr essi on is selec ted , pr oduces the fo llo w ing simplifi cation o f the expr ession:
Pa g e 2- 26 Ne xt , select the command DER VX (the deri vati ve w ith r espec t to the v ari able X, the c urr ent CAS indepe ndent var iable) b y using: ~d˜˜˜ . Command DER VX w ill no w be sele c ted: Pr ess the @ @OK@@ soft me nu k e y to get: Ne xt , pr ess the L k e y to r eco ver the or iginal E quati on W r iter men u , and pr ess the @ EVAL@ so ft men u k ey to e valuate this deri vati ve . The r esult is: Using the HELP m enu Pr ess the L k e y to sho w the @C MDS and @HELP s oft menu k e y s. Pr ess the @HELP soft menu k ey to get the lis t of CA S commands. T hen, pr ess ~ d ˜ ˜ ˜ to select the command DERVX. Pr ess the @@ OK@@ s oft men u k e y to get inf ormati on on the co mmand DERVX:
Pa g e 2- 27 Detailed e xplanation on the use of the help fac i lity f or the CA S is pr esented in Chapter 1. T o r eturn to the E quation W rite r , pre ss the @EXIT s oft menu k ey . Pr es s the ` k e y to e xit the E quation W rit er . Using the editing func tions BEGIN, END , COP Y , CUT and P ASTE T o f ac ilitate editing , w hether w ith the E quati on W r iter or on the stac k , the calc ulato r pr o v ide s fi ve editing f uncti ons , BE GIN, END , COP Y , CUT and P AS TE , acti v ated b y comb ining the ri ght-shif t k ey ( ‚ ) w ith k e ys ( 2 ,1) , ( 2 ,2) , (3,1) , (3,2), and ( 3, 3) , r especti vel y . Thes e ke ys ar e located in the leftmost part of r o w s 2 and 3 . The acti on of thes e editing func tions ar e as f ollo ws: BE GIN: marks the beginning of a str ing o f c harac ters for editing END: marks the ending of a s tring o f char act ers f or editing COP Y : cop ies the str ing o f char acter s select ed by BE GIN and END CUT : c uts the str ing o f char act ers s elected b y BE GIN and END P AS TE: paste s a string o f char act ers , pr ev iousl y copi ed or c ut, into the c urr ent c ursor po sition T o see and e x ample , lets st art the Eq uation W rit er and enter the f ollo w ing e xpre ssi on (used in an earli er ex er c ise) : 2 / R3 ™™ * ~‚m „¸\ ~‚m ™™ * ‚¹ ~„x 2 * ~‚m * ~‚c ~„y ——— / ~‚t Q1/3 The or iginal e xpres sion is the f ollo wing: W e want to r emo v e the sub-expr ession x 2 ⋅λ⋅Δ y f rom the ar gument of the LN func tion , and mo v e it to the ri ght of the λ in the fir st ter m . H er e is one possibilit y: ˜ššš———‚ªšš—*‚¬ T he modifi ed expr essio n looks as fo llo ws :
Pa g e 2- 28 Ne xt , we ’ll copy the f r actio n 2/ √ 3 from the lef tm ost facto r in th e exp r es sion, and place it in the numerat or of the ar gument fo r the LN function . T r y the fo llo w ing k ey str ok es: ˜˜šš———‚¨˜˜ ‚™ššš‚¬ T he r esulting sc r een is as f ollo w s: T he functi ons BE GIN and END are no t necessa r y w hen operating in the E quati on W rit er , since w e can s elect s tr ings of c har acter s by u sing the arr ow k e y s. F unctions BE GIN and END are mo r e use ful w hen editing an e xpre ssion w ith the line editor . F or e x ample , let’s s elect the e xpr essi on x 2 ⋅λ⋅Δ y fr om thi s e xpre ssi on, but u sing the line ed it or wi thin the E quatio n W rite r , as follo w s: ‚—A T he line editor sc r een w ill look like this (quo tes sho w n only if calc ulator in RPN mode): T o se lect the su b-e xpr essi on of in ter est , us e: ™™™™™™™™‚¢ ™™™™™™™™™™‚¤ T he sc r een sho w s the r equir ed sub-e xpr essi on hi ghlight ed:
Pa g e 2- 2 9 W e can no w cop y this expr essi on and place it in the denominator o f the LN ar gument , as follo ws: ‚¨™™ … ( 2 7 times ) … ™ ƒƒ … (9 times) … ƒ ‚¬ T he line editor n ow looks lik e this: Pr es sing ` sho ws the e xpres sion in the E quati on W r iter (in small-fo nt for mat , pr ess the @ BIG soft menu k ey) : Press ` to ex it the E quati on W r iter . Creating and editing summations, deri vati v es, and integrals Summations , deri vati v es, and integr als are commo nly used f or calc ulus , pr obabil ity a nd s tatisti cs appli cations . In this sect ion w e sho w so me e xample s of suc h oper ations c r eated w ith the equation wr iter . Us e AL G mode . Summations W e w ill use the E quati on W r iter to ent er the follo w ing summation: Press ‚O to acti vat e the E quatio n W rit er . Then pr ess ‚½ to enter the summation si gn . Notice that the si gn , when e nter ed into the E quation W rite r sc r een, pr ov ides input locati ons fo r the index o f the summati on as w ell as f or the quantity being summed . T o f ill these in put locations , use the fo llo w ing keys tro kes : ~„k™1™„è™1/~„kQ2 T he r esulting s cr een is: ∑ ∞ = 1 2 1 k k
Pa g e 2- 3 0 T o see the cor r esponding e xpr es sio n in the line editor , pr es s ‚— and the A soft menu k e y , to show : T his expr es sion sho w s the gener al form o f a summation typed dir ec tly in the stac k or line ed itor : Σ ( inde x = starting_v alue , ending_value , summation e xpres sion ) Press ` to r eturn to the E quation W r iter . The r esulting sc r een sho ws the v alue of the summati on, T o r ecov er the une valuated summati on use ‚¯ . T o ev aluate the summation again , y ou can use the D so ft menu k e y . This sho ws again that . Y ou can us e the E quatio n W rit er to pr o ve that . T his summation (r epr esenting an inf inite ser ies) is sai d to di ver ge . Double summatio ns ar e also pos sible , for e xampl e: Deri vati ves W e w ill use the E quati on W r iter to ent er the follo w ing der i vati ve: Press ‚O to acti vat e the E quatio n W rit er . Then pr ess ‚¿ to enter the (partial) der iv ativ e sign . Notice that the sign , when ente r ed into the E quati on W r iter sc r een, pr ov ides input locati ons f or the expr essio n being diffe r entiated 6 1 2 1 2 π = ∑ ∞ = k k ∞ = ∑ ∞ = 1 1 k k ) ( 2 δ β α ⋅ ⋅ t t dt d
Pa g e 2- 3 1 and the v ari able of diff er entiati on . T o f ill these input locati ons, use the f ollo w ing keys tro kes : ~„t™~‚a*~„tQ2 ™™ ~‚b*~„t ~‚d The r esulting scr een is the follo w ing: T o see the cor r esponding e xpr es sio n in the line editor , pr es s ‚— and the A soft menu k e y , to show : T his indicates that the gener al e xpr essi on f or a der i vati ve in the line editor or in the stac k is: ∂ va ria bl e ( fun ctio n of varia ble s ) Press ` to retur n to the E quati on W r iter . The r esulting s cr een is not the der iv ati v e we ente red , ho w ev er , but its s y mbolic v alue , namely , T o r ecov er the der iv ati ve e x pr ession u se ‚¯ . T o ev aluate the der i vati v e again , yo u can use the D so ft menu k e y . This sho ws again that . Second or der der i vati v es ar e pos sible , for e x ample: whi ch e valuates to: β α δ β α ⋅ = ⋅ − ⋅ t t t dt d 2 ) ( 2
Pa g e 2- 32 Definite integr als W e w ill use the E quati on W r iter to ent er the follo w ing def inite inte gral: . Pr es s ‚O t o acti v ate the E quatio n W rit er . Then pr ess ‚ Á to enter the integral sign . Notice that the si gn, w hen enter ed into the E quati on W rit er sc r een, pr ov ide s input locations f or the limits of integr ation , the integr and, and the v ar ia ble of integr ation . T o fi ll these in put locations , use the f ollo wing k ey str ok es: 0™~‚u™~ „ t*S~„t™~„t . The r esulting scr e en is the follo wing: T o see the cor r esponding e xpr es sio n in the line editor , pr es s —— and the A soft menu k e y , to show : T his indicates that the gener al e xpr essi on f or a der i vati ve in the line editor or in the stac k is: ∫ ( lo we r_limit , upper_limit ,integr and ,var i able_of_in tegr ation ) Press ` to retur n to the E quati on W r iter . The r esulting s cr een is not the def inite integr al we enter e d , ho we v er , but its sy mbolic value , namely , T o r ecov er the der iv ati ve e x pr ession u se ‚¯ . T o ev aluate the der i vati v e again , yo u can use the D so ft menu k e y . This sho ws again that Not e : The notati on is prope r of par ti al der i vati v es . The pr oper notation f or total der i vati v es (i .e ., deri vati ves o f one var iable) is . T he calc ulator , ho w e ver , doe s not distinguish between partial and tot al deri vati v es . () x ∂ ∂ () dx d ∫ ⋅ ⋅ τ 0 ) sin( dt t t
Pa g e 2- 3 3 Double integr als ar e also pos sible . F or e x ample , w hich e v aluates to 3 6. P artial e valuati on is poss ible , for e x ample: T his integral e v aluates t o 3 6. Organi zing data in t he calculator Y ou can or gani z e data in yo ur calculator b y stor ing var iables in a dir ectory tr ee . T o unders tand the calc ulator ’s memory , w e f irst tak e a look at the f ile dir ect or y . Pr ess the k ey str ok e combinati on „¡ (first k ey in se cond ro w of k e y s fr om the top of the ke y boar d) to get the calculat or’s F ile Manager sc r een: T his scr een giv es a snap shot of the calc ulator’s memory and of the dir ectory tr ee . T he sc r een sho ws that the calc ulator has thr ee memory por ts (or memory partitions) , port 0:IRAM , port 1:ERAM , and port 2 :FL A SH . Memor y ports ar e used to stor e third part y a pplicati on or libr ar ies , as w ell as f or back ups . T he si z e of the thr ee differ ent ports is also indi cated . The f ourth and su bsequent lines in this sc r een show the calculator ’s direc tory tree . T he top dir ect or y (c urr entl y highlighted) is the Home dir ector y , and it has pr edef ined into it a sub- dir ect or y called CA SDIR . The F ile Manager sc r een has thr ee func tions associ a ted with th e soft -m enu k ey s: ) cos( ) sin( ) sin( 0 τ τ τ τ ⋅ − = ⋅ ⋅ ∫ dt t t
Pa g e 2- 3 4 @CHDIR : Change to selected dir ectory @CANCL : Canc el action @@OK@ @ : Appr o ve a selec tion F or ex ample , to c hange dir ectory to the CA SDI R , pr ess the do w n -arr o w k ey , ˜ , and pre ss @CH DIR . This acti on c lose s the Fi l e M a n a g e r w indo w and r eturns us to normal calc ulator dis play . Y ou w ill notice that the s econd line fr om the top in the displa y no w starts w ith the c har acter s { HOME CA SDIR } indicating that the c urr ent direc tory is CASDIR w ithin the HOME dir ecto r y . Functions for manipulation o f v ariables T his scr een includes 20 comman ds assoc iated w i th the s oft menu k ey s that can be used to c r eate , edit , and manip ulate v ar iables . The f irst si x functions ar e the fo llo w ing: @EDIT T o edit a highlighted v ari able @COPY T o copy a hi ghlighted var i able @MOVE T o mo ve a highli ghted var iable @@RCL@ T o recall the contents o f a highlighted v ar iable @EVAL T o e valuate a hi ghlighted v ari able @TREE T o see the dir ectory tree w her e the var iable is contained If y ou pr ess the L k e y , the ne xt set of f uncti ons is made av ailable: @PURGE T o pur ge , or delet e , a v ari able @RENAM T o r ename a v ar iable @NEW T o cr eate a new v ar ia ble @ORDER T o or der a set of v ari ables in the dir ectory @SEND T o send a v ar iable to anothe r calc ulator or co mputer @RECV T o r e ce i v e a v ari able f r om another calc ulator o r compute r If y ou pr ess the L ke y , the third s et of f unctio ns is made av ailable: @HALT T o r eturn to the stack tem por aril y @VIEW T o see contents of a var iable @EDITB T o edit contents of a b inar y v ar iable (similar to @EDIT ) @HEADE T o sho w the dir ectory containing the v a r iable in the header @LIST Pr o v ides a lis t of v ari able names and des cr iption @SORT T o sort v ari ables accor ding to a sorting cr iter ia If y ou pr ess the L ke y , the last s et of f uncti ons is made av ailable: @XSEND T o se nd var ia ble w ith X-modem pr otoco l @CHDIR T o change dir ectory
Pa g e 2- 3 5 T o mo ve betw een the differ ent so f t men u commands, y ou can u se not onl y the NEXT k e y ( L ), but also the PREV k e y ( „« ). T he user is in v ited to try these f uncti ons on his or her o w n. Their applicati ons ar e str aightf orwar d. T he HOME director y T he HOME dir ectory , as pointed out ear lier , is the bas e direc tory for memory oper ation f or the calc ulator . T o get to the HOME dir ect or y , y ou can pre ss the UPDIR func tion ( „§ ) -- r epeat as needed -- until the {HOME } sp ec is sho w n in the s econd line of the displa y header . Alter nativ ely , y ou can use „ (hold) § , pr ess ` if in the algebr aic mode . F or this ex ample, the HOME dir ectory contains nothing but the CA SD IR . Pr essing J w ill sho w the v ari ables in the so ft menu k e y s: Subdirector ies T o sto r e y our data in a we ll or gani z ed direc tory tree y ou ma y want to cr eate subdir ecto r ies under the HO ME dir ectory , and mor e subdir ector ies w ithin subdir ector ies , in a hier arc h y of dir ector i es similar to f older s in modern compute rs . T he subdir ecto ri es w ill be gi v en names that ma y r ef lect the cont ents of eac h subdir ectory , or an y arb itrary name that y ou can think o f . T he CASDIR sub-dir ec tory The CA SDIR sub-direct or y contains a number of var iables needed by the pr op er oper ation o f the CAS (C omput er Algebr ai c S y stem , see a ppendix C). T o see the contents of the dir ectory , we can us e the k ey str ok e combinati on: „¡ which op en s th e F ile Manager once mor e:
Pa g e 2- 36 T his time the CA SD IR is hi ghlighted in the scr een. T o s ee the contents of the dir ect or y pr ess the @@OK@@ sof t m enu ke y or ` , to get the f ollo w ing sc r een: T he scr een sho w s a table des cr ibing the var iable s contained in the CA SD IR dir ect or y . Thes e are v ar iable s pr e -def ined in the calculat or memory that est ablish certain par ameter s for CA S oper ati on (see appendi x C). T he ta ble abo ve contains 4 columns: • T he fir st column indicate the ty pe of var i able (e .g ., ‘E Q’ means an equati on -t y pe v ari able , |R indi cates a r eal-value v ar iable , { } means a list , nam means ‘ a global name ’ , and the s y mbol r epr esents a gr aphi c va riab le. • The s econd column repr es ents the name of the var iable s, i .e., PRI M IT , CA SINF O , MODUL O , REAL A S S UME , PER IOD , VX, and EP S . • Column numbe r 3 show s another s pec ifi cation f or the var ia ble t y pe, e .g., AL G means an algebr aic e xpre ssio n, GR OB stands for gr aphics object , INT G means an integer numer ic var iable , LI S T means a lis t of dat a, GNAME means a global name , and REAL means a r eal (or f loating-point) nu me ric va riab le. • T he fourth and last column r epr esents the si z e, in b ytes , of the var iable truncated , w ithout decimals (i .e., nibbles) . T hus , for e x ample , var iable PE RIOD tak es 12 .5 b ytes, w hile v ari able REALA S S UME tak es 2 7 . 5 by tes (1 b yte = 8 bits , 1 bit is the smallest unit of memory in computers and calc ulat or s) . CASDIR V ariables in t he stack Pr es sing the $ k e y clo ses the pr e v iou s scr een and retur ns us to nor mal calc ulator displa y . B y defa ult , w e get ba c k the T OOL menu: W e can see the var iables contained in the c ur rent dir ectory , CA SD IR , by pr essing the J k e y (f irst k e y in the second r o w fr om the top o f the k ey board). T his pr oduces the f ollo wing sc ree n:
Pa g e 2- 3 7 Pr essing the L k e y show s one mor e var iable stor ed in this dir ectory: • T o see the contents o f the var ia ble EPS , f or e xam ple , use ‚ @EPS@ . T his sho w s the v alue of EP S to be .0000000 001 • T o see the v alue of a numeri cal v ari able , w e need t o pre ss onl y the soft menu k ey f or the v ar iable . F or ex ample , pr es sing cz f ollo w ed by ` , sho w s the same v alue of the var iable in the s tac k, if the calc ulator is set t o Algebr aic . If the calc ulator is set t o RPN mode , y ou need onl y pr ess the so ft menu k ey for ` . • T o see the f ull name of a v ar iable , pr ess the ti ckmar k k e y f irs t , ³ , and then the s oft menu k e y cor r esponding to the v ar iable . F or e x ample , f or the v ari able list ed in the s tac k as P ERIO , w e use: ³ @PERIO@ , whi c h pr oduces as output the str ing: 'PERIOD' . T his pr ocedur e appli es to both the Algebr aic and RPN calc ulator oper ating modes. V ariables in CASDIR T he defa ult var i ables con tained in the CA SDI R dir ectory are the f ollo w ing: PR IMIT Lat est pr imiti v e (anti-der i vati ve) calc ulated, n ot a defa ult var iable , but one cr eated by a pr ev io us e xe r c ise CA S INFO a gr aph that pr o vi des CA S infor mati on MODU L O Modulo for modular ar ithmetic (def ault = 13) REA L A S S UME List o f var iable name s assumed as real v alues PER IO D P eri od for tr i gonometri c func tions (de fault = 2 π ) VX Name of def ault independent v ari able (def ault = X) EP S V alue of small inc r ement (epsilon) , (de fault = 10 -10 ) The se var iables ar e used f or the operati on of the CAS . T yping dir ec tory and var iable names T o name subdi r ector i es, and s ometimes , v ar iable s, y ou wi ll hav e to ty pe str ings of lett ers at once , whi ch ma y or ma y not be comb ined w ith nu mbers . Rathe r than pr essing th e ~ , ~„ , or ~ ‚ k ey comb inations t o t y pe each letter , y ou can hold dow n the ~ k e y and ente r the v ari ous letter . Y ou can also
Pa g e 2- 3 8 loc k the alphabetic k ey boar d tempor aril y and enter a f ull name bef or e unloc king it again. T he fo llo w ing combination s of k e y str ok es w ill lock the alphabeti c k e yboar d: ~~ locks the alpha betic k e y boar d in upper case . When lock ed in this fas hio n , press in g th e „ befo re a letter k e y pr oduces a lo w er case letter , while pr essing the ‚ k e y bef or e a letter k ey pr oduces a spec ial c har acter . If the alphabeti c k e yboar d is alr eady lock ed in uppe r case , to lock it in l o we r case , ty pe , „~ ~~„~ locks the alphabeti c k e yboar d in lo wer case . When lock ed in this fashi on , pr essing the „ bef or e a letter ke y produ ces an upper case letter . T o unloc k lo w er case , pr ess „~ T o unlock the upper -case loc k ed ke yboar d , pre ss ~ Let ’s try some e xer c ises ty ping dir ectory/v ari able names in the stac k . Assuming that the calc ulator is in the A lgebr aic mode o f oper ation ( although the instr ucti ons w ork as w ell in RPN mode) , try the f ollo wing k ey str ok e sequences . W ith these commands we w ill be t y ping the w or ds ‘MA TH’ , ‘Math’ , and ‘MatH’ ~~math` ~~m„a„t„h` ~~m„~at„h` T he calc ulator displa y w i ll sho w the f ollo w ing (left-hand side is Algebr aic mode , r ight-hand side is RPN mode) : Note : if s ys tem flag 60 is se t , y ou can lock the alphabeti cal k e y board by j ust pr essing ~ . S ee Cha pt er 1 for more in forma tio n o n syste m fl ags.
Pa g e 2- 3 9 Creating subdir ec tor ies Subdir ector i es can be cr eated by using the FI LE S env ironme nt or by u sing the c om ma nd C RD I R. Th e t wo ap proa ch es for cr e at i ng su b- di r e cto ries a r e pr esen ted next . Using the FI LE S menu Re gardles s of the mode of oper ation of the calc ulator (A lgebrai c or RPN) , w e can c reat e a direc tory tree , based on the HOME dir ect ory , b y using the func tions acti vated in the FILE S menu . Pr ess „¡ to acti v ate the F ILE S menu . If the HO ME dir ectory is not alread y highli ghted in the scr e en , i . e ., use the u p and do wn ar r o w k e y s ( —˜ ) to highli ght it . The n, pr ess the @@OK@@ soft men u k ey . The sc r een may look lik e this: sho w ing that only one obj ect e x ists c urr entl y in the HOME dir ectory , namely , the CA SDIR su b-dir ectory . Let ’s cr eate another sub-dir ectory called MANS (f or MANualS) whe r e we w ill stor e var iables de veloped a s ex erc ises in this man ual. T o c r eate this sub-dir ectory f irst e nter : L @@NE W@@ . T his w ill pr oduce the fo llo w ing input for m:
Pa g e 2- 4 0 Th e Object input f i eld, the f irst input f ield in the f orm , is highlight ed by def ault . T his input fi eld can hold the conte nts of a ne w var ia ble that is being cr eated. Since w e hav e no contents f or the new sub-dir ectory at this po int , we simpl y skip this input f ield b y pr essing the do w n -ar r o w k ey , ˜ , once . The Name input f iel d is no w highli ghted: This is w her e we ente r the name of the new sub-dir ectory (or var iable , as the case may be), a s fol low s: ~~m ans` Th e cu rso r m oves to th e _ Dir ectory chec k fi eld. Pr ess the @  @CH K@@ s oft menu k ey to spec if y that y ou ar e c r eating a direc tory , and pr ess @@OK@@ to e x it the input f orm . T he var i able listing f or the HOME direc tory wi ll be sho wn in the s cr een as fo llo w s: T he sc r een indicate s that ther e is a ne w dir ectory (MANS) within the HO ME dir ect ory . Ne xt , we w ill cr eate a sub-dir ectory named INTRO (f or INTR Oducti on) , w ithin MANS , to hold var iable s cr eated as e xe r c ise in sub seque nt sec tio ns of this chapter . Pres s t he $ k e y to retur n to normal calc ulator displa y (the T O OL S menu w ill be sho wn). The n, pr ess J to sho w the HOME dir ectory contents in the so ft menu k ey la bels. T he displa y may look lik e this (if y ou ha ve cr eated other var iables in the HOME dir e c tory they w ill sho w in the soft men u k ey labels too):
Pa g e 2- 4 1 T o mo v e into the MAN S dir ect ory , pr ess the co rr es ponding so ft menu k ey ( A in this case) , and ` if in algebr aic mode . The dir ectory tr ee will be sho w n in the second line o f the display as {HOME M NS} . Ho we v er , ther e w ill be no labels as soc iat ed w ith the soft me nu k ey s , as sho w n belo w , becau se ther e are no var iables def ined wi thin this direc tory . Let ’s cr eate the sub-dir ect or y INTR O b y using: „¡ @@OK @@ L @@NEW@ @ ˜ ~~intro` @  @CHK@@ @@OK@@ Pr ess the $ k ey , follo w ed by the J k e y , to see the contents of the MAN S dir ect or y a s fo llo ws : Pr ess the ) ! INTRO soft men u k e y to mo ve in to the INTR O sub-dir ectory . This w ill sho w an empty sub-dir ecto r y . Lat er on, w e w ill do some e x er c ises in c r eating va riab le s. Using the comma nd CRDIR T he command CRDI R can be us ed to cr eate direc tor ie s. T his command is av ailable thr ough the command catal og k e y (the ‚N k ey , second k e y in fo urth r ow o f k e ys fr om the top o f the k ey boar d) , thr ough the progr amming menus (the „° key , s a me key a s t h e ‚N ke y) , or by simpl y typing it . • T hro ugh the catalog ke y Press ‚N~c . Us e the up and do w n arr o w k e ys ( —˜ ) to locate the CRDI R command . Pr ess the @@OK@@ soft menu k e y to acti v ate the command . • T hr ough the pr ogr amming menus Press „° . This w ill pr oduce the f ollo wing pull-do wn men u for pr ogr amming:
Pa g e 2- 42 Us e the do wn ar r o w k e y ( ˜ ) to selec t the option 2. M E M O RY … , or ju st press 2 . Then , pre ss @@OK@@ . T his will pr oduce the follo w ing pull-dow n menu: Us e the do wn ar r o w k ey ( ˜ ) to select the 5 . DIRE CT OR Y opti on , or ju st press 5 . Then, press @@OK@@ . This w ill produ ce the follo w ing pull-dow n menu: Us e the do wn arr o w k e y ( ˜ ) to se lect the 5. C R D I R opti on , and pr ess @@OK@@ . Command CRD IR in Algebraic mode Once y ou ha ve s elected the CRDIR through one of the means sho wn abo v e , the command w i ll be a v ailable in y our stac k as f ollo w s: At this point , you need to ty pe a direc tory name, sa y ch ap 1 : ~~„~chap1~` T he name of the ne w dir ectory w ill be sho wn in the s oft men u k e ys , e .g ., Command CRD IR in RPN m o de T o us e the CRD IR in RPN mode y ou need to ha v e the name of the dir ectory alr eady a v ailable in the stac k bef or e accessing the command . F or e x ample: ~~„~chap2~` T hen access the CRDIR command by e ither of the means sho w n abo v e, e.g ., thr ough the ‚N key:
Pa g e 2- 4 3 Pr ess the @ @OK@ soft menu k ey to ac tiv ate the comm and , to cr eate the sub- dir ectory: Mov ing among subdirectories T o mo ve do wn the dir ectory tr ee , y ou need to pr ess the so ft menu k ey cor r esponding to the sub-dir ect or y y ou wan t to mo v e to . T he list o f var iable s in a sub-dir ecto r y can be pr oduced b y pr essing the J ( V A R ia b l e s ) k ey . To m o ve up in the dir ectory tr ee , us e the func tion UP DIR, i .e ., enter „§ . Alter nati vel y , y ou can use the FILE S me nu , i .e ., pr ess „¡ . U se the up and do w n arr o w k e y s ( —˜ ) to se lect the sub-dir ectory y ou want to mo ve t o , and then pr ess the !CH DIR (CHange D IR ectory) or A soft menu k ey . This w ill sho w the contents of the su b-direc tory you mo ved to in the so ft menu ke y labels. Deleting subdirectories T o delet e a sub-dir ectory , us e one of t he fo llo w ing pr ocedur es: Using the FI LE S menu Pr ess the „¡ k ey t o tri gger the FILE S menu . Selec t the dir ecto r y co ntaining the sub- dir ectory yo u wan t to delete , and pres s the !CHDIR if needed . This w ill c lose the FILE S menu and displa y the cont ents of the dir ectory y ou selec ted . In this case y ou will need t o pre ss ` . Pre ss the @@OK@@ soft menu ke y to list t he contents of the dir ectory in the sc r een. S elect the sub-dir ectory (or v ar iable) that y ou want to delete . Pre ss L @PURGE . A scr een similar to the f ollo w ing w ill be s hown :
Pa g e 2- 4 4 T he ‘S2’ str ing in this f orm is the name of the sub-dir ectory that is being deleted . T he soft men u k ey s pro vi de the fo llo w ing options: @YES@ Pr oceed w ith deleting the sub-dir ectory (or var ia ble) @ALL@ Pr oceed w ith deleting all sub-dir ector ie s (or var iables) !ABORT Do not delete sub-dir ectory (or var ia ble) fr om a list @@NO@ @ Do not delet e sub-dir ectory (or v ari able) After se lecting one of the se fo ur commands, y ou w ill be r eturned to the s cr een listing the contents o f the sub-dir ectory . The !ABORT command , how ev er , w ill show a n err or m essage : and y ou w ill hav e t o pr ess @@OK@@ , bef or e r eturning t o the var i able listing . Using the command PGDIR T he command PGDIR can be used to purge dir ector ies . L ik e the command CRDIR, the P GDIR command is av ailable thr ough the ‚N or thr ough the „° k e y , or it can simpl y be typed in . • T hro ugh the catalog ke y Press ‚N~~pg . This should highli ght the PGDIR command. Pr ess the @ @OK@@ soft men u k e y to ac ti vate the command. • T hr ough the pr ogr amming menus Press „° . This w ill pr oduce the f ollo wing pull-do wn men u for pr ogr amming:
Pa g e 2- 4 5 Us e the do wn ar r o w k e y ( ˜ ) to selec t the option 2. M E M O RY … T h e n , press @@OK@ @ . This w ill produ ce the fo llo w ing pull-do w n menu: Us e the dow n arr o w k e y ( ˜ ) to select the 5 . DIRE CT OR Y opti on. T hen , press @@OK@ @ . This w ill produ ce the fo llo w ing pull-do w n menu: Us e the do wn arr ow k e y ( ˜ ) to select the 6. PG DI R opti on, and pr ess @@OK@@ . Command P GDIR in Algebra ic mode Once y ou ha ve s elected the P G DIR thr ough one o f the means show n abo v e , the command w i ll be a v ailable in y our stac k as f ollo w s: At this point , you need to ty pe the name of an e x isting dir ectory , sa y S4 : ~s4` As a r esult , sub-dir ectory ) @@S4@@ is deleted: Instead o f typing the name o f the dir ectory , yo u can simply pr es s the cor re sponding so ft menu k e y at the listing of the P GDIR( ) command, e .g.,
Pa g e 2- 4 6 Press @@OK@@ , to get: Then , pres s ) @@S3@@ to enter ‘S3 ’ as the ar gument to PGDI R . Press ` to delete the sub-dir ectory: Command PGDIR in RPN m o de T o us e the PGDIR in RPN mode y ou need to hav e the name o f the direc tory , between q uotes , alr eady a vaila ble in the stac k bef or e accessing the command . F or ex ample: ³~s2` T hen access the P GDI R command b y eithe r of the means sho wn abo ve , e.g . , thr ough the ‚N key: Pr ess the @ @OK@ so ft menu k ey t o acti v ate the command and de lete the sub- dir ectory:
Pa g e 2- 4 7 Using the PURGE command fr om the T OOL menu T he T OOL me nu is av ailable by pr essing the I k ey ( Algebr a i c and RPN modes sho wn): T he PUR GE command is av ailable by pr essing the @PURGE s oft menu k e y . In the fo llo w ing e xample s w e want t o delete sub-dir ectory S1 : • Algebr aic mode: Enter @PURGE J ) @@S1@@ ` • RPN mode: Enter J³ @S1@@ `I @PURGE J Va r i a b l e s V ar iables ar e lik e f iles on a computer har d dri ve . One v ar iable can s tor e one obj ect (numer i cal values , algebr aic e xpr essi ons , lists , vec tors , matr ices , pr ogr ams, etc) . E ven su b-direc tori es can be thr ough of as var i ables (in fac t, in the calc ulator , a subdir ectory is also a type of calc ulator obj ect) . V ar iable s ar e re fe rr ed to b y their name s, w hic h can be an y combinati on of alphabeti c and numer ical char act ers , starting w ith a letter (e ither English or Gr eek) . S ome non-alphabeti c char acter s, suc h as the arr o w ( → ) can be us ed in a var iable name , if combined w ith an alphabe tical c har acter . Th us, ‘ → A’ i s a v alid v ar iable name , but ‘ → ’ is not . V alid e xample s of v ar iable names ar e: ‘ A ’ , ‘ B ’, ‘ a ’, ‘ b ’, ‘ α ’, ‘ β ’ , ‘ A1’ , ‘ AB12’ , ‘  A12’ , ’V el’ , ’Z0’ , ’z1’ , etc . A var iable can not hav e the same name than a func tion of the calc ulator . Y ou can not hav e a S IN var iable f or e x ample as there is a S IN command in the calc ulator . T he r ese r v ed calc ulator v ari able name s ar e the fo llow ing: ALRMD A T , CS T , EQ, EXP R , IER R , IOP AR, MAXR, MINR, P ICT , P P AR, PR TP AR , VP AR, ZP AR, der_, e , i, n1,n2 , …, s1, s2 , …, Σ DA T , Σ PA R , π , ∞ V ar iables can be or gani z ed into sub-dir ector ie s. Creating v ar iabl es T o cr eate a v ar iable , w e can use the FILE S menu , along the lines of the e x amples sho w n abo ve f or cr eating a sub-dir ect or y . F or ex ample, w ithin the sub-dir ectory {HOME M NS INTRO} , c reat ed in an earli er e x ample , w e want to st ore the f ollo w ing v ari ables w ith the values sho wn:
Pa g e 2- 4 8 Using the FI LE S menu W e w ill use the FILE S menu to enter the v ari able A. W e assume that w e are in the sub- dir ectory {HOME M NS INTRO}. T o get to this sub-dir ect or y , use the f ollo w ing: „¡ and sel ect the INTR O sub-dir ectory as sho w n in this scr een : Press @@OK@@ to ent er the dir ectory . Y ou w ill get a f iles listing w ith no e ntr ies (the INTRO su b-direc tory is empt y at this po int) Pr ess the L k e y to mo ve t o the next set of s oft menu k e ys , and pr ess the @@NEW@@ soft men u k ey . This w ill pr oduce the NEW V ARIABLE input f or m: Name Contents T ype A1 2 . 5 r e a l α -0.2 5 r eal A12 3 × 10 5 re a l Q ‘ r/(m r)' algebr ai c R [3,2 ,1] vec tor z1 3 5i comple x p1 << → r 'π *r^2' >> pr ogr am
Pa g e 2- 49 T o enter v ari able A (see table abov e) , w e fir st enter its contents , na me ly , the number 12 . 5, and then its name, A, as follo ws: 12.5 @@OK@@ ~a @@OK@@ . Resulting in the f ollo wing sc r een: Press @@OK@@ once more to c reate the v ari able. T he ne w var iable is show n in the fo llo w ing var ia ble listing: T he listing indicat es a r eal var iable ( |R ) , w hos e name is A, and that occ upie s 10. 5 b ytes of memor y . T o se e the contents o f the v ari able in this sc r een , pr ess L @VIEW@ . • Pr ess the @ GRAPH soft me nu k e y to see the contents in a graphi cal for mat . • Pr ess the @ TEXT soft menu k e y to s ee the contents in text f ormat . • Press @@OK@@ to return to the v ariable list • Press $ once mor e to r eturn to normal displa y . V ariable A should no w be featur ed in the s oft menu k e y labels:
Pa g e 2- 5 0 Using the ST O  command A simpler w ay to cr eate a v ar ia ble is by us ing the S T O command (i .e ., the K k e y) . W e pro vi de e xample s in both the Algebr ai c and RPN modes, b y cr eating the r emaining of the v ar iable s suggested abo ve , namely : • Algebr aic mode Use the f ollo w ing k ey str ok es to s tor e the value of –0.2 5 into v ari able α : 0.25\ K ~‚a . A T this point , the scr e en w ill look as f ollo w s: T his expr essi on means that the v alue –0.2 5 is be ing stor ed int o α (the sym bo l  sugges ts the oper ation). Pr ess ` to cr eate the v ar iable . T he var iable is no w sho wn in the s oft menu k ey la bels when yo u pr es s J : T he follo wi ng ar e the k ey str ok es r equir ed to enter the r emaining va riab le s: A12 : 3V5K~a12` Q: ~„r/„Ü ~„m ~„r™™ K~q` R: „Ô3‚í2‚í1™ K~r` Name Co ntents T ype α -0.2 5 r eal A12 3 × 10 5 re a l Q ‘ r/(m r)' algebr ai c R [3,2 ,1] vec tor z1 3 5i comple x p1 << → r 'π *r^2' >> pr ogr am
Pa g e 2- 5 1 z1: 3 5*„¥ K~„z1` (if needed , accept c hange to Comple x mode) p1: ‚å‚é~„r³„ì* ~„rQ2™™™ K~„p1` . T he scr een , at this point , will look as follo ws: Y ou w ill see si x of the se ven v ari ables lis ted at the bottom of the sc r een: p1, z1, R, Q, A12 , α . • RPN mode Use the f ollo w ing k e ys tr ok es to s tor e the value o f –0.2 5 into v ari able α : .25\`³~‚a` . At this point , the sc r een w ill lo ok as f ollo ws: W ith –0.2 5 on the lev el 2 of the st ack and ' α ' on the lev el 1 of the st ack , y ou can us e the K k e y to cr eate the var iable . The var iable is no w sho w n in the soft menu k e y labels w hen yo u pres s J : T o enter the v alue 3 × 10 5 int o A12 , we can use a shorter v ersi on of the pr ocedure: 3V5³~a12` K Here is a w ay to enter the contents of Q : Q: ~„r/„Ü ~„m ~„r™™ ³~q` K T o enter the value of R , w e can use an e ven shorter v ersio n of the pr ocedure: R: „Ô3#2#1™ ³~r K Notice that to separ ate the elements of a ve ctor in RPN mode we can use the space k ey ( # ) , r ather than the comma ( ‚í ) us ed abo v e in Algebr aic mode .
Pa g e 2- 52 z1: ³3 5*„¥ ³~„z1 K (if needed , accept change to Comple x mode) p1: ‚å‚é~„r³„ì* ~„rQ2™™™ ³ ~„p1™` K . T he scr een , at this point , will look as follo ws: Y ou w ill see si x of the se v en var iables lis ted at the bottom of the sc reen: p1, z1, R, Q, A12 , α . Chec king v ariables contents As an ex er cise on peeking into the contents of v ari ables we w ill us e the sev en var iables enter ed in the e xe r c ise abo ve . W e show ed how to u se the FILE S me nu to v ie w the c ontents o f a var iable in an earlier e xer c ise w hen we cr eated the var iable A. In this secti on w e will sh o w a simple wa y to look into the contents of a v ar iable . Pres sing th e s oft menu ke y label for the v ariable This pr o cedur e wi ll show the contents of a var iable as long as the var iable cont ains a numer ical v alue or an algebr aic v alue , or an ar r ay . F or e xample , for the var iable s listed abov e, pr ess the f ollo w ing k ey s to see the contents of the va riab le s: Algebr aic mode T ype thes e k ey str ok es: J @@z1@@ ` @@@R@@ ` @@@Q@@@ ` . At this po int , the sc r een looks as f ollo w s: Ne xt , t y pe these k e ys tr ok es: @@A12@ ` ` L @@@A@@@ ` . At t his point , the sc r een looks as f ollo w s:
Pa g e 2-53 Pr essing the soft me nu k e y cor r esponding t o p1 will pr o v ide an er r or messa ge (tr y L @@@p1 @@ ` ): Note: By pre ss i n g @@@p1@@ ` w e are try ing to acti vate (run) the p1 progr am. Ho w ev er , this pr ogram e x pec ts a numer ical input . T r y the f ollo w ing e xer c ise: $ @@@p1@ „Ü5` . The r esult is: T he pr ogr am has the f ollo wing s truc tur e: << → r 'π *r^2' >> T he « » sy mbols indicate a pr ogr am in Us er RPL language . The c har acter s → r indicat e that an input , to be r ef err ed t o as r , is to be pr o vi ded to the pr ogr am. T he acti on fr om the pr ogr am is to t ak e that v alue of r and ev aluate the algebr aic ' π *r^2'. I n the e xam ple sh ow n abo v e , r took the v alue of 5, and thu s the v alue of π r 2 = π⋅ 2 5 is r etur ned. T his pr ogr am , ther ef or e , calculat es the ar ea o f a ci rcl e giv en i t s ra d i us r . RPN mode In RPN mode , y ou only need to pr ess the corr esponding soft menu k e y label to get the conten ts of a numer ical or algebr aic v ar ia ble. F or the cas e under consi derati on , we can try peeking into the v ari ables z1 , R, Q, A12 , α , and A , cr ea ted abo ve , as follo w s: J @@z1@ @ @@@R@@ @@@Q@@ @@A12@@
Pa g e 2- 5 4 At this point , the scr een looks lik e this: T o see the contents o f A, use: L @@@A@@@ . To r u n p r o g r a m p1 w ith r = 5, use: L5 @@@ p1 @@@ . Notice that to run the pr ogram in RPN mo de , yo u only need to enter the in put (5) and pr es s the corr es ponding soft menu k ey . (In algebr aic mode , y ou need to place pare nth eses to ente r the argument). Using the right-shift ke y ‚ follo we d by so ft m e nu ke y labels In Algebr aic mode , you can displa y t he content of a v ar iable b y pr essing J @ and then the corr esponding so ft menu k ey . T r y the f ollow ing e xample s: J‚ @@p1@@ ‚ @@z1@@ ‚ @@ @R@@ ‚ @@@Q@@ ‚ @@A12@@ Note: In RPN mode , yo u don ’t need to pr ess @ (jus t J and then the cor r esponding s oft menu k e y) . T his pr oduces the fol low ing sc r een (Algebr aic mode in the left , RPN in the r ight)
Pa ge 2- 55 Notice that this time the con tents of pr ogr am p1 are liste d in the scr ee n . T o see the r emaining v ari able s in this direc tory , pr ess L : Listing the con tents of all v ariables in the s c r een Use the k e y str ok e combinati on ‚˜ to list the cont ents of all v ar iable s in the sc r een . F or e xample: Press $ to re turn to nor mal calculator dis play . Replacing th e contents o f v ariables R eplac ing the contents of a v ar iable can be thought of as stor ing a differ ent v alue in the same var i able name . Thu s, the e x amples f or c r eating var iable s sho w n abo v e can be used to ill ustr ate the re placement of a v ar iable ’s conten t . Using the ST O  command Using as illus tr ation the si x v ari ables , p1, z1, R , Q, A12 , a , and A , c r eate d earli er , w e w ill pr oceed to change the conten ts of v ar iable A12 (c ur r ently a numer ical v ari able) w ith the algebrai c e xpr essi on ‘ β /2’ , using the S T O  command . F ir st , using the Algebr aic oper ating mode: ³~‚b/2™ K @@A12@@ ` Chec k the ne w conte nts of var iable A12 by using ‚ @@A12@@ . Using the RPN ope r ating mode: ³~‚b/2` ³ @@ A12@@ ` K or , in a simplified w a y , ³~‚b/2™ ³ @@A12@@ K Usi ng the le ft-sh ift „ k e y follo wed b y the var iable’s soft menu ke y (RPN) T his is a v ery simple wa y to c hange the cont ents of a v ar iable , but it only w orks in the RPN mode . T he pr ocedur e consists in ty ping the ne w conte nts of the v ari able and enter ing them into the stack , and then pr essing the left-shift ke y
Pa g e 2- 5 6 fo llow ed by the var iable ’s soft menu k e y . F or e xample , in RPN , if w e want to c ha nge the conten ts of var iable z1 to ‘ a b ⋅ i ’, u s e : ³~„a ~„b*„¥` T his wil l place the algebrai c e xpr essi on ‘ a b ⋅ i ’ in le v el 1: i n t h e st a ck . To en t e r this r esult into var iable z1 , us e: J„ @@@ z1@@ T o chec k the ne w contents of z1 , use: ‚ @@@z1@@ An eq uiv alen t wa y to do this in Algebr aic mode is the follo wing: ~„a ~„b*„¥` K @@@z1@@ ` T o chec k the ne w contents of z1 , use: ‚ @@@z1@@ Using the AN S(1) v ariable ( Algebraic mode) In Algebr aic mode one can us e the ANS(1) v ar iable to r eplace the cont ents of a var iable . F or ex ample, the pr ocedur e for c hanging the contents o f z1 to ‘ a bi ’ is the fo llow ing: „î K @@@z1@@ ` . T o c hec k the new co ntents of z1 , us e: ‚ @ @@z1@ @ Cop ying v ariables T he follo wing e x er c ises sho w d i ffer ent wa y s of copy ing var iables fr om one sub- dir ect or y t o another . Using the FI LE S menu T o cop y a var iable f r om one dir ectory to another y ou can use the FILE S menu . F or ex ample , w ithin the sub-dir ect or y {HO ME MANS INTRO}, w e ha ve va riab le s p1, z1, R, Q, A12 , α , and A . Suppos e that we w ant to cop y v ari able A and place a copy in sub-dir ectory {HO ME MANS}. Also , we w i ll cop y va riab le R and place a cop y in the HOME dir ec tor y . Her e is ho w to do it: Press „¡ @@OK@@ to pr oduce the fo llo w ing list of v ar iable s: Use the do w n -arr o w k ey ˜ to selec t var iable A (the las t in the list), then pr ess @@COPY@ . The calc ulator w ill r espond w i th a s cr een labeled PICK DE ST INA TION:
Pa g e 2- 57 Use t he up ar r o w k ey — to s elect the sub-dir ectory MANS and pr es s @@OK@@ . If y ou no w press „§ , the scr een will sho w the contents of sub-direc tory MANS (notice that v ar iable A is show n in this list , as e xpected): Press $ @INTRO@ ` (A lgebrai c mode) , or $ @IN TRO@ (RPN mode) to r eturn to the INTR O direc tory . Pr ess „¡ @@ OK@@ t o pr oduce the list o f var iables in {HOME MAN S INTRO} . Use the do w n arr ow k ey ( ˜ ) to s elect v ar ia ble R , then pr ess @ @COPY@ . U se the up arr ow k ey ( — ) to select the HO ME direc tory , and pr ess @@OK@ @ . If y ou no w pres s „§ , twi ce , the scr een will sho w the contents o f the HOME dir ectory , including a cop y of v ar iable R : Using the hi story in Al gebr aic mode Here is a w ay to use the h istor y (stack) to copy a variable fr om on e directory to another w ith the calc ulator set to the A lgebr aic mode . Suppos e that we ar e w ithin the sub-dir ecto r y {HO ME MANS INTR O}, and wan t to cop y the conten ts of vari able z1 to sub-dir ectory {HOME MANS}. Use the f ollo w ing pr ocedur e: ‚ @@z1@ K @ @z1@ ` T h i s s i m p l y s t o r e s t h e c o n t e n t s o f z1 into itself (no change effected on z1 ) . Next , use „§` to mov e to the {HOME MANS} sub- dir ectory . The calc ulator scr een will look lik e this:
Pa g e 2- 5 8 Ne xt , use the delet e k ey thr ee times, to r emo ve the la st thr ee lines in the displa y : ƒ ƒ ƒ . At this po int , the stac k is r eady t o e xec ute the command ANS( 1)  z1. Pr es s ` to ex ec ute this command . Then , use ‚ @@z1 @ , to ve rify the contents of the v ar iable . Using the stac k in RPN mode T o demonstr a t e the use of the s tac k in RPN mode to cop y a v ari able f rom one sub-dir ec tory t o another , w e assume y ou ar e w ithin sub-dir ectory {HOME MANS INTRO}, and that w e w ill cop y the contents of var iable z1 into the HOME dir ectory . U se the f ollo w ing pr ocedur e: ‚ @@z1@ `³ @@z1@ ` T his procedur e lists the contents and the name of the v ar iable in the stac k. The calc ulator sc r een w ill look lik e this: No w , us e „§„§ to m o ve to the HOME d ir ector y , and p r ess K to complete the oper ation . Use ‚ @ @z1@ , to v er if y the contents of the v ari able. Cop ying two or mor e v ariables using the stac k in Algebraic mode T he follo wing is an e xer cis e to de monstr ate ho w to copy tw o or mor e var iable s using the s tac k whe n the calc ulato r is in Algebr aic mode. Suppos e , once mor e , that w e are w ithin sub-dir ectory {HOME MANS INTR O} and that w e want to cop y the var iables R and Q into su b-dir ectory {HOME MAN S}. T he k ey str ok es necess ar y to complet e this oper ation ar e show n f ollo w ing: ‚ @@ @R@@ K @@@R@@ ` ‚ @@ @Q@@ K @@@Q@@ ` „§` ƒ ƒ ƒ` ƒ ƒ ƒ ƒ ` T o ve rify the contents of the v ar iables , use ‚ @@ @R @ and ‚ @@ @Q . T his pr ocedur e can be gener ali z ed to the cop y ing of thr ee or mor e v ari ables .
Pa g e 2- 59 Cop ying two or mor e v ariables using the stac k in RPN mode T he follo wing is an e xer cis e to de monstr ate ho w to copy tw o or mor e var iable s using the st ack w hen the calc ulator is in RPN mode. W e assume , again, that w e ar e wi thin sub-dir ectory {HOME MAN S INTRO} and that w e want to cop y the v ari able s R and Q into sub-dir ectory {HOME MANS}. T he ke ystr ok es necess ar y to complet e this oper ation ar e show n f ollo w ing: ‚ @@ @R@@ ³ @@@R @@ ` ‚ @@ @Q@@ ³ @@@Q@@ ` „§K K T o ve rify the contents of the v ar iables , use ‚ @@ @R @ and ‚ @@ @Q . T his pr ocedur e can be gener ali z ed to the cop y ing of thr ee or mor e v ari ables . Reor dering v ariables in a dir ec tory In this secti on w e illustr ate the us e of the ORDER command to reo rder the v ari ables in a dir ectory . W e assume w e start w ithin the sub-dir ectory {HOME MANS} cont aining the var iables , A12 , R , Q, z1, A, and the sub-dir ect or y INTRO , as show n belo w . (Cop y A12 fr om INTRO into MANS). Algebraic mode In this case , we ha v e the calculator s et to Algebr a i c mode . Suppo se that w e want to cha nge th e or der of the variables to INTRO , A, z1, Q, R , A12 . Pr oceed as f ollo ws t o acti vat e the ORDER f unction: „°˜ @@OK@ @ Selec t MEMOR Y fr om the progr amming menu ˜˜˜˜ @@ OK@@ Select DIRECT O R Y f r om the MEMOR Y menu —— @ @OK@@ Se lect ORDER fr om the DIRE CT OR Y menu Th e sc re en wi l l s h ow th e fo ll owi n g i np u t l i n e: Ne xt , we ’ll list the new or der of the v ari ables b y u sing their names ty ped between quotes: „ä ³ ) @INTRO ™‚í³ @@@@A@@@ ™‚í³ @@@ z1@@ ™‚í³ @@@ Q@@@ ™ ‚í³ @@@@R@@@ ™‚í³ @@A 12@@ `
Pa g e 2- 6 0 T he sc r een no w sho w s the new o rde ring o f the var ia bles: RPN mode In RPN mode, the lis t of r e -or der ed var iables is list ed in the s tack be for e appl y ing the command ORDER. Su ppose that w e start fr om the same situati on as abo ve , but in RPN mode, i .e ., Th e re ord e red l i st i s c rea t ed by u si n g : „ä ) @INTRO @@@@A@@@ @@@z1@@ @@@Q@@@ @@@@R@@@ @@A12@@ ` Then , en ter the command O RDER , as done befor e , i .e. , „°˜ @@OK@@ Select MEM OR Y fr om the pr ogr amming menu ˜˜˜˜ @@ OK@ Select DIRECT O R Y f r om the MEMOR Y menu —— @ @OK@@ Se lect ORDER fr om the DIRE CT OR Y menu T he r esult is the f ollo w ing scr een: Mov ing var iables using th e FILE S menu T o mo ve a v ar iable f r om one dir ectory to another y ou can us e the FILE S menu . F or ex ample , w ithin the sub-dir ect or y {HO ME MANS INTRO}, w e ha ve va riab le s p1, z1, R, Q, A12 , α , and A . Su ppose that w e w ant to mo ve va riab le A12 to su b-dir ectory {HOME MANS}. Her e is ho w to do it: Pr ess „¡ @@OK@ @ to sho w a var ia ble list . Us e the do wn-arr ow k e y ˜ to select va riab le A12 , then pres s @@MOVE@ . T he calc ulator w ill r espond w ith a P ICK DE S TIN A TION s cr een. U se the up ar r o w k e y — to select the s ub-d ir e ctory MANS and pr ess @@ OK@@ . T he sc reen w ill no w show the contents o f sub-dir ectory {HOME MAN S INTRO} :
Pa g e 2- 6 1 Notice that v ar iable A12 is no longer ther e . If yo u no w pr ess „§ , the sc r een w ill sho w the contents of sub-dir ectory MANS , including v ari able A12 : Deleting va riables V ar iables can be deleted using functi on P URGE . T his fu ncti on can be acc essed dir ectl y b y using the T OOLS men u ( I ), or by u sing the FILE S men u „¡ @@OK@@ . Using the FI LE S command T he FILE S command can be used to pur ge one var iable at a time . T o delete a v ari able fr om a giv en dir ectory yo u can use the FILE S menu . F or ex ample, w ithin the sub-dir ectory {HOME MAN S INTRO}, w e hav e v ari able s p1, z1, R , Q, α , and A left . Suppose that w e delete v ari able A . He r e is h o w to do it: Pr ess „¡ @@OK@ @ to pr oduce the var iable list . Use the do wn -ar r o w ke y ˜ to select v a r iable A (the last in the list), then pre ss L @PURGE@ @@@YES@ @@ . T he sc r een w ill no w sho w the contents of sub-dir e c tory INTRO w ithout var iable A. Using function PURGE in the stac k in Algebr aic mode W e start again at subdir ect ory {HOME MANS INTRO} con taining no w onl y va riab le s p1, z1, Q, R , and α . W e w ill use command P URGE to de lete Note: Y ou can use the s tac k to mo ve a v ar iable b y combining copy ing with deleting a v ari able . Pr ocedure s f or deleting v ar iable s ar e demonstr ated in the ne xt secti on .
Pa g e 2- 6 2 va riab le p1 . Pr ess I @PURGE@ J @@p1@@ ` . T he scr e en w ill no w show va riab le p1 rem ove d : Y ou can us e the P URGE command to er as e mor e than one var iable b y plac ing their name s in a list in the ar gument of P URGE . F or e x ample , if no w we w anted to pur ge var iables R and Q , simultaneou sly , we can tr y the f ollo w ing ex er c ise . Press : I @PURGE@ „ä³ J @ @@R!@@ ™ ‚í ³ J @@@Q!@@ At this po int , the sc r een w ill sho w the f ollo w ing command re ady to be ex ecut ed: T o f inish deleting the var iables , pr ess ` . The sc r een wi ll now sho w the r emaining v ar ia bles: Using function PURGE in the stack in RPN mod e W e start again at subdir ecto r y {HO ME MANS INTRO} cont aining var ia bles p1, z1, Q, R , and α . W e w ill use co mmand PUR GE to delete v ar iable p1 . Press ³ @@p1@@ ` I @PURGE@ . T he scr e e n w ill no w s ho w var iable p1 re move d : T o delete two v ar iables simultaneou sly , say var iables R and Q , fir st cr eate a list (in RPN mode , the elements of the list need not be separ ated b y commas as in Algebr aic mode): J „ä³ @@@R!@@ ™³ @@@Q!@@ ` . Then , pr ess I @PURGE@ use to pur ge the v ari ables. UNDO and CMD func tions Fu n ct io n s U ND O a n d CM D a re us ef ul f or re c ove ri ng re c en t c o mm a n d s, or t o r ev er t an oper ati on if a mistak e was made . These f uncti ons are as soc iated w ith
Pa g e 2- 6 3 the HIS T k ey : UNDO r esults f r om the k e ys tr ok e seq uence ‚¯, w hile CMD r esults f r om the k e y str ok e seq uence „® . T o illus trat e the us e of UNDO , try the follo w ing ex er c ise in algebr aic (A L G) mode: 5*4/3` . T he UNDO command ( ‚¯ ) w ill simply er ase the r esult . The same e xer c ise in RPN mode, w ill f ollo w thes e keys tro kes : 5`4`*3`/ . Using ‚¯ at this po int w ill undo the most r ecent oper ation ( 20/3) , leav ing the ori ginal t erms bac k in the st ack: T o illus trat e the use o f CMD , let’s ente r the follo w ing entr ies in AL G mode. Pr ess ` af te r each entry . Ne xt , use the CMD f uncti on ( „® ) to show the f our mos t r ecent commands enter ed by the user , i .e., Y ou can us e the up and do w n arr o w ke y s ( —˜ ) to navi gate th r oug h these commands and hi ghlight an y of the m that you w ant to entr y ane w . Once y ou hav e s elected the command to enter , pre ss @@@ OK @@@ . The CM D fun ctio n o pe r a tes in th e s am e fas h ion wh en th e c al c u la tor is i n RP N mode , e x cept that the list of commands onl y show s number s or algebrai cs . It does not sho w func tions ent er ed. F or ex a m ple , tr y the f ollo w ing e xer c ise in RPN mode: 5`2`3/*S ³S5*2` . Pr es sing „® pr oduce s the follo w ing selecti on bo x:
Pa g e 2- 6 4 As y ou can see , the number s 3, 2 , and 5, u sed in the fi rst calc ulation abo ve , ar e listed in the s electi on bo x , as w ell as the algebr aic ‘S IN(5x2)’ , but not the SIN f uncti on enter e d pr ev io us to the algebr aic . F lags A flag is a Boo lean value , that can be s et or clear ed (true or f alse) , that spec if ies a gi ven se t ting o f the calculator or an opti on in a pr ogram . F lags in the calc ulator ar e identif ied b y numbers . Ther e are 2 5 6 flags , number ed fr om - 12 8 to 12 8. P o siti ve f lags ar e called user f lags and ar e av ailable f or pr ogr amming purpos es b y the user . Flag s r epr esente d by negati v e numbers ar e called s y st em flags and aff ect the w a y the calc ulator oper ates . T o see th e c urrent s ystem fla g sett ing press th e H button , and then the @FLAGS! soft men u ke y (i .e., F1). Y ou w ill get a sc r een labeled S Y S TEM FLA G S listing flag n umbers and the cor r esponding s etting. ( Note : In this sc r een , as onl y s y stem f lags ar e pre sent , only the a bsolu te v alue of the f lag number Is display ed) . A flag is said to be set if y ou see a c hec k mark ( ) in fr ont of the flag number . Other w ise , the flag is not s et or cl ea red . T o change the s tatus of a s yst em flag pr es s the @  @CHK@@ ! soft men u ke y while the flag y ou want t o change is hi ghlight ed, or u se the \ k e y . Y ou can use the up and do w n arr o w ke y s ( —˜ ) to mov e about the list of s y stem f lags. Although ther e are 12 8 s y stem f lags, not all o f them ar e used , and some of them ar e used f or inter nal s y stem contr ol . S y stem fl ags that are not acces sib le to the user ar e not vi sible in this sc r een. A complete lis t of flags is pr esen ted in Chapter 2 4.
Pa g e 2- 65 Ex ample of flag setting: general solutions v s. pr incipal value F or e xample , the def ault v alue f or s y ste m flag 01 is Gener al solu tions . What this means is that , if an equation has m ultiple soluti ons, all the s olutions w ill be r eturned b y the calculato r , most lik el y in a list . B y pr essing the @  @CHK@ @ soft menu k e y y ou can c hange s ys tem f lag 01 to Pr inc ipal value . This setting w ill f or ce the calc ulator t o pr o vi de a single v alue kno wn a s the princ ipal value o f the solu tion . T o se e this a t w ork, f irst set s y stem fla g 01 (i.e ., sel ect Pr incipal V alue ). P r e s s @@OK@@ twi ce to r eturn to nor mal ca lc u l a t or displa y . W e will try sol ving a quadr atic eq uation so lution , sa y , t 2 5t 6 = 0, w ith command QU AD . Algebraic mode Use the f ollo wing k ey str ok e seque nce: ‚N~q (use the up and do w n arr o w k e ys , —˜ , to s elect command QU AD) , pr ess @@OK@@ . T o enter the equati on as the f irst ar gument of f uncti on QU AD , use the f ollo w ing keys tro kes : ‚O~ „t Q2™ 5*~ „t 6—— ‚Å0` ‚í ~ „t` T he r esult is: No w , change the se tting of flag 1 to Gener al soluti ons : H @F LAGS@ @ @ CHK@@ @ @OK@@ @@OK@@ . A nd tr y the s oluti on again: —— `` . The soluti on no w includes tw o v alu es : RPN mode F irst set s ys tem flag 01 (i .e., Pr inc ipal V alue ). P r e ss @@OK @@ tw ice to r eturn to normal calc ulator dis play . Then , type the quadr atic equati on as fo llo ws: ‚O~ „t Q2™ 5*~ „t 6—— ‚Å0`
Pa g e 2- 6 6 ` (keep ing a second cop y in the RPN st ack) ³~ „t` Use the follo w ing k ey str oke sequence to enter the Q U AD command: ‚N~q (us e the up and dow n arr o w ke ys , —˜ , to s elec t command QU AD) , pr ess @@OK@@ . The sc reen sho ws the pr inc ipal soluti on: No w , change the se t ting o f flag 01 to Ge ner al soluti ons : H @FLAGS@ @  @CH K@@ @@OK@@ @@OK@@ . And try the solution again: ƒ³ ~ „t` ‚N~q (us e the up and dow n arr o w ke ys , —˜ , to s elect command QU AD) , pr ess @@OK@@ . The sc r een now sho w s the t w o soluti ons: Other flags of interest Br ing up once mor e the c urr ent f lag setting by pr essing the H but ton , and then the @FLAGS! soft men u k e y . Mak e su r e to clear s y stem f lag 01, w hic h was left set f r om the pr ev ious e x er cis e . Use the up and do w n arr o w ke ys ( —˜ ) to mo ve abo ut the s y ste m flag lis t . Some f lags of inte r est and the ir pre fer r ed v alue for the pur pos e of the e xer c ises that fo llo w in this manual ar e: 02 Co n s ta n t → sym b : Constant v alues (e .g ., π ) ar e k ept as s ymbo ls 03 Fu nct io n → sym b : F unctions ar e not auto matically e valuated , instead the y ar e loaded as s ymbo lic e xpr es sions . 2 7 ‘X Y*i ’ → (X,Y): Comple x numbers ar e r epre sented as or der ed pairs 60 [ α ][ α ] loc ks :T h e s e q u e n c e ~~ locks the alphabe tic k e y board Press @@OK@@ t w ice to retur n to norma l calc ulator display .
Pa g e 2- 6 7 CHOO SE bo x es vs . Soft MENU In some of the ex er c ises pr es ented in this chapter w e hav e seen menu lists of commands dis play ed in the scr een. T hes e menu lists ar e r ef err ed to as CHOO SE bo x es . F or ex ample, to us e the ORD ER command to r eorde r v ari ables in a dir ect or y , we u se , in algebr aic mode: „°˜ Sho w PR OG menu list and se lect MEM OR Y @@OK@ @ ˜˜˜˜ Show the MEMOR Y menu list and s elect DIRECT OR Y @@OK@@ —— Sho w the DIRE CT OR Y menu lis t and select ORDER @@OK@ @ acti v ate the ORDER command T here is an alt ernati ve w a y to access the se menu s as soft M ENU keys, by se t t in g fla g 117 . T o set this f lag tr y the f ollo wing: H @FLAGS! ———————
Pa g e 2- 6 8 T he sc r een sho w s flag 117 not se t ( CHOO SE box es ) , as sho wn her e: Pr es s the @  @CHK@@ soft menu k e y to set f lag 117 to soft MENU . The s cr een w ill r ef lect that c hange: Press @@OK@@ t w ice to retur n to normal calc ulator displa y . No w , we ’ll tr y to f i nd the ORDER command using similar k e y str ok es to tho se u se d ab ove, i. e. , we s ta r t wit h „° . Notice that ins tead of a menu lis t , we ge t soft menu labe ls w ith the differ ent options in the P ROG men u , i .e ., Press B to sele ct the MEMO R Y sof t menu ( ) @@ MEM@@ ). The displa y no w sho w s: Press E to sele ct the DI RE C T OR Y sof t menu ( ) @@D IR@@ ) T he ORDER command is not sho wn in this sc r een . T o find it w e us e the L key to find it: T o acti vate the ORDER command w e pr ess the C ( @ORDER ) so ft menu k ey . Although not a pplied to a spec ifi c ex ample , this ex er cis e sho ws the tw o options fo r menus in the calc ulator (CHOO SE bo xe s and soft MENU s) .
Pa g e 2- 69 Note: mos t of the e xam ples in this user guide a ssume that the cur r ent s et ting o f flag 117 is its default setting (that is, not se t) . If y ou ha ve s et the flag but w ant to str i ctl y follo w the e xam ples in this guide , y ou should c lear the flag bef or e con tinuing . Selec ted CHOO SE bo x es Some men us w ill onl y pr oduce CHOO SE bo xe s, e .g., • T he APP S (A PP licationS men u) , acti vated w ith the G key , fi r st key i n the second r o w of k e y s fr om the top of the k ey boar d: • T he CA T (CA T alog menu) , ac ti vat ed w ith the ‚N k e y , second k ey in the f ourth ro w of k ey s fr om the top of the k e yboar d: • T he HELP menu , acti vated w ith I L @HELP
Pa g e 2- 70 • T he CMDS (CoMmanD S) menu , acti v ated w ithin the Eq uation W rit er , i. e. , ‚O L @CMDS
Pa g e 3 - 1 Chapter 3 Calculation with re al numbers T his chapte r demonstr ates the us e of the calc ulator f or oper ations and f uncti ons r elated to r eal numbers . Oper ations along the se lines ar e use ful f or mos t common calc ulati ons in the ph ysi cal sc iences and engineer ing. T he user should be acquaint ed w ith the ke yboar d t o identify certain func tions a vaila ble in the k e yboar d (e.g ., S IN, CO S, T AN, etc.). Also , it is as sumed that the r eader kno ws ho w to adjus t the calc ulator's oper ation , i .e ., selec t oper ating mode (see Chapte r 1) , use men us and choo se bo x es (see Chapt er 1) , and oper ate w ith var iables (see Chapter 2) . Chec king calculators settings T o chec k the c urr ent calc ulator and CA S settings y ou need to j ust look at the top line in the calc ulator displa y in normal oper ati on. F or e x ample , y ou may s ee the follo wing s et ting: R AD XY Z D E C R = ‘X’ T his stands f or R ADi ans for angular measur ements, XYZ f or Rec tangular (Cartesi an) coordinat es, DE C imal number bas e , R eal numb ers pr eferr ed, = means “ ex act ” r esults, and ‘X’ is the v alue of the defa ult independent var iable . Anothe r possible lis ting of options could be D E G R ∠ Z HE X C ~ ‘t ’ T his stands f or DE Gree s as angular mea sur ements, R ∠ Z fo r P olar coor dinates , HEX agesimal n umber base , Comple x n umbers allo we d, ~ s tands f or “ appr ox imate ” re sults, and ‘t’ as the de fault independen t var ia ble . In gener al , this par t o f the display cont ains se ven eleme nts. E ac h element is identif ied ne xt under numbers 1 thr ough 7 . T he possible v alues for eac h element ar e sho wn be tween par entheses f ollow ing the element desc ripti on . The e xplanati on of each o f thos e v alues is als o sho wn: 1. Angle mea sur e spec ifi catio n (DE G , R AD , GRD) DEG: degr ees, 3 60 degr ees in a complet e c irc le RA D: r adians , 2 π r adians in a complete c ir c le GRD: gr ades , 400 grade s in a complete c ir cle
Pa g e 3 - 2 2 . Coordinate sy stem spe c ification (X Y Z , R ∠ Z, R ∠∠ ). T h e s y m b o l ∠ stands f or an angular coor dinate . XYZ: Carte sian or r ect angular (x,y ,z) R ∠ Z: cylindr ic a l P olar co or dinates (r , θ ,z ) R ∠∠ : Spher i cal coor dinates ( ρ,θ,φ ) 3 . Number base s pecif ication (HE X, DEC , OCT , BIN) HEX: he x adec imal number s (base 16) DEC: dec imal numbers (ba se 10) OCT : octal n umbers (bas e 8) BIN: binary numbers (base 2) 4. R eal or com ple x mode spec if icati on ( R , C) R : r eal numbers C : comple x numbers 5 . Exac t or appr o x imate mode spec if icati on (=, ~) = ex act (s ymboli c) mode ~ appr o x imate (numer ical) mode 6 . D e fault CA S independent var i able (e.g ., ‘X’ , ‘t’ , etc .) Chec king calculator mode When in RPN mode the differ ent le vels o f the stac k are list ed in the left -hand side o f the scr een. W hen the AL GEBRAIC mode is s elected ther e ar e no number ed stac k lev els, and the w or d AL G is listed in the top line of the display to w ar ds the ri ght-hand side . T he differ ence be t w een these oper ating modes w as desc r ibed in de tail in Chapte r 1. Real number calculations T o perfor m r eal number calculati ons it is pr ef err e d t o hav e the CAS se t to Re a l (as opposite to Compl e x ) mode . In s ome cases , a complex re sult may sho w u p , and a r equest to c hange the mode to Complex w i ll be made b y the calc ulator . Ex act mode is the defa ult mode f or most oper ations . Ther ef or e , y ou may w ant to st ar t y our calc ulati ons in this mode . An y c hange to Ap pro x mode r equir ed to complete an oper ation w ill be r equest ed by the calc ulator . Ther e is no pr ef err ed selec tion f or the angle measure or f or the number base spec ifi cation .
Pa g e 3 - 3 R eal number calc ulations w ill be demonstr ated in both the Algebr ai c (AL G) and R ev er se P olish Notati on (RPN) modes . Changing sign of a number , var iabl e , or e xpression Use the \ k e y . In AL G mode , y ou can pr ess \ be for e entering the number , e.g ., \2.5` . Re sult = - 2 . 5 . In RPN mode , y ou need to enter at least part of the number f irst , and then us e the \ k ey , e .g., 2.5\ . R esult = - 2 .5 . If yo u use the \ functi on while ther e is no command line , the calc ulator w ill apply the NE G func tion (in v ers e of sign) t o the obj ect on the fi rst le v el of the stac k. T he inv erse func tion Use the Y ke y . In AL G mode , pre ss Y fi rs t , fo ll owe d by a nu mb e r o r algebr aic e xpr essi on , e .g ., Y2 . R esult = ½ or 0. 5 . In RPN mode , ent er the number f irs t , then use the k e y , e. g., 4`Y . Result = ¼ or 0.2 5 . Addition , subtraction, multiplication, div ision Use the pr oper oper ation k ey , namely , - * / . In AL G mode , pr ess an oper and , then an oper ator , then an oper and, f ollo wed b y an ` to obtain a r esult . Ex amples: 3.7 5.2 ` 6.3 - 8.5 ` 4.2 * 2.5 ` 2.3 / 4.5 ` T he fir st thr ee oper ations abo v e are sho wn in the fo llow ing scr een shot: In RPN mode , enter the oper ands one after the other , separ ated b y an ` , then pr ess the oper ator k ey . Ex amples: 3.7` 5.2 6.3` 8.5 - 4.2` 2.5 * 2.3` 4.5 /
Pa g e 3 - 4 Alte rnati v el y , in RPN mode, y ou can separ ate the oper ands with a space ( # ) bef or e pr essing the oper ator k e y . Example s: 3.7#5.2 6.3#8.5 - 4.2#2.5 * 2.3#4.5 / Using parentheses P ar entheses can be used to gr oup operati ons, as w ell as to enclose ar guments of f unctions . T he par entheses ar e av ailable through the k ey str oke combinati on „Ü . P ar enthese s ar e alw ay s ent er ed in pairs . F or ex ample , to calc ulate (5 3 .2)/( 7 - 2 .2): In AL G mode: „Ü5 3.2™/„Ü7-2.2` In RPN mode , yo u do n ot need the par enthesis , calc ulatio n is done dir ectl y on the st ack: 5`3.2 7`2.2-/ In RPN mode , typing the e xpr es sion betw een quotes will allo w you t o enter the e xpr es sion lik e in algebr aic mode: ³„Ü5 3.2™/ „Ü7-2.2`μ F or both, AL G and RPN modes , using the E quation W rite r : ‚O5 3.2™/7-2.2 T he expr essi on can be ev aluated w ithin the E quation w r iter , b y using: ———— @EVAL@ or , ‚— @ EVAL@ Absolute value func tion T he absolute v alue f unction , AB S, is a vaila ble thr ough the k ey str ok e comb ination: „Ê . When calc ulating in the st ack in AL G mode, en ter the func tion bef ore the ar gument , e .g ., „Ê \2.32` In RPN mode , enter the numbe r fir st , then the f uncti on, e .g., 2.32\„Ê
Pa g e 3 - 5 Squares and squar e roots T he squar e func tion , S Q, is av ailable thr ough the k e y str ok e combinati on: „º . When calc ulating in the st ack in AL G mode , e nter the fu ncti on bef or e the argument , e.g ., „º\2.3` In RPN mode , enter the numbe r fir st , then the f uncti on, e .g., 2.3\„º The s quar e r oot functi on, √ , is a vaila ble thr ough the R k e y . When calc ulating in the stac k in AL G mode , ent er the func tion bef ore the argument , e. g., R123.4` In RPN mode , enter the numbe r fir st , then the f uncti on, e .g., 123.4R P o wers and r oots T he pow er f uncti on , ^, is av ailable thr ough the Q k e y . When calc ulating in the stac k in AL G mode, e nter the bas e ( y ) follo wed b y the Q ke y , and then the ex p on en t ( x ), e .g ., 5.2Q1.25 In RPN mode , enter the numbe r fir st , then the f uncti on, e .g., 5.2`1.25`Q T he r oot functi on , XROO T (y ,x) , is av ailable thr ough the ke ys tr ok e combination ‚» . When calc ulating in the stac k in AL G mode , ente r the functi on XR OO T f ollo wed b y the argumen ts ( y, x ) , separ ated by commas , e .g ., ‚»3‚í 27` In RPN mode , enter the ar gument y , fi rst , then , x , and f inall y the functi on call , e .g., 27`3`‚» Base -10 logarithms and po w ers of 10 L ogar ithms of base 10 ar e calculated b y the ke ys tr ok e combinati on ‚à (functi on L OG) while its in ver se func tion (AL OG , or antilogarithm) is calc u l ated by us in g „ . In AL G mode , the functi on is enter ed bef or e the ar gument: ‚Ã2.45` „Â\2.3` In RPN mode , the ar gument is enter ed bef or e the func tio n 2.45` ‚à 2.3\` „Â
Pa g e 3 - 6 Using po wers o f 10 in entering data P owe rs of te n, i.e. , nu mb e rs of t he fo rm - 4 .5 ´ 10 -2 , etc., ar e entered b y using the V k ey . F or e x ample , in AL G mode: \4.5V\2` Or , in RPN mode: 4.5\V2\` Natural logar ithms and e xponential func tion Natur al logar ithms (i .e ., logarithms of base e = 2. 7 1 82 8 1 82 82 ) ar e calc ulated b y the k ey str ok e combination ‚¹ (f uncti on LN) while its in ve rse f uncti on , the e xponenti al func tion (f uncti on EXP) is calc ulated b y using „¸ . In AL G mode , the f unction is enter ed bef or e the ar gument: ‚¹2.45` „¸\2.3` In RPN mode , the ar gument is enter ed bef or e the func tio n 2.45` ‚¹ 2.3\` „¸ T rigonometric functions T hree tr igonome tri c f uncti ons are r eadily a vaila ble in the k ey boar d: sine ( S ), co sine ( T ) , and tange nt ( U ) . The ar guments of thes e func tions ar e angles, ther ef or e , the y can be ent er ed in an y s y stem o f angular measur e (degr ees, r adians , gr ades) . F or e x ample , w ith the DE G option selec ted , w e can calc ulate the f ollo w ing tri gonometr ic f uncti ons: In AL G mode: S30` T45` U135` In RPN mode: 30`S 45`T 135`U In verse tr igonometric functions T he inv erse tr igon ometr ic f uncti ons a vailable in the k ey boar d ar e the ar csine (A SIN), ar ccosine (A CO S) , and ar ctangen t (A T AN) , av ailable thr ough the keys tro ke c o m bi n at io n s „¼ , „¾ ,a n d „À , r espec ti vel y . Since
Pa g e 3 - 7 the in ver se tr igonometr i c functi ons r e present angles , the ans w er fr om these func tions w ill be gi v en in the select ed angular measur e (DEG , R AD , GRD) . Some e xamples ar e show n ne xt: In AL G mode: „¼0.25` „¾0.85` „À1.35` In RPN mode: 0.25`„¼ 0.85`„¾ 1.35`„À All the func tions de sc ribed abo ve , namel y , AB S, S Q, √ , ^, XR OO T , L OG , AL OG, LN , EXP , SIN , CO S , T AN, A SIN , A COS , A T AN, can be combined w ith the fundamental oper ati ons ( -*/ ) t o f orm mor e complex e xpre ssi ons. The E quation W rite r , who se oper ations is desc ribed in C hapter 2 , is ideal f or building such e x pr essi ons, r egar dless o f the calculat or oper ation mode . Differences between functions and operators F uncti ons lik e ABS , S Q, √ , L OG, AL OG , LN, EXP , SIN, CO S , T AN, A SIN, A CO S, A T AN req uir e a single ar gument . T hus , their appli catio n is AL G mode is str aightf orwar d, e .g ., ABS(x). So me functi ons lik e XR OO T req uire tw o ar guments, e .g ., XROO T(x,y). T his func tion has the equi valent k ey str oke sequen ce ‚» . Oper ators , on the other hand , ar e placed after a single ar gument or betwee n two ar guments. T he fac tor ial oper ator (!), for e x ample , is placed af t er a number , e .g. , 5~‚2` . Since this oper ator requir es a single ar gument it is r ef err ed to as a unar y oper ator . Oper a t ors that r e q uir e t w o ar guments , such as - * / Q , ar e binary oper ator s, e .g ., 3*5 , or 4Q2 . Real number functions in the MTH m enu T he MTH (Ma TH e matic s) menu inc lude a number of mathe matical fu nctions mostl y applicable to r eal number s. T o access the MTH menu , use the k e y str ok e
Pa g e 3 - 8 comb ination „´ . With the def ault setting of CHOOSE bo xes for sys te m flag 117 (see C hapter 2) , the MTH menu is sho wn as the f ollo w ing menu list: As the y ar e a gr eat number of mathematic f uncti ons a vailable in the calc ulator , the MTH menu is s orted b y the t y pe of ob ject the f uncti ons appl y on . F or e x ample , options 1 . VE CT OR.. , 2. M A T R I X . , and 3 . LIS T .. appl y to tho se data types (i .e., v ect ors , matri ces, and lis ts) and will disc ussed in mor e de tail in subsequent chapter s. Options 4. HYPERB OLIC.. and 5. R E A L. . appl y to r eal number s and wi ll be disc uss ed in detailed her ein . Opti on 6. B AS E . . is used f or con v ersi on of number s in d i ffer ent bases , and is also to be disc us sed in a separ ate c hapter . Option 7. P R O B A B I L I T Y . . i s use d for prob abi lit y app lic atio ns and w ill be disc us sed in an upcoming chapt er . Option 8. FFT .. (F ast F our ier T r ansf orm) is an applicati on of si gnal pr oces sing and w ill be disc ussed in a diffe r ent chapt er . Op ti on 9. C O M P L E X . . contains functi ons appr opr iate f or comple x numbers , w hic h w ill be disc uss ed in the next c hapter . Option 10. CONST A NT S pr ov ides access to the cons tants in the calc ulator . This opti on w ill be presented later in this section . F inally , opti on 11. SP E CIAL FUNCT IONS .. inc ludes f uncti ons of adv anced mathematic s that will be di sc ussed in t his se ction a lso . In gener al, to a pply an y of thes e func tions y ou need to be a w ar e of the number and or der of the ar guments r equir ed, and k eep in mind that , in AL G mode y ou should selec t f irst the f uncti on and then enter the ar gument , w hile in RPN mode , y ou should enter the ar gument in the s tack f irst , and then select the f uncti on . Using cal culator m enus : 1. Since the oper ation of MTH functi ons (and of man y other calc ulator menus) is v er y similar , w e w ill desc ribe in det ail the use of the 4. HYP ERBOLIC.. menu in this s ection , w ith the intentio n of des cr ibing the gener al operati on of calc ulator men us. P ay c los e at t entio n to the pr ocess f or selec ting differ ent op ti ons. 2. T o quic kly s elect one o f the number ed op ti ons in a menu lis t (or C HOO SE bo x) , simpl y pre ss the number f or the option in the k ey board . F or e xample , to selec t option 4. HYP ERBOLIC.. in the MTH menu , simply pr ess 4 .
Pa g e 3 - 9 Hy perbolic functions and th eir in verses Selecting Option 4. HYP ERBOLIC.. , in the MTH men u , and pr es sing @@OK@@ , pr oduces the h yper bolic f unction men u: The h y perbolic f unctions ar e: Hy perbo lic sine , SINH , and its inv ers e , AS INH or sinh -1 Hy perbo lic cosine , CO SH, and its inv erse , A CO S H or cosh -1 Hy per bolic t angent , T ANH, and its in v er se , A T ANH or tanh -1 T his me nu contains also the func tions: EXP M(x) = e xp(x) – 1, LNP1(x) = ln(x 1) . F i nall y , option 9. M A T H , r eturns the us er to the MTH menu . F or ex ample , in AL G mode , the k ey str ok e sequence t o calculat e , sa y , ta nh(2 . 5) , is the f ollo w ing: „´ Select MTH menu 4 @@OK@@ Select the 4. HYPERB OLIC.. menu 5 @@OK@@ Select the 5. T A N H f unction 2.5` Ev aluate tanh(2 .5) T he sc r een sho w s the fo llo w ing outpu t: In the RPN mode , the k e y str ok es to perf orm this calc ulati on ar e the follo wing: 2.5` Enter the ar gument in the stac k „´ Select MTH menu 4 @@OK@@ Select the 4. HYPERB OLIC.. menu 5 @@OK@@ Select the 5. T A N H f unction
Pa g e 3 - 1 0 T he r esult is: T he oper ations sho wn abo ve as sume that yo u are u sing the defa ult setting f or s y stem f lag 117 ( CHOO SE box es ). If y ou hav e changed the s etting of this flag (see Chapter 2) to SO FT m e nu , the MTH men u w ill sho w as labe ls of the s oft menu k ey s , as fo llo ws (l eft -hand si de in AL G mode , ri ght –hand side in RPN mode): Pr es sing L sho w s the r emaining options: Th us, to se lect , for e x ample , the h yper bolic f unctions men u , with this men u fo rmat pr es s ) @@ HYP@ , to pr oduce : F i nall y , in or der to selec t , for e xample , the h yper bolic tangent (t anh) functi on , simpl y pr es s @@TANH@ . Note: Pr essing „« w ill re turn to the f irst s et of MTH options . A lso , using the combinati on ‚˜ w ill list all men u func tions in the sc r een, e .g .
Pa g e 3 - 1 1 F or ex ample , to calculat e tanh( 2 . 5), in the AL G mode , when u sing SO FT m e nu s ove r CHOO SE bo xe s , f ollo w this pr ocedur e: „´ Sele c t MTH menu ) @@HYP@ Select the HYPERB OLIC.. menu @@TANH@ Select the TA N H funct ion 2.5` Ev aluate t anh(2 .5 ) In RPN mode , the same value is calc ulated using: 2.5` Ente r ar gument in the s tack „´ Sele c t MTH menu ) @@HYP@ Select the HYPERB OLIC.. menu @@TANH@ Select the TA N H funct ion As an e x er c ise o f appli cations o f h yper boli c func tions , v er ify the fo llo w ing val ue s: S INH (2 .5 ) = 6. 05 0 20.. A SINH( 2 . 0) = 1.44 3 6… CO SH (2 .5 ) = 6 .13 2 2 8. . A CO SH (2 . 0) = 1. 316 9… T ANH(2 . 5) = 0.9 8 6 61.. A T ANH(0.2) = 0.20 2 7… EXP M(2 . 0) = 6 .3 8 90 5…. LNP1(1. 0) = 0.6 9 314…. Once again, the ge ner al pr ocedur e show n in this sec tion can be appli ed fo r selec ting options in an y calculator men u . Real number functions Selec ting option 5 . REAL .. in the MTH menu , w ith sy stem fl ag 117 set to CHOO SE bo x es , gener ates the f ollo w ing men u list: Note: T o see additional opti ons in these soft men us, pr es s the L key o r t he „« k ey str ok e sequence .
Pa g e 3 - 1 2 Option 19 . MA TH.. r eturn s the user to the MTH men u . The r emaining func tions ar e gr ouped in to si x diffe r ent gr oups des cr ibed be low . If s y stem fl ag 117 is set to SO FT m e nu s , the REAL f uncti ons menu w ill look like this (A L G mode used , the same so ft menu k e y s w ill be a vailable in RPN mode) : The v ery las t op ti on , ) @@MTH@ , r etur ns the user t o the MTH men u . Pe r c e n t a g e f u n c t i o n s T hese f unctions ar e used to calc ulate per centages and r elated value s as fo llo ws: % (y ,x) : calc ulates the x per centage o f y %CH(y ,x) : calc ulates 100(y- x)/x, i .e ., the per centage c hange , the differ ence between two number s. %T(y ,x) : cal c u lates 100 x/y , i .e ., the per c entage total, the portion that one number (x) is of another (y) . T hese f uncti ons r equir e two ar guments , w e illustr ate the calc ulation of %T(15, 4 5 ) , i .e. , calculati on 15% of 4 5, ne xt . W e a ssume that the calc ulator is set to AL G mode, and that s y stem f lag 117 is set to CHOOSE bo xes . T he pr ocedure is as f ollo w s: „´ Select MTH menu 5 @@OK@@ Select the 5 . REAL .. menu 3 @@OK@@ Select the 5. % T function 15 Enter f irst ar gument ‚í Enter a comma to separat e argume nts 45 Enter s econd ar gument ` Calc ulate f uncti on
Pa g e 3 - 1 3 T he r esult is sho wn ne xt: In RPN mode , recall that ar gument y is located in the second le v el of the st ack , w hile argument x is located in the f ir st le ve l of the s tac k. This mean s, y ou should enter x fir st , and then, y , ju st as in AL G mode. T hus , the calculati on of %T(15, 4 5 ) , in RPN mode , and w ith s y ste m flag 117 s et to CHOOSE bo xes , w e pr oceed as fo llo w s: 15` Enter f irs t ar gument 45` Enter second argume nt „´ Sele c t MTH menu 5 @@OK@@ Select the 5. R E A L . . menu 3 @@OK@@ Select the 5. % T fun ctio n As an e xer c ise f or per cent age -r elated f uncti ons, v er ify the follo w ing values: %(5,20) = 1, %CH(2 2 ,2 5) = 13 .6 3 63 .., %T (5 00,20) = 4 Minimum and maximum Use thes e func tions to det ermine the minimum or max imum value of two ar guments . MIN(x ,y) : minimum value of x and y MAX(x ,y) : max imum val ue of x and y As an e x er c ise , ver i fy that MIN(- 2 ,2) = - 2 , MAX(- 2 ,2) = 2 Modulo MOD: y mod x = r esidual of y/x, i .e ., if x and y ar e integer numbe rs , y/x = d r/x , wher e d = quotien t , r = r esidual . I n this case , r = y mod x. Not e: The e xer cises in th is section illustrate the gener al use of calc u lator fu ncti ons hav ing 2 ar guments . The ope rati on of f uncti ons hav ing 3 or more ar guments can be gener ali z ed fr om these e xamples .
Pa g e 3 - 1 4 P lease notice that MOD is not a function , but r ather an operator , i.e ., in AL G mode , MOD sho uld be us ed as y MOD x , and not as MOD (y,x) . Th us, the oper ation o f MOD is similar to that of , - , * , / . As an e x er c ise , v er ify that 15 M OD 4 = 15 mod 4 = r esidual o f 15/4 = 3 Absolute value , sign, mantissa, e xponent, integer and fr ac tional parts ABS(x) : calc ulates the absolu te value , |x| SIGN(x) : determine s the sign of x , i .e . , -1, 0, or 1. MANT(x) : deter mines the mantissa o f a number based on log 10 . XP ON(x) : de termine s the pow er of 10 in the number IP(x) : deter mines the integer part of a r eal number FP(x) : deter mines the fr actional part of a r eal numbe r As an e x er c ise , ver i fy that ABS( -3) = |-3| = 3, SIGN(-5) = -1, MANT( 2 54 0) = 2 . 5 40 , XPON( 2 54 0) = 3, IP( 2 . 3 5 ) = 2 , FP( 2 . 3 5) = 0. 3 5 . Rounding, tr uncating, floor , and ceiling func tions RND(x ,y) : r ounds up y t o x dec imal places TRNC(x ,y) : ! truncat e y to x dec imal places FL OOR(x) : clo sest integer that is l ess than or equal to x CEIL(x) : cl o sest inte ger that is gr eater than or equal to x As an e x er c ise , ver i fy that RND(1.4 5 6 7 ,2) = 1.4 6 , TRNC(1.4 5 6 7 ,2) = 1.4 5, FL OOR( 2 . 3) = 2 , CEIL(2 , 3) = 3 Radians-to-d egr ees and degrees-to -r adians functions D  R (x) : conv er ts degr ees to r adians R  D (x) : con v er ts r adians to degr ees. As an e x er c ise , ver i fy that D  R(4 5) = 0.7 8 5 3 9 (i .e., 4 5 o = 0.7 8 5 3 9 ra d ), R  D ( 1 .5 ) = 85. 9 43669 . . (i .e., 1. 5 ra d = 8 5 .9 4 3 6 6 9 .. o ). Special func tions Option 11. S pec ial f uncti ons… in the MTH me nu include s the follo wing fu nct ions :
Pa g e 3 - 1 5 G AMM A: The Gamma functi on Γ (α ) P SI: N -th deri vati v e of the digamma f uncti on P si: Digamma f uncti on, de ri vati v e of the ln(Gamma) T he Gamma functi on is def ined b y . T his functi on has appli cations in applied mathematic s fo r sc ience and engineer ing , as well a s in pr obab ility and statis tic s. Th e PSI fu nct ion , Ψ (x ,y) , r epresen ts the y-th deri vati v e of the digamma f uncti on , i. e. , , wh e re Ψ (x) is kno wn as the di gamma functi on , or P si functi on. F or this functi on, y mus t be a positi ve integer . Th e P s i fu nct ion , Ψ (x) , or digamma functi on , is def ined as . Fa c t o ri a l o f a n u m b e r The facto r ia l of a pos it i ve i nte ger numb er n is def ined as n!=n ⋅ (n -1) ×(n - 2) …3 ×2 ×1 , w ith 0! = 1 . The fac tor ial f unction is a vailable in the calculator b y usi ng ~‚2 . In both AL G and RPN modes , ent er the number f irs t , f ollo w ed b y the seq uence ~‚2 . Example: 5~‚2` . T he G amma f uncti on, def ined abo ve , has the property that Γ(α) = (α−1) Γ(α−1) , fo r α > 1. The r efor e , it can be r elated to the fact ori al of a number , i .e ., Γ(α) = (α−1) !, wh en α is a positi ve integer . W e can also use the fac tor ial f unction t o ca lc ulate the Gamma functi on , and vi ce v ersa . F or ex ample , Γ (5) = 4! or , 4~‚2` . The fa cto r ia l fu nctio n i s ava ila bl e i n th e M TH menu, thr ough the 7. P R O B A B I L I T Y . . menu . ∫ ∞ − − = Γ 0 1 ) ( dx e x x α α ) ( ) , ( x dx d x n n n ψ = Ψ )] ( ln[ ) ( x x Γ = ψ
Pa g e 3 - 1 6 Ex amples of thes e spec ial f unctions ar e sho w n her e using both the AL G and RPN modes. As an e x er c ise , v er if y that G AMMA(2 . 3) = 1.166 711…, PSI(1 . 5 , 3) = 1 .40909 .. , and P s i ( 1 .5) = 3. 6489 9 7 39 . . E- 2 . T hese calc ulations ar e sho w n in the fo llo w ing sc r een shot: Calculator constants T he follo w ing are the mathemati cal cons tants us ed by y our calc ulator : Θ e : the base of natur al logarithms . Θ i : the imaginar y unit , i i 2 = -1. Θ π : the r atio of the length o f the c ir cle to its di ameter . Θ MINR: the minimum r eal number a v ailable to the calc ulator . Θ MAXR: the max imum r eal number a vaila ble to the calculat or . T o hav e access to these constants , selec t option 11. CON S T ANT S.. in the MTH menu , T he constants ar e listed a s follo ws:
Pa g e 3 - 1 7 Selec ting an y of thes e entr ies w ill place the value s elected , w hether a sy mbol (e .g ., e , i, π , MINR , or MAXR ) or a v alue ( 2 .7 1.., (0,1) , 3 . 14.., 1E - 4 99 , 9. 9 9. . E 4 9 9 ) in the s tac k. P lease notice that e is a v a i lable fr om the k ey boar d as ex p (1 ) , i .e ., „¸1` , in AL G mode , or 1` „¸ , in RPN mode . Also , π is av ailable dir ectl y fr om the ke yboar d as „ì . F inally , i is av ailable b y using „¥ . Operations w ith units Numbers in the ca lc ulator can ha ve un its assoc iated with them . Thu s, it is pos sible to calculat e re sults in v olv ing a consisten t sy stem of units and pr oduce a r esult w ith the appr opr iate comb ination of units . T he UN I T S menu T he units menu is launched b y the k e y str ok e combinati on ‚Û (ass oc iate d w ith the 6 k ey). With s y stem f lag 117 set to CHOOSE bo x es , the result is the f ollo w ing menu: Option 1. T ools .. contains f unctions u sed to oper ate on units (disc ussed later ) . Options 3. Le n g t h. . thr ough 17 .V iscosity .. contain menu s with a number o f units fo r each of the q uantities de scr ibed. F or e xample , selecting opti on 8. F or ce .. sho w s the fo llo w ing units menu:
Pa g e 3 - 1 8 T he user w ill recogni z e most o f these units (some , e.g ., dy ne , are not u sed v ery often no w aday s) fr om his or her ph ysi cs c lasse s: N = ne wtons, dyn = dynes, gf = gr ams – for ce (to distinguish f rom gr am-mass, or plainl y gr am, a unit of mas s) , kip = kilo -poundal (1000 pounds) , lbf = pound-f or ce (to dis tinguish fr om pound-ma ss), pdl = poundal. T o attach a un it objec t to a number , the n umber mu st be f ollo w ed by an under scor e . Th us , a for ce of 5 N w ill be ente r ed as 5_N. F or ext ensi ve oper ations w ith units S OFT menu s pr o v ide a mor e con v enient w a y of attaching units. Change s y stem flag 117 to S OFT menus (see Chapter 1) , and us e the k e y str ok e comb ination ‚Û to get the fo llo wing men us . Pr ess L to mov e to the ne xt menu page . Pr essing on the appr opri ate soft me nu k e y w ill open the sub-men u of units for that par ti c ular sel ectio n. F or e xample , fo r the @) SPEED sub-menu , the follo w ing units ar e a vaila ble: Pr essing the soft me nu k ey @) UNITS w i ll tak e you bac k to the UNIT S m e nu . R ecall that you can al w ay s list the f ull menu labels in the sc r een b y using ‚˜ , e .g ., for the @) ENRG set of units the follo wing la bels will be lis ted:
Pa g e 3 - 1 9 A vailable units T he follo w ing is a l ist of the units av ailable in the UNI T S menu . T he unit sy mbol is sho wn f irs t follo wed b y the unit name in parenth eses: LENG TH m (meter ) , cm (centimeter ) , mm (millimeter ) , y d (yar d) , ft (feet) , in (inc h) , Mpc (Mega parsec) , pc (par sec) , ly r (light -y e ar ) , a u (astr onomical unit) , km (kilometer ) , mi (inter national mile) , nmi (nauti cal mile) , miU S (U S statut e mile) , c hain (chain), r d (r od) , f ath (fatho m) , ftUS (surv e y foot ) , Mil (Mil ) , μ (mi cr on) , Å (A ngstr om) , fer mi (fe rmi) ARE A m^2 (sq uare meter ) , cm^2 (squar e centimeter ), b (bar n) , y d^2 (sq uare y ar d) , ft^2 (square f eet) , in^2 (square inc h) , km^2 (squar e kilometer ) , ha (hectare), a (ar e) , mi^2 (s quar e mile) , miU S^2 (squar e statut e mile) , ac r e (acr e) V OL UME m^3 (c ub ic mete r), st (ster e) , cm^3 (c ubi c centimeter ) , yd^3 (c ubi c yar d) , ft^3 (c ubi c f eet) , in^3 (c ub ic inc h) , l (liter ) , galUK (UK gallon), galC (Canadi an gallon) , gal (U S gallon) , qt (quart) , pt (pint), ml (mililiter ) , c u (US c up) , ozfl (U S fluid ounce), oz UK (UK fluid ounce) , tbs p (tablespoon) , tsp (teaspoon), bbl (barr el) , bu (bushe l) , pk (peck), fbm (boar d f oot) T IME y r (year ) , d (da y) , h (hour ) , min (minute), s (second) , Hz (hertz) Not e: Use the L key or t he „« ke ystr oke sequence to nav igate thr ough the menus .
Pa g e 3 - 2 0 SPEED m/s (meter per s econd), cm/s (centimeter per second), f t/s (f eet per s econd) , kph (kilometer per ho ur ) , mph (mile per hour), knot (nautical mile s per hour), c (speed of light) , ga (accelerati on of gr av ity ) MA S S k g (kilogram), g (gr am) , Lb (av oir dupo is pound) , oz (ounce) , slug (slug) , lbt (T r o y pound) , ton (short ton), tonUK (long ton), t (metri c ton), ozt (T ro y ounce) , ct (car at) , gr ain (grain), u (unified atomi c mass), mol (mole) FO RCE N (ne wton) , dy n (d yne), gf (gram-f or ce) , kip (kilopound-for c e), lbf (pou nd- fo r ce) , pdl (poundal) ENERG Y J (joule), er g (erg), Kcal (kilocalori e) , Cal (calor ie) , Btu (I nternati onal table btu), ft × lbf (f oot -pound) , ther m (EE C therm), Me V (mega electr on -v olt) , e V (electr on- vol t) POWE R W (w att) , hp (hors e pow er), PRES SUR E P a (pascal) , atm (atmo spher e), bar (bar), psi (pounds per s quar e inc h) , t orr (tor r), mmHg (millimet ers o f mer c ur y), inHg (inc hes o f mer cury) , inH20 (inche s of water) , TEMP ER A TURE o C (degr ee Ce lsius), o F (degr ee F ahr enhe it) , K (K elv in) , o R (degr ee Rankine), ELE CTRIC CURRENT (Elec tri c measur emen ts) V (v olt) , A (ampe re), C (coulomb) , Ω (ohm), F (far ad), W (w att) , Fd y (f ar aday), H (henr y) , mho (mho) , S (si emens) , T (tesla) , Wb (w eber )
Pa g e 3 - 2 1 ANGLE (planar and soli d angle measur ements) o (se x agesimal degree), r (radi an) , gr ad (gr ade) , ar cmin (minute of ar c) , ar cs (second of ar c) , sr (ster adian) LIGHT (Illuminati on measur ements) fc (foot candle) , f lam (footlambe rt) , lx (lu x) , ph (phot), sb (stilb), lm (lumem) , cd (candela) , lam (lambert) RAD IA T I ON Gy (gr a y) , r a d (r ad) , r em (r em) , Sv (si ev ert) , Bq (becquer el) , C i (c uri e) , R (r oentge n) VIS CO SI TY P (pois e) , St (s tok es) Units not listed Units not list ed in the Units menu , but a v ailable in the calc ulator include: gmol (gr am-mole) , lbmol (pound-mole), rpm (r e v olutions per minu te) , dB (dec ibels) . T hese units ar e accessible thr ough menu 117 . 0 2 , tr igger ed b y using MENU(117 . 0 2) in AL G mode , or 117 . 0 2 ` MENU in RPN mode . The men u w ill sho w in the sc ree n as f ollo ws (u se ‚˜ to sho w labels in displa y) : T hese units ar e also accessible thr ough the catalog, f or e x ample: gmol: ‚N~„g lbmol: ‚N~„l rp m: ‚N~„r dB: ‚N~„d
Pa g e 3 - 2 2 Conv erting to base units T o conv er t an y of these units to the def ault units in the SI s yst em, u se the functi on UB A SE . F or e xample , to find out what is the v alue of 1 po ise (uni t of viscosit y) in the SI units , use the f ollo w ing: In AL G mode , s y ste m flag 117 se t to CHOOSE bo xes : ‚Û Select the UNIT S menu @@OK@@ Select the T OOLS m en u ˜ @@OK@@ Select the UB A SE functi on 1 ‚Ý Enter 1 and under line ‚Û Select the UNIT S menu — @@OK @@ Selec t the VIS CO SI TY option @@OK@@ Select the UNI TS men u ` Con vert the units T his re sults in the f ollo w ing sc r een (i .e ., 1 pois e = 0.1 k g/(m ⋅ s) ): In RPN mode , s y stem f lag 117 set to CHOO SE bo x es : 1 Enter 1 (n o underline) ‚Û Select the UNIT S menu — @@OK @@ Selec t the VIS CO SI TY option @@OK@@ Select the unit P (po ise) ‚Û Select the UNIT S menu @@OK@@ Select the T OOLS m en u ˜ @@OK@@ Select the UB A SE functi on In AL G mode , s y ste m flag 117 se t to SO F T m e n us : ‚Û Select the UNIT S menu ) @TOOLS Select the T OOLS m en u @UBASE Select the UB A SE functi on 1 ‚Ý Enter 1 and under line ‚Û Select the UNIT S menu „« @ ) VISC Select the VISC OS I TY option @@@P@@ Select the unit P (poise)
Pa g e 3 - 23 ` Con vert the units In RPN mode , s y stem f lag 117 set to SO FT m e nu s : 1 Enter 1 (n o underline) ‚Û Select the UNIT S menu „« @ ) VISC Select the VISC OS I TY option @@@P@@ Select the unit P (poise) ‚Û Select the UNIT S menu ) @TOOLS Select the T OOLS m en u @UBASE Select the UB A SE functi on Attac hing units to numbers T o attach a un it objec t to a number , the n umber mu st be f ollo w ed by an under scor e ( ‚Ý , ke y(8,5 )) . T hus , a for ce of 5 N w ill be enter ed as 5_N. Her e is the sequence of steps to enter this number in AL G mode , s ys tem flag 117 set t o CHOOSE bo xe s : 5‚Ý Enter number and under scor e ‚Û Acc ess th e U NIT S menu 8 @@OK@@ Select units of f or ce ( 8. F or ce .. ) @@OK@ @ Select Ne wtons ( N ) ` Enter q uantit y w ith units in the st ack T he scr een w ill look lik e the follo wing: T o ente r this same quantity , w ith the calc ulator in RPN mode , us e the follo w ing keys tro kes : 5 Enter nu mber (do not enter underscor e) ‚Û A ccess the UNIT S menu 8 @@OK@@ Select units of fo r ce ( 8. F or ce . . ) @@OK@ @ Select Ne wtons ( N ) Not e : If yo u fo r get the unders cor e , the r esult is the e xpr essi on 5*N , whe r e N her e represen ts a po ssible var iable name and not Ne wtons .
Pa g e 3 - 24 Notice that the under scor e is ente r ed automati call y when the RPN mode is acti v e . The r esult is the follo w ing sc r een: As indicated ear lier , if sy stem flag 117 is s et to SO FT m e nu s , then the UNI T S menu w ill sho w up as labels f or the soft menu k e ys . This se t up is very con veni ent f or extensi ve oper ations w i th units . The k e ystr oke sequences to enter units when the SO F T me n u opti on is selected , in both AL G and RPN modes , ar e illustr ated ne xt . F or e x ample , in AL G mode , to enter the quantity 5_N us e: 5‚Ý Enter number and under scor e ‚Û Acc ess th e U NIT S menu L @ ) @FORCE Select units of f or ce @ @@N@@ Select Ne wtons ( N ) ` Enter q uantit y w ith units in the st ack T he same quantity , enter ed in RPN mode u ses the f ollo w ing k e y str oke s: 5 Enter number (no underscor e) ‚Û Acc ess th e U NIT S menu L @ ) @FORCE Select units of f or ce @ @@N@@ Select Ne wtons ( N ) Unit prefi x es Y ou c an enter p r efi xes for uni ts according to the f ollow ing table of pr efi xes fr om the S I sy stem . T he pre fi x abbr ev iation is sho w n fir st , fo llo we d by its name , and b y the e xponent x in the fac tor 10 x cor re sponding to eac h pr ef i x: ___________ _____________________ ___________________ Pr ef i x Name x Pre f i x Nam e x ___________ _____________________ ___________________ Note: Y ou can enter a qua ntity with units by typing the underline and uni ts with the ~ keyboa r d, e.g ., 5‚Ý~n will produce the entry: 5_N
Pa g e 3 - 25 Yy o t t a 2 4 dd e c i - 1 Z z etta 21 c cent i - 2 E e x a 18 m milli -3 P peta 15 μ mic r o -6 T ter a 12 n nano -9 Gg i g a 9 p p i c o - 1 2 Mm e g a 6 f f e m t o - 1 5 k ,K kilo 3 a atto -18 h,H h ecto 2 z z epto - 21 D(*) dek a 1 y yoc to - 2 4 ___________ _____________________ ___________________ (*) In the S I s yst em, this pre f i x is da r ather than D . Use D f or dek a in the calc ulat or , h o w ev er . T o ente r these pr efi xes, simply t y pe the p r efi x using t he ~ keyb o ard. For e xample , to enter 12 3 pm (1 picometer ) , us e: 123‚Ý~„p~„m Using UB A SE to con vert to the def ault unit (1 m) r esults in: Operations w it h units Once a quantity accompanied w ith units is enter ed into the stac k , it can be used in oper atio ns similar to plain numbers , e xcept that quantiti es w ith units c a n no t b e us e d a s a rg u m e n t s o f fu n c ti o n s ( s ay , SQ o r SI N ) . T hu s, a t t e mp t i n g to calc ulate LN(10_m) w ill pr oduce an err or mess age: E rro r: B ad A rgu m e nt T yp e. Her e ar e some calc ulation e xam ples using the AL G operatin g mode. Be w arned that , when m ultiply ing or di v iding quantities with units , y ou must enclosed eac h quantity with its units bet w een parenth eses . Thus , to enter , f or e x ample , the pr oduct 12 .5m × 5 .2_y d, type it to r e ad (12 . 5_m)*(5 .2_yd) ` :
Pa g e 3 - 26 whi ch sho ws as 6 5_(m ⋅ yd). T o conv ert to units of the SI s y stem , use f uncti on UB A SE: T o calc ulate a di visi on , say , 3 2 5 0 mi / 50 h , enter it a s (3 2 5 0_mi)/(5 0_h) ` : w hich tr ansfor med to S I units , w ith func tion UB ASE , pr oduces: Additi on and subtr actio n can be perfor med, in AL G mode, w ithout using par entheses, e .g . , 5 m 3 2 00 mm , can be enter ed simply as 5_m 3 2 00_mm ` : Mor e complicated e xpres sion r equir e the use of par entheses, e .g., (12_mm)*(1_cm^2)/( 2_s) ` : Not e: R ecall that the ANS(1) var ia ble is availa ble thro ugh the ke y str oke combinati on „î (as soc iate d w ith the ` key ) .
Pa g e 3 - 27 St ack calc ulations in the RPN mode , do not r equir e y ou to enc lose the diff er ent terms in par enth eses, e .g ., 12_m ` 1.5_y d ` * 3 2 50_mi ` 5 0_h ` / T hese oper ati ons pr oduce the f ollo w ing output: Also , tr y the f ollo wing oper ations: 5_m ` 32 0 0 _ m m ` 12_mm ` 1_cm^2 `* 2_s ` / T hese las t two ope rati ons pr oduce the f ollo wing o utput: Units manipulation tools T he UNIT S menu contains a T OOL S sub-menu , whi ch pr ov i des the f ollo w ing fu nct ions : CONVER T(x,y): conv ert unit objec t x to units of obj ect y UB A SE(x) : c onv ert unit objec t x to SI units UV AL(x) : extr act the value f r om unit objec t x Note: Units are not allo wed in e xpr essi ons enter ed in the eq uation w r iter .
Pa g e 3 - 28 UF A CT(x ,y) : fac tors a un it y fr om unit obj ect x  UNI T(x ,y) : combines v alue of x w ith units o f y T he UB A SE func tion w as disc ussed in detail in an earli er sec tio n in this cha pter . T o access any o f these f unctions f ollow the e xamples pro vided ear lier f or UB A SE . Notice that , w hile func tion UV AL r equir es onl y one ar gument , functi ons CONVER T , UF A CT , and  UNIT r equir e tw o ar guments . T ry the f ollo wing e xer c ises . The ou tput sho wn belo w was de v eloped in AL G mode w ith s ys tem flat 117 s et to SO F T m e nu : Ex amples of ! CONVER T T hese e x amples pr oduce the same r esult , i .e., t o conv ert 3 3 watts to btu s CONVER T(3 3_W ,1_hp) ` CONVER T(3 3_W ,11_hp ) ` The se oper ations ar e sho wn in the scr een as: Ex amples of UV AL: UV AL(2 5_ft/s) ` UV AL(0.0 21_cm^3) ` Ex amples of UF ACT UF A CT(1_ha,18_km^2) ` UF A CT(1_mm ,15 .1_cm) `
Pa g e 3 - 2 9 Ex amples of  UNI T  UNIT( 2 5,1_m) `  UNIT(11. 3,1_mph) ` Ph y sical constants in t he calculator F ollow ing a l ong the treatment o f units, w e disc uss the u se of ph ysi cal constants that ar e av ailable in the calc ulato r’s memory . Thes e ph ysi cal cons tants ar e cont ained in a const ants libr ary acti vat ed with the command CONLIB . T o launch this command y ou could simpl y t y pe it in the stack: ~~conlib~` or , yo u can select the command CONLIB f r om the command catalog, as fo llo ws: F irst , launch the catalog b y using: ‚N~c . Ne xt , use the up and do w n arr ow k ey s —˜ to select C ONLIB. F inally , pre ss the F ( @@ OK@@ ) soft men u ke y . Pr ess ` , if needed . T he const ants libr ar y s cr een wi ll look like the f ollow ing (use the do wn ar r o w k ey to nav igate thr ough the libr ar y) :
Pa g e 3 - 3 0 T he soft menu k ey s cor r esponding t o this CONS T A NT S LIBRAR Y sc r een inc lude the f ollo w ing func tions: SI when se lected , constants v alues ar e sho w n in SI units ENGL w hen se lected , constant s value s ar e sho w n in English units ( *) UNIT whe n select ed, co nstants ar e sho wn w ith units att ached (*) V AL UE whe n select ed, co nstants ar e sho wn w ithout units  S TK copi es value ( w ith or w ithout units) to the stac k QUIT e x it constants libr ary (*) Ac tiv e only if the func tion V AL UE is activ e. T his is the w a y the top of the CON S T ANT S LIBR AR Y sc r een looks when the option V AL UE is selected (units in the SI s yst em):
Pa g e 3 - 3 1 T o see the v alues of the const ants in the English (or Imperi al) s ys tem , pre ss the @ENGL opti on: If w e de -select the UNIT S opti on (pr ess @UNITS ) onl y the v alues ar e show n (English units se lected in this case): T o cop y the value o f Vm to the s tack , select the var iable name , and pr ess ! , then , pr ess @QUIT@ . F or the calculat or set t o the AL G , the sc r een w ill look lik e this: T he displa y show s w hat is c alled a tagged value , Vm:359.0394 . In her e , Vm, is the tag of this r esult . An y arithme tic oper ati on w ith this number w ill ignor e the tag. T ry , for e x ample: ‚¹2*„î` , whi c h pr oduces: T he same oper ati on in RPN mode wil l req uir e the fo llo w ing ke ys tr ok es (after the v alue of Vm wa s extr acted fr om the cons tants libr ar y): 2`*‚ ¹
Pa g e 3 - 32 Special ph ysical functions Menu 117 , tr igge r ed by u sing MENU(117) in AL G mode, or 117 ` MENU in RPN mode , pr oduces the fo llo w ing menu (labels lis ted in the displa y b y using ‚˜ ): Th e fu nct ion s i ncl ud e: ZF A CT O R: gas compr essibilit y Z f actor function F AN NI NG : Fan ni ng fr ict ion fact or fo r fl uid flow DARCY : Da r cy - W eis bach frictio n fa ctor for f lui d fl o w F0 λ : Black bod y emissi v e po w er functi on S IDENS: Silico n intr insic densit y TDEL T A: T emper atur e delta func tion In the second page of this menu (pr ess L ) we fi n d t h e fol lowi n g i t em s: In this menu page , there is one f uncti on (TINC) and a n umber of units des cr ibed in an earlier sec tion on units (see abo v e) . The f uncti on of inter est is: T INC: temper atur e incr ement command Out of all the f uncti ons av ailable in this MENU (UTILI TY menu), namel y , ZF A C T OR, F ANNING , D ARC Y , F0 λ , SIDEN S, TDEL T A, and T INC, f unctio ns F ANNING and D ARC Y ar e desc ribe d in Cha pter 6 in the conte xt of s ol v ing equati ons for p ipeline flo w . T he r emaining functi ons ar e desc r ibed follo w ing. Function ZF A CT OR F uncti on ZF A CT OR calculat es the gas compr essibility corr ec tion fac tor f or noni deal behav ior of h ydr ocarbon gas . The f uncti on is called by using
Pa g e 3 - 3 3 ZF A C T OR(x T , y P ) , w her e x T is the re duced temper atur e , i .e ., the r atio of ac tual temper ature t o pseudo -c ri tical temper ature , and y P is the r educed pr essur e , i .e ., the r atio of the ac tual pr essur e t o the pseudo -c r itical pr es sur e . The v alue of x T must be betw een 1. 05 and 3 . 0, while the value of y P mu st be betw een 0 and 30. Example , in AL G mode: Function F0 λ Fu n c ti o n F 0 λ (T , λ ) calc ulates the f r action (dimensi onless) o f total blac k -bod y emissi ve po w er at tempe ratur e T bet w een w av elengths 0 and λ . If n o u n it s a re attached to T and λ , it is implied that T is in K and λ in m. Ex ample , in AL G mode: Function SIDENS F uncti on S ID EN S(T) calc ulates the intr insic density of sili con (in units of 1/cm 3 ) as a func tion of temper ature T (T in K), f or T between 0 and 16 8 5 K . F or exa mp l e , Function TDEL T A F uncti on TDEL T A(T 0 ,T f ) y ields the tempe ratur e inc r ement T f – T 0 . T he re sult is r eturned w ith the same units as T 0 , if an y . Otherw ise , it re turns sim ply the diffe r ence in number s . F or e x ample , The purpose of this function is to fac ilitate the calc ulation of temperatur e diffe r ences gi v en tem per atur es in differ ent units. Otherw ise , it’s simply calc ulat es a su btr act ion , e. g .,
Pa g e 3 - 3 4 Function T I NC F uncti on T INC(T 0 , Δ T) calc ulates T 0 D T . T he operati on of this f uncti on is similar to that of f uncti on TDEL T A in the sense that it r eturns a r esult in the units of T 0 . Otherwise , it re turns a simple additi on of value s, e .g ., Defining and using functions Use rs can def ine the ir ow n functi ons by u sing the DEF command av ailable thought the k ey str ok e sequence „à (asso c iated w ith the 2 key ) . Th e func tion mu st be enter ed in the f ollo w ing for mat: F uncti on_name(ar guments) = e xpre ssi on_containing_ar guments F or ex ample , w e could def ine a simple functi on H(x) = ln( x 1) exp(- x) . Suppos e that y ou ha ve a need to e valuate this func tion f or a n umber of dis cr ete value s and, ther efor e , y ou want t o be a ble to pr ess a single button and get the r esult y ou w ant w ithout hav ing to t y pe the expr es sion in the r ight-hand side f or eac h separ ate v alue. In the f ollo w ing e xample , we a ssume y ou hav e set y our calc ulator to AL G mode . Enter the f ollo w ing sequence of k ey str okes: „à³~h„Ü~„x™‚Å ‚¹~„x 1™ „¸~„x` T he scr een w ill look lik e this:
Pa g e 3 - 3 5 Pr ess the J k ey , and y ou w ill notice that ther e is a ne w var iable in y our s oft menu k ey ( @@@H@@ ) . T o see the contents of this v ar iable pr ess ‚ @@@H@@ . T he scr een wi ll s how n o w: T hus , the var iable H contains a pr ogram de fined b y : <<  x ‘LN(x 1) EXP(x)’ >> T his is a simple pr ogr am in the def ault pr ogr amming language of the calc ulator . T his pr ogr amming language is called UserRP L . The pr ogr am sho w n abo ve is r elati v ely simple and consists of t w o pa rts , contained between the pr ogram cont ainers << >> : Θ Input:  x  x Θ Pr oces s: ‘LN(x 1) EXP(x) ‘ This is to b e interpr eted as sa ying: enter a value that is temporar i l y assigned to the name x (r ef err ed to as a local v a r iable) , e v aluate the e xpres sion betw een quot es that contain that local v ari able , and show the e valuated e xpr essi on . T o acti v ate the f unction in AL G mode, ty pe the name of the func tion f ollo wed b y the ar gument between par entheses, e .g., @@@H@@@ „Ü2` . S ome e x amples ar e sho wn be lo w: In the RPN mode , to ac ti vate the f unc tion enter the ar gument fir st , then pr es s the so ft menu k e y corr esponding to the v ar iable name @@@H@@@ . F or ex ample , y ou could try : 2 @@@H@@@ . T he other e x amples sho w n abo v e can be enter ed by using: 1.2 @@@H @@@ , 2`3/ @@@H@@@ . F uncti ons can hav e mor e than 2 ar guments. F or e x ample , the scr een belo w sho w s the defi nition of the f unctio n K( α , β ) = α β , and its ev aluati on w ith the ar guments K( √ 2, π ), and K(1.2 ,2 . 3):
Pa g e 3 - 3 6 T he contents of the v ar iable K ar e: <<  α β ‘ α β ’ >>. Functions defined b y mor e than one e xpression In this secti on w e disc us s the treatme nt of f uncti ons that are de fi ned by tw o or mor e e xpre ssio ns. An e x ample o f such f uncti ons wo uld be The fun ct ion IFT E ( I F- Th en -E lse ) d escri be s su ch fu nct ions. T he IFTE func tion T he IFTE fu nction is w r itten as IFT E( condition , operati on_if_true , oper atio n_if_fals e ) If conditi on is true then ope rati on_if_true is perfor med, els e op e rati on_if_false is perf ormed . F or e x ample , w e can wr ite ‘f(x) = IF TE(x>0, x^2 -1, 2*x -1)’ , to desc r ibe the func tion list ed abo ve . Func tion IFTE is acce ssible fr om the func tion catalog ( ‚N ) . The s y mbol ‘>’ (great er than) is av ailable as (as soc iated w ith the Y k ey). T o define this f unction in AL G mode us e the command: DEF(f(x) = IFTE(x>0, x^2 -1, 2*x -1)) then , pr ess ` . In RPN mode, ty pe the func tion def inition betw een apostr op hes: ‘f(x) = IFTE(x>0, x^2 -1, 2*x- 1)’ then pr ess „à . Press J to re cove r you r va ria bl e m en u. Th e fu n ct io n @@@f@@@ should be a v ailable in y our so ft k ey men u . Pr ess ‚ @@@f@@@ to see the r esulting pr ogr am: <<  x ‘IFTE(x>0, x^2 -1, 2*x -1)’ >> T o e valuate the f uncti on in AL G mode , type the f uncti on name, f , f ollo w ed by the nu mb er at wh ich you wan t t o eva lu at e t he fun ct ion, e . g . , f (2) , t he n p ress ` . In RPN mode , enter a number and pr ess @@@f@@@ . Chec k, f or e x ample , that f( 2) = 3 , wh ile f(- 2) = -5 . ⎭ ⎬ ⎫ ⎩ ⎨ ⎧ > − < − ⋅ = 0 , 1 0 , 1 2 ) ( 2 x x x x x f
Pa g e 3 - 37 Combined IFTE functions T o pr ogr am a mor e compli cated f uncti on such as y ou can combine se v er al le ve ls of the IFTE func tion , i .e ., ‘ g(x) = IFTE(x<- 2 , - x, IF TE(x<0, x 1, IFTE(x<2 , x -1, x^2)))’ , Def ine this func tion b y an y of the means pr esent ed abo ve , and c hec k that g(-3) = 3, g(-1) = 0, g(1) = 0, g(3) = 9 . ⎪ ⎪ ⎩ ⎪ ⎪ ⎨ ⎧ ≥ < ≤ − < ≤ − − < − = 2 , 2 0 , 1 0 2 , 1 2 , ) ( 2 x x x x x x x x x g
Pa g e 4 - 1 Chapter 4 Calculations with compl e x numbers T his chapte r show s e xam ples of calc ulations and a pplication o f functi ons to comp lex n umbers . Definitions A comple x number z is a number w r itten as z = x iy , wher e x and y ar e r eal numbers , and i is the imaginar y unit de fined b y i 2 = - 1. The comple x number x iy has a r eal par t, x = Re(z), and an imaginary par t, y = Im(z) . We c a n think of a comple x number as a point P(x ,y) in the x-y plane , w ith the x -ax is r efer r ed to as the r eal ax i s, and the y-ax is re fe rr ed to as the ima ginary ax i s. T hus , a comple x number r epr es ented in the f orm x iy is said to be in its Car tesian repr esentat i o n . An alter nativ e Cartesian r epre sentati on is the or der ed pair z = (x ,y) . A comple x number can also be r epre sented in polar coor dinates (polar r epr esentatio n) as z = r e i θ = r ⋅ cos θ i r ⋅ sin θ , w here r = |z| =i s t h e magnitude of the complex number z , and θ = Ar g(z) = ar ctan( y/x) is the ar gumen t of the co mple x number z . T he re lationship be tween the Cartesian and po lar repr esentati on of comple x numbers is gi ven b y the E uler f or mula : e i θ = cos θ i sin θ. The complex co njugate of a comple x number z = x iy = r e i θ , is ⎯ z = x – iy = re -i θ . T he comple x conjugate of i can be thought of as the r eflec tion of z about the r eal ( x ) axis . Similarl y , the negati ve of z , –z = - x -iy = - r e i θ , can be thought of a s the r ef lecti on of z about the or igin . Setting t he calculator to COMP LEX mode When w orking with comple x numbers it is a good idea to set the calculator to comple x mode , using the f ollo w i ng k e ys tr ok es: H ) @@CAS@ ˜˜™ @ @CHK @ T he COMP LEX mode w ill be selected if the CA S MODE S sc r een sho ws the option _C omple x chec k ed, i .e ., 2 2 y x
Pa g e 4 - 2 Press @@OK@@ , t w ice , to r eturn to the stack . Enterin g comple x numbers Comple x numbers in the calc ulator can be enter ed in either of the tw o Car tesian repr esenta tions, nam el y , x iy , or (x ,y) . T he r esults in t he calc ulator w ill be show n in the or der ed-pair format , i.e ., (x ,y) . F or e x ample , w ith the calc ulato r in AL G mode , the comple x number ( 3 . 5,-1. 2), is enter ed as: „Ü3.5‚í\1.2` A comple x number can also be enter e d in the f or m x iy . F or e x ample , in AL G mode , 3 . 5-1.2i is enter ed as: 3.5 -1.2*„¥` The f ollo wing sc r een r esults af ter ente ring thes e complex number s: In R PN mo de , th ese numb ers w il l be entered us ing the f ol lo w in g k ey str okes: „Ü3.5‚í1.2\` (Notice that the c hange -sign k e y str oke is en ter ed after the numbe r 1.2 ha s been enter ed, in the oppo site or der as the AL G mode ex er c ise) . T he r esulting RPN sc r een wi ll be:
Pa g e 4 - 3 Notice that the las t entr y sho ws a comple x number in the f orm x iy . T his is so becaus e the number w as enter ed bet w een single quot es, w hic h r epr ese nts an algebr aic e xpr essi on . T o ev aluate this number u se the EV AL k e y( μ ). Once the algebr aic e xpr essi on is e val uated, y ou reco v er the comple x number (3 .5,1 .2) . P olar r epresentation o f a compl e x number T he re sult sho wn a bov e repr esents a Cartesi an (rec tangular ) re pre sentati on of the comple x number 3 . 5-1.2i . A polar r epr esent ation is po ssible if w e change the coor dinate s y stem to c ylindr ical or polar , by u sing func tion C YLIN. Y ou can find this functi on in th e cat alog ( ‚N ) . Ch a n g in g t o po l a r s h ows th e re su l t ! in RPN mode: F or this re sult , it is in standar d not ation and the angular measur e is set to r adians (y ou can alw ay s change to r adians by u sing functi on R AD). The r esult sho w n abov e re pr esents a magnitude , 3 .7 , and an angle 0. 3 30 2 9…. The angle s y mbol ( ∠ ) is sho wn in f r ont of the angle measur e . R eturn to Cartes ian or r ectangular coor dinates by u sing func tion RE CT (a vailable in the cat alog , ‚N ) . A comple x number in polar r epresentati on is wr itten as z = r ⋅ e i θ . Y ou can enter this comple x number int o the calc ulator b y using an or der e d pair o f the fo rm (r , ∠θ ) . T he angle s y mbol ( ∠ ) can be enter ed a s ~‚6 . F or e xample , the complex n umber z = 5. 2 e 1.5i , can be ent er ed as fo llo ws (the f igur es sho w the st ack , bef or e and after enter ing the number ): Becau se the coordinat e sy stem is set t o r ectangular (or C ar t esian) , the calc ulator automati cally con v erts the number enter ed to Cartesian coor dinates, i .e ., x = r cos θ , y = r sin θ , r esulting, for this cas e , in (0. 3 6 7 8… , 5 .18…) .
Pa g e 4 - 4 On the other hand , if the coor dinate s yst em is set to c ylindr ical coor dinates (us e C YLIN) , ent ering a com plex n umber (x,y), wher e x and y are r eal numbers , will pr oduce a polar repr esentati on . F or e x ample , in c y lindr ical coor dinates , enter the number (3 .,2 .) . T he fi gur e belo w show s the RPN st ack , bef or e and after enter ing this number : Simple oper ations with comple x numbers Comple x numbers can be comb ined using the fo ur fundamental ope r ations ( -*/ ) . T he r esults f ollo w the r ules of algebr a w ith the cav eat that i 2 = -1 . Oper ati ons wi th complex n umbers ar e similar to thos e with r eal numbers . F or e xample , w ith the calc ulator in AL G mode and the CA S s et to Com plex , w e’ll attempt the f ollo wing sum: ( 3 5i) (6 - 3 i) : Notice that the r e al parts (3 6) and imaginary par ts (5-3) ar e combined together and the re sult gi ve n as an or der ed pair w ith r eal part 9 and imagina ry part 2 . T r y the f ollo w ing oper ations on y our ow n: (5- 2i) - (3 4i) = ( 2 ,-6 ) (3 -i )· (2 - 4i ) = (2 , -1 4) (5- 2i)/(3 4i) = (0.2 8 ,-1. 04) 1/(3 4i) = (0.12 , -0.16) Notes: T he pr oduct of tw o number s is r epr esent ed by : (x 1 iy 1 )(x 2 iy 2 ) = (x 1 x 2 - y 1 y 2 ) i (x 1 y 2 x 2 y 1 ). T he div isi on of tw o comple x number s is accomplished b y multiply ing both numer ator and denominator b y t he comple x conj ugate of the den ominator , i. e. ,
Pa g e 4 - 5 Changing sign of a complex number Changing the si gn of a comple x number can be accomplish ed by u sing the \ k e y , e. g., -(5-3 i) = -5 3i Entering the unit imaginary number T o ent er the unit imaginar y number ty pe : „¥ Notice that the n umber i is enter e d as the or der ed pair (0,1) if the CAS is s et to AP PR O X mode . In EX A CT mode , the unit imaginar y numbe r is enter ed as i . Other op er atio ns Oper ations suc h as magnitude , ar gument , r eal and imaginar y parts, and comple x conj ugate ar e av ailable thr ough the CMP LX menus detailed lat er . T he CMPLX menus T here ar e two CMP LX (CoMP LeX number s) menus a vailable in the calc ulator . One is av ailable thr ough the M TH men u (intr oduced in Cha pter 3) and one dir ectl y into the k ey board ( ‚ß ). T he two CMP LX menus ar e pres ented ne xt . T hus , the inv erse f uncti on INV (acti vated w ith the Y k e y) is de f ined as 2 2 2 2 2 1 1 2 2 2 2 2 2 1 2 1 2 2 2 2 2 2 1 1 2 2 1 1 y x y x y x i y x y y x x iy x iy x iy x iy x iy x iy x − ⋅ = − − ⋅ = 2 2 2 2 1 1 y x y i y x x iy x iy x iy x iy x ⋅ = − − ⋅ =
Pa g e 4 - 6 CMP LX menu through the MTH menu Assuming that s y st em flag 117 is se t to CHOOSE bo x es (s ee Chapter 2), the CMPLX sub-men u w ithin the MTH menu is acc essed by using: „´9 @@OK@ @ . The follo wing sequen ce of scr een shots illustr ates t hese steps: T he fir st menu (opti ons 1 through 6) sho w s the follo w ing functi ons: RE(z) : R eal part o f a comple x number IM(z) : Imaginary par t o f a com ple x number C → R(z) : T ake s a complex n umber (x ,y) and separ ates it in to its r eal and imaginar y parts R → C(x,y): F or ms the complex n umber (x,y) out o f real number s x and y ABS(z) : Calc ulates the magnitude of a comple x number or the abs olute value of a r eal number . ARG(z): Calc ulate s the ar gument of a comple x number . T he r emaining op ti ons (opti ons 7 thr ough 10) ar e the fo llo w ing: S IGN(z) : Calc ulates a comple x number of unit magnitude as z/|z|. NE G : Change s the sign of z CONJ(z): Pr oduces the com ple x conjugat e of z Ex amples of a pplicati ons of thes e func tions ar e sho wn ne xt. R ecall that, f or AL G mode , the func tion mu st pr ecede the argume nt , w hile in RPN mode , y ou enter the ar gument f irst , and then select the f uncti on . Also , re call that y ou can get these f uncti ons as soft menu s by c hanging the setting of s yst em flag 117 (See Chapter 3) .
Pa g e 4 - 7 T his fir st sc r een sho ws f uncti ons RE , IM, and C  R . Noti ce that the last f uncti on r eturns a list {3 . 5 .} re pre senting the r eal and imaginar y compone nts of the comp lex n umber : T he follo wing s cr een sho ws func tions R  C, AB S , and ARG . Notice that the AB S functi on gets tr anslated to |3 . 5 .·i|, the notation o f the absolu te value . Als o , the r esult of f uncti on ARG , whi ch r epre sents an angle , w ill be gi ve n in the units of angle measur e c urr entl y selec ted . In this ex a m ple , ARG( 3 . 5 .·i) = 1. 0 30 3… is gi ve n in r adians. In the ne xt scr een w e pr es ent e x amples of f uncti ons SIGN , NE G (w hic h sho w s up as the negativ e sign - ) , and C ONJ. CMP LX menu in k e yboar d A second CMPLX menu is acces sible by using the r ight-shift opti on ass oci ated w ith the 1 k ey , i .e., ‚ß . W ith s ys tem f lag 117 set to CHOO SE bo x es , the k e yboar d CMPLX men u show s up as the follo wing sc r eens:
Pa g e 4 - 8 T he re sulting menu inc lude some of the f uncti ons alread y intr oduced in the pr e vi ou s secti on , namely , AR G , AB S , CONJ , IM, NEG , RE , and SIGN . It also inc ludes fu nctio n i whi ch s erve s the same pur pos e as the k e y str ok e comb ination „¥ , i .e ., to enter the unit imaginar y number i in an expr essi on. The k ey board-bas e CMPLX menu is an alter nativ e to the M TH-based CMP LX menu containing the ba sic comple x number f uncti ons. T r y the e x amples sho wn earli er using the k ey boar d-bas ed CMP LX menu f or pr acti ce. F unc tions applied to comple x numbers Man y of the k e yboar d -ba sed functi ons def ined in Cha pter 3 f or r eal numbers , e .g., S Q , ,LN , e x , L OG , 10 X , SIN , CO S , T AN, A SIN , A CO S, A T AN, can be appli ed to com ple x number s. T he r esult is another co mple x number , as illus tr ated in the f ollo w ing ex amples. T o a pply this f unct ions u se the same pr ocedur e as pr esented for r e al n umbers (see Chapter 3) .
Pa g e 4 - 9 Functions fr om th e MTH menu T he h yper bolic f uncti ons and their in v ers es , as w ell as the Gamma, P SI , and P si func tions (spec ial f uncti ons) we re introduced and appli ed to r eal numbers in Chapte r 3 . Thes e functi ons can also be appli ed to comple x numbers b y fo llo w ing the procedur es pr esented in Chapte r 3 . Some e xample s are sho wn belo w : T he follo wing s cr een sho w s that functi ons EXP M and LNP1 do not appl y to comple x number s. Ho we v er , func tions G AMMA, P SI , and P si accept comple x numbers: Function DROI TE: equation of a str aight line F uncti on DROI TE tak es as ar gument two comple x number s, sa y , x 1 iy 1 and x 2 iy 2 , and r eturns the eq uation of the str aight line , say , y = a bx, that contains the po ints (x 1 ,y 1 ) and (x 2 ,y 2 ) . F or ex ample , the line betw een points A(5,-3) and B(6,2) can be f ound as fo llo ws (e xample in Algebr a i c mode) : Not e: When u sing trig onometri c functi ons and their in ver ses w ith comple x numbers t he ar g uments are no longer a ngles. Ther efor e, the ang ular me asur e selec ted f or the calculat or has no bearing in the calc ulati on of these f uncti ons w ith comple x argume nts. T o unders tand the wa y that tr igonometr ic func tions , and other func tions , are de fined f or comple x number s consult a book on complex v ar iables .
Pa g e 4 - 1 0 F uncti on DROI TE is f ound in the command catalog ( ‚N ). Using E V AL(AN S(1)) simplif ies the r esult to:
Pa g e 5 - 1 Chapter 5 Algebraic and ar it hmetic oper ations An algebr aic ob ject , o r simpl y , algebr aic , is an y number , var i able name or algebr aic e xpr essi on that can be operat ed upon , manipulated, and comb ined accor ding to the rule s of algebr a . Example s of algebr aic ob jec ts ar e the fo llo w ing: • A number : 12 .3, 15 .2_m, ‘ π ’, ‘ e ’, ‘ i ’ • A var iable name: ‘ a’ , ‘ ux ’ , ‘ wi dth ’ , etc. • An e xpres sio n: ‘ p*D^2/4’ , ’f*(L/D)*(V^2/( 2*g))’ • An eq uation: ‘Q=(C u/n)*A(y)*R(y)^(2/3)*S o^0. 5’ Entering algebr aic objec ts Algebr aic ob jec ts can be c r eated b y typ ing the ob ject betw een single quot es dir ectl y into st ack le ve l 1 o r by using the eq uation w r iter ‚O . F or e x ample , to ent er the algebr aic obj ect ‘ π *D^2/4’ dir ectl y into s tack le vel 1 use: ³„ì*~dQ2/4` . The r esulting sc r een is sho w n ne xt for both the AL G mode (left -hand si de) and the RPN mode (ri ght- hand side): An algebr aic obj ect can also be built in the E quati on W r iter and then sent to the stac k . The oper ation of the E quation W r iter w as desc ri bed in Chapter 2 . As an e xer c ise , build the f ollow ing algebrai c objec t in the E quation W riter : After building the obj ect , pr es s to sho w it in the stac k ( AL G and RPN modes sho w n belo w) : Simple oper ations with algebraic objects Algebr aic ob jec ts can be added , subtrac ted, multipli ed, di vi ded (ex cept by z ero), rais ed to a po we r , used as ar guments fo r a var iety of s tandard f uncti ons
Pa g e 5 - 2 (e xponential , logar ithmic , tr igonometry , h yper bolic , etc .) , as y ou would an y r eal or comple x number . T o demonstr ate basi c oper ations w i th algebr aic obj ects , let’s cr eate a c o up le of objects , say ‘ π *R^2’ and ‘ g*t^2/4’ , and stor e them in var iables A1 and A2 (See C hapter 2 to learn ho w to c r ea te v ari ables and store value s in them) . Her e ar e the ke ys tr ok es fo r stor ing var i ables A1 in AL G mode: ³„ì*~rQ2™ K ~a1 ` , r esulting in: T he k ey str ok es cor r esponding to RPN mode ar e: ³„ì*~r Q2`~a1 K After st or ing the var iable A2 and pr es sing the k ey , the s cr een will sho w the var iables as fo llo ws: In AL G mode , the f ollo w ing k ey str ok es w ill sho w a number of ope rati ons w ith the algebr aic s cont ained in var i ables @@A1@@ and @@A2@ @ (pr ess J to reco ver va riab le m enu ) : @@A1@@ @@A2@@ ` @@A1@@ - @@A2@@ ` @@A1@@ * @@A 2@@ ` @@A1 @@ / @@A2@@ `
Pa g e 5 - 3 ‚¹ @@A1@ @ „¸ @@A2@ @ T he same r esults ar e obtained in RPN mode if using the fo llo w ing ke ys tr ok es: @@A1@ @ @@A2@ @ μ @ @A1@@ @@A2@@ -μ @@A1@ @ @@A2@ @ *μ @@A1@@ @@ A2@@ /μ @@A1@@ ʳ ‚¹ μ @@A2@ @ ʳ „¸ μ Functions in the AL G menu T he AL G ( Algebr aic) menu is av ailable b y using the k e ys tr ok e seq uence ‚× (ass oc iated w i th the 4 k ey). With s yste m flag 117 set to CHOO SE bo x es , the AL G menu sho w s the fo llo w ing functi ons: R ather than listing the de sc ri ption of eac h f uncti on in this manual , the u ser is in vi ted to look up the des cr iption using the calc ulato r’s help f ac ility: I L @) HELP@ ` . T o locate a par ti c ular functi on , t y pe the f irst letter o f the functi on . F or ex ample , for f uncti on COLLE CT , w e t y pe ~c , then us e the up and do w n arr o w k ey s, —˜ , to locate COLLE CT within the help w indo w . T o complete the oper ation pr ess @@ OK@@ . Her e is the help sc ree n for f unction COL LECT :
Pa g e 5 - 4 W e notice that , at the bottom of the sc r een , the line See: EXP AND F A CT OR suggests links t o other help f ac ility entr ies , the f unctions E XP AND and F A CT OR. T o mo ve dir ectly t o those entr ie s, pr ess the soft men u k ey @SEE1! for E XP AND , and @SEE2! for F A CT OR . Pre ssing @SEE1 ! , f or ex ample, sho ws the fo llo w ing i nfo rma ti on fo r E XP A ND : Help fac ility A help fac ilit y accessible vi a T OOL NEX T CA S CMD allow s y ou to bro wse thr ough all the CAS commands . It pr o v ides not onl y infor mation on eac h command , but also pr o v ides an e x ample of its a pplicati on. T his e xam ple can be copi ed onto y our stac k b y pr essing the @ECHO ! so ft menu k ey . F or e x ample , fo r the EXP AND entry show n a bov e, pr ess the @ECHO! soft menu k e y to get the fo llo w ing ex ample copied to the stac k (pr ess ` to e xec ute the command) : W e lea ve f or the u ser to e xplore the lis t of CA S f unctions a vaila ble . Here ar e a couple of e xamples: T he help f ac ility will sho w the follo wing in for mation on the commands: COL LECT : EXP A ND:
Pa g e 5 - 5 F A CT OR: LNC OLLECT : LIN: P ARTFRA C: S OL VE: S UBS T : TEXP AND: Not e: R ecall that , to use these , or any othe r functi ons in the RPN mode, y ou mus t enter the ar gument f irst , and then the func tion . F or e x ample , the e x ample for TE XP AND , in RPN mode will be s et up as: ³„¸ ~x ~y` At this point , select f uncti on TEXP AND fr om menu AL G (or direc tl y fr om the catalog ‚N ) , to complete the operati on.
Pa g e 5 - 6 Other forms o f substitution in alg ebr aic e xpressions F uncti ons SUB S T , sho wn abo v e , is used to subs titute a var ia ble in an expr ession . A second f orm of substituti on can b e accomplished b y using the ‚¦ (ass oc iated w ith the I k e y) . F or e xample , in AL G mode , the fol lo w ing entry wi ll subs titute the v alue x = 2 in the e xpr ession x x 2 . The f igur e to the left sh o ws the w ay to en ter the e xpr essio n (the substitu ted value , x=2 , must be enc losed in par enthes es) bef or e pr essing ` . After the ` ke y is pressed , th e r esult is sho w n in the r ight-hand fi gur e: In RPN mode , this can be accomplished by en ter ing f irst the e xpr essi on wher e the sub stituti on w ill be perfor med (x x 2 ) , f ollow ed b y a list (see Chapter 8) containing the sub stituti on v ari able , an space , and the v alue to be sub stitut ed, i .e ., {x 2}. The f inal step is to pr es s the ke ys tr ok e combination : ‚¦ . T he r equir ed k e y str okes ar e the follo w ing: ³~„x ~„xQ2` „ä~„x#2` ‚¦` In AL G mode , subs tituti on of mor e than one v ar iable is po ssible as illu str ated in the f ollo w ing ex ample (sho w n befo r e and af t er pr essing ` ) In RPN mode , it is also possible to subs titute mor e than one var i able at a time, as illus tr ated in the e xample belo w . R ecall that RPN mod e u ses a lis t of v ari able names and v alues f or substitu tion .
Pa g e 5 - 7 A differ ent appr oach to subs titution consis ts in def ining the substituti on e xpr essi ons in calc ulator v ar iables and plac ing the name of the var iables in the or iginal e xpr essi on . F or e xample , in AL G mode , stor e the fo llow ing var ia bles: Then , enter the e xpre ssion A B: T he last e xpr essi on enter e d is a utomati cally e valuated after pr es sing the ` k e y , pr oduc ing the r esult sho wn abo v e . Operations w ith transcendental functions T he calculat or offe rs a number of f uncti ons that can be used t o replace e xpre ssi ons containing logar ithmic , e xponen tial , trigonometr ic , and hy per bolic func tions in ter ms of tri gonometri c identitie s or in terms of e xponential functi ons. T he menus co ntaining f uncti ons to r eplace tr igonometr ic func tions can be obtained dir ectl y fr om the ke yboar d b y pre ssing the ri ght -shift k e y fo llow ed b y the 8 k ey , i .e., ‚Ñ . T he combinati on of this k e y w ith the le ft -shift k e y , i .e ., ‚ Ð , pr oduces a men u that lets y ou r eplace expr essi ons in ter ms of e xponenti al or natur al logar ithm functi ons . In the ne xt secti ons w e co ve r those menus in mor e detail. Expansion and factoring using log-e xp func tions Th e „Ð pr oduces the f ollo w ing menu: Inf ormatio n and ex ample s on these commands ar e av ailable in the help fac ilit y of the calc ulator . Some of the command listed in the EXP& LN menu , i .e ., LIN,
Pa g e 5 - 8 LNCOLLE CT , and TEXP AND ar e also contained in the AL G menu pr es ented earli er . F uncti ons LNP1 and EXP M wer e intr oduced in menu HYP ERBOLIC, under the MTH men u (See Chapt er 2) . T he only rem ainin g fun ctio n i s EXPL N. Its des cr ipti on is sho w n in the left-hand side , the e x ample fr om the help f ac ility is sho w n to the r ight: Expansion and factoring using trigonometric functions T he TRIG menu , tr igger ed by u sing ‚Ñ , show s the fo llo w ing functi ons: T hese functi ons allo w to simplif y e xpr essi ons b y r eplacing s ome categor y o f tr igonometr ic f unctions f or another one . F or ex ample , the functi on A CO S 2S allo w s to r eplace the func tion ar ccosine (aco s(x)) w ith its e xpr es sion in t erms o f ar csine (asin(x)). Desc r iption of thes e commands and ex amples of the ir applicati ons ar e av ailable in the calc ulator ’s help fac ility ( IL @HELP ) . T he user is in v ited to e xplor e this fac ilit y to f ind info rmation on the commands in the TRIG men u . Notice that the f irs t command in the TRIG menu is the HYPERBOLIC men u , w hose f uncti ons w er e intr oduced in Chapt er 2 .
Pa g e 5 - 9 Functions in the ARITHME T I C menu T he ARITHME T IC menu cont ains a number of sub-menu s for s pec ifi c appli cations in n umber theory (int egers , poly nomials , etc .) , as w ell as a nu mber of f uncti ons that apply to ge ner al arithme tic ope rati ons . The AR ITHME TI C menu is tr igge r ed through the k ey str ok e combinati on „Þ (asso c iated w ith the 1 k e y) . With s y st em flag 117 set to CHOOSE bo xe s , „Þ sho w s the f ollo w ing menu: Out of this me nu list , optio ns 5 through 9 ( D IV IS, F ACTORS, L G CD, PROP F R A C , SI MP 2 ) corr espond to common functions that apply to integ er numbers or to poly nomials . The r emaining opti ons ( 1. INTEGER , 2 . P OL YNOMIAL , 3. MODU L O , and 4. PERMUT A TI ON ) ar e actuall y sub-menu s of f uncti ons that appl y to spec ifi c mathematical object s. T his distinc tion betw een sub-menu s (options 1 thr ough 4) and plain functi ons (options 5 thr ough 9) is made c lear w hen sy stem f lag 117 is set to SO F T m e n us . Ac ti vating the ARI THME TIC men u ( „Þ ) , unde r these c ir c umstances , pr oduces: F ollo wing , we pr esent the help fac ilit y entr ies f or the func tions of optio ns 5 thr ough 9 in the ARITHME TIC men u ( IL @HELP ): DIVIS: F A CT ORS:
Pa g e 5 - 1 0 L GCD (Greatest C ommon Denominator): P ROPFRA C (pr oper fr action) SI MP 2 : T he functi ons ass oci ated w ith the ARITHME T IC submenus: INTE GER , P OL YNOMIAL , MODUL O , and PERMUT A TION , are the fo llow ing: INT EG ER me nu EU LE R N u mb e r of in te g er s < n, c o - p rim e w i th n IABCUV Sol v es au b v = c , w ith a,b ,c = integer s IBERNOULLI n -th Ber noulli numbe r ICHINREM C hinese r eminder fo r intege rs IDIV2 E ucli dean div ision of tw o integer s IE GCD R eturns u ,v , suc h that au bv = gcd(a ,b) IQUO T E ucli dean quoti ent of two integer s IREMAINDER E ucli dean r emainde r of tw o intege rs ISP RIME? T est if an inte ger number is prime NEXTP RIME Ne xt pr ime fo r a giv en integer n umber P A2B2 Pr ime number as s quar e norm o f a complex n umb e r PR EVPR IME Pr ev ious pr ime f or a gi v en integer n umber PO L Y NO M I AL m en u ABCUV Béz out poly nomial equati on (au b v=c) CHINREM Chine se r emainder for pol y nomials CY C L OT OM IC n - t h cycl oto mic po lyno mia l DIV2 E uc lidean di v ision o f t w o poly nomials E GDC R eturns u ,v , fr om au b v=gcd(a,b)
Pa g e 5 - 1 1 F A CT OR F act ori z es an integer n umber or a poly nomial FCOEF Gener ates f rac tio n giv en r oots and multipli c ity FR OO T S Retur ns r oots and multiplic it y gi v en a fr action GCD Gr eatest common div isor of 2 numbers or pol y nomials HERMITE n -th degree Her mite pol yn omial HORNER Horner e v aluation o f a pol yno mial L A GRANGE Lagr ange poly nomi al interpolati on L CM L o w est common multiple of 2 number s or poly nomi als LE GENDRE n -th degr ee Lege ndr e poly nomial P AR TFR A C P ar ti al-fr acti on decompositi on of a gi ve n fr acti on P COEF (help-fac ility entry mis sing) P T A YL R eturns Q(x -a) in Q(x -a) = P(x) , T ay lor pol y nomial QUO T Euc lidean quotient of two pol y nomials RE SUL T ANT Determinant o f the S y lv est er matr ix o f 2 poly nomi als REMAINDER E ucli dean r eminder of tw o poly nomi als S T URM Stur m seq uences fo r a poly nomial S TURMAB Sign at lo w bound and number of z er os betw een bounds MODUL O menu ADD TMOD Add tw o e xpr essi ons modulo c urr ent modulu s DIVMOD Di vi des 2 pol yn omials modulo c ur ren t modulus DIV2MOD E ucli dean di v ision of 2 pol y nomi als w ith modular coeff ic ients EXP ANDMOD Expands/simplify pol y nomial modulo c urr ent modulus F A CT ORMOD F act ori z e a pol y nomial modul o c urr ent modulu s GCDMOD GCD of 2 pol y nomi als modulo cur r ent modulus INVMOD in ve rs e of intege r modulo cu rr ent modulu s MOD (not ent r y a vaila ble in the help fac ilit y) MOD S T O Changes modulo se t ti ng to spec if ied v alue MUL TMOD Multipli cation of tw o pol yn omials modulo c urr ent modulus P O WMOD Raise s poly nomi al to a pow er modulo c urr ent modulu s S UB TMOD Subtr acti on of 2 pol yn omials modulo c urr ent modulus
Pa g e 5 - 1 2 Applications of the ARI THME T I C menu T his s ectio n is intended to pr es ent some of the back ground neces sar y f or appli cation of the ARI THMET IC menu f unctions . Def initions ar e pr esen ted ne xt r egarding the su bj ects of pol ynomials , pol ynomi al fr acti ons and modular ar ithmetic . T he ex amples pr esented belo w ar e pr esente d independently o f the ca lc ula tor set ting (AL G or RPN) Modular arithmetic Consi der a counting s y stem of integer nu mbers that per iodi cally c yc les bac k on itself and starts again, suc h as the hours in a cloc k. Suc h counting sy stem is called a ri n g . Becaus e the n umber of integers u sed in a r ing is finite , the ar ithmetic in this r ing is called finit e arithmeti c . Let our s yste m of finite integer number s consists of the number s 0, 1, 2 , 3, …, n -1, n . W e can also r ef er to the ar ithmetic of this counting s yst em as modular arithme tic of modulu s n . In the case of the hour s of a c lock , the modulu s is 12 . (If w orki ng wi th modular ar ithmetic u sing the hours in a c lock , ho w e ve r , we w ould ha ve t o use the inte ger number s 0, 1, 2 , 3, …, 10, 11 , r ather than 1, 2 , 3,…,11, 12). Operations in modular arithm etic Additi on in modular arithmeti c of modulus n, whi ch is a positi ve integer , follo w the rule s that if j an d k ar e an y two no nnegativ e integer n umbers , both smaller than n , if j k ≥ n , then j k is de f ined as j k - n . F or e x ample , in the case of the cl ock, i . e . , fo r n = 12 , 6 9 “=” 3 . T o distinguish this ‘ equality’ fr om infini te arith metic e qual ities, th e s ymbo l ≡ is used in place of the eq ual sign , and the r elationship be twee n the numbers is r efer r ed to as a congruence rather than an equalit y . Thu s, f or the pre vi ous e xample w e would w r ite 6 9 ≡ 3 (mod 12) , and r ead this expr ession a s “ si x plus nine is congr uent to thr ee, modulu s tw el v e . ” If the numbers r epres ent the hours since mi dnight , for e xample , the congr uence 6 9 ≡ 3 (mod 12) , can be interpr eted as sa y ing that “ six hour s past the ninth hour after midni ght will be thr ee hours past noon. ” Other sums that can be def i ned in modulu s 12 ar ithmetic ar e: 2 5 ≡ 7 (mod 12); 2 10 ≡ 0 (mod 12); 7 5 ≡ 0 (mod 12) ; e tcet er a . Th e ru le for subtr actio n w i l l be suc h that if j – k < 0 , then j-k is def ined as j-k n . Th erefore, 8-10 ≡ 2 (mod 12) , is r e ad “ ei ght minus te n is congruent to tw o , modulus tw el ve . ” Other e x amples of su btrac tion in modulus 12 ar ithmeti c w ould be 10 -5 ≡ 5 (mod 12) ; 6 -9 ≡ 9 (mod 12) ; 5 – 8 ≡ 9 (mod 12); 5 –10 ≡ 7 (mod 12); etceter a . Multiplicati on follo ws the r ule that if j ⋅ k > n , so that j ⋅ k = m ⋅ n r , w here m and r ar e nonnegati ve inte gers , both less than n , then j ⋅ k ≡ r (mod n ) . T he re sult of
Pa g e 5 - 1 3 multipl y ing j times k in modulus n arithmeti c is, in essence , the integer r emainder o f j ⋅ k /n in infinit e arithmeti c , if j ⋅ k>n . F or e xample , in modulus 12 ar ithmetic w e hav e 7 ⋅ 3 = 21 = 12 9 , (or , 7 ⋅ 3/12 = 21/12 = 1 9/12 , i .e ., the int eger r eminder of 21/12 is 9). W e can no w wr ite 7 ⋅ 3 ≡ 9 (mod 12) , and r ead the latter re sult as “ se ve n times thr ee is congruent to nine , modulus twel v e .” Th e o pera tio n of di v ision can be def ined in ter ms of multipli cation as f ollo ws, r/ k ≡ j (mod n ), i f , j ⋅ k ≡ r (mod n ). T his means that r must be the r emaind er of j ⋅ k/n . F or e xample , 9/7 ≡ 3 (mod 12) , because 7 ⋅ 3 ≡ 9 (mod 12) . Some di v isions ar e not per mitted in modular arit hmetic . F or e x ample , in modulus 12 ar ithmetic y ou cannot def ine 5/6 (mod 12) because the mul tiplicatio n table o f 6 does no t sho w the r esult 5 in modulus 12 ar ithmeti c. T his multiplication t able is sho wn belo w: F ormal definition of a finite ar ithm etic ri ng T he e xpr essi on a ≡ b (mod n) is inter pr eted a s “ a is congruent to b , modulo n ,” and holds if (b-a) is a multiple of n . With this def inition the r ules of ar ithmeti c simplify to the f ollo w ing: If a ≡ b (mod n) and c ≡ d (mod n) , then a c ≡ b d (mod n) , a- c ≡ b - d (mod n) , a × c ≡ b × d (mod n). F or div ision , fo llo w the rules presented ear lier . F or e xample , 17 ≡ 5 (mod 6) , and 21 ≡ 3 (mod 6) . Us ing these ru les, w e can w r ite: 17 21 ≡ 5 3 (mod 6) => 3 8 ≡ 8 (mod 6) => 3 8 ≡ 2 (mod 6) 17 – 21 ≡ 5 - 3 (mod 6) => - 4 ≡ 2 (mod 6) 17 × 21 ≡ 5 × 3 (mod 6) => 3 5 7 ≡ 15 (mod 6) => 3 5 7 ≡ 3 (mod 6) 6*0 (mod 12) 0 6*6 ( mod 12) 0 6*1 (mod 12) 6 6*7 ( mod 12) 6 6*2 (mod 12) 0 6*8 ( mod 12) 0 6*3 (mod 12) 6 6*9 ( mod 12) 6 6*4 (mod 12) 0 6*10 (mod 12) 0 6*5 (mod 12) 6 6*11 (mod 12) 6
Pa g e 5 - 1 4 Notice that , whene v er a r esult in the ri ght -hand si de of the “ congruence ” s ymbol pr oduces a r esult that is lar ger than the modulo (in this case , n = 6), you can alw ay s subtr act a multiple of the modulo fr om that re sult and simplif y it to a number smaller than the modulo . Thu s, the r esults in the f irst case 8 (mod 6) simplif i es to 2 (mod 6 ) , and the r esult o f the third ca se , 15 (mod 6) simplif ies to 3 (mod 6) . C onfu sing? W ell , not if y ou let the calculator handle tho se oper ations . T hu s, r ead the f ollo wing s ecti on to unde rst and ho w finit e arithmeti c r ings ar e oper ated upon in y our calc ulator . F inite arithmetic rings in the calc ulator All along w e hav e def ined our f inite arithmeti c oper ation so that the r esults ar e alw ay s positi v e . T he modular arithmeti c s ys tem in the calc ulator is set so that the r ing of modulu s n include s the numbers -n/2 1, …,-1, 0, 1,…,n/2 -1, n/2 , if n is e ve n, and –(n-1)/2 , -(n-3)/2 ,…,-1, 0,1,…,(n -3)/2 , (n-1)/2 , if n is odd. F or ex ample , fo r n = 8 (ev en) , the f inite arithmeti c r ing in the calc ulator include s the number s: (-3,- 2 ,-1, 0,1, 3, 4) , w h ile for n = 7 (odd), the cor r es ponding calc ulato r’s f inite ar ithmetic r ing is giv en by (-3,- 2 ,-1, 0,1,2 , 3) . Modular arit hmetic in the calculator T o launc h the modular arithmeti c menu in the calc ulator select the M ODUL O sub-menu w ithin the ARITHME TIC menu ( „Þ ) . T he av ailable me nu inc ludes func tions: ADD TMOD, DIVM OD , DIV2M OD , EXP ANDMOD , F A CT OR M OD , GCDMOD , INVMOD , MOD , MODS T O , MUL TMOD , P O WMOD , and S UB TMOD . Br ie f desc r iptions of these f uncti ons we r e pr ov ided in an earlier sec tion . Next w e pres ent some applications o f these functi ons . Setting the modulus (or MODUL O) T he calculat or contains a var i able called MODUL O that is placed in the {HOME CA SDIR} dir ectory and w ill stor e the magnitude of the modulu s to be used in modular ar ithmetic. T he default v alue of M ODU L O is 13 . T o change the v alue of MODUL O , yo u can eithe r stor e the new v alue dir ectl y in the var iable M ODUL O in the sub- dir ect or y {HO ME CA SDIR} Alter nati v el y , y ou can sto r e a new M ODUL O value by us in g fu n ct ion MO DST O. Modular arithmetic oper ations with numbers T o add , subtr act , multipl y , div ide , and r aise t o a po w er using modular ar ith metic y ou w ill use the functi ons A DD TMOD , SUB TMOD , MU L TMOD, DIV2MOD and DIVM OD (for di v ision), and P O WMOD . In RPN mode yo u need to enter the tw o number s to oper ate upon , separ ated b y an [ENTER] or an
Pa g e 5 - 1 5 [SP C] entry , and then pr es s the corr esponding modular arithme tic f uncti on . F or e x ample , using a modulus o f 12 , tr y the f ollo wing oper ations: ADDTMOD e xamples 6 5 ≡ -1 (mod 12) 6 6 ≡ 0 (mod 12) 6 7 ≡ 1 (mod 12) 11 5 ≡ 4 (mod 12) 8 10 ≡ -6 (mod 12) SUB TMOD ex amples 5 - 7 ≡ - 2 ( mod 12) 8 – 4 ≡ 4 (mod 12) 5 –1 0 ≡ -5 (mod 12) 11 – 8 ≡ 3 (mod 12) 8 - 12 ≡ -4 (mod 12) MUL TMOD ex amples 6 ⋅ 8 ≡ 0 (mod 12) 9⋅ 8 ≡ 0 (mod 12) 3⋅ 2 ≡ 6 (mod 12) 5 ⋅ 6 ≡ 6 (mod 12) 11⋅ 3 ≡ -3 (mod 12) DIVMOD e xamples 12/3 ≡ 4 (mod 12) 12/8 (mod 12) doe s not ex ist 25 / 5 ≡ 5 (mod 12) 64/13 ≡ 4 (mod 12) 66/ 6 ≡ -1 (mod 12) DIV2MOD e x amples 2/3 (mod 12) doe s not e x ist 2 6/12 (mod 12) does not e x ist 12 5/17 (mod 12) ½ 1 w ith re mainder = 0 6 8/7 ½ - 4 (mod 12) w ith r emainder = 0 7/5 ½ -1 (mod 12) w ith r emainde r = 0 P OWMOD e x amples 2 3 ≡ - 4 (mod 12) 3 5 ≡ 3 (mod 12) 5 10 ≡ 1 (mod 12) 11 8 ≡ 1 (mod 12) 6 2 ≡ 0 (mod 12) 9 9 ≡ -3 (mod 12) In the e x amples of modular ar ithmetic oper ations sho wn abo v e , w e hav e us ed numbers that not nece ssar il y belong to the r ing , i .e ., number s such as 6 6, 12 5, 17 , etc. T he calculator w ill conv ert tho se nu mbers to r ing num ber s b ef or e Not e : DIVMOD pr o v ides the quoti ent of the modular di visi on j/k (mod n) , w hile D IMV2MOD pr o v ides no onl y the quoti ent but also the r emainder of the modular div ision j/k (mod n) .
Pa g e 5 - 1 6 oper ating on them. Y ou can also con vert an y number into a r ing number by using the f uncti on EXP ANDMOD . F or ex ample, EXP A NDMO D(1 2 5) ≡ 5 (mod 12) EXP A NDMO D(17 ) ≡ 5 (mod 12) EXP ANDMOD(6) ≡ 6 (mod 12) The modular inv erse of a numb er Let a number k belong to a f inite ar ithmetic r ing of modulu s n , then the modular in ver se of k , i .e ., 1/k ( mod n) , is a number j , suc h that j ⋅ k ≡ 1 ( mod n ). T h e modular in ve rse o f a number can be obtained b y using the func tion INVM OD in the MODUL O sub-men u of the AR ITHME T IC menu . F or e x ample , in modulus 12 ar ithmetic: 1/6 (mod 12) doe s not e x ist . 1/5 ≡ 5 (mod 12) 1/7 ≡ -5 (mod 12) 1/3 (mod 12) does not e x ist . 1/11 ≡ -1 (mod 12) The MOD operat or T he MOD operator is u sed to obtain the ring n umber of a gi ve n modulus cor re sponding to a gi ve n integer number . On paper this oper ation is w r it t en as m mod n = p , and is read as “ m modulo n is equal to p ” . F or e x ample , to calc ulat e 15 mod 8 , en ter : Θ AL G mode: 15 MO D 8` Θ RPN mo de: 15`8` MOD T he re sult is 7 , i. e., 15 mod 8 = 7 . T ry the f ollo wing e xer ci ses: 18 mod 11 = 7 2 3 mod 2 =1 40 mod 13 = 1 2 3 mod 17 = 6 34 mod 6 = 4 One pr actical appli cation of the MOD fu ncti on for pr ogramming pur p oses is to deter mine when an int eger number is odd or ev en , since n mod 2 = 0, if n is e ven , and n mode 2 = 1, if n is odd . It can also be us ed to deter mine w hen an integer m is a multiple of anothe r integer n , f or if that is the case m mod n = 0.
Pa g e 5 - 1 7 P ol ynomials P oly nomials ar e algebrai c expr essi ons consisting of one or mor e ter ms cont aining decr easing po we rs of a gi v en v ari able . F or e xample , ‘X^3 2*X^2 - 3*X 2’ is a thir d-or der poly nomi al in X, while ‘S IN(X)^2 - 2’ is a second-or der poly nomial in SI N(X) . A listing o f poly nomi al-r elated f uncti ons in the ARITHM E TIC m enu was presented ea r lier . Some general definit i ons on poly nomials ar e pro vi ded ne xt . In thes e def initi ons A(X) , B( X) , C(X), P(X) , Q(X) , U(X) , V(X), etc., ar e poly nomials . Θ P ol yno mial fr action: a fr action w hos e numer ator and denominator ar e poly nomials , say , C(X) = A(X)/B(X) Θ R oots, or z er os , of a poly nomial: v alues of X f or w hic h P(X) = 0 Θ P oles of a f rac tion: r o ots o f the denominator Θ Multipli c ity of r oots or poles: the n umber of times a r oot sho ws up , e .g ., P(X) = (X 1) 2 (X-3) has r oots {-1, 3} w ith multipli c itie s {2 ,1} Θ C y cloto mic pol yn omial (P n (X)): a poly nomi al of or der E ULER( n) whose roots ar e the pr imiti v e n -th roots o f unit y , e.g ., P 2 (X) = X 1, P 4 (X) = X 2 1 Θ Béz out ’s poly nomi al equatio n: A(X) U(X) B(X)V(X) = C(X) Spec ifi c ex amples of pol yno mial appli cations ar e pro vi ded next . Modular arithmetic with poly nomials T he same w ay that w e def ined a f inite -ar ithmeti c ring f or n umbers in a pr ev io us secti on , w e can de f ine a finite -ar ithmetic r ing for pol yn omials w i th a gi v en poly nomial as modulo . F or e x ample , w e can wr ite a certain pol yn omial P(X) as P(X) = X (mod X 2 ), or another pol ynomi al Q(X) = X 1 (mod X - 2) . A poly nomial , P(X) belong s to a f inite ar ithmeti c ring o f poly nomi al modulus M(X), if there e xis ts a thir d poly nomial Q(X) , such that (P(X) – Q( X)) is a multiple of M(X) . W e th en wou ld writ e: P(X) ≡ Q(X) (mod M(X)). The late r expr essi on is interpr eted as “ P(X) is congruent t o Q(X) , modulo M(X)” . T he CH INREM func tion CHINREM stands f or CHINese REMainde r . The oper ation coded in this command sol ves a s y st em of two congr uences using the C hinese R emainder T heor em . This command can be u sed w ith pol yno mials, a s w ell as w ith int eger Not e: R ef er to the help fac ilit y in the calc ulator f or desc r iption and e x amples on other modular ar ithmeti c. Man y of thes e func tions ar e applica ble to pol yn omials . F or inf ormati on on modular ar ithmetic w ith poly nomi als please r ef er to a te xtbook on number theor y .
Pa g e 5 - 1 8 number s (func tion ICHINREM) . T he input consis ts of tw o v ector s [e xpr essi on_1, modulo_1] and [e xpr es si on_2 , modulo_2] . The o utput is a v ector containing [e xpr essi on_3, modulo_3] , wher e modulo_3 is related to the product (modulo_1) ⋅ (modulo_2) . Example: CHINREM([X 1, X^2 -1],[X 1,X^2]) = [X 1,-(X^4 -X^2)] Statement of t he Chines e Remainder T h eor em for integers If m 1 , m 2 ,…,m r ar e natur al numbers ev ery pair of w hic h ar e r elati v ely prime , and a 1 , a 2 , …, a r ar e any integer s, then ther e is an integer x that simult aneousl y satisf ies the congr uences: x ≡ a 1 (mod m 1 ), x ≡ a 2 (mod m 2 ), …, x ≡ a r (mod m r ) . A dditionall y , if x = a is an y solu tion then all othe r soluti ons ar e congrue nt to a modulo equal to the pr oduct m 1 ⋅ m 2 ⋅ … m r . T he EGCD func tion E GCD stands f or Extended Gr eatest Co mmon Di v isor . Gi v en tw o poly nomials , A(X) and B(X), functi on E GCD pr oduces the po ly nomi als C(X) , U(X), and V(X) , so that C(X) = U(X)*A(X) V(X)*B(X). F or e xample , for A(X) = X^2 1, B(X) = X^2 -1, E GCD(A(X),B(X)) = {2 , 1, -1}. i . e ., 2 = 1*( X^2 1’) -1*( X^2 -1) . A lso , E GCD(‘X^3- 2*X 5’ , ’X’) = { 5,1,-(X^2 - 2)}, i .e ., 5 = – (X^2 - 2)*X 1*(X^3- 2*X 5). T he GCD func tion T he functi on GCD (Gr eates t Common Den ominator ) can be used to obt ain the gr eatest common denominator o f two pol y nomi als or of tw o lists of po ly nomi als of the same length . The two pol y nomials or lis ts of poly nomials w ill be placed in stac k le vels 2 and 1 be for e using GCD . The r esults w ill be a poly nomi al or a list r e pr esenting the gr eatest co mmon denominator of the tw o poly nomials or of eac h list of po ly nomi als. Ex ampl es, in RPN mode , follo w (calculat or set to Ex act mode): ‘X^3-1’ ` ’X^2 -1’ ` GCD Re sults in: ‘X-1’ {‘X^2 2*X 1’ , ’X^3 X^2’} ` {'X^3 1','X^2 1'} ʳʳ ` GCD r esults in {'X 1' 1} T he HERM I TE func tion T he functi on HERMITE [HERMI] u ses as ar gument an integer numbe r , k , and r eturns the Her mite pol y nomial o f k -th degr ee. A Hermit e poly nomi al, He k (x) is def ined as ,... 2 , 1 ), ( ) 1 ( ) ( , 1 2 / 2 / 0 2 2 = − = = − n e dx d e x He He x n n x n n
Pa g e 5 - 1 9 An alter nate def initi on of the Hermite pol yn omials is wher e d n /dx n = n -th de ri vati v e with r espec t to x. T his is the defi nition us ed in the calc ulator . Ex amples: The Her mite pol ynomi als of or ders 3 and 5 ar e giv en b y: HERMITE( 3) = ‘8*X^3-12*X’ , And HER MI TE(5) = ‘3 2*x^5-160*X^3 120*X’ . T he HORNER func tion T he functi on HORNER pr oduces the Horner di v ision , o r s yntheti c di visi on , of a poly nomial P(X) b y the fac tor (X- a ). T he input t o the f unction ar e the pol yno mial P(X) and the number a . The f uncti on r eturns the q uotient pol y nomial Q(X) that r esults fr om div i ding P(X) b y (X- a ), t h e v a l ue of a , and the v alue of P( a ), in that or der . In other w or d s , P(X) = Q(X)(X-a) P(a). F or e xample , HORNER(‘X^3 2*X^2 -3*X 1’ ,2) = {‘X^2 4* X 5’ , 2 , 11}. W e could, ther ef or e, w r ite X 3 2X 2 -3X 1 = (X 2 4X 5 )(X- 2) 11. A second e x ample: HORNER(‘X^6 -1’ ,-5 )= {’X^5-5*X^4 2 5*X^3-1 2 5*X^2 6 2 5*X-3125’ ,-5, 1 5 6 2 4} i .e ., X 6 -1 = (X 5 -5*X 4 2 5X 3 -12 5X 2 6 2 5X- 312 5)(X 5 ) 15 6 2 4. T he var iable VX A v ari able called VX ex ists in the calc ulator ’s {HOME CA SDI R} dir ect or y that tak es, b y def ault , the v alue of ‘X’ . T his is the na me o f the pre fer r ed independent v ar ia ble fo r algebrai c and calc ulus a pplicati ons. A vo id u sing the var iable VX in y our progr ams or equations , so as to not get it conf used w ith the CA S’ VX. If y ou need to r e fer to the x -component of vel oc it y , for e x ample , y ou can use vx or Vx . F or additional inf ormation on the CA S var iable s ee Appendi x C. T he L A GR ANGE function T he functi on LA GR ANGE r equir es as input a matr i x ha vi ng two r ow s and n columns . The matr i x stor es data poin ts of the f orm [[x 1 ,x 2 , …, x n ] [y 1 , y 2 , …, y n ]]. Appli cation of the functi on L A GRANGE produce s the poly nomi al ex p an d ed fro m ,... 2 , 1 ), ( ) 1 ( ) ( * , 1 * 2 2 0 = − = = − n e dx d e x H H x n n x n n
Pa g e 5 - 2 0 F or ex ample , for n = 2 , w e w ill w rit e: Chec k this r esult w ith yo ur calculator : L A GR ANGE([[ x1,x2],[y1,y2] ]) = ‘((y1-y2)*X (y2*x1-y1*x2))/(x1- x2)’ . Other e x ample s: LA GR ANGE([[1, 2 , 3][2 , 8 , 15]]) = ‘(X^2 9* X-6)/2’ L A GRANGE([[0.5,1. 5,2 .5 , 3 .5, 4.5][12 .2 ,13 . 5,19 .2 ,2 7 . 3, 3 2 .5] ]) = ‘ -( . 1 3 7 5 * X ^4 - .7 66666666666 7 * X^ 3 - .7 43 7 5 * X^ 2 1 .99 1 66666666 7 * X- 1 2 . 92 2 65 6 25) ’ . T he LCM function T he functi on L CM (Least C ommon Multiple) obtains the least common multiple of tw o poly nomials or of lists o f poly nomials o f the same length. Ex amples: L CM(‘2*X^2 4*X 2’ ,‘X^2 -1’ ) = ‘(2*X^2 4*X 2)*( X-1)’ . L CM(‘X^3-1’ ,‘X^2 2*X’) = ‘(X^3-1)*( X^2 2*X)’ T he LEGENDRE func tion A Lege ndr e poly nomi al of or der n is a poly nomial func tion that s olv es the diffe r ential equation To o b t a i n t h e n - th or der Le gendr e poly nomial , use LE GENDRE( n ), e . g . , LE GENDRE(3) = ‘(5*X^3-3*X)/2’ LE GENDRE(5) = ‘(6 3*X ^5- 7 0*X^3 15*X)/8’ Not e: Matr ices ar e introduced in Chapt er 10. . ) ( ) ( ) ( 1 , 1 , 1 1 j n j n j k k k j n j k k k n y x x x x x p ⋅ − − = ∑ ∏ ∏ = ≠ = ≠ = − 2 1 2 1 1 2 2 1 2 1 2 1 1 2 1 2 1 ) ( ) ( ) ( x x x y x y x y y y x x x x y x x x x x p − ⋅ − ⋅ ⋅ − = ⋅ − − ⋅ − − = 0 ) 1 ( 2 ) 1 ( 2 2 2 = ⋅ ⋅ ⋅ ⋅ − ⋅ − y n n dx dy x dx y d x
Pa g e 5 - 2 1 T he PCOEF function Gi ven an ar r ay co ntaining the r oots of a pol y nomial , the fu nction PC OEF gener ates an ar r ay containing the coe ffi c ients o f the corr esponding poly nomial . T he coeffi c ients cor r espond t o decr easing or der o f the independent var ia ble. F or ex ample: PCOEF([- 2 ,–1, 0,1,1,2]) = [1. –1. –5 . 5 . 4. –4. 0.], w hic h r epr esents the pol y nomial X 6 -X 5 -5X 4 5X 3 4X 2 -4 X . T he PR OO T func tion Gi v en an arr ay containing the coe ffi c ients o f a poly nomi al, in dec reasing or der , the func tion P R OO T pr ov ides the r oots of the pol yn omial . Example , fr om X 2 5X-6 =0, P ROO T([1, –5, 6]) = [2 . 3 .]. T he PT A YL func tion Gi v en a pol yn omial P(X) and a number a , the func tion P T A YL is used to obtain an e xpr essi on Q(X- a ) = P(X), i .e ., to de v elop a pol y nomial in po wer s of (X- a ). T his is also know n as a T ay lor pol y nomial , fr om w hic h the name of the func tion , P oly nomial & T A YLor , follo w : F or ex ample , PT A YL(‘X^3- 2 *X 2’ ,2) = ‘X^3 6*X^2 10*X 6’ . In actuality , y ou should inte rpr et this r esult to mean ‘(X- 2) ^3 6*(X- 2) ^2 10*(X- 2) 6’ . Let ’s chec k b y using the subs tituti on: ‘X = x – 2’ . W e r ecov er the or i ginal poly nomial , but in terms o f low er -case x r ather than upper - ca se x . T he QUO T and REMAINDER func tions T he functi ons QUO T and REMAIND ER pr ov ide , re specti vel y , the quoti ent Q(X) and the r emainder R(X) , r esulting fr om di v iding t w o poly nomials , P 1 (X) and P 2 (X) . In othe r w or ds, the y pr ov ide the v alues o f Q(X) and R(X) f r om P 1 (X)/P 2 (X) = Q(X) R(X)/P 2 (X) . F or ex ample , QUO T(X^3- 2*X 2 , X-1) = X^2 X -1 REMAINDER(X^3- 2*X 2 , X-1) = 1. Th us, w e can wr ite: (X 3 - 2X 2)/(X-1) = X 2 X-1 1/( X-1) .
Pa g e 5 - 2 2 T he EPSX0 function and t he CAS v ariable EPS Th e va riab le ε (epsilon) is typ icall y used in mathemati cal te xtbooks to r epr esen t a v ery small number . T he calc ulator’s CAS cr eate s a v ari able EP S , w ith def ault v alue 0. 000000000 1 = 10 -10 , w hen you u se the EP SX0 functi on. Y ou can change this v alue , once cr eate d , if y ou pr ef er a diff eren t value f or EP S . T he func tion EP SX0, w hen applied to a pol y nomial , w ill r eplace all coeff ic ients w hose a bsolut e value is le ss than EP S w ith a z er o . F u nc tion EP SX0 is not a vailable in the AR ITHME T IC menu , it m ust be acces sed f r om the func tion catalog (N). Ex ample: EP SX0(‘X^3-1.2E -12*X^ 2 1.2E -6*X 6 .2E -11)= ‘X^3-0 *X^2 . 0000012*X 0’ . Wi th μ : ‘X^3 . 0000012 *X’ . T he PE V AL function The f unctions P EV AL (P ol ynomi al EV ALuati on) can be used to e valuate a poly nomial p(x) = a n ⋅ x n a n-1 ⋅ x n-1 … a 2 ⋅ x 2 a 1 ⋅ x a 0 , gi ve n an arr a y of coeff i c ients [ a n , a n-1 , … a 2 , a 1 , a 0 ] and a value of x 0 . T he re sult is the e valuati on p(x 0 ). F uncti on PE V AL is not av a i lable in the ARITHME TIC men u , it must b e accesse d fr om the function ca talog ( ‚N ). Ex ample: P EV AL([1,5, 6,1],5 ) = 2 81. T he T CHEB Y CHEFF func tion T he functi on T CHEB Y CHEFF( n ) gener ates the T cheb yc heff (or Cheb y s he v) poly nomial of the fir st kind , or der n, def ined a s T n (X) = co s(n ⋅ ar ccos(X)). If the integer n is negativ e (n < 0), the func tion T CHEB Y CHEFF( n ) gener ates the T cheb yc heff pol yno mial of the second kind , or der n, def ined a s T n (X) = sin(n ⋅ ar ccos(X))/sin(ar ccos(X)) . Ex amples: T CHEB Y CHEFF(3) = 4*X^3-3*X T CHEB Y CHEFF(-3) = 4*X^2 -1 Not e : y ou could get the lat t er r esult b y using P R OPFR A C: P ROPFRA C(‘(X^3- 2*X 2)/(X-1)’) = ‘X^2 X-1 1/(X-1)’ .
Pa g e 5 - 23 Fra c ti on s F r acti ons can be expanded and fact or ed b y using func tions EXP AND and F A CT OR, f r om the AL G menu (‚×) . F or ex ample: EXP AND(‘(1 X)^3/((X-1) *(X 3))’) = ‘(X^3 3*X^2 3*X 1)/(X^2 2*X-3)’ EXP AND(‘(X^2)*(X Y)/( 2*X-X^2)^2)’) = ‘(X Y )/(X^2 - 4*X 4)’ EXP AND(‘X*(X Y )/(X^2 -1)’) = ‘(X^2 Y*X)/(X^2 -1)’ EXP AND(‘4 2*(X-1) 3/((X- 2)*(X 3)) -5/X^2’) = ʳʳ ʳ ‘( 2*X^5 4*X^4 -10*X^3-14*X^2 -5*X 3 0)/(X^4 X^3-6*X^2)’ F A CT OR(‘(3*X^3- 2*X^2)/(X^2 -5*X 6)’) = ‘X^2*(3*X- 2)/((X- 2)*(X-3))’ F A CT OR(‘(X^3-9*X)/(X^2 -5*X 6)’ ) = ‘X*( X 3)/(X- 2)’ F A CT OR(‘(X^2 -1)/(X^3*Y - Y)’) = ‘(X 1)/((X^2 X 1)*Y)’ T he SI MP2 function F uncti ons SIMP2 and P R OPFR A C ar e us ed to simplify a fr action and t o pr oduce a pr oper fr acti on, r especti ve ly . F unction S IMP2 tak es as ar guments t w o numbers or pol y nomials , r epre senting the numer a t or and denominator of a r ational f rac tion , and r eturns the simplif ied n umerat or and denominator . F or e x ample: S IMP2(‘X^3-1’ , ’X^2 - 4*X 3 ’) = { ‘X^2 X 1’ ,‘X-3’}. T he PR OPFR A C func tion T he functi on P ROPFRA C con verts a r ational f r action int o a “ proper ” fr actio n, i .e ., an integer part added to a fr acti onal part, if suc h decompositi on is possible . F or e xam ple: PR OPFR A C(‘5/4’) = ‘1 1/4’ P ROPF R A C(‘(x^2 1)/x^2’) = ‘1 1/x^2’ T he P ARTFRA C func tion T he functi on P ARTFRA C decomposes a r ational fr action into the partial f rac tions that pr oduce the ori ginal fr ac tion . F or e x ample: P AR TFR A C(‘( 2*X^6 -14*X^5 2 9*X^4 -3 7*X^3 41*X^2 -16*X 5)/(X^5- 7*X^4 11*X^3- 7*X^2 10*X)’) = ‘2*X (1 /2/(X- 2) 5/(X-5) 1/2/X X/(X^2 1))’ T his techni que is use ful in calc ulating integr als (see c hapter on calc ulus) o f r ational f rac tions .
Pa g e 5 - 24 If y ou hav e the C omple x mode acti v e , the r esult w ill be: ‘2*X (1/2/(X i) 1/2/(X- 2 ) 5/(X -5) 1/2/X 1/2/(X- i))’ T he FCOEF func tion T he function FC OEF is used to obta in a r a ti onal fr action , giv en the r oots and poles of the f r action . T he input f or the func tion is a v ector lis ting the r oots fo llo w ed by the ir multipli c ity (i .e ., ho w man y times a gi v en r oot is r epeated) , and the poles f ollo w ed b y their multiplic it y r epr esented as a negati ve number . F or e x ample , if we w ant to c reat e a fr acti on hav ing roots 2 w ith multiplic ity 1, 0 wi th multiplic i ty 3, and -5 w ith multipli c it y 2 , and pol es 1 wi th multiplic it y 2 and –3 w ith multiplic it y 5, use: FCOEF([2 , 1, 0, 3, –5, 2 , 1, –2 , – 3 , –5]) = ‘(X--5)^2*X^3*(X- 2)/(X 3)^5*(X- 1)^2’ If y ou pr ess μ„î` (or , simpl y μ , in RPN mode) y ou w ill get: ‘(X^6 8*X^5 5*X^4 -5 0*X^ 3)/(X^7 13*X^6 61*X^ 5 105*X^4 - 4 5*X^3- 2 9 7*X^2 -81*X 2 43)’ T he FROO TS func tion T he functi on FR OO TS obt ains the r oots and poles of a f r actio n. As an exa m p le, a p p lyi n g fu n ct io n F RO O TS t o th e re s ul t p ro d uc e d ab ov e, wi l l res u l t i n: [1 –2 . –3 –5 . 0 3 . 2 1. –5 2 .]. T he re sult sho ws pole s follo w ed b y their multiplic ity as a negativ e number , and roo ts follo wed b y the ir multiplic ity as a positi ve number . In this case , the poles ar e (1, - 3) w ith multip l ic itie s (2 ,5) r especti vel y , and the r oots ar e (0, 2 , -5) w ith multipli c ities ( 3, 1, 2) , r espec ti vel y . Another e x ample is: FROO T S (‘(X^2 -5*X 6 )/(X^5-X^2)’)= [0 –2 . 1 –1. 3 1. 2 1.]. i .e ., pole s = 0 (2), 1(1) , and r oots = 3(1), 2( 1) . If y ou ha v e had Com plex Not e : If a rati onal fr action is gi ven as F(X) = N(X)/D(X), the roots of the fr action r esult fr om sol v ing the equation N(X) = 0, w hile the poles r esult f r om so lv ing the eq uation D(X) = 0.
Pa g e 5 - 25 mode selec ted, then the r esults w ould be: [0 –2 . 1 –1. – ((1 i* √ 3)/2) –1. – ((1–i*√ 3)/2) –1. 3 1 . 2 1.]. Step-b y-step operations w ith poly nomials and fractions B y setting the CA S modes to S tep/st ep the calc ulato r wil l sho w simplif icati ons of fr actions or oper ations w ith poly nomi als in a step-b y-step f ashio n. T his is ve r y u sef ul to see the step s of a s yntheti c di v ision . T he ex ample of di v iding is sho wn in det ail in Appendi x C. T he f ollo w ing e x ample show s a le ngthier syn th e t ic di vis io n : Note that DIV2 is av ailable f r om the ARI TH/POL YNOMIAL me nu . 2 2 3 5 2 3 − − − X X X X 1 1 2 9 − − X X
Pa g e 5 - 26 T he CONVERT M enu and algebr aic oper ations T he CONVER T menu is acti vated b y u sing „Ú ke y (the 6 key) . Th is menu summar i z es all con ver sion men us in the calc ulator . The lis t of these men us is sho wn next: T he functi ons a vaila ble in each o f the sub-menu s ar e sho w n next . UNIT S con vert menu (Option 1) T his menu is the same as the UNI T S menu obtained b y u sing ‚Û . The appli cations of this menu ar e disc uss ed in det ail in Chapter 3 .
Pa g e 5 - 27 B ASE con vert menu (Option 2) T his menu is the same as the UNI T S menu obtained b y u sing ‚ã . The appli cations of this menu ar e discu sse d in det ail in Chapter 19 . TRIGONOMETRIC conv er t menu (Option 3) T his menu is the same as the TRIG men u obtained b y using ‚Ñ . The appli cations o f this menu ar e disc uss ed in detail in this C hapter . MA TRI CE S conv er t menu (Opti on 5) T his menu cont ains the fo llo w ing func tio ns: T hese f unctions ar e discu ssed in detail in C hapter 10. REWRI TE con vert m enu (Opti on 4) T his menu cont ains the fo llo w ing func tio ns: Fu n c ti o n s I  R and R  I are us ed to con vert a number f r om integer (I) to r eal (R) , or v ice v ersa . Int eger number s ar e sho w n w ithout tr ailing dec imal points , w hile r eal number s r epr esenting integers w ill hav e a tr ailing decimal po int , e .g .,
Pa g e 5 - 28 Fu n c ti o n  NUM has the same effec t as the k ey str ok e combinati on ‚ï (ass oc iated w ith the ` key ) . Fun ct io n  NU M co nver ts a s ym bo lic res ul t i nt o its floating-po int value . Func tion  Q conv er ts a floating-po int v alue into a fr acti on . F uncti on  Q π con verts a floating-point v alue into a fr acti on of π , if a fr a ction of π can be f ound f or the number ; other w ise , it con verts the n umber to a fr action . Ex amples ar e of thes e thr ee f unctions ar e show n ne xt . Out of the f uncti ons in the REWRI TE menu , f unctions DIS TRIB, EXPLN , EXP2P O W , FDIS TRIB , LIN, LNCOLLE CT , PO WEREXP AND , and SIMP LIFY apply to algebr aic e xpr essi ons . Many o f these f unctio ns ar e pr esented in this Chapt er . Ho we ver , for t he sak e of compl etenes s w e pr ese nt her e the help-f ac ility en tries for th ese fun ctio ns. DIS TR IB EX PL N EXP 2PO W FD IS TRIB
Pa g e 5 - 2 9 LIN LNCOLLE CT P O WEREXP AND S IMPLIF Y
Pa g e 6 - 1 Chapter 6 Solution to single equations In this c hapter w e featur e thos e functi ons that the calc ulator pr o vi des f or sol v ing single equations o f the for m f(X) = 0. Assoc iat ed with the 7 k e y ther e ar e two men us o f equation-sol v ing func tions , the S y mbolic S O L V er ( „Î ) , and the NUMer ical S oL V er ( ‚Ï ) . F ollo w ing, w e pr esent some of the functi ons cont ained in these menu s. Change CAS mode to C omple x f or thes e ex er c ises (see Chapter 2). S ymbolic solution o f alg ebr aic equations Her e w e desc r ibe some o f the functi ons f ro m the S y mbolic S ol ver menu . Ac ti vate the menu by u sing the k e y str ok e combinati on . With s ys tem flag 117 set to CHOO SE bo x es, the follo w ing menu lis ts will be a v ailable: F uncti ons DE S OL VE an d LDE C ar e used f or the solu tion of diff er ential equati ons, the sub ject o f a differ ent c hapter , and there for e will not be pr es ented her e . Similarl y , func tion LIN S OL VE r elates to the s olution o f multiple linear equati ons, and it w ill be pr esented in a differ ent c hapte r . F uncti ons IS OL and S OL VE can be used to s olv e f or an y unknow n in a poly nomi al equation . F uncti on S OL VEVX sol v es a pol ynomi al equation w her e the unknow n is the def ault CA S var iable VX ( typi cal l y set to ‘ X’) . F i nally , function ZE R OS pr ov ides the z eros , or roots, of a poly nomial . Entr ies f or all the fu nctions in the S . SL V menu , ex cept IS OL, ar e av ailable thr ough the CA S he lp fac ility ( IL @HELP ). Function ISOL F uncti on IS OL(Eq uation , v ari able) w ill pr oduce the solu tion(s) to E quation by isolating varia bl e . F or ex ample, w ith the calculator s et to AL G mode , to so lv e for t in the equation at 3 -bt = 0 w e can use the f ollo wing:
Pa g e 6 - 2 Using the RPN mode, the s olution is accomplished b y enter ing the equation in the stac k , f ollo we d by the v ar ia ble , bef or e enter ing f uncti on IS OL. R ight bef or e the e xec ution of I SOL , the RPN st ack should look as in the f igur e to the left. After appl y ing IS OL , the r esult is sho w n in the f igur e to the r ight: T he fir st ar gument in IS OL can be an expr essi on , as sho wn abo ve , or an equati on. F or e x ample , in AL G mode , tr y : T he same pr oblem can be so lv ed in RPN mode as illu str ated belo w (fi gur es sho w the RPN st ack be for e and after the applicati on of f uncti on IS OL) : Function SO L V E F uncti on S OL VE has the same sy ntax as functi on IS OL , e xcept that S OL VE can also be us ed to sol v e a set of pol y nomial equati ons. T he help-fac ilit y entry f or func tion S OL VE , w ith the solu tion to equation X^4 – 1 = 3 , is sho wn ne xt: T he follo wing e x amples sho w the us e of f unction S OL VE in AL G and RPN modes: Not e: T o ty pe the equal sign (=) in an equation , use ‚Å ( assoc iate d w ith the \ key ) .
Pa g e 6 - 3 The s cr e e n shot sho wn abo v e displa ys tw o solutions . In the firs t one , β 4 -5 β =12 5, SOL VE pr oduces no so lutions { }. In the s econd one , β 4 - 5 β = 6 , S OL V E pr oduces f our soluti ons, sho w n in the last output line . The v ery last so lutio n is not v isible because the r esult occ up ies mor e c har acter s than the w idth of the calc ulator ’s sc r een. Ho we v er , y ou can still see all the solu tions b y using the do wn ar r o w k e y ( ˜ ) , w hic h tri gger s the line editor (this oper ation can be used to access an y output line that is w ider than the calc ulato r’s sc r een): T he corr esponding RPN s cr eens fo r these two e xamples , bef or e and af t er the appli cation of f unction S OL VE , are sho wn ne xt: Use of the do wn-arr o w k ey ( ˜ ) in this mode w ill launch the line editor : Function SO L V E VX T he functi on S OL VEVX so lv es an equati on f or the def ault CA S var iable contained in the r eser v ed var iab le name VX. B y defa ult , this var iable is set to ‘X’ . Ex a m ples, u sing the AL G mode with VX = ‘X’ , are sho wn belo w :
Pa g e 6 - 4 In the f irst case S OL VEVX could not find a s olution . In the second case , S OL VEVX f ound a single solu tion , X = 2 . The fol low i ng scr e ens sh o w the RP N stack for solving th e t wo exam pl es s hown abo ve (be for e and after applicati on of S OL VEVX) : T he equation u sed as ar gument fo r functi on S OL VEVX must be r educ ible to a r ational e xpr essi on . F or e x ample , the follo wing eq uation w ill not pr oces sed b y S OL VEVX: Function ZERO S T he functi on ZERO S f inds the soluti ons of a pol yno mial equati on , w ithout sho w ing their multiplic it y . The f unctio n req uir es hav ing as input the e xpre ssi on fo r the equati on and the name of the var ia ble to sol v e fo r . Examples in AL G mode ar e sho wn next: T o us e functi on ZER OS in RPN mode , e nter f irs t the poly nomi al expr essi on, the n the var iable to sol ve f or , and then f unction ZER OS . T he fo llow ing scr een shots sho w the RPN st ack be for e and after the applicati on of ZER O S to the two exa mp l es ab ove:
Pa g e 6 - 5 The S ymbolic S olv er functi ons pre sented abo ve pr oduce soluti ons to rati onal equati ons (mainly , poly nomial equations). If the equation to be s ol ved f or has all numer i cal coeffi c ients , a numer ical soluti on is pos sible thr ough the use of the Numer ical S olv er f eatur es of the calc ulator . Numerical sol v er menu T he calculator pr ov ides a v ery po werf ul env iro nment for the so lution o f single algebr aic or tr anscende ntal equations . T o access this en v ir onment w e start the numeri cal sol v er (NUM. SL V ) b y usi ng ‚Ï . This pr oduces a dr op-do wn menu that inc ludes the fo llow ing options: Item 2 . So lv e diff eq .. is to be d is c ussed in a later c hapter on diff er ential equations . Item 4. S olv e lin s ys .. w ill be disc uss ed in a la t er Chapte r on mat r ices. I tem 6. MSL V (Multiple eq uation SoL V er ) wi ll be pre sented in the ne xt chapter . F ollo wing , w e pr esent applications o f items 3. So lv e p oly .. , 5. So l ve f inance , and 1. Solv e equation .. , in that or der . Appendi x 1-A, at the end o f Chapter 1, contains ins tructi ons on ho w to use input f orms w ith ex amples f or the numer ical sol v er appli cations . Notes: 1. Whene v er y ou sol ve f or a value in the NUM. SL V applicati ons, the v alue sol ved f or w ill be placed in the stack . This is us eful if y ou need to k eep that v alu e a v ailable for other oper ations . 2 . The re w ill be one or mor e var iables c reated w henev er y ou acti vate some of the applicati ons in the NUM. SL V menu .
Pa g e 6 - 6 P ol ynomial Equations Using the Sol ve poly… option in the calc ulator’s SOL V E en vir onment y ou can: (1) find the s olutions to a poly nomi al equation; (2) obtain the coeffi c ie nts of the pol y nomial ha v ing a number of gi ven r oots; (3) obtain an algeb r aic e xpr essi on for the pol y nomial as a func tion o f X. F inding th e s olutions to a pol ynomial equation A pol yno mial equati on is an equatio n of the for m: a n x n a n-1 x n-1 … a 1 x a 0 = 0 . The f undamental theor em of algebr a indi cates that ther e ar e n solutions to an y pol ynomi al equation o f or der n . S ome of the solu tions could be comple x numbers , nev ertheless. As an e x ample , solv e the equati on: 3s 4 2s 3 - s 1 = 0. W e wa nt to place the coeff i c ient s of the equatio n in a vec tor [a n ,a n-1 ,a 1 a 0 ]. F or this e xample , let's use the v ector [3,2 , 0,-1,1]. T o solv e f or this poly nomial equati on using the calc ulator , try the follo w ing: ‚Ϙ˜ @@OK@ @ Sel ect solve po ly . .. „Ô3‚í2‚í 0 ‚í 1\‚í1 @@OK@ @ Ente r ve ctor o f coeff ic ie nts @SOLVE@ Solve equ ation T he scr een will sho w the solu tion as f ollo w s: Press ` to re turn to s tack . The s tack w ill show the follo w i ng r esults in AL G mode (the same r esult w ould be show n in RPN mode): T o see all the so lutions , pr ess the dow n -ar r o w k e y ( ˜ ) to tri gger the line edito r:
Pa g e 6 - 7 All the s olutions ar e complex n umbers: (0.4 3 2 ,-0. 38 9) , (0.4 3 2 , 0. 38 9) , (-0.7 6 6 , 0.6 3 2) , (-0.7 66 , -0.6 3 2) . Gene r ating poly nomial coefficients gi ven the polyn omial's roots Suppos e y ou w ant to gener ate the poly nomial w hose r oots are the n umbers [1, 5, - 2 , 4]. T o us e the calculat or fo r this purpo se , f ollo w these s teps: ‚Ϙ˜ @@OK@ @ Sel ect solve po ly . .. ˜„Ô1‚í5 ‚í2\‚í 4 @@OK@ @ Enter vector of r oots @SOLVE@ So lve fo r co ef ficie nt s Press ` to re turn to s tack , the coeff ic ients w ill be sho wn in the stac k . Not e : Recall that comple x numbers in the calc ulator ar e r epre sented as or der ed pairs , w ith the fir st number in the pa ir be ing the r eal part, and the second number , the imaginar y part. F or e xample , the number (0.43 2 ,-0. 3 8 9) , a comple x number , w ill be wr itten nor mally as 0.4 3 2 - 0.3 8 9 i , wher e i is the imaginary unit, i .e ., i 2 = -1. Not e : Th e f undamental theor em of algebr a indicat es that ther e are n sol utions for an y polynomial equation of order n . T her e is another theor em of algebr a that indicat es that if one of the solu tions to a pol y nomial equati on w ith r eal coeff i c ients is a comple x number , the n the conjugate of that number is also a soluti on . In other w or ds, comple x soluti ons to a pol y nomial equation w i th r eal coeff ic ie nts come in pairs. T hat means that poly nomial equati ons w ith r eal coeff i c ients o f odd order w ill hav e at least one r eal so lution .
Pa g e 6 - 8 Press ˜ to tri gger the line editor to see all the coeff ic ients . Gene r ating an algebraic e xpression f or the polynomial Y ou can use the calc ulator to gener ate an algebr aic e xpr es sion f or a poly nomial giv en the coe ffi c ients or the r o o ts of the pol y nomial . T he r esulting e xpre ssi on w ill be giv en in ter ms of the def ault CA S v ar iable X. (The e xamples belo w sho w s ho w y ou can r eplace X w ith an y other v ari able b y using the func tion |.) T o gener ate the algebr ai c expr essi on using the coe ffi c ients , try the fo llo w ing e x ample . Assume that the poly nomial coe ffi c ie nts ar e [1,5,- 2 , 4]. Use the fo llo w ing k ey str ok es: ‚Ϙ˜ @@OK@ @ Select Solv e poly… „Ô1‚í5 Ente r v ector o f coe ffi c ie nts ‚í2\‚í 4 @@OK@ @ — @SYMB@ Gener ate s ymboli c expr ession ` Ret ur n to st ack. T he expr essi on thus gene rat ed is sho wn in the s tac k as: 'X^3 5*X^2 - 2*X 4'. T o gener ate the algebr aic e xpr es sion using the r oots , tr y the f ollo w ing e x ample . Assume that the pol y nomial r oots are [1, 3,- 2 ,1]. Us e the follo wing k ey str ok es: ‚Ϙ˜ @@OK@ @ Select Solv e poly… ˜„Ô1‚í3 Enter v ector of r oots ‚í2\‚í 1 @@OK@ @ ˜ @SYMB@ Gener ate s ymboli c e xpre ssion ` Ret ur n to st ack. T he expr essi on thus gene r ated is sho wn in the s tac k as:' (X-1)*(X-3)*(X 2)*(X -1) '. Note : If y ou w ant to get a poly nomial w i th r eal coeffi c ients, but ha v ing com- ple x r oots, y ou mu st include the comple x r oots in pair s of conj ugate number s. T o illus tr ate the po int , gener ate a pol yno mial ha v ing the r oots [1 (1,2) (1,- 2)]. V erify that the r esulting pol y nomial ha s only r eal coeffi c ients . A lso , try gener a ting a pol y nomial w ith r oots [1 (1,2) (-1,2)], and ve r ify that the re sult- ing pol yno mial w ill ha ve com plex coeff ic ients .
Pa g e 6 - 9 T o e xpand the pr oducts , y ou can us e the EXP AND command . The r esulting e xpr es si on is: ' X^4 -3*X^3 - 3*X^2 11*X-6' . A differ ent appr oach to obtaining an e xpr essi on f or the poly nomi al is to gener a te the coeff ic ients fir st , then gene rat e the algebrai c e xpr essi on w ith the coeff ic ients highli ghted . F or e x ample , fo r this case try: ‚Ϙ˜ @@OK@ @ Select Solv e poly… ˜„Ô1‚í3 Enter v ector of r oots ‚í2\‚í 1 @@OK@ @ @SOLVE@ So lve fo r co ef ficie nt s ˜ @SYMB@ Gener ate s ymboli c e xpre ssion ` Ret ur n to st ack. T he expr essi on thus gene r ated is sho wn in the s tac k as: ' X^4 -3*X^ 3 - 3*X^2 11*X -6*X^0 ' . The coeffi c ients ar e listed in st ack le v el 2 . F inancial calc ulations T he calculati ons in item 5 . So lv e f inance.. in the Numer ical S ol ve r ( NUM.SL V ) ar e us ed fo r calc ulations of time value o f mone y of inter est in the dis c ipline of engineer ing economics and othe r financ ial applicati ons . This appli cation can also be st arted by u sing the k e ys tr ok e co mbination „sÒ (assoc iated w ith the 9 ke y) . Bef or e disc us sing in detail the oper ation of this s ol ving en vi r onment , w e pr esent s ome def initions needed to unders tand f inanci al oper ations in the calc u lato r . Definition s Often , to de ve lop pr ojec ts, it is neces sary to borr ow mone y fr om a f inanc ial institut ion or f r om publi c funds . The amount of mone y borr o w ed is r ef err ed to as the P r esent V a lue (PV) . This mone y is to be r epaid thr ough n peri ods (typi call y multiples or su b-multiples o f a month) subj ect to an annual inte r est r ate of I%YR . The n umber of per iods per y ear (P/YR) is an integer number of per iods in w hic h the year w ill be di v ided f or the purpos e of r epa y ing the loan mone y . T y pical v alues o f P/YR are 12 (one pa yme nt per month) , 2 4 (p a yment twi ce a month) , or 5 2 (w eekly pa yments). T he pa yment (P MT) is the amount that the bor r o wer mu st pa y to the lender at the beginning or end o f each o f the n per iods o f the loan. T he futu re val ue of the mone y (FV) is the value that the borr ow ed amount o f mone y wi ll be wo r th at the end o f n per iods. T yp icall y pay ment occur s at the end of each per iod , so that the bor r o wer starts pay ing at the end of the f irst per iod , and pay s the same f i x ed amount at the end of the second , third , etc., up to the end of the n -th per iod.
Pa g e 6 - 1 0 Ex ample 1 – Calculating pa yment on a loan If $2 milli on ar e borr o w ed at an annual int er est rat e of 6 . 5% to be r epaid in 60 monthly pa y ments , what should be the monthl y pay ment? F or the debt to be totall y r epaid in 6 0 months, the f utur e value s of the loan should be z er o. S o , for the purpo se of using the f inanc ial calc ulatio n featur e of the calc ulator w e w ill use the fo llow ing v alues: n = 60 , I%YR = 6. 5, PV = 2000000, FV = 0, P/YR = 12 . T o ente r the data and sol ve f or the pa ymen t , P MT , use: „Ò S tart th e financ ial calc ulation in put f orm 60 @@OK@@ Enter n = 6 0 6.5 @@OK@@ Enter I%YR = 6 . 5 % 2000000 @@OK@@ Enter PV = 2 , 000, 000 US$ ˜ Skip P MT , since w e w ill be sol v ing fo r it 0 @@OK@@ Ente r FV = 0, the opti on End is highli ghted — š @@S OLVE! Highl ight P MT and sol v e f or it T he soluti on sc r een will look lik e this: The s cr een no w sho ws the v alue of P MT as –3 9 ,13 2 . 30, i .e., the borr ow er must pa y the lender US $ 3 9 ,13 2 .3 0 at the end of eac h month fo r the ne xt 60 months to r epay the en tir e amount. T he re ason w h y the value of P MT turned out to be negati v e is becaus e the calculat or is looking at the money amo unts fr om the point of v ie w of the bor r ow er . T he borr ow er has U S $ 2 , 000, 000. 00 at time peri od t = 0, then he starts pay i ng , i .e . , adding -U S $ 3 913 2 . 3 0 at times t = 1, 2 , …, 6 0. At t = 60, the ne t value in the hands of the borr ow er is z er o . No w , if y ou take the v alue U S $ 3 9 ,13 2 .3 0 and multipl y it b y the 60 pa y ments, the to tal paid bac k by the bo rr ow er is U S $ 2 , 3 4 7 , 9 3 7 .7 9 . T hus , the lender mak es a net pr of it of $ 3 4 7 , 9 3 7 .7 9 in the 5 year s that his mone y is used to f inance the borr o w er’s pr oject . Ex ample 2 – Calculating amortiz ation of a loan T he same soluti on to the pr oblem in Ex ample 1 can be found b y pr essing @) @AMOR!! , whi ch is s tands f or AMOR TI ZA TION . This option is u sed to calc ulate ho w muc h of the loan has been amorti z ed at the end of a certain number of
Pa g e 6 - 1 1 pay m ents . Suppo se that w e use 2 4 peri ods in the firs t line of the amorti z ation scr een, i.e ., 24 @@OK @@ . T hen , pr ess @@AMOR@@ . Y ou w ill get the f ollo w ing re su l t : T his scr een is interpr eted as indi cating that after 2 4 months of pa y ing back the debt , the borr ow er has paid up US $ 7 2 3,211.43 int o the princ ipal amount borr ow ed, and US $ 215, 9 63 .6 8 of inter est . T he borr o w er still has to pay a balance o f US $1,2 7 6, 7 88. 5 7 in the next 3 6 months . Chec k what ha ppens if y ou r eplace 6 0 in the Pa y m e n t s : entry in the amorti z ation s cr een, then pr ess @ @OK@@ @@AMOR@ @ . T he scr een now looks lik e this: T his means that at the end o f 60 mon ths the US $ 2 , 000, 000.00 pr incipal amount has been paid , together w ith US $ 3 4 7 , 9 3 7 .7 9 of inte r est , w ith the balance be ing that the lender o w es the borr ow er US $ 0. 000316 . Of cours e, the balance should be z ero . The v alue show n in the sc r een abov e is simpl y ro un d - of f e rro r res u lt i n g fro m t he n u me ri ca l s ol u t io n. Press $ or ` , twi ce , to r eturn to no rmal calc ulator displa y . Ex ample 3 – Calculating payment w ith pay ments at beginning of period Let ’s sol ve the same pr oblem as in Exam ples 1 and 2 , but using the opti on that pay ment occur s at the beginning o f the pay ment per iod . Use: „Ò S tart th e financ ial calc ulation in put f orm 60 @@OK@@ Enter n = 6 0 6.5 @@OK@@ Enter I%YR = 6 . 5 % 2000000 @@OK@@ Enter PV = 2 , 000, 000 US$
Pa g e 6 - 1 2 ˜ Skip P MT , since w e w ill be sol v ing fo r it 0 @@OK@@ Ente r FV = 0, the opti on End is highli ghted @@CHOOS ! — @@OK@@ Change pa y ment opti on to Begin — š @@S OLVE! Highl ight P MT and sol v e f or it T he scr een no w sho ws the v alue of P MT as –38 , 9 21.4 7 , i .e ., the borr o w er mu st pay the lender US $ 3 8, 9 21.48 at the beginn ing of eac h month for the ne xt 60 months to r epa y the entir e amount . Noti ce that the amount the borr ow er pa ys monthly , if pay i ng at the beginning of eac h pay ment per iod , is slightly smalle r than that paid at the end of eac h pay ment per iod . The r eason f or that diffe r ence is that the lender gets inter es t earnings f r om the pay ments fr om the beginning of the per iod , thus alle v iating the bur den on the lender . Deleting the var iables When y ou us e the fi nanci al calc ulator en vi r onment fo r the firs t time w ithin the HOME dir ectory , or any sub-dir ectory , it w ill gener ate the v ar iable s @ @@N@@ @I©YR@ @@PV@ @ @@PMT@ @ @@PYR@@ @@FV@@ to stor e the corr esponding terms in the calc ulations .. Y ou can see the cont ents of thes e var iables b y using : ‚ @@ @n@@ ‚ @I©YR@ ‚ @@PV@ @ ‚ @@PMT @@ ‚@@ PYR@@ ‚ @@FV@@ . Y ou can either k e ep thes e var iables f or f utur e use , or us e the PURGE f unction to er ase them f r om y our dir ectory . T o er ase all of the var iables at once , if using AL G mode , try the follo w ing: I @PURGE J „ä Enter P URGE , pr epar e list of v ari ables ³‚ @@@n@@ Enter name o f var iable N ™ ‚í Enter a comma ³ ‚ @I©YR@ Enter name of v ar iable I%YR ™ ‚í Enter a comma ³ ‚ @@PV@@ Enter name o f var iable PV ™ ‚í Enter a comma ³ ‚ @@PMT@@ Enter name of var ia ble P MT Notes : 1. The f inanc ial calc ulator en v ir onment allo ws y ou to s olv e fo r any o f the terms in vo lv ed , i .e ., n, I%YR , PV , FV , P/Y , gi v en the r emaining terms in the loan calc ulation . Just hi ghlight the v alue you w ant to sol ve for , and pres s @@SOLVE! . T he re sult will be sho w n in the hi ghlighted f ield . 2 . T he v alu e s calc ulated in the financ ial calculat or en vir onment ar e copi ed to the stac k w ith their cor r esponding tag (i dentif y ing label) .
Pa g e 6 - 1 3 ™ ‚í Enter a comma ³ ‚ @@PYR@ @ Enter name o f var iable P YR ™ ‚í Enter a comma ³ ‚ @@FV@ @ . Enter name o f var iable FV ` Ex ec ute P URG E command T he fo llo w ing two s cr een shots sho w the P URGE co mmand for purging all the v ari ables in the dir ectory , and the r esul t af t er e x ecu ting the command. In RPN mode , the command is ex ec uted b y u sing: J „ä Pr epar e a list of v ar ia bles to be pur ged @@@n@@ Enter name of v ari able N @I©YR@ Ente r name of var ia ble I%YR @@PV@@ Enter name of v ar iable PV @@PMT@@ Enter name of v ari able P MT @@PYR@@ Enter name of v ari able P Y R @@FV@ @ Enter name of v ar iable FV ` Enter li st of v ariables in stack I @PURGE P u r g e v ar iables in list Bef or e the command P URGE is e nter ed, the RPN s tack w ill look lik e this: Solv ing equations with one unkno wn through NUM.SL V T he calculator's NUM. SL V menu pr ov ides item 1. So lv e equatio n.. sol v e differ ent types of equations in a single v ari able , including non-linear algebrai c and tr anscendental eq uations . F or e xample , let's sol ve the eq uation: e x -sin( π x/3) = 0. Simply en ter the e xpr essi on as an algebr aic ob ject and st or e it int o var iable E Q. The r equir ed ke ystr oke s in AL G mode ar e the follo wing:
Pa g e 6 - 1 4 ³„¸~„x™-S„ì *~„x/3™‚Å 0™ K~e~q` Press J to see the ne w ly c r eated E Q v ari able: Then , enter the SOL VE env ironment and select S olv e equation… , by using: ‚Ï @@OK@@ . The corr esponding sc r een w ill be sho w n as: T he equation w e s tor ed in v ari able E Q is alr eady loaded in the Eq field in the S OL VE EQU A T ION input for m. A lso , a fi eld labeled x is pr ov ided . T o sol ve the equati on all y ou need to do is highlight the f ield in f r ont of X: b y using ˜ , and pr ess @SOLVE@ . The s oluti on sho wn is X: 4. 5 006E - 2: Function STEQ F u nc tion S TE Q, av ailable thr ough the command catalog , ‚N , w ill stor e its ar gument into var iable E Q, e .g., in AL G mode: In RPN mode , enter the equati on bet w een apostr ophes and ac tiv ate command S TEQ. T hu s, f uncti on S TE Q can be used a s a shortc ut to st or e an e xpr essi on into var iable EQ.
Pa g e 6 - 1 5 This , ho w ev er , is not the only po ssible soluti on fo r this equation . T o obtain a negati ve s olutio n, f or e xampl e, ent er a negati v e number in the X: f ield be for e sol ving the equati on. T r y 3\ @@@OK@@ ˜ @SOLVE@ . T he soluti on is no w X: - 3.045. Solution procedur e for Equation Solve ... T he numer ical sol ve r for single-unkno wn equati ons w or ks as f ollo ws: Θ It lets the user ty pe in or @CHOOS an eq uation t o sol v e . Θ It c reat es an input f orm w ith inpu t fi elds corr esponding to all v ari ables in vo lv ed in equati on stor ed in v ari able E Q. Θ T he use r needs to enter v alues f or all v ar iables in v ol ved , ex cept one. Θ T he use r then highlights the f ield co rr es ponding to the unkno wn f or whi ch to solve the equ ation , and pr esses @SOLVE@ Θ T he use r may f or ce a solu tion b y pr o v iding an initial gue ss f or the solu tion in the appr op r iate input f i eld befo r e solv ing the equation . T he calculat or uses a sear ch algor ithm to pin point an int erval f or w hic h the func tion c hanges sign , whi ch indi cates the ex istence of a r oot or soluti on. It then utili z es a numer ical method t o conv er ge into the solu tion . T he solution the calc ulator seeks is deter mined by the initi al value pr esent in the unkno wn input f ield . If no v alue is pr es ent , the calculat or uses a def ault value o f z er o. T hus , y ou can sear ch f or mor e than one soluti on to an equation b y c han ging the initi al value in the unkno w n input f ield . Ex amples of the equati ons solu tions ar e sho wn f ollo wing . Ex ample 1 – Hook e’s law f or stress and str ain T he equation t o use is Hook e’s la w for the nor mal str ain in the x-dir ectio n for a soli d par ti c le subj ected t o a state o f str ess gi ve n by ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ zz zy zx yz yy yx xz xy xx σ σ σ σ σ σ σ σ σ
Pa g e 6 - 1 6 T he equation is her e e xx is the unit str ain in the x -directi on , σ xx , σ yy , and σ zz , ar e the normal str esses on the par ti cle in the dir ecti ons of the x -, y-, and z -ax es , E is Y oung’s modulus or modulus of elasti c ity of the mat er ial , n is the P ois son r ati o of the mater ial , α is the thermal e xpansion coeff i c ient of the mat er ial , and Δ T is a te mperatur e incr ease . Suppo se that y ou ar e gi v en the f ollo w ing data: σ xx = 2 50 0 psi , σ yy =1200 psi, and σ zz = 5 00 psi, E = 1200000 p si, n = 0.15, α = 0. 00001/ o F, Δ T = 60 o F. T o calc ulate the str ain e xx us e the f ollo w ing: ‚Ï @@OK@@ Access num er ical sol ver to solve equa tions ‚O Access the equation w r iter to enter equation At this po int follo w the instructi ons fr om Chapter 2 on ho w to use the E quation W r iter to build an equation. T he equati on to enter in the Eq fi eld should look lik e this (notice that w e us e onl y one sub-index to r efer t o the var i ables, i. e ., e xx is tr anslated as ex , etc. -- this is done to sa v e typ ing time) : Use the follow i ng shortcuts f or spe c ial characters: σ : ~‚s α : ~‚a Δ: ~‚c a nd re c a ll t h at l owe r-c a se l et t er s a re e nt ere d by us i n g ~„ bef or e the letter k ey , thus, x is typed as ~„x . Press ` to re turn to the sol ver s cr een . Enter the values pr oposed abo ve into the corr esponding f ields , so that the sol ver s cr een looks like this: , )] ( [ 1 T n E e zz yy xx xx Δ ⋅ ⋅ − = α σ σ σ
Pa g e 6 - 1 7 W ith the ex : fi eld highli ghted , pr ess @SOLVE @ to sol ve f or ex : T he soluti on can be seen fr om within the S OL VE EQU A TION in put for m b y pr essing @ EDIT wh i le th e ex : fie ld is highlighted . T he resulting v alue is 2. 4 7 0 833333333 E- 3. P r es s @@@OK@@ to e x it the ED I T featur e. Suppos e that y ou no w , w a n t to deter mine the Y oung’s modulu s that w ill pr oduce a str ain of e xx = 0.005 under t he same sta te of stress , n eglectin g thermal e xpansion . In this ca se , y ou sho uld ent er a value o f 0. 00 5 in the ex : fi eld, and a z ero in the Δ T : fi el d (wi t h Δ T = 0, n o ther mal eff ects ar e inc luded) . T o sol v e fo r E , highlight the E: fi eld and pr ess @SOLVE@ . The r esult , see ing w ith the @ EDIT featur e is, E = 44 9 000 psi . Pr es s @SOLVE@ ` to r etu r n to normal display . Notice that the r esults of the calc ulations perf or med wi thin the numer ical so lv er en vi r onment hav e been copi ed to the stac k: Also , y ou wi ll see in y our so f t-menu k e y labels v ar iable s corr esponding to those v ari ables in the eq uation s tor ed in EQ (pr ess L to see all var iables in y our d i rec to r y ) , i. e., va ri ab l es ex, Δ T, α , σ z, σ y, n , σ x, and E . Ex ample 2 – Specific energ y in open chann el flo w
Pa g e 6 - 1 8 Spec ifi c ener gy in an open c hannel is def ined as the ener g y per unit w eight measur ed w ith r es pect to the c hannel bottom . Let E = s pec if ic ener g y , y = c hannel depth , V = flo w v eloc ity , g = acceler ation of gra v ity , the n we w rite T he flo w v eloc it y , in tu r n , is gi ven b y V = Q/A, w her e Q = w ater dischar ge, A = c ro ss-sec tional ar ea. T he ar ea depends on the cr oss-sec tion us ed , for e x ample , f or a tra pez oidal c r oss-s ecti on, a s sho wn in the f igur e belo w , A = (b m ⋅ y) ⋅ y , whe r e b = bot t om wi dth, and m = side slope of c r oss s ectio n. W e can t y p e in the equati on for E as sho w n abov e and u se au xi liary var iables fo r A and V , so that the r esulting input f or m w ill hav e fi elds for the fundament al v ar iab les y , Q, g, m, an d b , as f oll o ws : Θ F irst , cr eate a su b-dir ectory called SP EN (SP ec if ic ENe rg y) and w ork w ithin that sub-dir ectory . Θ Ne xt , def ine the f ollo w ing var iable s: Θ Launc h t he numeri ca l solv er for solv ing equ ations: ‚Ï @@OK@@ . Notice that the inpu t for m contains entri es f or the v ari ables y , Q, b , m, and g: Θ T ry the follo w ing input data: E = 10 ft , Q = 10 cf s (c ubi c feet per second), b = 2 . 5 ft , m = 1. 0, g = 3 2 .2 ft/s 2 : . 2 2 g V y E = z c 2 n
Pa g e 6 - 1 9 Θ Sol ve fo r y . T he r esult is 0.14 9 8 3 6.., i .e., y = 0.14 9 8 3 6 . Θ It is kno wn , ho w e ve r , that the r e ar e actuall y tw o soluti ons av ailable f or y in the spec if ic ener gy equatio n. T he soluti on w e jus t found cor r esponds to a numer i cal soluti on w i th an initial v alue of 0 (the de faul t va lu e fo r y , i .e ., whene v er the solution f i eld is empt y , the initi al v alue is z er o) . T o find the other s oluti on, w e need to enter a lar ger val ue of y , s ay 15 , highlight the y inpu t fi eld and so lv e f or y o nce mor e: The r esult is now 9 .9 9 99 0, i .e ., y = 9 .99 9 90 ft . T his ex ample illus tr ates the us e of au x iliary var iables t o wr ite compli cated equati ons. W hen NUM.SL V is acti vat ed, the subs titutions impli ed b y the au x iliary va ri ables ar e implement ed, and the in put sc r een fo r the equation pr o v ides in put f ield f or the pr imitiv e or fundament al var iable s re sulting f r om the subs titutions . The e xample als o illustr ates an eq uation that has mor e than one solu tion , and ho w choo sing the initial gues s fo r the soluti on may pr od u ce those diffe r ent soluti ons.
Pa g e 6 - 2 0 In the ne xt e x ample w e w ill use the D ARC Y functi on f or f inding fr ic tion fact ors in pipeline s. T hus , w e def ine the f unctio n in the follo wing f r ame . Special function for pipe flo w: D ARC Y ( ε /D ,Re) T he D ar cy- W eis bach equatio n is used to calc ulate the ener g y loss (per unit wei g ht ) , h f , in a pipe flo w thr ough a pipe o f diameter D , absolu te r oughness ε , an d le ng th L, whe n th e flow vel ocit y in the pip e is V . T h e eq uat ion i s wr it ten as . T he quantity f is kno wn as the f r icti on fac tor of the f lo w and it has been f ound to be a f uncti on of the r elati v e r oughnes s of the pipe , ε /D , and a (dimensionless) R e y nolds number , R e. T he Re y nolds number is def ined as Re = ρ VD/μ = VD/ ν , whe re ρ and μ ar e the density and dy namic v iscosity of the flui d , r espec tiv ely , and ν = μ/ρ is the kinematic v iscosity of the flui d. T he calculator pr ov ides a func tion called D ARC Y that us es as input the r elati v e r oughnes s ε /D and the R e y nolds number , in that order , to calculat e the fr icti on fac tor f . The f uncti on D AR CY can be f ound thr ough the command catalog: F or ex ampl e , fo r ε /D = 0. 0001, Re = 1000000, y ou can find the fr ic tion f act or b y using: D ARC Y(0. 0001,1000000) . In the f ollo w ing sc r een , the fu nction  NUM ( ) w as used to obtain a numer ical value of the function: T he r esult is f = D AR CY(0. 0001,1000000) = 0. 01341… The function F ANNING( ε /D ,Re) In aer ody namic s applicati ons a differ en t fr icti on fac tor , the F anning fr ic tion fac tor , is u sed. The F an ni ng friction fact or , f F , is de f ined as 4 time s the Dar cy- W ei sb ach frict ion fa ctor , f . The calc ulator al so pr o v ides a f uncti on called F ANNING that uses the same in put as D ARC Y , i .e ., ε /D and R e , and pr o v ides the F ANNING fr ic tion f actor . C h eck that F ANNING(0. 0001 ,1000000) = 0. 00 3 3 60 3 5 8 9181s . g V D L f h f 2 2 ⋅ ⋅ =
Pa g e 6 - 2 1 Ex ample 3 – F low in a pipe Y ou may w a nt t o cr eate a separ ate sub-dir ectory (PIPE S) to tr y this e x ample . T he main equation go v ernin g flo w in a p ipe is, o f course , the D ar cy- W eisbac h equati on. T hu s, type in the fo llo w ing equation into E Q : Also , e nter the follo w ing var iables (f , A, V , Re): In this case w e stor ed the main equation (Dar cy- W eis bach eq uation) into E Q, and then r eplaced se v er al of its var iables b y other expr essi ons thr ough the def inition of v ar iables f , A , V , and R e . T o see the combined equation , use EV AL(EQ). In this e x ample we c hanged the display s et t ing so that w e can s ee the entir e equation in the sc r een: T hus , the equation w e ar e sol v ing , after combining the diffe r ent var iables in the dir ectory , is:
Pa g e 6 - 2 2 T he combined equation has pr imitiv e v ari ables: h f , Q , L, g, D, ε , and Nu . Lau nch t he num erical solver ( ‚Ï @@ OK@@ ) to s ee the primiti ve v ari ables listed in the S OL VE E QU A TION in put f orm: Suppo se that w e us e the value s hf = 2 m, ε = 0. 00001 m , Q = 0. 0 5 m 3 /s , Nu = 0. 000001 m 2 /s, L = 20 m , and g = 9 .806 m/s 2 , f ind the diameter D . Enter the input v alues , and solv e f or D , The soluti on is: 0.12 , i .e., D = 0.12 m . If the equatio n is dimensionall y consis tent , y ou can add units to the input v alues, a s sho wn in the f igur e belo w . Ho we v er , y ou must add tho se units to the initial gues s in the soluti on . Th us, in the e xample belo w w e p l ace 0_m in the D: f ield be fo r e sol v ing the pr oblem . T he soluti on is sho wn in the s cr een to the r ight: Press ` to r etur n to normal calc ulator displa y . T he soluti on for D w ill be listed in the stac k . ⎟ ⎟ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎜ ⎜ ⎝ ⎛ ⋅ = Nu D QD D DARCY gD L Q h f 4 / , 8 2 5 2 2 π ε π
Pa g e 6 - 23 Ex ample 4 – Uni versal gr av itation Ne wton ’s la w of uni v ersal gr av itati on indicat es that the magnitude of the attr acti v e f or ce betw een tw o bodi es o f mas ses m 1 and m 2 separ ated by a distance r is gi ven b y the equatio n Her e , G is the uni v ersal gr av itati onal constant , who se v alue can be obtained thr ough the use o f the functi on CON S T in the calc ulator by us ing: W e can solv e f or an y term in the equation (e x cept G) by enter ing the equation as: T his equation is the n sto red in E Q: La unching the n umer ical so lv er f or this equati on r esults in an in put fo rm containing inpu t fi elds f or F , G , m1, m2 , and r . Let ’s sol v e this proble m using units w ith the follo w ing values f or the kno w n v ari ables m1 = 1. 0 × 10 6 k g , m2 = 1. 0 × 10 12 k g , r = 1. 0 × 10 11 m . Also , enter a value of 0_N in f ield F to ensur e the pr oper soluti on using units in the calc ulat or : . 2 2 1 r M M G F ⋅ ⋅ =
Pa g e 6 - 24 Sol v e for F , and pr ess to r eturn to norm al calculator dis play . The sol ution is F : 6 .6 7 2 5 9E -15_N , or F = 6 .6 7 2 5 9 × 10 -15 N. Different w ay s to enter equations into EQ In all the e xample s sho wn abo v e we ha ve en ter ed the equati on to be sol ved dir ectl y into v ar iable E Q befo r e acti vating the n umer ical sol v er . Y ou can actuall y type the equati on to be sol v ed direc tly int o the sol v er after acti vating it b y editing the contents of the E Q fie ld in the numer ical s ol ve r input f orm . If v ari able E Q has not been def ined pr ev io usl y , when y ou launch the n umer ical solv er ( ‚Ï @@OK@ @ ) , the E Q f ield w ill be hi ghligh ted: At this po int y ou can e ither ty pe a new eq uation b y pre ssing @EDIT . Y ou w ill be pr o v ided w ith a set of apos tr ophes so that y ou can type the e xpr essi on betw een them: Not e : When u sing units in the numer ical s ol ve r mak e sur e that all the v ari ables hav e the pr oper units, that the units ar e compatible , and that the equation is dimensio nally homogeneous .
Pa g e 6 - 2 5 T ype an equati on, sa y X^2 - 12 5 = 0, dir ectl y on the stac k, and pr es s @@@OK@@@ . At this point the equati on is r eady f or solu tion . Alte rnati v ely , you can acti vate the equati on w riter after pr essing @EDIT to enter y our equation . Pr ess ` to return to the num e rical solv er scr een. Another wa y to enter a n equation into the EQ var iable is to select a v ariable alr eady e xis ting in y our direc tory to be enter ed into E Q. This means that y our equati on wo uld hav e to hav e been s tor ed in a var iable name pr ev i ousl y to acti v ating the numer ical sol v er . F or e x ample, suppose that w e ha v e enter ed the fo llo w ing equati ons into var ia bles E Q1 and E Q2: Now , laun c h the numeri cal solv er ( ‚Ï @@OK@@ , and hi ghlight the E Q fi eld . A t this point pr ess the @CHOOS s oft menu k e y . Use the u p and do w n arr ow k e ys ( — ˜ ) to select, say , variable EQ1: Press @@@OK@@@ after selecting E Q1 to load into var iable E Q i n the solv er . The ne w equati on is read y to be so lv ed.
Pa g e 6 - 26 The S OL VE soft menu The SOL V E soft menu a llow s a ccess to some of the numerical solv er fu nctions thr ough the soft men u k e ys . T o access this men u us e in RPN mode: 7 4 MENU , or in AL G mode: MENU(7 4) . Alter nativ ely , y ou can use ‚ (hol d) 7 to acti v ate the S OL VE soft men u . T he sub-menu s pr ov ided b y the S OL VE soft menu ar e the f ollo w ing: T he ROO T sub-menu T he ROO T sub-men u include the f ollo w i ng f uncti ons and sub-men us: Function ROO T F uncti on ROO T is us ed to sol v e an equation f or a gi v en var iable w ith a starting guess v alue . In RPN mode the eq uation w ill be in stac k lev el 3, while the v ari able name w ill be located in le ve l 2 , and the initi al guess in le v el 1. The fo llo w ing fi gur e sho ws the RPN stac k bef or e and after acti vating f uncti on @ ROOT : In AL G mode , y ou w ould us e ROO T(‘ T A N( θ )=θ ’, ’ θ ’ ,5) to activ ate functi on ROO T : V ariable EQ Th e so ft m enu ke y @@EQ@@ in this sub-men u is used as a r efer ence to the v ari able E Q. Pre ssing this soft menu k ey is equi valent to u sing functi on RCE Q (R eCall EQ ) . T he SOL VR sub-menu T he SO L VR sub-men u acti v ates the soft-menu sol v er fo r the equation c urr ently stor ed in EQ. Some e x amples ar e sho w n next:
Pa g e 6 - 27 Ex ample 1 - Sol v ing the equati on t 2 -5t = - 4 F or ex ample , if you s tor e the equati on ‘t^2 -5*t=- 4’ into E Q, and pr ess @) SOLVR , it w ill acti v ate the f ollo wing menu: T his result indi cates that y ou can sol v e for a v alue of t f or the equation lis ted at the top of the displa y . If y ou tr y , fo r ex ample , „ [ t ], it w ill giv e y ou the r esult t: 1., after br ie fl y flashing the me ssage “S olv ing f or t . ” Ther e is a second r oot to this equatio n, w hic h can be found b y c hanging the v alue of t , bef or e sol v ing for it again . Do the follo w ing: 10 [ t ], then pre ss „ [ t ]. T he r esult is no w , t: 4.000000000 3 . T o v er ify this r esult , pr ess the soft men u ke y labeled @EXPR= , whi ch e v aluates the e xpr essi on in E Q for the c urr en t value of t . T he re sults in this case ar e: T o e x it the S OL VR e nv i r onment , pr ess J . T he acces s to the S OL VE menu is lost at this point , so y ou ha v e to acti v ate it once mor e as indi cated earli er , to contin ue with the e x er c ises belo w . Ex ample 2 - Sol v ing the equation Q = at 2 bt It is poss ib le t o sto r e in EQ, an equ at ion i n volvin g m or e t han one v ari able , sa y , ‘Q = at^2 bt’ . In this case , after acti vating the S O L VE soft menu , and pr essing @) ROOT @ ) SOLVR , y ou w ill get the follo wing s cr een: W ithin this SOL VR env ir onment y ou can pr ov ide value s fo r any o f the var ia bles listed b y enter ing the value in the stac k and pre ssing the corr es ponding soft - menu k ey s . F or e x ample , say y ou enter the v alues Q = 14 , a = 2 , and b = 3 . Y ou w ould use: 14 [ Q ], 2 [ a ], 3 [ b ]. As v ari ables Q, a , and b , get assi gned numer i cal value s, the as signments ar e listed in the upper left cor ner of the displa y . At this point w e can sol v e fo r t , by using „ [ t ]. The r esult is t: 2 . Pr essing @EXPR= sho ws the r esults: Ex ample 3 - So lv ing two sim ultaneou s equatio ns, o ne at a time
Pa g e 6 - 2 8 Y ou can also sol ve mor e than one equati on by s olv ing one equation at a time , and r epeating the pr ocess until a soluti on is fo und . F or e xample , if y ou enter the f ollo w ing list of equati ons into var i able E Q: { ‘ a*X b*Y = c’ , ‘k*X*Y=s ’}, the k e y str ok e sequ ence @) ROOT @) SOLVR , w ithin the S OL VE s oft men u , wi ll pr oduce the f ollo w ing scr een: T he fir st equati on, namel y , a*X b*Y = c , will be lis ted in the top par t o f the displa y . Y ou can enter v alues fo r the var iable s a, b , and c , say : 2 [ a ] 5 [ b ] 19 [ c ]. Also , since w e can only sol ve one equati on at a time , let’s ent er a guess v alue fo r Y , say , 0 [ Y ], and sol ve f or X, b y using „ [ X ]. T his gi v es the value , X: 9 .4 9 99…. T o chec k the value o f the equati on at this point , pr ess @EXPR= . The r esults are: L eft: 19 , Ri ght: 19 . T o sol v e the next equati on, pr ess L @NEXQ . T he sc r een sho w s the soft menu k e y s as: Sa y w e enter the v alues k = 2 , s = 12 . Then sol v e f or Y , and pre ss @EXPR= . T he re sults ar e no w , Y : W e then contin ue mo vi ng fr om the fir st to the s econd equati on , back and f or th , sol v ing the fir st equati on fo r X and the second fo r Y , until the v alues of X and Y con ve rge to a s olution . T o mov e fr om equation to equati on use @NEXQ . T o sol v e f or X and Y use „ [ X ], a nd „ [ Y ], re spectiv ely . The f ollo w ing sequen ce of sol utions is p r oduc ed: After so lv ing the t w o equatio ns, one at a time , we noti ce that , up to the thir d dec imal , X is con v er ging to a v alue of 7 . 5 00, w hile Y is con v er ging to a v alue o 0.7 99 .
Pa g e 6 - 2 9 Using units with the SOL VR sub-menu T hese ar e some rule s on the us e of units w ith the S OL VR sub-men u: Θ Ent eri ng a guess w ith units f or a gi ve n var i able , w ill intr oduce the use of thos e units in the soluti on. Θ If a ne w guess is gi v en w ithout units, the units pr ev iousl y sa ve d for that partic ular v ar iab le ar e used . Θ T o remo ve units e nter a number w ithout units in a list as the ne w guess , i .e ., us e the for mat { number }. Θ A list o f numbers can be gi v en as a gues s for a v ar iable . In this cas e , the units tak es the units used belong to the last n umber in the list . F or e x ample , enter ing { 1.41_ft 1_cm 1_m } indi cates that meter s (m) w ill be used f or that v ari able . Θ T he e xpr essi on used in the s olution m ust ha ve consis tent units, or an err or w ill r esult w hen tryi ng to sol v e for a v alue . T he DIFFE sub-menu T he DIFFE sub-menu pr ov ides a number of func tio ns fo r the numer i cal soluti on of diffe r ential equatio ns. T he functi ons pr ov ided ar e the follo wing: The se functi ons are pr esented in detail in Chapter 16. T he POL Y sub-menu T he POL Y sub-me nu perf orms ope rati ons on po ly nomi als. The f uncti ons inc luded ar e the foll o wi ng: Function PROO T T his functi on is us ed to f ind the r oots of a pol y nomial gi ven a v ector co ntaining the poly nomial coeff ic ie nts in decr easing or der of the po w ers o f the independent v ar iable . In other wor ds, if the pol yn omial is a n x n a n-1 x n-1 … a 2 x 2 a 1 x a 0 , the v ector of coeff ic ients should be ente r ed as [a n , a n-1 , … , a 2 , a 1 , a 0 ]. F or ex ample , the r oots of the pol yn omial w hose coe ffi c ients ar e [1, -5, 6] ar e [2 , 3]. Function PCOEF
Pa g e 6 - 3 0 T his functi on pr oduces the coeff ic ients [a n , a n-1 , … , a 2 , a 1 , a 0 ] of a poly nomial a n x n a n-1 x n-1 … a 2 x 2 a 1 x a 0 , give n a ve c to r of it s ro ot s [r 1 , r 2 , …, r n ]. F or e x ample , a ve ctor w hose r oots ar e gi v en by [-1, 2 , 2 , 1, 0], w ill p r oduce the f ollo w ing coeff ic ients: [1, - 4 , 3, 4, - 4 , 0]. The poly nomial is x 5 - 4x 4 3x 3 4x 2 - 4x . Function PEV AL T his functi on e valuate s a poly nomial , gi v en a v ector o f its coeff i c ients , [a n , a n-1 , … , a 2 , a 1 , a 0 ], and a value x 0 , i .e ., P EV AL c alc ulates a n x 0 n a n- 1 x 0 n-1 … a 2 x 0 2 a 1 x 0 a 0 . F or ex ample , for coeff i c ients [2 , 3, -1, 2] and a v alue of 2 , PE V AL r etur ns the value 2 8. T he S Y S sub-m enu T he S Y S sub-menu cont ains a listing of f uncti ons used to sol ve linear s y stems . T he functi ons listed in this sub-men u are: The se functi ons are pr esented in detail in Chapter 11. T he T VM sub-menu T he T VM sub-men u contains f uncti ons f or calc ulating Time V alue of Mone y . This is an alternati ve w a y to sol v e FINANCE pr oblems (s ee Chapte r 6) . The func tions a vaila ble ar e sho wn ne xt: The SOL VR sub-m enu T he S OL VR sub-menu in the TV M su b-menu w ill launc h the sol v er fo r sol ving T VM pr oblems. F or ex ample , pr essing @) SOLVR , at this point , will tr igger the fo llo w ing sc reen: As an e xer c ise , try using the values n = 10, I%YR = 5 .6, PV = 10000, and FV = 0, and ent er „ [ P MT ] to f in d P M T = -1021. 08…. Pr essin g L , pr oduces the f ollo w ing scr een:
Pa g e 6 - 3 1 Press J to e x it the S OL VR env iro nment . F ind y our w ay bac k to the TVM su b- menu w i thin the S OL VE sub-menu to try the other functi ons a vailable . Function T VMROO T This fun c tion requires as argument t he na me of one of the v ariables in t he T VM pr oblem . The f uncti on r eturns the s oluti on fo r that var ia ble , giv en that the other v ari ables e x ist and hav e values s tor ed pr ev iou sly . F or e x ample , hav ing sol v ed a T VM pr oblem abov e , w e can s olv e fo r , say , ‘N’ , as f ollo w s: [ ‘ ] ~n` @TVMRO . T he r esult is 10. Function AMORT T his functi on tak es a value r epr esenting a per i od of pa yment (between 0 and n) and r eturns the pr incipal , inte r est , and balance f or the value s c urr entl y stor ed in the T VM v ar iables . F or e x ample , with the data u sed earli er , if w e acti vat e fu nct ion AMO RT for a va lu e o f 1 0, we ge t: Function BEG If selec ted , the TMV calculati ons use pa y ments at the beginning of eac h peri od . If deselec ted , the TMV calculati ons use pa ymen ts at the end of each per iod.
Pa g e 7- 1 Chapter 7 Solv ing multiple equations Man y pr oblems of sc i ence and engineer ing req uir e the simultaneous solu tions of mor e than one equation . The calc ulator pro v ides s ev er al pr ocedur es f or solv ing multiple equations as pr esented belo w . P lease notice that no discu ssion of solv ing sy stems of linear equation s is pr esented in this c hapter . L inear s ystems solut i ons will b e discus sed in deta i l in subsequent chapters on ma tr ices and linear algebr a. Rational equation s y stems E quati ons that can be r e -wr itten as pol y nomials or r ational algebr ai c e xpre ssi ons can be solv ed dir ectly b y the calc ulator by u sing the functi on S OL VE . Y ou need to pro vide the list o f equations as elements of a v ector . The list of v ar iable s to solv e f or mu st also be pr ov i ded as a vect or . Make sur e that the CA S is set to mode Ex act befo r e at t empting a soluti on using this pr ocedure . Also , the mor e complicated the e xpr essi ons , the longer the CA S tak es in sol ving a par ti c ular s y stem of eq uations . Example s of this appli cation f ollo w : Ex ample 1 – Projectile motion Use f uncti on S OL VE with the f ollo w ing v ector ar guments, the f irst be ing the list of equati ons: [‘ x = x0 v0*CO S( θ 0)*t’ ‘ y =y0 v0*S IN( θ 0)*t – g*t^2/2’] ` , and the second being the v ari ables to sol ve f or , sa y t and y0, i.e ., [‘t’ ‘ y0’]. T he soluti on in this case w ill be pr o vi ded using the RPN mode . T he onl y re ason being that w e ca n build the s olution s tep b y step . T he soluti on in the AL G mode is ve r y similar . Fi rst , w e stor e the fir st v ector (equati ons) into v ari able A2 , and the vector of v ari ables into var iable A1. The follo wing s cr een sho ws the RPN stack befor e saving th e v ariables. At this point , w e need only pr ess K t w ice to stor e the se var iables . T o so lv e , f irst change CA S mode to Ex act , then, list the contents of A2 and A1, in that or der : @@@A2@@@ @@@A1@@@ .
Pa g e 7- 2 Use co mmand S OL VE at this point (f r om the S . SL V menu: „Î ) A fter about 40 s econds, may be more , yo u get as re sult a list: { ‘t = (x -x0)/(C OS( θ 0)*v0)’ ‘ y0 = (2*C OS( θ 0)^2*v0^2*y (g*x^2(2*x0*g 2*SIN(θ 0))*CO S( θ 0 )*v0^2)*x (x0^2*g 2*S IN( θ 0)*C OS( θ 0)*v0^2*x0)))/(2*CO S( θ 0)^2*v0^ 2)’]} Press μ to r emo ve the v ector fr om the list , then u se command OB J  , to get the equati ons listed se parat ely in the s tac k. Ex ample 2 – Str esses in a thic k w all cylinder Consi der a thic k -wall cy linder f or inner and outer r adius a and b , r especti vel y , sub ject t o an inner pr essur e P i and out er pr essur e P o . At an y r adial dist ance r fr om the cylinder ’s ax is the normal str esse s in the radi al and trans ver se dir ecti ons, σ rr and σ θθ , r espec ti v ely , ar e gi ven b y Notice that the r ight-hand sides o f the t w o equati ons differ onl y in the sign between the two te rms. T her ef ore , to wr ite these equations in the calc ulator , I suggest y ou t y p e the f ir st ter m and stor e in a var i able T1, then the s econd term , and stor e it in T2 . W riting the eq uations afterwar ds will be matter o f r ecalling Not e : This method w ork ed fine in this e x ample becaus e the unknow ns t and y0 w er e algebr aic ter ms in the equations . This method w ould not w or k for solv ing for θ 0, since θ 0 belongs to a tr a ns cendental ter m . , ) ( ) ( 2 2 2 2 2 2 2 2 2 a b r P P b a a b P b P a o i o i − ⋅ − ⋅ ⋅ − ⋅ − ⋅ = θθ σ . ) ( ) ( 2 2 2 2 2 2 2 2 2 a b r P P b a a b P b P a o i o i rr − ⋅ − ⋅ ⋅ − − ⋅ − ⋅ = σ
Pa g e 7- 3 the cont ents of T1 and T2 to the stac k and adding and subtr acting them . Here is ho w to do it w ith the eq uation w r iter : Enter and s tor e ter m T1: Enter and st or e ter m T2: Notice that w e ar e using the RPN mode in this ex ample, ho we v er , the pr ocedur e in the AL G mode should be v ery simi lar . Cr eate the equation f or σ θθ : J @@@T1@@@ @@T2#@@ ~‚s ~‚t ` ™ ‚Å Cr eate the equation f or σ rr : J @@@T1@@@ @@T2#@@ - ~‚s ~„r ` ™ ‚Å P ut t ogether a ve ctor w ith the tw o equations , using fu nction  ARR Y (find it using the command catalog ‚N ) after t y ping a 2 : No w , suppose that w e w ant to sol ve f or P i and P o , gi v en a , b , r , σ rr , and σ θ θ . W e enter a v ector w ith the unknow ns: To s o l v e f o r P i and P o , use the command S OL VE fr om the S . SL V menu ( „Î ), it may t ak e the calculat or a minute t o produ ce the r esult: {[‘P i=-((( σθ - σ r) *r ^2 - ( σθ σ r )*a^2)/( 2*a^2))’ ‘P o=-((( σθ - σ r) *r ^2 - ( σθ σ r )*b^2)/( 2*b^2))’ ] } , i .e. ,
Pa g e 7- 4 Notice that the r esult include s a vec tor [ ] contained w ithin a list { }. T o r emo ve the list s y mbol , use μ . F inall y , to dec o mpose the v ector , use f uncti on OB J  . T he r esult is: T hese tw o ex amples constitu te sy stems of linear equatio ns that can be handled equall y w ell w ith func tion LIN S OL VE (see Chap ter 11) . T he f ollo w ing e x ample sho w s fu nction S OL VE applied to a s y stem of poly nomial eq uations . Ex ample 3 - S y stem of pol ynomial equations T he foll ow ing scr een shot sho ws the s olution o f the s y stem X 2 XY=10, X 2 -Y 2 =-5, using f uncti on S OL VE: Solution to simultaneous equations with MSL V F uncti on MSL V is av ailable as the last opti on in the ‚Ï menu: T he help-fac ilit y en tr y f or f uncti on MSL V is sh o wn ne xt:
Pa g e 7- 5 Ex ample 1 - Ex ample from the help facilit y As w ith all functi on entr ie s in the help fac ility , ther e is an e x ample at t ached to the MSL V entr y a s show n abo v e . Notice that f uncti on MSL V r equir es thr ee ar guments: 1. A v ector co ntaining the equati ons, i .e., ‘[S IN(X) Y ,X SIN(Y )=1]’ 2 . A v ector containing the var ia bles to solv e fo r , i.e ., ‘[X,Y]’ 3 . A v ector con taining initial v alues f or the soluti on , i .e ., the initial v alues of both X and Y ar e z er o for this e xample . In AL G mode, pr ess @ECHO t o copy the e x ample to the stac k , pr ess ` to run the e x ample . T o see all the elements in the sol ution y ou need to ac ti vate the line editor b y pr es sing the dow n arr o w k e y ( ˜) : In RPN mode , the soluti on f or this ex ample is pr oduced b y using: Ac tiv ating f unction M SL V r esults in the fo llo w ing scr een. Y ou ma y hav e noticed that , w hile pr oduc ing the soluti on , the scr een show s intermedi ate infor mation on the upper le ft c or ner . Since the solution pr ov ided b y MSL V is numer ical , the infor mation in the upper left corner sho ws the r esults of the ite rati ve pr oces s used to obtain a s olutio n. The f inal solu tion is X = 1.8 2 3 8 , Y = -0.9 681 . Ex ample 2 - Entrance fr om a lake into an open channel T his par ti cular pr oblem in open channel flo w req uires the simult aneous soluti on of two equati ons, the equation o f ener gy : , and Manning ’s equati on: . In thes e equations , H o r e pr esents the e ner gy head (m , or ft) a v ailable fo r a flo w at the entr ance to a channel , y is the flo w depth (m or ft) , V = Q/A is the flo w v eloc ity (m/s or ft/s), Q is the v olumetri c g V y H o 2 2 = o S P A n Cu Q ⋅ ⋅ = 3 / 2 3 / 5
Pa g e 7- 6 disc har ge (m 3 /s or ft 3 /s) , A is the c r oss-sec tional ar ea (m 2 or ft 2 ), C u is a coeff ic ient that depends on the s ys tem of units (C u = 1. 0 f or the SI , C u = 1.4 8 6 fo r the English s ys tem o f units) , n is the Manning’s coe ff ic ient , a measure o f the c ha nnel surf ace r oughness (e . g ., f or conc r ete , n = 0. 012) , P is the w et t ed perimete r of the cr oss se ction (m or ft) , S o is the slope of the channel bed e xpre ssed a s a dec imal fr acti on. F or a tra pez oidal c hannel , as show n belo w , the ar ea is gi v en by , w hile the we tted per imeter is gi ven b y , whe r e b is the b o ttom w idth (m or ft) , and m is the side sl ope (1 V : mH) of t he cr oss se ction. T yp icall y , one has to sol ve the equati ons of ene rg y and Manning ’s simult aneousl y f or y and Q. Once these eq uations ar e wr itten in te rms of the p rim i ti ve va ria b le s b, m, y , g, S o , n, Cu , Q, and H o , we a re l ef t wit h a sys te m of equati ons of the f orm f 1 (y ,Q) = 0, f 2 (y ,Q) = 0. W e can build these two equati ons as f ollo w s. W e assume that w e w ill be using the AL G and Exac t modes in the calc ulator , although def ining the equati ons and sol v ing them with M SL V is ve r y similar in the RPN mode . Cr eate a sub-dir ect or y , say CHANL (f or open CHANneL) , and w ithin that sub-dir ectory def ine the fo llo w ing var iable s: T o see the or iginal equatio ns, E Q1 and E Q2 , in terms o f the primiti ve v ari ables listed abo v e , w e can u se f unction E V AL applied to eac h of the equations , i .e ., y my b A ) ( = 2 1 2 m y b P =
Pa g e 7- 7 μ @@@EQ1@@ μ @@@EQ2@@ . T he equations ar e listed in the st ack as f ollo ws (small fo nt option s elected): W e can see that these eq uations ar e indeed giv en in ter ms of the pr imitiv e var iable s b, m , y , g, S o , n , Cu , Q, and H o . In or der to solv e for y and Q we need to giv e v alues to the other v ar iables. Suppos e w e use H 0 = 5 ft, b = 1. 5 ft, m = 1, n = 0. 012 , S 0 = 0. 00001, g = 3 2 . 2 , a n d C u = 1 . 486. Be fo re b ei n g ab l e t o us e M SL V fo r th e so l ut io n, we need to ente r these v alues into the corr esponding v ari able names . This can be accomplished as fo llo ws: No w , we ar e r eady to s olv e the equation . F irst , we need to put the two equati ons together into a v ector . W e can do this by actuall y stor ing the vec tor into a v ar iable that w e w ill call E QS (E QuationS): As initial v alues f or the v ari ables y and Q w e w ill us e y = 5 (equal to the v a l ue of H o , w hich is the max imum value that y can take) and Q = 10 (this is a guess). T o obtain the solution w e se lect func tion M SL V fr om the NUM. SL V men u , e .g ., ‚Ï6 @@@OK@@@ , to place the command in the s cr een:
Pa g e 7- 8 Ne xt , we ’ll enter var iable E QS: LL @@EQS@ , fo llow ed by v ector [y ,Q]: ‚í„Ô~„y‚í~q™ and b y t he in itial gu esses ‚í„Ô5‚í 10 . Bef or e pre ssing ` , the sc r een will look lik e this: Press ` to sol ve the s yst em of equations . Y ou may , if your angular measur e is not set to r adians , get the fo llow ing req uest: Press @@OK@@ and allo w the s oluti on to pr oceed. An int ermedi ate soluti on step ma y look lik e this: T he vec tor at the top r epre senting the c u r r ent value o f [y ,Q] a s the soluti on pr ogr ess es, and the v alue . 3 5 8 8 2 2 9 8 6 2 8 6 r epre senting the c r iter ia f or con v er gence of the numer ical method used in the soluti on . If the sy ste m is we ll posed , this value w ill diminish until r eaching a v alue c lose to z er o . At that po int a numer ical so lution w ould hav e bee n found . The sc r een , af ter M SL V finds a solution w i ll look lik e this:
Pa g e 7- 9 T he re sult is a list of thr ee v ector s. T he fir st vec tor in the list w ill be the equations sol ved . The second v ector is the list of unkno wns. The thir d v ector r epres ents the solu tion . T o be able to see the se v ector s, pr es s the do wn-a r r o w k e y ˜ to acti v ate the line editor . T he soluti on w ill be sho w n as fo llow s: T he soluti on suggested is [4.9 9 3 6 .., 20.661…]. T his mea ns , y = 4.9 9 ft, and Q = 20.6 61… ft 3 /s . Y ou can use the ar r o w k e ys ( š™—˜ ) to see the solu tion in detail . Using the M ultiple Equation Solv er (ME S) T he multiple equati on so lv er is an en v ir onment w her e y ou can s olv e a sy stem of multiple equati ons by sol v ing for one unkno w n fr om one equation at a time . It is not r eally a sol ver t o simultaneou s soluti ons, rather , it is a one -b y-one sol v er of a number of r elated equations . T o illustr ate the u se of the ME S fo r solv ing multiple equati ons w e pr esen t an appli cation r elated to tr igono metr y in the next sec tion . The e xamples sho wn her e ar e dev eloped in the RPN mode. Application 1 - Solution of tr iangles In this sec tion w e use one important a pplicatio n of tr igono metri c func tions: calc ulating the dimensio ns of a tr iangle . T he soluti on is implement ed in the calc ulator using the Multiple E quati on Sol v er , or M E S . Consi der the tri angle ABC sho w n in the f igur e belo w . T he sum of the inter ior angles of an y tri angle is alw a ys 180 o , i .e ., α β γ = 180 o . T he sine law indi cates that: . sin sin sin c b a γ β α = =
Pa g e 7- 1 0 T he cosine la w indicat es that: a 2 = b 2 c 2 – 2 ⋅ b ⋅ c ⋅ cos α , b 2 = a 2 c 2 – 2 ⋅ a ⋅ c ⋅ cos β , c 2 = a 2 b 2 – 2 ⋅ a ⋅ b ⋅ co s γ . In or der to sol v e an y tr iangle , you need to kno w at least thr ee of the fo llo w ing si x v ar iable s: a, b, c, α, β, γ . T hen, y ou can use the equati ons of the sine la w , cosine la w , and sum of interi or angles of a tr iangle , to sol ve f or the other thr ee va riab le s. If the thr ee sides ar e know n, the ar ea of the tr iangle can be calculat ed w ith H e ron’ s fo rm u la , wh e re s i s kno wn as the semi-per imeter o f the tr iangle , i .e ., T r iangle s olution using th e Multiple Equation Solv er (MES) T he Multiple E quati on So lv er (ME S) is a f eatur e that can be used to sol ve t w o or mor e coupled equations . It must be po inted out , how ev er , that the ME S does not sol v e the equations simult aneously . R ather , it tak es the kno wn v ar iables , and then sear ches in a list o f equations un til it finds one that can be s olv ed f or one of the unkno w n var iables . Then , it sear ches f or ano ther equation that can be sol v ed fo r the next unkn o wns , and so on , until all unkno w ns hav e been solv e d for . Crea ting a workin g direc tor y W e w ill use the ME S t o sol ve f or tri angles b y cr eating a list of eq uations cor r esponding to the sine and cosine la ws , the law of the sum o f inter i or angles, and Her on ’s for mul a for the ar ea. F ir st , cr eate a sub-dir ectory w ithin HOME that w e w ill call TR IANG , and mo v e into that dir ectory . See C hapter 2 for instr ucti ons on ho w to cr eate a new su b-dir ectory . Enterin g t he list of equ ations W ithin TRIANG , ente r the follo w ing list of equati ons e ither by typ ing them dir ectl y on the stac k or by u sing the equation w riter . (Recall that ~‚a pr oduces the c har act er α , and ~‚b pr oduces the char acter β . T he ch arac ter γ needs to be @ECHO ed fr om ‚± ): ) ( ) ( ) ( c s b s a s s A − ⋅ − ⋅ − ⋅ = . 2 c b a s =
Pa g e 7- 1 1 ‘SIN( α )/a = SIN(β )/b’ ‘SIN( α )/a = S IN( γ )/c’ ‘SIN( β )/b = S IN( γ )/c’ ‘ c^2 = a^2 b^2 - 2*a*b*CO S( γ )’ ‘b^2 = a^2 c^2 - 2*a*c*CO S( β )’ ‘ a^2 = b^2 c^2 - 2*b*c*CO S( α )’ ‘ α β γ = 180 ’ ‘ s = (a b c)/2’ ‘A = √ (s*(s-a)*(s-b)*(s-c))’ Then , enter the number 9 , and cr eate a list of eq uations b y using: fu ncti on  LIS T (use the co mmand catalog ‚N ) . Stor e this list in the var ia ble EQ. T he var ia ble E Q contains the list of equati ons that w ill be scanned b y the ME S w hen tr y ing to sol ve f or the unkno wns . Entering a win do w titl e Ne xt , we w ill c r eate a str ing var iable to be called TI TLE to contain the str ing “T ri angle Soluti on ” , as f ollo ws: ‚Õ Open double quotes in sta c k ~~„~ L oc ks k ey boar d into lo we r-cas e alpha. „triangle# Enter te xt : T ri an gle_ „solution Enter text: Solution ` Enter s tring “ T r iangle S olution ” in stac k ³ Open single quotes in stac k ~~title` Enter v ar iable name ‘ TI T LE’ K Sto re st rin g int o ‘TIT L E’ Creating a list of variabl es Ne xt , cr eate a list of v ari able names in the st ack that w ill look lik e this: { a b c α β γ A s } and stor e it in var ia ble L V ARI (L ist of V A R Iables) . The lis t of var iable s repr esents the or der in w hic h the v ari ables w ill be list ed w hen the ME S gets s tarted. It must inc lude all the var iable s in the equations, or it w ill not w or k wit h functi on MITM (see belo w) . Her e is the sequence of k ey str okes to use to pr epar e and stor e this list:
Pa g e 7- 1 2 Press J , if needed , to get y our var i ables me nu . Y our menu should sho w the va riab le s @LVARI! !@ TITLE @@EQ@@ . Preparing to run t he ME S T he next s tep is to acti vate the ME S and tr y one s ample soluti on. Be for e we do that , ho we v er , w e want to s et the angular units to DEGr ees, if the y ar e not alr eady s et to that , by ty ping ~~deg` . Ne xt, w e w ant to k eep in the stack the contents o f TI TLE and L V ARI, b y using: !@TITLE @LVARI! W e w ill use the f ollo w ing ME S f unctions Θ MINI T : ME S INI T iali z ation: initiali z es the v ar iable s in the equati ons s to re d in EQ . Θ MI TM: M E S’ Menu Item: T ak es a title fr om stac k le vel 2 and the list o f v ari ables f r om stac k le vel 1 and place s the title atop of the ME S w indo w , and the list of v ari ables as so ft menu k ey s in the orde r indicat ed by the list . In the pr esent e x er c ise , w e alr eady ha v e a title ( “ T r iangle So lution ”) and a list of v ar iable s ({ a b c α β γ A s }) in stac k lev els 2 and 1, r especti vel y , r eady to acti vate MI TM. Θ M S OL VR: ME S S OL VER; acti v ates the Multiple E quatio n Solv er (ME S) and waits f or input by the us er . Running the ME S interactiv ely T o get the ME S s tarted, w ith the var ia bles T ITLE and L V ARI listed in the stac k , acti v ate command MINI T , then MITM, and f inall y , MS OL VR (f ind these f uncti ons in the catalog ‚N ). The ME S is launched with the follow i ng list of v ariables av ai lable (Press L to see the next li st of vari ab les) : Press L to se e the third list of v ariables. Y ou should se e: Press L o n c e mo re t o re c ove r t he f ir st v ari ab l e m en u.
Pa g e 7- 1 3 Let ’s tr y a sim ple soluti on of Cas e I, using a = 5, b = 3, c = 5 . Us e the fo llo w ing entr ies: 5 [ a ] a:5 is listed in the top left corner of the displa y . 3 [ b ] b:3 is listed in the top left corner of the displa y . 5 [ c ] c:5 is listed in the top left corner of the display . T o so lv e f or the angles u se: „ [ α ] Calc ulator r epor ts Sol v ing for α , and sho ws the r esult α: 72. 5 423 96 87 6 3 . Ne xt , we calc ulate the other tw o values: „ [ β ] T he re sult is β : 34.9152062474 . „ [ γ ] T he r esult is γ : 72.5423968763 . Y ou should ha ve the v alues o f the three angl es listed in stac k le ve ls 3 thr ough 1. Pr es s tw ice to c hec k that they add indeed to 180 o . Press L t o mov e to the ne xt v aria bles menu . T o calc ulate the ar ea use: „ [ A ]. The calc ulato r fir st sol v es f or all the other v ari ables , and then finds the ar ea as A: 7 .15 4 544 0106 3 . Not e : If y ou get a value that is lar ger than 180, try the follo wing: 10 [ α ] Re -initi ali z e a to a smaller value . „ [ α ] C alc ulator r eports So lv i ng for α Not e : When a solu tion is f ound, the cal c ulator r epor ts the conditi ons fo r the soluti on as e ither Z er o, or Sign R e v ersal . O the r messages ma y occur if the calc ulator has diff ic ulties f inding a s olution .
Pa g e 7- 1 4 Pr es sing „ @@ALL@@ will s olv e f or all the v ari ables , tempor a r ily sho w ing the intermediate r esults. Pr ess ‚ @@AL L@@ to see t he sol utions: When done , pres s $ to retur n to the ME S env i r onment . Pre ss J to ex it t he ME S en v ir onment and r eturn to the nor mal calc ulator displa y . Org anizing th e v ariabl es in the su b dir ec tory Y our var iable menu w ill no w contain the var iables (pres s L to see the second set of variables) : V ar iables corr esponding to all the v ari ables in the equati ons in E Q ha ve been c reat ed. T her e is also a ne w v ari able called Mpar (ME S par ameter s) , w hic h contains inf or mation r egar ding the setting up of the ME S for this partic ular set o f e q u a t i o n s. I f yo u u s e ‚ @Mpar to see the conten ts of the v ari able Mpar . Y ou w ill get the cry ptic mes sage: L ibr ary Data . The meaning of this is that the ME S par ameters ar e coded in a binar y f ile, w h i ch cannot be acc essed b y the editor . Ne xt , we w ant to place them in the menu labe ls in a differ ent order than the one list ed abo v e , by f ollo w ing these s teps: 1. Cr eate a list containing { E Q Mpar L V ARI T ITLE }, b y using: „ä @@@ EQ@@@ @ Mpar! !@ LVARI @@ TITLE ` 2 . P lace contents of L V ARI in the stac k, b y using: @LV ARI . 3 . Join the tw o lists by pr essing . Use f unctio n ORD ER (u se the command catalog ‚N ) to or der the var ia bles as show n in the li st in stack lev el 1. 4. Pr es s J to r eco ve r yo ur var iables lis t . It should no w look lik e this: 5. Press L to r eco v er the fir st v ari able menu .
Pa g e 7- 1 5 Progr amming the MES triangle solution using User RPL T o fac ilitate acti vating the ME S for f utur e soluti ons , w e will c r eate a pr ogram that w ill load the ME S wi th a single ke y str oke . The pr ogr am should look lik e this: << DEG MINI T TI TLE L V ARI MITM M S OL VR >>, and can be t y ped in by using : ‚å Opens the pr ogr am s y mbol ~~ L ocks alphan umer i c k e yboar d deg# T ype in DE G (angular units s et to DE Gr ees) minit# T ype in MINI T_ ~ Unloc ks alphanumer i c k ey b oar d @TITLE L ist the name T ITLE in the pr ogram @LVARI L ist the name L V ARI in the pr ogr am ~~ L ocks alphan umer i c k e yboar d mitm# T ype in MI TM_ msolvr Ty p e i n M S O LV R ` Enter pr ogr am in stac k St o re t h e p ro gra m i n a v ari ab l e c al l e d T RI SOL , f or T R Ia n g l e SOLu t io n, by us i n g : ³~~trisol` K Press J , if needed , to r eco v er y our list o f var i ables . A soft k e y label @ TRISO should be av ailable in y our menu . Runnin g the p r ogram – so lution e x amp les T o run the pr ogram , pr es s the @TRISO sof t me nu key . Y ou wil l now h ave th e M ES menu cor r esponding to the tr iangle solu tion . Le t’s try ex amples of the thr ee cases listed ea rlier for triangle solution . Ex ample 1 – Ri ght tr iangle Use a = 3, b = 4, c = 5 . Here is the soluti on sequence: 3 [ a ] 4 [ b ] 5 [ c ] T o en ter data „ [ α ] T he re sult is α : 36. 8698 97 6 458 „ [ β ] T he re sult is β : 53 . 1 3 0 1 0 235 4 1 . „ [ γ ] T he re sult is γ : 90 . L T o mo ve to the ne xt var iable s menu . [  ][ A ] T he re sult is A: 6 . L L T o mo ve t o the next v ar iable s menu . Ex ample 2 - An y t y pe of tri angle
Pa g e 7- 1 6 Use a = 3, b = 4, c = 6 . The soluti on pr ocedure us ed her e consists of so lv ing fo r all var ia bles at once , and then r ecalling the soluti ons to the st ack: J @TRISO T o clear up data and r e -start ME S 3 [ a ] 4 [ b ] 6 [ c ] T o en ter data L T o mo ve t o the next v ar iable s menu . „ @ ALL! So lv e f or all the unkn o w ns. ‚ @ ALL! Sho w the soluti on: Th e so lu tio n i s: At the bottom of the s cr een, y ou w ill hav e the s oft menu k e y s: @VALU  @ EQNS! @PRINT %%%% %%%% @EXIT T he squar e dot in @VALU  indicates that the v alues of the v ar ia bles, r ather than the equati ons fr om whi ch they w er e sol ved , ar e sho wn in the displa y . T o see the equati ons used in the solu tion of eac h var i able , pr ess the @ EQNS! soft menu ke y . T he displa y will no w l ook lik e this: Th e so ft m enu ke y @P RINT is used to print the s cr e e n in a printer , if av ailable . And @EXIT r eturns y ou to the ME S env iro nment f or a ne w soluti on , if needed . T o r eturn to nor mal calc ulator displa y , pre ss J . T he follo w ing table of tr i angle s oluti ons sho w s the data input in bold f ace and the solu tion in itali cs . T r y r unning the pr ogr am w ith these in puts to ve r ify the soluti ons. P lease reme mber to pr ess J @TRIS O at the end of eac h soluti on to c lear up v ari ables and start the ME S soluti on again. Otherw ise , yo u may car r y over info rma tio n from th e p r evious sol ut ion t ha t m ay wreck havo c wit h your c urr ent calc ulations .
Pa g e 7- 1 7 Adding an INFO but ton to your dir ec tory An inf ormati on button can be us ef ul for y our dir ectory to help y ou r emember the oper ation o f the func tions in the dir ectory . In this dir ecto r y , all w e need t o r emember is to pr ess @TRISO to get a tr iangle s olution s tarted. Y ou may w ant to type in the fo llo w ing pr ogr am: <<“Pre ss [TRISO] to start . “ M SGBO X >>, and s tor e it in a var iable called INF O . As a re sult , the fir st v ar iable in y our dir ect or y w ill be the @INFO but ton . Application 2 - V elocit y and acceleration in polar coor dinates T w o -dimensional partic le moti on in polar coo rdinates o ften in vo lv es det ermining the r adial and tr ansv erse components o f the veloc it y and acceler ation o f the particle gi ven r , r’ = dr/dt, r ” = d 2 r/dt 2 , θ, θ ’ = d θ /dt , and , θ ” = d 2 θ /dt 2 . T he follo w ing equations ar e us ed: Cr eate a subdir ect or y called P O L C (POL ar Coor dinate s) , w hic h w e w ill use to calc ulate v eloc ities and acceler atio ns in polar coor dinates . W ithin that subdir ecto r y , enter the follo wing v ar iable s: a b c α( ο )β ( ο )γ ( ο ) A 2.5 6. 98 3 7 7. 2 20.2 2 9 75 8 4.771 8.6 9 3 3 7. 2 8 . 5 14 .2 6 2 2 .61 6 27 13 0. 3 8 2 3 . 3 09 21.9 2 1 7 .5 1 3.2 90 52 . 9 8 3 7 .03 115 .5 41.9 2 23 29 . 6 75 3 2 73 32 8 . 8 1 10.2 7 3 .2 6 1 0.5 77 18 8 5 16 .6 6 17 2 5 3 2 31.7 9 5 0.7 8 9 7 .44 210.71 Pr ogram or v alue Stor e into v ari able: << PE Q S TE Q MINIT NAME LI S T MITM M S OL VR >> "v el. & acc . polar coor d." { r rD rDD θ D θ DD v r v θ v ar a θ a } { 'vr = rD' 'v θ = r* θ D' 'v = √ (v r^2 v θ ^2)' 'ar = rDD − r* θ D^2' 'a θ = r*θ DD 2*rD*θ D' 'a = √ (ar^2 a θ ^2)' } SOL VEP NAM E LIST PE Q θ θ θ θ θ θ & & & & & & & & & r r a r v r r a r v r r 2 2 = = − = =
Pa g e 7- 1 8 An e xplanatio n of the v ari ables f ollo ws : SOL VEP = a progr am that tr iggers the multiple equati on sol v er fo r the partic ular s et of equations s tor ed in var iable PEQ ; NAME = a v aria ble stor ing the name of the m ultiple equation s ol ve r , namely , "v el . & acc. polar coor d. " ; LIST = a list of the v ar iable u sed in the calculati ons, placed in the or der we want them to sho w up in the multip le equat i on solv er en v ironment; PE Q = list of equati ons to be so lv ed , corr esponding to the r adi al and tr ansv erse components of v eloc it y ( vr , v θ ) and acceler ation ( ar , a θ) in polar coordinates , as well as eq uations to calculate the magnitude of the veloc it y ( v ) and the acceler ation ( a ) when the polar components ar e kno w n. r , rD , rD D = r (r adial coor dinate), r- dot (fir st der i vati ve of r ) , r -double dot (second der i v ativ e of r). θ D , θ DD = θ -dot (f irs t deri vati v e of θ ), θ -dou ble dot (second der i vati ve of θ ). ___________ _____________________ _____________________ ___________ Suppo se y ou ar e gi ve n the follo w ing infor mation: r = 2 .5, rD = 0. 5, rDD = - 1. 5, θ D = 2 .3, θ DD = -6. 5, and you ar e aske d to find v r , v θ , ar , a θ , v , and a . Start the multiple equation s olv er by pr essing J @SOLVE . T he calculator pr oduces a sc r een labeled , "v el . & acc . polar coor d." , that looks as f ollo ws: T o ent er the values of the kno wn v ari ables , j ust ty pe the value and pr es s the button cor r esponding t o the var ia ble to be enter ed. Us e the fo llow ing k ey str ok es: 2 . 5 [ r ] 0.5 [ rD ] 1.5 \ [ rDD ] 2 .3 [ θ D ] 6 . 5 \ [ θ DD ].
Pa g e 7- 1 9 Notice that afte r y ou enter a partic ular value , the calc ulator displa y s the v ari able and its value in the upper le f t co rner o f the displa y . W e hav e no w enter ed the kno wn v a r iables . T o calc ulate the unkno w ns w e can pr oceed in two ways: a) . So lv e fo r indiv idual var iables , for e xample , „ [ v r ] giv es vr : 0. 500. Press L„ [ v θ ] to get vθ : 5 .7 5 0 , and so on . Th e r emaining r esult s ar e v: 5 .7 716 9 8 19 0 31; a r : -14.7 2 5; a θ : -13.9 5; and a : 20.2 8 3 6 91108 9 .; or , b) . Sol v e for all v ar iable s at once , by pr essing „ @ALL! . T he calc ulator w ill flas h the soluti ons as it finds them . W hen the calc ulator st ops, y ou can pr ess ‚ @ALL ! to list all r esults . F or this cas e we hav e: Pressing t he soft -m enu k ey @EQNS wi ll let yo u know the equati ons us ed to sol v e f or each o f the values in the scr een: T o use a ne w set of v alues pre ss, e ither @EXIT @@ALL@ LL , o r J @SOLVE . Le t's tr y an other e xam ple using r = 2 . 5, v r = rD = -0. 5, rDD = 1. 5, v = 3 . 0, a = 25.0 . Fi n d , θ D, θ DD , v θ , ar , and a θ . Y ou should get the f ollo w ing re sults:
Pa g e 7- 2 0
Pa g e 8 - 1 Chapter 8 Operations w ith lists L ists ar e a type o f calculat or’s ob ject that can be u sef ul f or data pr oces sing and in pr ogr amming. T his Cha pter pr esents e x amples of oper ations w ith lists . Definitions A list , within the conte xt of the calculat or , is a seri es of ob jec ts enclo sed between br aces and se parated b y space s ( # ), in the RPN mode , or commas ( ‚í ) , in both mode s. Ob jects that can be inc luded in a list are n umbers , letters , char acter str ings, var i able names, and/or oper ators . Lis ts ar e use ful f or manipulating data se ts and in some pr ogr amming appli cations . Some e x amples o f lists ar e: { t 1 } , {"BET " h2 4 } , {1 1.5 2.0}, {a a a a} , { {1 2 3} {3 2 1} {1 2 3}} In the e x amples sho w n belo w we w ill limit ourse lv es to n umer ical lis ts. Cr eating and storing lists T o cr eate a list in AL G mode, f irs t enter the br aces k e y „ä (asso c ia ted w ith the k ey), then type or en ter the eleme nts of the list , separating them w ith commas ( ‚í ) . The fo llow ing ke ystr ok es will enter the list {1 2 3 4} and stor e it into v ar iable L1. „ä 1 ‚í 2 ‚í 3 ‚í 4 ™K~l1` Th e sc re en wi l l s h ow th e fo ll owi n g : T he fi gur e to the le ft show s the s cr een befor e pre ssing ` , while the one to the r ight sho ws the s cr e e n after stor ing the list into L1. Noti ce that bef or e pr essing ` the list sho w s the commas separ ating its elements . Ho w ev er , afte r pr essing ` , the commas are r eplaced with space s. Enter ing the same list in RPN mode r equir es the f ollo w ing k e y str ok es: „ä 1 # 2 # 3 # 4 ` ~l1`K
Pa g e 8 - 2 T he fi gur e belo w sho w s the RPN stac k befo r e pre ssing the K key: Composing and decomposing lists Compo sing and decompo sing lists mak es sense in RPN mode onl y . Under such oper ating mode , decomposing a list is ac hie v ed by u sing functi on OB J  . With this func tion , a list in the RPN stac k is decompos ed into its elements, w i th s tac k le vel 1: sho wing the n umber of elements in the list . The ne xt two sc r een shots sho w the st ack w ith a small list bef or e and after appli cation o f func tion OB J  : Notice that , after apply ing OB J  , the elements of the list occ up y lev els 4: thr ough 2 :, while le v el 1: sho ws the n umber of elements in the list . T o compose a lis t in RPN mode , place the elements of the lis t in the stac k, enter the list si z e , and apply f unct ion  LIS T (select it fr om the func tion catalog , as fo llo ws: ‚N‚é , then us e the up and dow n ar r ow k ey s ( —˜ ) to locate f uncti on  LIS T) . The follow ing sc reen shot s sho w th e elem ents of a li st of si z e 4 be fo re and af te r applicati on of func tion  LI S T : Note: Fu n ct i o n O BJ  applied to a list in AL G mode simply r e pr oduces the list , adding to it the list si z e: Operations w ith lists of numbers T o demonstr a t e oper ations w i th lists of number s, w e will c r eate a couple o f other lists , besides list L1 c r eated abo ve: L2={-3,2 ,1,5}, L3={-6 ,5, 3,1, 0, 3,- 4}, L4={3,- 2 ,1,5, 3,2 ,1}. In AL G mode , the scr een wi ll look lik e this afte r enter ing lists L2 , L3, L4:
Pa g e 8 - 3 In RPN mode , the follo wi ng scr een show s the thr ee lists and their name s read y to be stor ed. T o stor e the lis ts in this case you need to pr ess K thr ee times. Changing sign T he sign - change k e y ( \ ) , whe n applied to a lis t of number s, w ill c hange the sign o f all elements in the list . F or e xam ple: Addition , subtraction, multiplication, div ision Multiplicati on and div ision of a list b y a single number is distr ibuted ac r os s the list , f or e xample: Subtr actio n of a single n umber fr om a list w ill subtr ac t the same number f r om eac h element in the list , for e xample: Additi on of a single number to a list pr oduces a list a ugmented by the number , and not an addition of the single number t o each element in the list . F or exa mp l e:
Pa g e 8 - 4 Subtr actio n, multiplicati on, and di v ision o f lists of numbers o f the same length pr oduce a list of the s ame length with ter m-b y- te rm oper ations . Exam ples: T he div ision L4/L3 w ill pr oduce an infinity entry becaus e one of the e lements in L3 is z er o: If the lists in v ol ved in the oper ation ha ve diff er ent lengths, an err or me ssage is pr oduced (Err or : Inv a l id Dimensi on) . T he plus si gn ( ) , whe n applied to lis ts, acts a concatenati on oper ator , putting together the tw o lists , r ather than adding them ter m-by-ter m. F or exa mp l e: In or der to pr oduce ter m-b y- te rm additi on of two lists o f the same length, w e need to us e oper ator ADD . T his oper ator can be loaded b y using the f uncti on catalog ( ‚N ). T he sc r een belo w sho ws an a pplicati on of ADD to add lists L1 and L2 , te rm-b y- ter m: Real number functions from the k e yboar d Re a l number functi ons fr om the k e yboar d (AB S, e x , LN, 10 x , L OG , SIN, x 2 , √, CO S, T AN, A S IN, A CO S, A T AN, y x ) can be us ed on lists. Her e are s ome exa mp l es :
Pa g e 8 - 5 AB S EXP and LN L OG and ANTIL OG S Q and squar e r oot SIN, ASIN COS, ACOS T AN, A T AN INVER SE (1/x) Real number functions from the MTH menu F uncti ons of inter est fr om the MTH me nu include , fr om the HYPERB OLIC menu: S INH, A S INH, CO SH , A C OSH , T ANH, A T ANH, and fr om the REAL menu: %, %CH, %T , MIN, MAX, MOD , SIGN, MANT , XPON , IP , FP , RND , TRNC, FL OOR , CEIL , D  R, R  D . Some o f the f uncti ons that tak e a single ar gument ar e illustr ated belo w applied to lists o f re al numbers: SI NH, ASIN H COS H, ACOSH
Pa g e 8 - 6 T ANH, A T ANH S IGN, MANT , XP ON IP , FP FL OOR, CEIL D  R, R D Ex amples of functions t hat use tw o arguments T he scr een shots belo w show appli cations o f the functi on % to list ar guments . F unction % r e quir es t w o ar guments. The f irst tw o ex amples sho w cases in w hic h only one o f the t w o ar guments is a lis t . T he re sults are lis ts w ith the functi on % distribu ted accor ding to the list ar gument . F or e xample , %({10, 20, 30},1) = {%(10,1) ,%( 20,1) ,%(3 0,1)}, wh il e %(5,{10,20, 3 0}) = {%(5,1 0) ,%(5,20),%(5, 30)} In the f ollo w ing ex ample, both argume nts of f uncti on % ar e lists of the same si z e. In this case , a ter m-by-term dis tribu tion of the ar guments is perfor med, i .e .,
Pa g e 8 - 7 %({10,20, 30},{ 1,2 , 3}) = {%(10,1),%(20,2),%(3 0, 3)} T his desc r iption o f func tion % f or list ar guments sh o ws the gener al pattern of e valuati on of an y f uncti on w ith two ar guments when one or both ar guments ar e lists . Ex amples of appli cations o f func tion RND ar e sho wn ne xt: Lists o f comple x numbers T he foll o w ing e xe r c ise sho ws ho w to cr eate a list o f comple x number s gi v en tw o lists of the s ame length, one r epr esenting the r eal par ts and one the imaginar y parts of the complex n umbers . Use L1 ADD i*L2 . F uncti ons such as LN, EXP , S Q, etc ., can also be applied to a list o f complex numbers , e .g.,
Pa g e 8 - 8 T he follo w ing ex ampl e sho w s applicati ons of the f uncti ons RE(R eal part) , IM(imaginar y part) , AB S(magnitude) , and AR G(argument) o f comple x numbers . The r esults are lists o f real n umbers: Lists o f algebraic objects T he follo wing ar e ex amples o f lists of algebr aic obj ects w ith the func tion S IN appl ie d to the m: T he MTH/LIST menu T he MTH menu pr o vi des a number of f uncti ons that ex clusi v el y to lists . With flag 117 s et to CHOO SE box es: Ne xt , w ith s ys tem f lag 117 set to S OFT menu s:
Pa g e 8 - 9 T his menu cont ains the fo llo w ing func tio ns: Δ L I S T : C alculate inc r ement among consec uti ve elements in list Σ LIS T : Ca lculat e summation o f elemen ts in the list Π LIS T : Calc ulate pr oduct of elements in the list S OR T : So rts elements in inc r easing or der REVLI S T : R e v erse s or der of list ADD : Oper ator for ter m-b y- ter m addition of tw o lists of the same length (e xample s of this oper ator w er e sho w n abov e) Ex amples of appli cation o f these func tions in AL G mode ar e sho wn ne xt: S OR T and REVLIS T can be combined to sort a list in dec r easing orde r: If y ou ar e w or king in RPN mode , ente r the list ont o the stac k and then select the oper ation y ou w ant . F or e x ample , to calculate the inc r ement betwee n consec utiv e elements in list L3, pr ess: l3`!´˜˜ #OK# #OK# T his places L3 onto the stac k and then sel ects the Δ LIS T operati on fr om the MTH menu .
Pa g e 8 - 1 0 M anipulating elements of a list T he PR G (pr ogr amming) menu inc ludes a LI S T sub-m enu w ith a n umber of func tions t o manipulate ele ments of a list . W ith s ys tem f lag 117 se t to CHOO SE bo x es: Item 1. ELEMENT S.. co ntains the fo llo w ing func tions that can be us ed for the manipulation o f elements in lists: List si ze F uncti on SI ZE , fr om the P RG/LI S T/ELEMENTS sub-menu , can be used to obtain the si z e (also kno w n as length) of the list , e .g ., Extracting and inserting el ements in a list T o extr act elements of a list w e use func tion GE T , av ailable in the PR G/LIS T/ ELEMENT S sub-menu . The argumen ts of f unctio n GET ar e the list and the number of the element y ou w ant to e xtract . T o insert an e lement into a list use func tion P UT (also a v ailable in the PR G/LS T/ELEMENT S sub-menu). The ar guments of f uncti on P UT ar e the list , the positi on that one wan ts to r eplace , and the value that w ill be replaced . Exam ples of appli cations of f uncti ons GET and PUT ar e sho w n in the f ollo w ing sc r een:
Pa g e 8 - 1 1 F uncti ons GET I and PUT I , also av ailable in sub-me nu PR G/ ELEMENT S/, ca n also be us ed to ext rac t and place elements in a list . Thes e t w o functi ons, ho w e ve r , are u se ful mainl y in pr ogr amming . F uncti on GET I us es the same ar guments as GE T and r eturns the lis t , the element locati on plus one , and the element at the location r equested . F uncti on PUT I use s the same arguments as GET and r eturns the list and the list si z e . Element position in t he list T o deter mine the positi on of an element in a lis t use f uncti on PO S ha v ing the list and the element of inter est as ar guments. F or ex ample, HEAD and T AIL func tions T he HEAD func tion e xtr acts the f irst el ement in the list . The T AIL functi on r emo v es the fir st element o f a list , r eturning the r emaining list . S ome e x amples ar e sho wn ne xt: T he SEQ function Item 2 . PR OCEDURE S .. in the PR G/LIS T menu contains the follo wing f unctions that can be used to oper ate on lists . F uncti ons REVLIS T and S ORT w er e intr oduced earlie r as p art of the MTH/LIS T menu . F unctio ns DOLIS T , DO SUB S, NS UB, END S UB, and S TREAM, ar e designed as pr ogramming f uncti ons f or oper ating lists in RPN mode. F uncti on
Pa g e 8 - 1 2 SE Q is use ful t o pr oduce a list of v alues gi ve n a par ti c ular expr essi on and is desc r ibed in mor e detail her e . T he SEQ f uncti on tak es as ar guments an e xpr essi on in ter ms of an index , the name of the inde x , and starting, ending , and incr ement values f or the inde x , and r eturns a lis t consisting of the e valuati on of the e xpr essi on for all pos sible v alues of the inde x . The gener al for m of the func tio n is SEQ( e xpre ssion , inde x, start , end, inc r ement ). In the f ollo w ing ex ample , in AL G mode , we ide ntify e xp r ession = n 2 , inde x = n, star t = 1, end = 4 , and inc r ement = 1: T he list pr oduced cor r esponds t o the value s {1 2 , 2 2 , 3 2 , 4 2 }. In RPN mode , y ou can list the diffe r ent argume nts of the func tion as f ollo w s: bef or e appl y ing func tion SE Q. The MAP func tion T he MAP functi on , av ailable thr ough the command catalog ( ‚N ) , tak es as ar guments a list of n umbers and a f unction f(X) or a pr ogr am of the fo rm <<  a … >>, and produce s a list consisting of the application o f that functi on or pr ogr am to the list of n umb e rs . F or e x ample , the f ollow ing call to func tion MAP applie s the functi on S IN(X) to the list {1,2 , 3}: In AL G mode , the s y ntax is: ~~map~!Ü!ä1@í2@í3™@ í S~X` In RPN mode , the s yntax is: !ä1@í2@í3`³S~X`~~m ap`
Pa g e 8 - 1 3 In both case s, y ou can ei ther t y pe out the MAP command (as in the e x amples abo v e) or select the command fr om the CA T menu . T he follo w ing call to func tion MAP us es a pr ogr am instead of a f uncti on as second a r gument: Defining functions t hat use lists In Chapte r 3 w e intr oduced the use o f the D EFINE f unction ( „à ) t o c r eate func tions o f r eal number s with one or mor e argumen ts. A f uncti on def ined w ith DEF can also be used w ith list ar guments, e x cept that, an y functi on incorpo rating an additi on mus t use the ADD oper ator r ather than the plus si gn ( ) . F or e x ample , if we de fine the f unction F(X,Y ) = (X-5)*(Y - 2) , sho wn he r e in AL G mode: w e can use lis ts (e .g ., var ia bles L1 and L2 , def ined ear lier in this Cha pter ) to e valuate the f uncti on, r esulting in: Since the fu nctio n state ment include s no additions , the appli cation o f the function to li st ar gu ments is str aight f or w ard . How ev er , i f w e d ef ine the function G(X,Y) = (X 3)*Y , an attempt to e valuate this f uncti on w ith list ar guments (L1, L2) w ill f ail: T o f ix this pr oblem we can edit the cont ents of v ari able @@@G@@@ , whi ch w e can list in the stac k b y using … @@@G@@@ ,
Pa g e 8 - 1 4 to r eplace the plus sign ( ) w ith ADD: Ne xt , we s tor e the edited e xpres sion in to v ari able @@@G@@@ : Ev aluating G(L1,L2) now pr oduces the f ollo w ing r esult: As an alter nati ve , y ou can define the f uncti on w ith ADD rathe r than the plus sign ( ), fr om the s tart, i .e ., use DEFINE(' G(X,Y)=(X DD 3)*Y') : Y ou can also def ine the func tion as G(X,Y ) = (X--3)*Y .
Pa g e 8 - 1 5 Applications of lists T his sectio n show s a couple of appli cations o f lists to the calc ulation o f statisti cs of a sa mple. B y a samp le w e u nderstand a list of v alu es , sa y , {s 1 , s 2 , …, s n }. Suppo se that the sample o f inter est is the list {1, 5, 3, 1, 2, 1, 3, 4, 2, 1} and that w e stor e it into a var iable called S (The s cr e e n shot belo w show s this acti on in AL G mode , ho w e ve r , the pr ocedure in RPN mode is v er y simil ar . Just k eep in mind that in RPN mode y ou place the arguments of f uncti ons in the stac k bef or e acti v ating the functi on): Harmonic mean of a list T his is a small enough sample that w e can count on the sc r een the number of elements (n=10) . F or a larger lis t, w e ca n us e functi on SI ZE to obtain that number , e .g. , Suppos e that we want t o calc ulate the harmoni c mean of the sample , def ined as . T o calc ulate this v alue w e can f ollo w this pr ocedur e: 1. Appl y func tion INV () to lis t S: 2 . A pply f unction Σ LIS T() to the r esulting list in1. ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ = = ∑ = n n k n h s s s n s n s 1 1 1 1 1 1 1 1 2 1 1 L
Pa g e 8 - 1 6 3 . Di vi de the r esult abov e by n = 10: 4. Appl y the INV() func tion to the lat est r esult: T hus , the harmonic mean o f list S is s h = 1.6 34 8… Geometric mean of a list T he geometri c mean of a sample is def ined as T o f ind the geometri c mean of the list stor ed in S , w e can use the f ollo w ing pr ocedur e: 1. Appl y func tion Π LIS T() to list S: 2 . A pply f unction XR OO T(x ,y) , i .e ., k ey str ok es ‚» , to the r esult in 1: n n n n k k g x x x x x L 2 1 1 ⋅ = = ∏ =
Pa g e 8 - 1 7 T hus , the geometri c mean of list S is s g = 1. 003 2 0 3… W eighted aver age Suppo se that the data in list S , def ined abo ve , namel y : S = {1,5,3,1 ,2,1,3,4,2,1 } is affec ted b y the we ights , W = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} If w e def ine the we ight lis t as W = {w 1 ,w 2 ,…,w n }, w e notice that the k -t h element in list W , a bo ve , can be de fi ned by w k = k. Thu s we c an use fun ctio n SE Q to g ener a te this list , and then stor e it into v ari able @@@W@@@ as f ollo w s: Gi ven the data lis t {s 1 , s 2 , …, s n }, and the w eig ht list {w 1 , w 2 , …, w n }, the w ei ghted av er age of the data in S is def ined as . T o calc ulate the w eighted a v er age of the data in lis t S w ith the w ei ghts in list W , w e can use th e f ollo wing s teps: 1. Multiply lis ts S and W : 2. U s e f u n c t i o n Σ LIS T in this re sult to calc ulate the numer ator of s w : ∑ ∑ = = ⋅ = n k k n k k k w w s w s 1 1
Pa g e 8 - 1 8 3. U se f un c t io n Σ LIS T , once mor e , to calculat e the denominator o f s w : 4. Use the e xpre ssi on ANS( 2)/ANS(1) to cal culat e the w ei ghted a v er age: Th us, the w ei ghted av er age of list S w ith w eights in lis t W is s w = 2 .2 . Statistics of gr ouped data Gr ouped dat a is t y p icall y gi v en b y a table sho wing the f r eque ncy ( w) of data in data c lasse s or bins . Eac h c lass or b in is repr esented b y a c lass mar k (s) , typ icall y the midpo int of the c lass . An e x ample o f gr ouped data is sho wn ne xt: Note : A NS ( 1 ) re fe rs t o t h e m os t re c e nt re su l t ( 5 5 ) , wh i l e AN S (2 ) ref er s t o the pr ev ious to last r esult (121) . Cl ass F r eque ncy Class mark count boundar ies s k w k 0 - 2 1 5 2 - 4 3 12 4 - 6 5 18 6 - 8 7 1 8 -10 9 3
Pa g e 8 - 1 9 T he clas s mar k data can be st ored in v ari able S , while the fr equency coun t can be stor ed in var iable W , as f ollow s: Gi ven the list of class marks S = {s 1 , s 2 , …, s n }, and the list of fr eque ncy counts W = {w 1 , w 2 , …, w n }, the w eig hted a ver age of the data in S w ith w ei ghts W r epr esents the mean v alue of the gr ouped data , that we call ⎯ s, in this conte xt: , w here r epr esents the total fr equency count . T he mean v alue for the data in lists S and W , ther ef or e , can be calc ulated us ing the pr ocedur e outlined abo ve f or the w e ight ed av er age , i. e., W e ’ll stor e this value into a v a r iable called XB AR: T he var iance o f this grou ped data is def ined as N s w w s w s n k k k n k k n k k k ∑ ∑ ∑ = = = ⋅ = ⋅ = 1 1 1 ∑ = = n k k w N 1
Pa g e 8 - 2 0 T o calc ulate this las t r esult , w e can us e the fo llow ing: T he standar d dev iati on of the gr ouped data is the sq uar e r oot of the var iance: N s s w w s s w V n k k k n k k n k k k ∑ ∑ ∑ = = = − ⋅ = − ⋅ = 1 2 1 1 2 ) ( ) (
Pa g e 9 - 1 Chapter 9 V ec tors T his Chapter pr o v ides e x amples o f enter ing and operating w ith vect ors , both mathematical v ector s of man y elements, as w ell as ph y sical v ectors of 2 and 3 components . Definitions F r om a mathematical po int of v ie w , a vec tor is an arr a y of 2 or mor e elements arr anged int o a r o w or a column . These w ill be r efe rr ed to as row and column vec tors . Ex ample s ar e sho wn belo w: Ph y sical v ector s hav e two or thr ee components and can be u sed to r epr ese nt ph y sical quantities suc h as position , v eloc it y , ac cele rati on, f or ces, moments , linear and angular momentum, angular v eloc it y and acceler ation , etc. R efe rr ing to a C ar t esian coor dinate s y stem (x ,y ,z) , the r e e xis ts unit v ector s i , j , k assoc iated w ith eac h coordinat e dir ecti on, such that a ph ysi cal vec tor A can be w ritt en in ter ms of its components A x , A y , A z , as A = A x i A y j A z k . Alterna ti v e notation for this vector ar e: A = [A x , A y , A z ], A = (A x , A y , A z ), or A = < A x , A y , A z >. A tw o dimensi onal v ersi on of this vec tor w ill be wr it t en as A = A x i A y j , A = [ A x , A y ], A = (A x , A y ), o r A = < A x , A y >. Since in the calc ulato r v ector s ar e w r itten betw een br ac k ets [ ], w e w ill c hoo se the notati on A = [ A x , A y , A z ] or A = [ A x , A y , A z ], to r ef er to tw o - and thr ee -dimensional vectors fr om now on. The m agnitu de of a vector A is de fined as | A | = . A unit vector in th e direction of vector A , is defined as e A = A /|A |. V ectors can be multiplied b y a scalar , e.g ., k A = [kA x , kA y , kA z ]. Ph y sicall y , the vec tor k A is par allel to v ecto r A , if k>0, or anti-par allel to ve ctor A , if k<0. T he negati ve o f a v ector is de fined a s – A = (–1) A = [–A x , –A y , –A z ]. Di v ision b y as scalar can be inter pr eted as a multiplicati on , i .e ., A /k = (1/k) ⋅ A . Additi on and subtr actio n of v ector s ar e def ined as A ±B = [ A x ± B x , A y ± B y , A z ± B y ], whe re B is the v ect or B = [B x , B y , B z ]. T here ar e t w o def initions o f pr oducts of ph ysi cal vec tors , a scalar or inter nal pr oduct (the dot pr od u ct) and a vec tor or ext ernal pr oduct (the cr oss pr oduct). T he dot produ ct pr oduces a scalar v alue def ined as A •B = | A ||B |cos( θ ), ] 2 , 5 , 3 , 1 [ , 6 3 1 − = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − = u v 2 2 2 z y x A A A
Pa g e 9 - 2 wher e θ is the angle betw een the tw o vec tors . The c r os s pr oduct pr oduces a vec tor A ×B w hos e magnitude is | A ×B | = | A ||B |sin( θ ), and its dir ection is gi v en by the s o -ca lled r ight -hand r ule (consult a textbook on Math , Ph y sics , or Mechani cs to s ee this oper ation illu str ated gr aphicall y) . In te rms of Ca r t esian comp onents , A • B = A x B x A y B y A z B z , and A ×B = [ A y B z -A z B y ,A z B x -A x B z ,A x B y - A y B x ]. T he angle between tw o ve ctor s can be found f r om the def initio n of the dot pr oduct as co s( θ ) = A •B /|A ||B |= e A • e B . T hus , if two v ec tor s A and B ar e per pendic ular ( θ = 90 0 = π /2 ra d ), A •B = 0. Entering v ec t ors In the calculator , vecto rs ar e repr esented by a sequence of numbers enc losed between brac k ets, and t y picall y ent er ed as r ow v ector s. The br ack ets ar e gener ated in the calc ulator b y the k ey str oke comb ination „Ô , assoc iated w ith the * k ey . T he f ollo w ing ar e ex amples o f vect ors in the calc ulator : [3.5, 2.2, - 1.3, 5.6, 2.3] A gener al r ow v ect or [1.5,-2.2] A 2 -D v ect or [3,-1,2] A 3-D v ect or ['t','t^2' ,'SIN(t)'] A vec tor of algebr ai cs T yping v ec tors in the stac k W ith the calculator in AL G mode , a vec tor is typed int o the stac k by opening a set of br ac k ets ( „Ô ) and t y ping the components or elements of the v ector separ ated b y commas ( ‚í ). T he scr een s hots belo w sho w the entering of a numer ical v ect or fo llo we d by an algebr aic v ect or . The f igur e to the left sho ws the algebr aic v ecto r bef or e pr essing „ . The f igur e to the r ight sho ws the calc ulator ’s sc r een after ente ring the algebr ai c vec tor : In RPN mode , yo u can enter a vec tor in the stac k by opening a set o f br ack ets and t y ping the vec tor components or elements separ ated b y either commas ( ‚í ) or spaces ( # ). Notice that after pr essing ` , in e ither mode , the calc ulator sho w s the vec tor elements separ ated b y spaces .
Pa g e 9 - 3 Stor ing vectors int o var iables V ector s can b e s tor ed into var iables . The sc r een shots belo w show the v ectors u 2 = [1, 2] , u 3 = [-3, 2, -2] , v 2 = [3,-1] , v 3 = [1, -5, 2] stor ed into v ariables @ @@u2@@ , @@@u3@@, @@@v2 @@ , and @@@v3@@ , r especti vel y . F irst , in AL G mode: T hen, in RPN mode (bef or e pr essing K , r epeatedly) : Using the M atr ix W riter (MTR W ) to enter v ectors V ector s can also be enter ed by using the Matr i x W r iter „² (thir d k e y in the fo urth r ow o f k e ys f r om the top of the k ey boar d) . T his command gener ates a spec ies o f spr eadsheet corr esponding to r o ws and columns of a matr i x (Details on using the Matr i x W r iter to ent er matri ces w ill be pre sented in a sub sequen t c hapter). F or a v ector w e are inter ested in filling onl y elements in the top r o w . B y defa ult , the cell in the top r o w and f irs t column is select ed. At the bo t t om of the spr eadsheet you w ill find the f ollo wing s oft menu k ey s: @EDIT! @VE C  ← WID @WID→ @GO→ @GO ↓ Th e @EDIT k ey is u sed to edit the co ntents of a select ed cell in the Matr i x W riter . Th e @VEC@@ k e y , w hen select ed, w ill pr oduce a vec tor , as opposit e to a matr i x of one r o w and many columns .
Pa g e 9 - 4 Th e ← WID k e y is used to decr ease the w i dth of the columns in the spr eadsheet . Pr ess this k ey a couple o f times to see the column w idth dec r ease in y our Matr i x W r iter . Th e @ W I D → k e y is used to incr ease the w idth of the columns in the spr eadsheet . Pr ess this k ey a couple o f times to see the column w idth inc r ease in y our Matr i x W r iter . Th e @G O →  k e y , when se lected , auto maticall y selects the ne xt cell to the r ight of the c u r r ent cell w hen y ou pre ss ` . This opti on is s elected b y def ault . Th e @GO ↓ k ey , w hen selec ted , aut omaticall y selec ts the ne xt cell belo w the c urr ent cell when y ou pr es s ` . Ac tiv ate the Matr i x W rit er again by u sing „² , and pr ess L to chec k out the second so ft ke y menu at the bottom of the displa y . It will sho w the k ey s: @ ROW@ @-ROW @ COL@ @-COL@ @ → STK@@ @G OTO@ V ec tors v s. matr ices T o se e the @VEC @ k ey in acti on , tr y the f ollo w ing ex erc ises: (1) Launc h the Matr i x W rit er ( „² ). W i t h @VEC  and @GO → selected , enter 3`5`2`` . This pr oduces [3 . 5 . 2 .]. (In RPN mode , y ou can us e the fo llo w ing ke ys tr ok e seque nce to pr oduce the same r esult: 3#5#2`` ). (2) Wi th @VEC @@ des elect ed and @GO →  selected ,, enter 3#5#2`` . T his produce s [[3 . 5 . 2 .]]. Although the se two r esults diff er only in the number of br ack ets us ed, f or the calc ulator the y r epre sent differ ent mathemati cal ob jects . The f irs t one is a vec tor w ith thr ee elements , and the second one a matri x with one r o w and three columns . Ther e ar e differ ences in the w ay that mathemati cal operati ons tak e place on a vec tor as opposit e to a matri x . Ther ef or e , for the time be ing, k eep the soft men u k e y @VEC  selected w hile using the Matri x W riter . M oving to t he righ t vs. m oving down in t he Ma trix W rit er Ac ti vate the Matr i x W r iter and enter 3`5`2`` w ith the @GO →  ke y sel ected (default ) . Next , enter th e sam e sequ ence of num bers with the @GO ↓  k e y selected to see the differ ence. In the fir st case y ou enter ed a v ector o f thr ee elements . In the seco nd case y ou enter e d a matri x of thr ee r o w s and one column.
Pa g e 9 - 5 Th e @ ROW@ k e y w ill add a r o w full o f z er os at the location of the s elect ed cell o f the spr eadsheet . Th e @-ROW k ey w ill delete the r o w corr esponding t o the selec ted cell of the spr eadsheet . Th e @ COL@ k ey w ill add a column full o f z er os at the location o f the selec ted cell of the spr eadsheet . Th e @-COL@ k ey w ill delete the column cor r esponding t o the selec ted cell of the s pr eadsheet . Th e @ → STK@@ ke y will place the contents of the selected cell on the stac k . Th e @GOTO@ k e y , when pr essed , w ill r eques t that the user indi cate the number of the r o w and column w here he o r she wants to positi on the cu rso r . Pr es sing L once mor e pr oduces the las t menu , whi ch contains onl y one fu nct ion @@DEL@ (delete) . Th e fu nct ion @@ DEL@ will delet e the contents of the se lected cell and r eplace it w ith a z er o . T o see thes e k ey s in action try the follo wing e xer c ise: (1) Acti vate the Matr i x W rite r by u sing „² . Mak e sur e the @VEC  and @GO →  k e y s ar e selec ted. (2) Enter the follo wing: 1`2`3` L @GOTO@ 2 @@OK@@ 1 @@OK@ @ @@OK@ @ 2`1`5` 4`5`6` 7`8`9` (3) Mov e the cur sor up tw o positi ons b y using —— — . Then press @-ROW . T he second r o w w ill disappear . (4 ) P re ss @ ROW@ . A r o w of thr ee z eroes appea r s in the second r ow . (5) Pre ss @-COL@ . The f irs t column w ill d i sappear . (6) Pr ess @ COL@ . A r o w of tw o z er oes appears in the fir st r o w . (7 ) P ress @ GOTO@ 3 @@OK@@ 3 @@O K@@ @@OK@@ to mo ve to position (3, 3) . (8) Pr ess @ → STK@@ . This will place the contents o f cell (3, 3) on the st ack , although y ou w ill not be able to se e it ye t . (9) Press ` to r eturn to normal display . Element (3, 3) and the full matr i x w ill be a vailable in the s cr een.
Pa g e 9 - 6 Building a vector with  ARR Y Th e fu nct ion → ARR Y , av ailable in the func tion catalog ( ‚N‚é , us e —˜ to locat e the functi on), ca n als o be u sed to build a v ect or or ar r ay in the f ollo w ing wa y . In AL G mode , enter  ARR Y( v ector el ements, numb er of elements ) , e .g ., In RPN mode: (1) Enter the n elements o f the arr a y in the order y ou w ant the m to ap pear in the arr ay (w hen read f r om left to r ight) into the RPN st ack . (2 ) E nte r n as the las t entry . (3) Use fun ction  ARR Y . T he follo w ing scr een shots sho w the RPN stac k bef or e and after appl y ing fu nct ion  ARR Y : Summary of M atri x W riter use fo r entering vec t ors In summary , to enter a v ector u sing the Matri x W rit er , simpl y acti vate the wr iter ( „² ) , and place the elements of the vecto r , pre ssing ` after each of them. The n , press `` . Make sur e that the @VEC  and @GO → @ keys are sele cted. Ex ample: „²³~„xQ2`2`5\`` pr oduces: [‘ x^2‘ 2 –5 ]
Pa g e 9 - 7 In RPN mode , the functi on [ → ARR Y] tak es the objec ts fr om stac k lev els n 1, n , n- 1 , …, dow n to st ack le ve ls 3 and 2 , and con v erts them into a v ector of n elements . T he object ori ginally at s tack le v el n 1 becomes the f irst element , the obj ect or iginally at le v el n becomes the second element , and so on . Id entify ing, e xtr ac ting, and inserting v ec tor elem ents If y ou sto r e a v ector into a v ar iable name , sa y A, y ou can i dentify elements of the v ector b y using A( i) , whe r e i is an integer numbe r less than or equal t o the v ector si z e. F or ex ample, cr eate the follo w ing arr a y and stor e it in var ia ble A: [-1, - 2 , -3, - 4, -5]: To r e c a l l the thir d element of A, f or e x ample, y ou could t y pe in A(3) into the calc ulato r . In AL G mode , sim ply ty pe A(3). In RPN mode , type ‘ A( 3)’ `μ . Y ou can oper ate w ith elements of the ar r ay b y w riting and e valuating algebr aic e xp r essions such as: Mor e complicated expr essi ons inv olv ing elements of A can also be wr itten . F or e xample , using the E quation W riter ( ‚O ) , we c a n wri te t he fol l o wi ng summation o f the elemen ts of A: Not e : F uncti on  ARR Y is also a vaila ble in the PR G/TYPE menu ( „° )
Pa g e 9 - 8 Highli ghting the entir e e xpr essio n and using the @EV AL@ soft men u ke y , w e get the re su l t : -1 5 . T o r eplace an e lement in an arr a y use f uncti on PUT (y ou can find it in the func tion cat alog ‚N , or i n the P RG/LI S T/ELEMENT S sub-men u – the later w as intr oduced in Chapter 8). In AL G mode , y ou need to use func tion P UT w ith the f ollo w ing ar guments: P UT( ar r ay , locati on to be r eplaced, ne w v alue ). F o r e xample , to change the contents of A(3) to 4. 5 , us e: In RPN mode , yo u can change the value of an eleme nt of A, b y stor ing a new v alue in that par ti c ular element . F or e xample , if we w ant to c hange the cont ents of A(3) to r ead 4.5 ins tead of its c urr ent value o f –3 ., use: 4.5`³~a„Ü3`K T o v er if y that the c hange took place use: ‚ @@@@A@@ . T he re sult no w sho wn is: [- 1 - 2 4.5 - 4 -5 ]. T o f ind the length of a v ector y ou can use the f unction S I ZE , av ailable thr ough the command catalog (N) or thr ough the P RG/LI S T/ELEMENT S sub-menu . Some e xamples , based on the ar r ay s or v ectors s tor ed pr ev io usly , are sho wn belo w : Note : The v ect or A can a l so be r efe rr ed to as a n inde xed v ar iable because the name A r epr esen ts not one , but man y values i dentifi ed b y a sub-inde x. Not e : This appr o ac h fo r changing the v alue of an arr ay ele ment is not allo w ed in AL G mode , if y ou try to st or e 4.5 in to A(3) in this mode y ou get the f ollow ing err or mes sage: In valid S y ntax.
Pa g e 9 - 9 Simple oper ations with vectors T o illus tr ate oper atio ns w ith vec tor s we w ill use the v ector s A, u2 , u3, v2 , and v3, sto r ed in an ear lier e xe r c ise . Changing sign T o change the si gn of a v ect or use the k e y \ , e .g., Addition , subtraction Additi on and subtrac tion o f vec tors r equir e that the t w o v ector oper ands hav e the same length: Attempting to add or subtr act v ect ors of diff er ent length pr oduces an er r or mess age (Inv alid Dimensi on) , e .g., v2 v3, u2 u3, A v3, etc. Multiplication b y a scalar , and div ision b y a scalar Multiplicati on b y a scalar or di visi on b y a scalar is str aightf orwar d:
Pa g e 9 - 1 0 Absolute value func tion T he absolute v alue func tion ( ABS), when appli ed to a vec tor , pr oduces the magnitude of the v ector . F or a vec tor A = [ A 1 ,A 2 ,…,A n ], the magnitude is def ined as . In the AL G mode , enter the functi on name f ollo we d by the v ector ar gument . F or e xample: BS([1,-2,6]) , BS( ) , BS(u3) , will sho w in the scr een as follo ws: T he MTH/VECT OR menu T he MTH menu ( „´ ) contains a men u of func tions that spec ificall y t o vector objects: T he VE CT OR menu contains the f ollo w ing f unctions (s ys tem flag 117 s et to CHOO SE bo x es): Magnitude T he magnitude of a vec tor , as disc ussed ear lier , can be f ound w ith func tion A B S. T h i s fu n c t i o n i s a l s o av a i l a b l e f ro m t h e k eyb o a rd ( „Ê ) . Ex amples of appli cation of f unction AB S w er e sho w n abo ve . 2 2 2 | | z y x A A A A = L
Pa g e 9 - 1 1 Dot pr oduct F uncti on DO T is used to calc ula t e the dot pr oduct of tw o vec tors o f the same length. S ome e xample s of applicati on of f uncti on DO T , using the v ecto rs A, u2 , u3, v2 , and v3, stor ed ear lie r , ar e show n next in AL G mode . Attempts t o calc ulate the dot pr oduct o f two v ector s of differ ent length pr oduce an err or mes sage: Cr oss product F uncti on CR OS S is used to calc ulate the c r os s pr oduct of tw o 2 -D v ectors , of tw o 3-D v ector s, or of one 2 -D and one 3-D vector . F or the purpo se of calc ulating a cr oss product , a 2 -D vector of t he form [ A x , A y ], is tr eated as the 3-D v ector [ A x , A y , 0]. Ex amples in AL G mode ar e sho wn ne xt f or tw o 2 -D and tw o 3-D v ector s . Notice that the c r oss pr oduct of tw o 2 -D v ector s w ill pr oduce a vec tor in the z - dir ecti on only , i .e ., a vec tor of the f or m [0, 0, C z ]: Exampl es of cr oss product s of one 3-D v ector w ith one 2 -D v ector , or v ice versa, ar e pr esent ed next: Attempts to calc ulate a c ro ss pr od u ct of v ector s of length other than 2 or 3, pr oduc e an er r or messag e (In vali d Dimension), e.g ., CRO S S(v3,A), etc. Decomposing a v ec t or Fu n c ti o n V  is use d t o de comp ose a vector into it s el emen ts o r co mpon ent s . If us ed in the AL G mode , V  will pr o v ide the elements of the v ect or in a list , e .g.,
Pa g e 9 - 1 2 In the RPN mode , appli cation o f func tion V  w ill list the components o f a ve ctor in the st ack , e .g., V  (A ) will pr oduce the f ollo w ing outpu t in the RPN stack (vector A is li sted in stack lev el 6: ). Building a t w o -dimensional v ec t or Fu n c ti o n  V2 is used in the RPN mode to bu ild a vect or w ith the value s in stac k le vels 1: and 2 :. T he f ollo w ing sc r een shots show the stac k bef or e and after appl y ing func tion  V2 : Building a three -dimensional v ector Fu n c ti o n  V3 is used in the RPN mode to bu ild a vect or w ith the value s in stac k le vels 1: , 2 :, and 3:. T he f ollo w ing sc r een shots sho w the stac k befor e and after appl y ing func tion  V2 : Changing coordinate s ystem F uncti ons RE CT , CYLIN , and SP HERE are u sed to c hange the c urr ent coor dinate s y stem t o r ectangular (C artesian), cy lindri cal (polar ) , or s pheri cal coor dinates . T he cur r ent s y st em is show n highlighted in the cor r espo nding CHOOSE bo x (s y stem f lag 117 unset) , or s elected in the corr esponding S OFT menu label (s y stem f lag 117 s et) . In the f ollo wing f igur e the RE CT angular coor dinate s ys tem is sho wn as s elected in thes e t w o fo rmats:
Pa g e 9 - 1 3 When the r ect angular , or Cartesi an, coor dinate s yst em is select ed, the t op line of the displa y w ill show an XY Z fi eld , and any 2 -D or 3-D v ector ent er ed in the calc ula t or is r eproduced as the (x ,y ,z) components o f the vecto r . T hus , to enter the v ector A = 3 i 2j -5k , w e use [3,2 ,-5], and the v ecto r is show n as: If i nstead of enter ing Ca rtesian c omponents of a vector w e enter cy lin dr ical (polar ) components, w e need to pr ov ide the magnitude , r , of the pr oj ecti on of the v ector on the x -y plane, an angle θ (in the cur r ent angular measur e) r epr esenting the inc lination of r w ith res pect to the positi ve x -ax is , and a z - component of the v ector . T he angle θ must be enter ed preceded b y the angle ch arac ter ( ∠ ), g e n e r a t ed b y u s i n g ~‚6 . F or ex ample, su ppos e that we hav e a v ector w ith r = 5, θ = 2 5 o (DE G should be se lected as t he angular measur e) , and z = 2 . 3, w e can enter this vec tor in the follo wing w a y: „Ô5 ‚í ~‚6 25 ‚í 2.3 Bef or e pre ssing ` , the sc r een w ill look as in the left -hand si de of the fo llo w ing fi gur e . After pr essing ` , the sc r een w ill look as in the ri ght -hand side o f the fi gur e (F or this e xample , the numer ical f ormat w as changed t o F i x, w ith thr ee dec imals) . Notice that the v ector is dis play ed in Cartesi an coordinate s , w ith components x = r co s( θ ) , y = r sin( θ ) , z = z , even thou gh we entered it in p olar c oor di nates. T his is becaus e the v ector dis play w ill def ault t o the c urr ent coo r dinate s ys tem . F or this case , w e hav e x = 4. 5 3 2 , y = 2 .112 , and z = 2 .3 00. Suppos e that we no w enter a v ector in s pheri cal coor dinates (i .e., in the f orm ( ρ,θ,φ ) , w her e ρ is the length of t he ve ctor , θ is the angle that the xy pr ojecti on of the v ect or for ms w ith the positi v e side of the x - ax is, and φ is the angle that ρ fo rms w ith the positi v e side of the z ax is) , w i th ρ = 5, θ = 2 5 o , and φ = 4 5 o . W e w ill use: „Ô5 ‚í ~‚6 25 í ~‚6 45
Pa g e 9 - 1 4 T he fi gur e belo w sho w s the tr ansfor mation o f the v ector f r om spher ical to Cartesi an coor dinates , w ith x = ρ si n( φ ) cos( θ ), y = ρ sin ( φ ) cos ( θ ), z = ρ co s( φ ) . F or this ca se , x = 3 .204 , y = 1.4 9 4, and z = 3 . 5 3 6. If the C YLINdri cal s y stem is s elected , the top line of the dis play w ill sho w an R ∠ Z f ield , and a vect or enter ed in cy lindr i cal coor dinates w ill be sho wn in its cy lindr ical (or polar ) coor dinate fo rm (r , θ ,z) . T o see this in acti on, c hange the coor dinate s y stem to C YLINdr ical and w atch ho w the vect or display ed in the last s cr een changes to its c yl indri cal (polar ) coor dinate fo rm . T he second component is sho w n w ith the angle c harac ter in f r ont to emphasi z e its angular natur e . T he conv ersi on fr om Cartesian t o cy lindr ical coor dinates is suc h that r = (x 2 y 2 ) 1/2 , θ = tan -1 (y/x) , and z = z . F or the case sho wn abo ve the tr ansfor mation w as suc h that (x,y ,z) = ( 3 .204 , 2 .112 , 2 . 300), pr oduced (r , θ ,z) = (3 . 5 3 6 ,2 5 o ,3. 5 36 ) . At this po int , change the angular mea sur e to Radi ans. If w e now ent er a vec tor of integer s in Cartesian f orm , ev en if the CYLINdr i cal coordinate s yste m is acti v e , it w ill be sho wn in Carte sian coor dinate s, e .g ., T his is because the int eger numbers ar e intended f or us e with the CA S and , ther ef or e , the components o f this vec tor ar e k ept in Cartesian f orm . T o fo r ce the con ve rsi on to pola r coor dinates enter the vec tor components as r e al n umbers (i .e ., add a dec imal point) , e .g., [2 ., 3 ., 5 .]. W ith the cy lindri cal coor dinate s y ste m selected , if we en ter a v ector in s pher ical coor dinates it w ill be automati cally tr ansf ormed to its c ylindr ical (polar )
Pa g e 9 - 1 5 equi vale nt (r , θ ,z) with r = ρ si n φ , θ = θ , z = ρ cos φ . F or e xample , the follo wi ng f igur e sho ws the v ector ent er ed in spher ical coor d i nates, and tr ansf ormed to polar coor dinates . F or this case , ρ = 5, θ = 2 5 o , and φ = 4 5 o , w hile the tr ansfor mation sho ws tha t r = 3 .5 6 3, and z = 3 .5 3 6. (Change to DE G) : Ne xt , let’s change the coor dinate s y stem to spher i cal coordinate s by using func tion SP HERE fr om the VE CT OR sub-menu in the MTH men u . When this coor dinate sy stem is selected , the displa y w ill sho w the R ∠∠ f ormat in the top line . T he last s cr een wil l change to sh o w the fo llo w ing: Notice that the v ect ors that w er e wr it t en in cy lindr ical polar coor dinate s hav e no w been c hanged to the spher ical coor dinate s y ste m. T he tr ansf ormati on is suc h that ρ = (r 2 z 2 ) 1/2 , θ = θ , and φ = t an -1 ( r/ z ) . Howeve r , t h e ve ct or t h at or iginall y was s et to Cartesian coor dinates r emains in that for m. Application of v ec tor oper ations T his sectio n contains some e xample s of v ector oper ations that y ou ma y encounter in Ph y sic s or Mechani cs appli cations . Resu ltan t of forces Suppo se that a partic le is subj ect to the f ollo w ing f or ces (in N): F 1 = 3 i 5 j 2 k , F 2 = - 2 i 3 j -5 k , and F 3 = 2 i -3k . T o determine the r esultant , i .e ., the sum, of all thes e for ces , yo u can use the f ollo w ing appr oach in AL G mode: T hus , the re sultant is R = F 1 F 2 F 3 = (3 i 8j -6k )N. RPN mode use: [3,5,2] ` [ -2,3,-5] ` [2,0,3] ` Angle bet w een vectors The angle betw een t w o v ector s A , B , can be found as θ =co s -1 ( A • B /| A || B |)
Pa g e 9 - 1 6 Suppos e that yo u want t o find the angle between v e c tors A = 3 i -5j 6k , B = 2 i j -3 k , y ou could tr y the f ollo w ing oper ation (angular mea sur e set to degr ees) in AL G mode: 1 - Enter vec tors [3,-5, 6], pr ess ` , [2 ,1,-3], pre ss ` . 2 - DO T(ANS(1),ANS(2)) calc ulates the dot pr oduc t 3 - ABS( ANS( 3))*ABS(( ANS( 2)) calc ulates pr oduct of magnitudes 4 - ANS( 2)/ANS(1) calc ulates cos( θ ) 5 - A CO S(ANS(1)), foll o wed b y ,  NUM( ANS(1)), calc ulates θ T he steps ar e sho w n in the follo w ing sc r eens ( AL G mode , of co urse): !!! T hus, the r esult is θ = 12 2 .8 91 o . In RPN mode use the follo wing: [3,-5,6] ` [2,1,-3] ` DOT [3,-5,6] ` BS [2,1,-3] ` BS * / COS  NUM Mom ent o f a for ce T he moment e x erted b y a f or ce F about a point O is def ined a s the cr os s- pr oduct M = r ×F , w her e r , also kno wn a s the arm of the f or ce , is the po sition v ector bas ed at O and pointing to w ar ds the point of appli cation o f the for ce. Suppo se that a f or ce F = (2 i 5 j -6 k ) N ha s an arm r = (3 i -5j 4k )m . T o deter mine the moment e xe rted by the f or ce w ith that arm , w e use f unction CR OS S as sho w n next:
Pa g e 9 - 1 7 Thu s, M = (10 i 2 6 j 2 5 k ) m ⋅ N. W e know that the magnitude of M is su ch that | M | = | r || F |sin( θ ) , w her e θ is the angle bet w een r and F . W e can f ind this angle as , θ = sin -1 (| M | /| r || F |) b y the follo w ing oper ations: 1 – AB S(AN S(1))/(AB S( ANS( 2))*ABS( ANS( 3)) calc ulates sin( θ ) 2 – A SIN( ANS(1) ) , f ollo w ed by  NUM( ANS(1)) calc ulates θ T hese oper ations ar e sho wn , in AL G mode , in the fo llo w ing scr eens: T hus the angle between v ect ors r and F is θ = 41. 0 38 o . RPN mode , w e can use: [3 ,-5,4] ` [2,5, -6] ` CROSS BS [3,-5, 4] ` BS [2,5,- 6] ` BS * / SIN  NUM Equation of a plane in space Gi v en a point in space P 0 (x 0 ,y 0 ,z 0 ) and a ve ctor N = N x i N y j N z k normal to a plane containing po int P 0 , the pr oblem is to find the equati on of the plane . W e can for m a vec tor starting at poin t P 0 and ending at point P(x ,y ,z) , a gener i c point in the plan e. Th us , this v ecto r r = P 0 P = (x - x 0 ) i (y-y 0 ) j (z - z 0 ) k, is perpendi c ular to the normal v ector N , since r is contained entir el y in the plane . W e learned that f or tw o nor mal v ector s N and r , N • r =0. Thu s, w e can use this r esult to determine the equati on of the plane . T o illustr ate the us e of this appr oac h, consi der the point P 0 (2 , 3,-1) and the normal vector N = 4 i 6j 2 k , w e can enter v ect or N and point P 0 as two ve ctor s, as sho wn belo w . W e also enter the v ector [x ,y ,z] last:
Pa g e 9 - 1 8 Ne xt , we calc ulate v ector P 0 P = r as ANS(1) – AN S(2), i .e ., F inally , w e tak e the dot pr oduct o f ANS(1) and ANS( 4) and mak e it equal t o z er o to complete the oper ation N •r =0 : W e can no w use f uncti on EXP AND (in the AL G men u) to e xpand this ex p ress io n : T hus , the equation of the plane thr ough point P 0 (2 , 3,-1) and hav ing nor mal vec tor N = 4 i 6 j 2 k , is 4x 6y 2z – 2 4 = 0. In RPN mode , use: [2,3,-1] ` [ 'x','y','z'] ` - [4,6,2] DOT EXP ND Ro w vectors, column v ec tors, and lists The v ectors pr esented in this c hapter ar e all r ow v ectors. In some instanc es , it is necessar y to c reate a column vec tor (e .g., to use the pr e -d e fined statisti cal func tions in the calc ulator ) . T he simplest w ay t o enter a column v ector is by enc losing each v e c tor eleme nt within br ac k ets, all contained w ithin an ext ernal set o f brac k ets . F or e xample , enter : [[1.2],[ 2.5],[3.2],[ 4.5],[6.2]] ` This is repr esente d as the follow in g colum n v ector:
Pa g e 9 - 1 9 In this secti on w e w ill show ing yo u wa y s to transf or m: a column vec tor into a r o w vec tor , a r ow v ect or into a column v ector , a list into a v ect or , and a v ec tor (or matr i x) into a list . W e f irst demons tr ate thes e transf ormations u sing the RPN mode. In this mode , w e w ill use f uncti ons OB J  ,  LIS T ,  ARR Y and DR OP to pe rfo rm the tr ansfor mation . T o fac ilitate accessing the se func tions w e w ill set s yst em flag 117 to S OFT menus (see C hapter 1) . With this f lag set , functi ons OB J  ,  ARR Y , and  LIS T will be acce ssible b y using „° @) TY PE! . F unctions OB J  ,  ARR Y , and  LIS T w ill be av ailable in s oft menu k ey s A , B , and C . F unction DR OP is a v ailable by using „° @) STACK @DROP . F ollow ing we intr oduce the oper ation o f functi ons OB J  ,  LI S T ,  ARR Y , and DROP w ith some e x amples. Function OBJ  T his functi on decomposes an ob ject into its com ponents. If the ar gument is a list , functi on OB J  will lis t the list elements in the stac k , w ith the number of elements in st ack le ve l 1, fo r ex ample: {1 ,2,3} `„ ° @) TYPE! @OBJ @ re su l t s in : When function OB J  is a pplied to a v ector , it w ill list the eleme nts of the v ect or in the sta c k, w it h the number of elem ents in le vel 1 : enclosed i n braces ( a list) . T he follo w ing ex ampl e illustr ates this applicati on: [1,2,3 ] ` „° @) TYPE! @OBJ  @ r esults in:
Pa g e 9 - 2 0 If w e no w appl y func tion OB J  once mor e, the lis t in stac k le v el 1:, {3 .}, w ill be decomposed as follo ws: Function  LIS T T his functi on is used to c r eate a list gi ven the eleme nts of the list and the list length or si z e. In RPN mode , the list si z e, s a y , n, should be placed in stac k le vel 1:. T he elements of the list should be locate d in stac k lev els 2 :, 3:, …, n 1:. F or ex ample , to cr eate the list {1, 2 , 3}, t y pe: 1` 2` 3` 3` „° @) TYPE! !  LIST@ . Func tion  ARR Y Th is fun cti on is u sed to crea te a ve cto r or a m at ri x. In th is se ctio n, we wi ll use it to build a v ecto r or a column vec tor (i .e ., a matr ix o f n r o w s and 1 column) . T o build a regular v ecto r we enter the elements of the v ector in the s tack , and in stac k le ve l 1: we e nter the v ector si z e as a list , e .g., 1` 2` 3` „ä 3` „° @) TYPE! !  ARRY @ . T o build a column vec tor of n elements , enter the elements of the v e c tor in the stac k , and in stac k le ve l 1 enter the list {n 1}. F or ex ample, 1` 2` 3` „ä 1‚í3` „° @) TYPE! !  ARRY@ . Function DROP T his functi on has the same effec t as the delete k e y ( ƒ ). T ransf orming a r ow v ector into a column vector W e illustr ate the tr ansfor mation w ith v ector [1,2,3] . Enter this v ector into the RPN stac k to f ollo w the e x er c ise . T o transf orm a r ow v ect or into a column v ector , we need to car r y on the f ollo wi ng oper ations in the RPN stac k: 1 - Decompos e the vec tor w ith func tion OB J  2 - Pr ess 1 to tr ansfor m the list in stac k le v el 1: fr om {3} to {3,1}
Pa g e 9 - 2 1 3 - Use f uncti on  ARR Y to build the column vec tor T hese thr ee steps can be put t ogether into a U serRP L pr ogr am, e nter ed as fo llo ws (in RPN mode , still) : ‚å„° @) TYPE! @ OBJ  @ 1 ! ARR Y@ `³~~rxc` K A ne w v ar iabl e , @@RXC@@ , will be av ailable in the soft menu labels after pr es sing J : Press ‚ @@RXC@@ to see the pr ogr am con tained in the var ia ble RX C: << OBJ  1  RRY > > Th is va r i ab le, @@RXC@@ , can no w be used to dir ectly tr ansfor m a r o w v ector to a column v ect or . In RPN mode , ente r the r o w v ector , and then pr ess @@RXC@ @ . T r y , fo r ex ample: [1 ,2,3] ` @@R XC@@ . After hav ing def ined this v ar iable , w e can us e it in AL G mode to transf orm a r o w vec tor into a column v ector . T hus , change y our calculator ’s mode to AL G and try the follo w ing procedur e: [1,2,3] ` J @@RX C@@ „ Ü „ î , r esulting in: T ransf orming a column vector into a r o w vector T o illustr ate this transf or mation , w e ’ll enter the column v ector [[1],[2], [3]] in RPN mode . Then , follo w the ne xt ex er cis e to transf orm a r o w v ector int o a column vect or : 1 - Use f uncti on OB J  to decompose the column v ector
Pa g e 9 - 2 2 2 - Use f uncti on OB J  to d ecompose the l ist in stac k le vel 1: 3 - Pr ess the de lete k e y ƒ (also kno wn as f uncti on DROP) to eliminat e the number in st ack lev el 1: 4 - Use f uncti on  LIS T to cr eate a list 5 - Use f uncti on  ARR Y to cr eate the r o w v ecto r T hese f i v e steps can be put t ogether into a Use rRPL pr ogram , ente re d as follo ws (in RPN mode , still): ‚å„° @) TYPE! @O BJ  @ @OBJ @ „° @) STACK @DROP „° @) TYPE! !  LIST@ ! ARRY@ ` ³~~cxr ` K A ne w v ar iabl e , @@CXR@@ , will be av ailable in the soft menu labels after pr es sing J : Press ‚ @@CXR@@ to see the pr ogr am con tained in the var ia ble CXR: << OBJ  OB J  DROP  RRY >>
Pa g e 9 - 23 Th is variab le, @@CXR@@ , can no w be used t o dir ectl y transf or m a column vec tor to a r o w vec tor . In RPN mode , enter the column v ector , and then pre ss @@CXR@ @ . T ry , fo r ex ample: [[1] ,[2],[3]] ` @@CXR @@ . After hav ing def ined v ar iabl e @@CXR@@ , w e can use it in AL G mode to transf or m a r o w vec tor into a column v ector . T hus , change y our calculator ’s mode to AL G and try the fo llow ing pr ocedur e: [[1],[2] ,[3]] ` J @@CXR@@ „Ü „î re su l t i ng i n : T ransf orming a list into a vector T o illustr ate this transf or mation , w e ’ll enter the list {1,2,3} in RPN mode. Then , follo w the ne xt e x er c ise to tr ansfor m a list into a vec tor : 1 - Use f uncti on OB J  to decompose the column v ector 2 - T ype a 1 and us e functi on  LIS T to cr eate a list in st ack le vel 1: 3 - Use f uncti on  ARR Y to cr eate the vector T hese thr ee steps can be put t ogether into a U serRP L pr ogr am, e nter ed as fo llo w s (in RPN mode) : ‚å„° @) TYPE! @OBJ  @ 1 ! LIST@ !  ARRY@ ` ³~~lxv ` K
Pa g e 9 - 24 A ne w v ar iabl e , @@LXV@@ , will be av ailable in the soft menu labels after pr es sing J : Press ‚ @@LXV@@ to see the pr ogr am con tained in the var ia ble LXV : << OBJ  1  LIST  RRY >> Th is va r i ab le, @@LXV@@ , can no w be used to dir ectly tr ansfor m a list into a v ector . In RPN mode , enter the list , and then pr ess @@LXV @@ . T r y , for ex ample: {1,2, 3} ` @@LXV@@ . After hav ing def ined v ar iabl e @@LXV@@ , w e can use it in AL G mode to transf or m a list int o a vec tor . Th us , change y our calculator ’s mode to AL G and try the fo llo w ing pr ocedur e: {1,2,3} ` J @ @LXV@@ „Ü „î , re sulting in: T ransf orming a vector (or matri x) into a list T o tr ansf orm a v ector into a list , the calc ulator pr o v ides f uncti on AXL. Y ou can f ind this functi on thr ough the command catalog, as f ollo w s: ‚N~~axl~ @@OK@ @ As an e x ample , appl y func tion AXL t o the vec tor [1,2,3] in RPN mode b y using : [1 ,2,3] ` XL . The f ollo win g scr een shot sho ws the appli cation o f func tion AXL t o the same v ector in AL G mode .
Pa g e 1 0 - 1 Chapter 10 ! Cr eating and manipulating matrices T his chapte r show s a number of e xamples aimed at c reating matr ices in the calc ulator and demons tr ating manipulation of matr i x elements . Definitions A matr i x is simpl y a re ctangular arr ay of ob jec ts (e.g ., numbers , algebr aics) hav ing a n umber of r o w s and columns. A matr i x A hav ing n r o w s and m columns w ill ha v e , ther ef or e , n × m elements . A gener ic element o f the matri x is r epr esented b y the inde x ed var ia ble a ij , corr esponding to r ow i and co lumn j. W ith this not ation w e can w rite matr i x A as A = [a ij ] n ×m . T he full matri x is sho w n ne xt: A matr i x is squar e if m = n. The tr anspose of a matr i x is construc ted b y s wa pping r o ws for columns and v ice v ers a. T hu s, the tr anspo se of matr i x A , is A T = [(a T ) ij ] m × n = [a ji ] m ×n . T he main diagonal of a s quar e matri x is the collecti on of elements a ii . An identity matri x , I n ×n , is a squar e matr i x who se main diagonal e lements ar e all equal to 1, and all off-diago nal elements ar e z er o. F or e xample , a 3 × 3 identity matri x is wr itten as An i dentit y matri x can be wr itten as I n ×n = [ δ ij ], whe re δ ij is a f unctio n kno wn as Kr o ne ck er’ s d el ta , and def ined as . . ] [ 2 1 2 22 21 1 12 11 ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = = × nm n n m m m n ij a a a a a a a a a a L O M M L L A ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = 1 0 0 0 1 0 0 0 1 I ⎩ ⎨ ⎧ ≠ = = j i if j i if ij , 0 , 1 δ
Pa g e 1 0 - 2 Entering matr ices in the stac k In this secti on w e pr esent tw o diffe r ent methods to enter matr ices in the calc ulator st ack: (1) using the Matr i x W rit er , and (2) typ ing the matri x dir ectl y i nto th e sta ck. Using the M atr ix W riter As w i th the case of vectors, discussed in Ch apter 9 , ma tr ices c an be en ter ed into the st ack b y using the Matr ix W rit er . F or e xample , to enter the matr i x : f irst , start the matr i x wr iter by using „² . Mak e sur e that the optio n @GO →  is se lected . T hen u se the f ollo w ing k e y str ok es: 2.5\` 4.2` 2`˜ššš .3` 1.9` 2.8 ` 2` .1\` .5` At this point , the Matri x W r iter sc r een may loo k like this: Press ` once more t o place the matri x on the s tack . The AL G mode s tac k is sho w n ne xt , bef or e and afte r pr essing ` , once mor e: , 5 . 0 1 . 0 2 8 . 2 9 . 1 3 . 0 0 . 2 2 . 4 5 . 2 ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − −
Pa g e 1 0 - 3 If y ou ha ve s elected the t extbook displa y option (using H @) DISP! and chec king off  Textbook ) , the matri x will loo k lik e the one sho w n abo ve . O the r w ise , the displa y w ill sho w: T he displa y in RPN mode w ill look very similar to these . T yping in the matri x directly into the stac k T he same r esult as a bov e can be ac hie v ed by ent er ing the fo llo w ing direc tly into the st ack: „Ô „Ô 2.5\ ‚í 4.2 ‚í 2 ™ ‚í „Ô .3 ‚í 1.9 ‚í 2.8 ™ ‚í „Ô 2 ‚í .1\ ‚í .5 T hus , to ent er a matr i x dir ectl y into the s tack open a set of br ack ets ( „Ô ) and encl ose eac h r o w of the matr ix w ith an a dditi onal set o f brac k ets ( „Ô ). C o mm as ( ‚í . ) should separ ate the elements of each r o w , as w ell as the br ack ets betw een r o w s. ( Note : In RPN mode , you can omit the inner br ack ets after the fir st set has been en ter ed , thus , instead of ty ping , fo r e xample , [[1 2 3] [4 5 6] [7 8 9]], t y pe [[1 2 3 ] 4 5 6 7 8 9 ].) F or futur e e x er c ises , let’s s av e this matri x under the name A. In AL G mode use K~a . In RPN mode , us e ³~a K . Cr eating matrices w ith calc ulator functions Some matr ices can be c reate d by u sing the calculat or functi ons av ailable in either the MTH/MA TRIX/MAKE su b-menu w ithin the MTH menu ( „´ ), Not e : Details on the use o f the ma tr ix w r iter w er e pr esent ed in C hapter 9 .
Pa g e 1 0 - 4 or in the MA TRICE S/CREA TE menu a v ailable thr ough „Ø : T he MTH/M A TRIX/MAKE sub menu (let’s call it the MAKE menu) contains the fo llo w ing fu ncti ons: w hile the MA TRICE S/CREA TE sub-menu (let’s call it the CREA TE menu) has the fo llo w ing fu ncti ons:
Pa g e 1 0 - 5 As y ou can see f r om e xploring the se menu s (MAKE and CREA TE) , the y both hav e the same f uncti ons GET , GET I, P UT , P U T I , SUB , REP L , RDM, R ANM, HILBERT , V ANDERMONDE , IDN, CON , → DIA G , an d DIA G → . T he CREA TE menu inc ludes the C OL UM N and RO W sub-menu s, that ar e also a vaila ble under the MTH/MA TRI X menu . T he MAKE men u includes the f uncti ons SI ZE , that the CREA TE menu does not inc lude. Basi call y , how ev er , both menus , MAKE and CREA TE , pr o v ide the user w ith the same set of f unctio ns. In the e x amples that fo llo w , we w ill show ho w to acces s func tions thr ough us e of the matr i x MAKE menu . At the end of this s ectio n we pr esent a table w ith the k e y str ok es r equir ed to obtain the same functi ons w ith the CREA TE menu whe n s ystem fla g 117 is set to S O FT menus. If y ou hav e set that s y stem f lag (flag 117) to SOF T menu , the MAKE menu w ill be av ailable thr ough the k ey str ok e sequence: „´ !) MATRX ! ) MAKE! T he functi ons av ailable w ill be show n as so ft -men u ke y labels as f ollo ws (pr ess L to mo v e to the ne xt se t of f uncti ons): W ith sy st em flag 117 set to S OFT menus, the f uncti ons of the CREA TE menu , tr igger ed b y „Ø ) @CREAT ,w ill sho w as f ollo ws: In the ne xt secti ons w e pr esent appli catio ns of the matr i x functi ons in the MAKE and CREA TE menu .
Pa g e 1 0 - 6 Functions GET and P UT F uncti ons GET , GE TI , P UT , and P UT I, oper ate w ith matri ces in a similar manner as w ith lists or v ectors , i .e ., y ou need to pr o vi de the location o f the element that y ou want to GE T or PUT . Ho we ver , w hile in lists and v ector s only one inde x is r equired to identify an element , in matr ices w e need a lis t of t w o indi ces {r ow , column} to identify matri x elemen ts. Ex amples of the use of GE T and PUT f ollo w . Let ’s use the matr i x we s tor ed abo ve int o var ia ble A to demonstr ate the use o f the GET and P UT func tions . F or ex ample , to e xtract element a 23 fr om matri x A, in AL G mode , can be perf ormed as f ollo w s: Notice that w e ac hie v e the same re sult b y simply typ ing (2,3 ) and pr essing ` . In RPN mode , this ex er c ise is perf or med by en ter ing @@@A@@@ ` 3 ` GET , or by u sing (2,3) ` . Suppo se that w e w ant to place the v alue ‘ π ’ into element a 31 of the matr i x . W e can use f uncti on P UT for that pur pose , e .g., In RPN mode y ou can use: J @@@A@@@ {3,1} `„ ì PUT . Alte rnati v el y , in RPN mode y ou can us e: „ì³ (2,3) `K . T o see the contents of var iable A after this oper ation , us e @@@A@@@ . Functions GET I and PUT I F uncti ons P UTI and GE TI ar e used in Us erRPL pr ogr ams since the y k eep tr ack o f an index f or repeated a pplication o f the PUT and GE T func tions . The inde x list in matr ices v ar ies by columns f irs t . T o illustr ate its use , w e pr opose the fo llo w ing e xer c ise in RPN mode: @@@A@@@ {2 ,2} ` GE TI . Scr een shots sho wing the RPN stac k bef or e and after the applicati on of func tion GE TI ar e show n belo w :
Pa g e 1 0 - 7 Notice that the s cr een is prepar ed fo r a subseq uent appli cation o f GET I or GE T , b y incr easing the column index o f the ori ginal re fer ence b y 1, (i .e., f r om {2 ,2} to {2 , 3}) , w hile sho w ing the ex trac ted v alue , namel y A(2 ,2) = 1.9 , in stac k le vel 1. No w , suppose that y ou w ant to inser t the v alue 2 in element {3 1} using PUT I. Still in RPN mode , tr y the f ollo w ing k e y str ok es: ƒ ƒ {3 1} ` 2 ` PUTI . The s cr een shots b e lo w show the RPN stac k b e fo r e and afte r the ap pl ica tio n o f fu nct ion PUTI : In this case , the 2 wa s r eplaced in positi on {3 1}, i .e ., no w A(3,1) = 2 , and the inde x list w as incr eased by 1 (b y c olumn f irs t) , i .e., f r om {3,1} to {3,2}. T he matr i x is in l ev el 2 , and the incr emented inde x list is in le v el 1. Function SIZE F uncti on S IZE pr ov ides a list sho wing the n umber of r o ws and columns o f the matr i x in stac k le ve l 1. The f ollo w ing sc r een sho ws a cou ple of appli cations o f func tion S I ZE in AL G mode: In RPN mode , thes e e xer c ises ar e perfor med by u sing @@@A@@@ SIZE , and [[1,2],[3, 4]] ` SIZE . Function TRN F uncti on TRN is used to pr oduce the tr ansconjugat e of a matri x, i .e., the tr anspos e (TR AN) f ollo w ed by its comple x conj ugate (CONJ). F or e xample , the fo llo w ing sc r een shot sho w s the ori ginal matr i x in var ia ble A and its trans pose , sho w n in small fon t display (s ee Chapte r 1) :
Pa g e 1 0 - 8 If the ar gument is a r eal matri x, TRN simpl y pr oduces the tr anspos e of the r eal matr i x. T r y , f or e xample , TRN(A ) , and compar e it w ith TRAN(A ) . In RPN mode , the tr ansconjugat e of matri x A is calc ula t ed by using @@@A@@@ TRN . Function CON T he functi on tak es as ar gument a list of tw o elements, cor r esponding to the number of r o w and columns o f the matr i x to be gene rat ed, and a constant value . Func tion CON gener ates a matri x with const ant elements . F or ex ample , in AL G mode , the f ollo w ing command c r eates a 4 × 3 matri x whose el ements a r e all equal to –1. 5: Not e : The calc ulator also include s F uncti on TR AN in the MA TRICE S/ OPERA TIONS sub-men u: F or ex ample , in AL G mode:
Pa g e 1 0 - 9 In RPN mode this is accomplished b y using {4 ,3} ` 1.5 \ ` CON . Function IDN F uncti on ID N (IDeNtity matri x) cr eates an identity matri x giv en its si z e. R ecall that an identity matr i x has to be a squar e matri x , ther ef or e , only one v alue is r equir ed to des cr i be it completel y . F or ex ample, t o cr eate a 4 × 4 identity matr i x in AL G mode us e: Y ou can also us e an ex isting squar e matri x as the argument o f func tion IDN, e .g., T he r esulting identity matr i x will hav e the same dimensions a s the ar gument matr i x. Be a w are that an atte mpt to use a r e c tangular (i .e ., non-squar e) matr i x as the ar gument of IDN w ill produce an er r or . In RPN mode , the two e x er ci ses sho wn abo ve ar e c r eated b y using: 4` IDN and @@@A@@@ IDN . Function RDM F uncti on RDM (Re -DiMensi oning) is used to r e -wr i t e vec tors and matr ice s as matr ices and v ect ors . The input t o the func tion consists o f the or iginal v ector o r matr i x follo w ed by a lis t of a single number , if conv er ting to a v ector , or t w o numbers , if con verting to a matr i x . In the f ormer cas e the number r epre sents the
Pa g e 1 0 - 1 0 v ector ’s dimensi on, in the latte r the number of r o ws and columns of the matr ix . T he follo wing e x amples illus tr ate the use o f functi on RDM: Re -dimensioning a vector into a matr ix T he follo w ing ex ample sho ws ho w to r e -dimension a v e c tor of 6 ele ments into a matr i x of 2 r o w s and 3 columns in AL G mode: In RPN mode , we can us e [1,2,3,4,5 ,6] ` {2,3} ` RD M to pr oduce the matr i x sho w n abov e . Re-dim ensioning a matr ix into another matri x In AL G mode , w e no w use the matr ix c r eated abo ve and r e -dimensi on it into a matr i x of 3 r o w s and 2 columns: In RPN mode, w e simply use {3,2} ` RDM . Re-dim ensioning a matr ix in to a vector T o r e -dimension a matr i x into a v ector , we us e as ar guments the matri x follo wed b y a list containing the number o f elements in the matr i x. F or ex ample, t o con v ert the matri x fr om the pr e v iou s ex ample int o a vec tor of length 6 , in AL G mode , us e:
Pa g e 1 0 - 1 1 If using RPN mode , we a ssume that the matr i x is in the stac k and us e {6} ` RDM . Function R ANM F uncti on RANM (RANdom Matr i x) w ill gener ate a matr i x w ith r andom integer elements gi ven a list w ith the number of r ow s and columns (i .e ., the dimensions of the matr i x) . F or e xample , in AL G mode , t w o diff er ent 2 × 3 matr ices w ith r andom elements ar e pr oduced b y using the same command , namel y , R NM({2,3}) : In RPN mode, use {2 , 3} ` RN M . Ob v iou sly , the r esults y ou w ill get in y our calculat or w ill most certainl y be diffe r ent than those sho w n abo ve . The r andom number s gener ated ar e integer number s unif orml y di str ibuted in the r ange [-10,10], i .e ., each one o f thos e 21 number s has the same pr obab ilit y o f being s elected . F unction RANM is usef ul fo r generating matr i ces of an y si z e to illustr ate matri x oper ations , or the appli cation of matr i x func tio ns. Function SUB F uncti on S UB extr acts a sub-matr i x fr om an ex isting matri x, pr o v ided y ou indicat e the initial and final po sition o f the sub-matr i x. F or e x ample , if we w ant to e xtrac t elements a 12 , a 13 , a 22 , and a 23 fr om the last r esult , as a 2 × 2 sub- matr i x, in AL G mode , use: Not e : F uncti on RDM pr o vi des a mor e dir ect and ef fi c ient w a y to tr ansfor m lists to ar r ay s and v ice v ersa , than that pr o vi ded at the end o f Chapt er 9 .
Pa g e 1 0 - 1 2 In RPN mode , assuming that the or iginal 2 × 3 matr i x is alread y in the stac k, u se {1,2} ` {2,3 } ` SUB . Function REP L F uncti on REPL r e place s or inserts a sub-matr i x into a lar ger one . The input f or this func tio n is the matri x wh ere the r eplacement w ill tak e place, the location w here the r e placeme nt begins, and the matr i x to be inser t ed. F or e x ample , k eeping the matr i x that w e inher ited fr om the pr ev i ous e x ample , enter the matr i x: [[ 1,2,3],[4,5, 6],[7,8,9]] . In AL G mode , the fo llo w ing sc r een shot to the left sho ws the ne w matri x bef or e pr essing ` . The scr een shot to the r ight sho w s the application o f functi on RPL t o replace the matr i x in NS(2) , the 2 × 2 matr i x, in to the 3 × 3 matr ix c urr entl y located in NS(1) , starting at positi on {2,2} : If w ork ing in the RPN mode, as suming that the 2 × 2 matri x was or ig inally in the stac k , w e pr oceed as f ollo w s: [[1,2,3],[ 4,5,6],[7,8, 9]] `™ (this last k ey s w aps the contents o f stac k lev els 1 and 2) {1,2} `™ (a nother s wapping of lev el s 1 and 2) REPL . Function → DIA G Fu n c ti o n → D IA G tak es the main diagonal of a sq uar e matri x of dimensi ons n × n, and cr ea t es a v ector of dimensi on n containing the elements o f the main diagonal . F or e x ample , for the matr i x r emaining fr om the pr e vi ous e x er c ise , w e can e xtr act its main diagonal b y using:
Pa g e 1 0 - 1 3 In RPN mode , wi th the 3 × 3 matri x in the stac k, w e simply hav e to acti v ate fu nct ion  DI G to obtain the same result as a b o ve . Function DIA G → Fu n c ti o n D I A G → tak es a vec tor and a lis t of matr i x dimensions {r o ws , columns}, and c r eates a diago nal matr ix w ith the main diagonal r eplaced w ith the pr oper v ector ele ments. F or e x ample , the command DI G  ([1,-1,2,3],{ 3,3}) pr oduces a diagonal matr ix w ith the f irst 3 elements o f the vec tor ar gument: In RPN mode , we can us e [1,-1,2,3] ` {3,3 } ` DI G  to obtain the same r esult as abo v e . Anothe r ex ample o f applicati on of the DIA G → func tion f ollo w s, in AL G mode: In RPN mode , use [1,2,3,4, 5] ` {3,2} ` DI G  . In this cas e a 3 × 2 matr i x was t o be c r eated using as main diagonal elements a s man y elements as possible f or m the vec tor [1,2 , 3 , 4,5]. T he main diagonal , for a r ectangular matri x, s tarts at po sition (1,1) and mo v es on to positi on (2 ,2) , (3, 3) , etc. until ei ther the number of r o w s or columns is e xhaus ted . In this ca se , the number of columns ( 2) w as ex hau sted bef or e the number of r o w s (3) , so the main diagonal inc luded onl y the elements in positi ons (1,1) and (2 ,2) . Th us , only the f irs t t w o elements of the vect or wer e requir ed to f orm the main diagonal . Function V ANDERMONDE F uncti on V AND ERM ONDE gene rat es the V andermonde matr ix o f dimension n based on a gi ven lis t of input dat a. T he dimensio n n is, o f cours e , the length o f the list . If the input list consists o f obj ects {x 1 , x 2 ,… x n }, then , a V andermonde matr i x in the calculat or is a matri x made o f the follo wing e lements:
Pa g e 1 0 - 1 4 F or ex ample, the f ollo wing command in AL G mode for the list {1,2 , 3, 4}: In RPN mode, ente r {1,2,3,4} ` V NDERMONDE . Function HIL BER T F uncti on HI LBER T cr eates the Hilbert matri x cor re sponding to a dimensi on n. B y def inition , the n × n Hilbert matr i x is H n = [h jk ] n ×n , so that T he Hilbert matri x has applicati on in numer ical c urve f itting b y the method of linear squar es . A pr ogram to build a matr ix out o f a number of lists In this secti on w e pr o v ide a couple o f Use rRPL pr ogr ams to build a matr i x out o f a number of lis ts of obj ects . The lists ma y r epr esent columns of the matr i x (pr ogr am @CRMC ) or r ow s of the matr i x (pr ogr am @CRMR ). The pr ogr ams ar e enter ed w ith the calc ulator set to RPN mode , and the instr uctions f or the k ey str ok es a r e gi v en f or s ystem flag 117 set to S OFT menus. T his section is intended f or y ou to pr actice acces sing pr ogr amming functi ons in the calc ulator . T he pr ogr ams are lis ted belo w sho wing , in the left -hand si de , the k ey str ok es necessar y to ente r the pr ogr am steps , and, in the r ight-hand side , the c harac ters ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − − − − 1 2 1 3 2 3 3 1 2 2 2 2 1 1 2 1 1 1 1 1 1 n n n n n n n x x x x x x x x x x x x L M O M M M L L L 1 1 − = k j h jk
Pa g e 1 0 - 1 5 enter ed in the displa y as you perf or m those k ey str ok es . F irs t , we pr esent the steps ne cessar y to produce p r og r am C RMC. Lists r epr esent columns of the matri x Th e p r o gra m @CRMC allo w s yo u to put together a p × n matri x (i .e., p r o w s, n columns) out of n lists of p elements each . T o cr eate the progr am enter the fo llo w ing k ey str ok es: K ey str ok e sequence : Pr oduces: ‚ å « „° @) STACK! @@DUP@ DUP ‚ é # ~ „n  n ‚ å << 1„° @) STACK! @SWAP 1 S W AP „° @) BRCH! @) FOR@! @FOR@ FO R ~„j j „° @) TYPE OBJ  OB J   ARRY@  ARR Y „° @) BRCH! @) @IF@@ @@IF@@ IF ~ „j# j ~„ n n „° @) TEST! @@@<@@@ < „° @) BRCH! @) @IF@ @THEN THEN ~ „j #1 j 1 „° @) STACK! L @ROLL R OLL „° @) BRCH! @) @IF@ @END END „° @) BRCH! @) FOR@! @NEXT NEXT „° @) BRCH! @) @IF@ @@IF@@ IF ~„ n# 1 n 1 „° @) TEST! @@@>@@@ > „° @) BRCH! @@IF@ @THEN THEN 1# 1 ~ „n #1- n 1 - „° @) BRCH! @) FOR@! @FOR@ FOR ~ „j # j ~ „j #1 j 1 „° @) STACK! L @ROLL! R OLL „° @) BRCH! @) FOR@! @NEXT! NEXT „° @) BRCH! )@@IF@! @END@ END
Pa g e 1 0 - 1 6 ~„n # n „´ @) MATRX! @) COL! @COL!  COL  ` Pr ogr am is display ed in le v el 1 To s a v e t h e p r o g r a m : ! ³~~crmc~ K T o see the contents o f the pr ogram u se J ‚ @CRMC . T he pr ogr am listing is the f ollo w ing: « DUP → n « 1 SWAP FOR j OBJ →→ RRY IF j n < THEN j 1 ROLL END NEX T IF n 1 > THEN 1 n 1 - FOR j j 1 ROL L NEXT END n CO L → » » T o use this pr ogram , in RPN mode , enter the n lists in the orde r that you w ant them as columns of the matr i x , enter the v alue of n, and pre ss @CRMC . As an e xam ple , tr y the f ollo w ing e xer c ise: {1,2,3,4} ` {1,4,9,16} ` {1,8,27,64} ` 3 ` @CRMC T he follo w ing scr een shots sho w the RPN st ack bef ore and af t er running pr ogr am @CRMC : T o us e the progr am in AL G mode , pr es s @CRMC f ollow ed by a set of parentheses ( „Ü ) . W i thin the pare nth eses t y pe the lists of data r epr esenting the columns o f the matri x, se par ated b y commas, and f inall y , a comma, and the number of columns . T he co mmand should look lik e this: CRMC({1,2 ,3,4}, {1,4,9,16}, {1,8,27,64}, 3) T he AL G s cr een sho wing the e xec ution of pr ogram CRM C is sho wn be low : Not e : if yo u sav e this pr ogr am in y our HOME dir ectory it w ill be a vailable fr om any other sub-dir ectory you u se .
Pa g e 1 0 - 1 7 Lists r epr esent ro w s of the matrix T he pre vi ous pr ogram can be easil y modif ied to c r eate a matri x when the input lists w ill become the r o ws o f the r esulting matr i x. T he only ch ange to be perfor med is to c h ange COL → fo r ROW → in the pr ogram listing . T o per f or m this c hange use: ‚ @CRMC L ist pr ogram CRM C in stac k ˜‚˜—ššš Mov e to end of pr ogram ƒƒƒ Dele te C OL ~~row~` T y pe in R O W , enter pr ogram T o store the program use: ³~~crmr~ K {1,2,3,4} ` {1,4,9,16} ` {1,8,27,64} ` 3 ` @CRMR T he follo w ing scr een shots sho w the RPN st ack bef ore and after r unning pr ogr am @CRMR : T hese pr ogr ams can be use ful f or statisti cal applicati ons , spec if icall y to cr eate the statis tical matr i x Σ D A T . Ex amples of the u se of thes e pr ogram ar e sho wn in a latter c hapter s. M anipulating matr ices b y columns T he calculat or pr ov ides a menu w ith f unctio ns f or manipulating matri ces b y oper ating in their columns . This menu is a v ailable thr ough the MTH/MA TRIX/ COL.. se quence : ( „´ ) show n in the figur e belo w wi th sy stem flag 117 s et to CHOOSE bo x es: or thr ough the MA TRICE S/CREA TE/COL UMN sub-men u:
Pa g e 1 0 - 1 8 Both appr oa c hes w ill show the same func tions: When s y stem f lag 117 is set to S OFT menus , the COL menu is accessible thr ough „´ !) MATRX ) !)@@COL@ , or thr ough „Ø !) @CREAT@ !) @@COL@ . Both appr oache s w ill sho w the same s et of f uncti ons: The op er ation of these functions is presented b elo w . Function → COL Fu n c ti o n → C OL tak es a s ar gument a matri x and decompos es it into v ect ors cor re sponding to its columns . An appli cation of f uncti on  CO L in AL G m ode is sho wn belo w . The matr i x us ed has been stor ed earli er in var iable A. The matr i x is show n in the f igur e to the left . The f igur e to the ri ght sho ws the matr ix decomposed in columns . T o see the full r esult , use the line editor (tr igge r ed by pr essing ˜ ). In RPN mode , yo u need to list the matri x in the s tack , and the acti v ate func tion  COL, i .e., @@@ A@@@  COL . The f i gur e belo w sho w s the RPN stac k bef or e and after the applicati on of f unction  COL.
Pa g e 1 0 - 1 9 In this r esult , the fir st column occ upi es the highe st stac k lev el af t er decompositi on , and stac k lev el 1 is occu pi ed by the n umber of co lumns of the or iginal matr ix . T he matr i x does not surv i v e decompositi on, i .e ., it is no longe r av ailable in the s tack . Function COL → Fu n c ti o n CO L → has the opposite eff ect of F unction → COL , i .e ., giv en n vec tors of the sa me length, and the n umber n, functi on COL  builds a matr i x by plac ing the inpu t vec tors a s columns of the r esulting matri x. Her e is an ex ample in AL G mode . The command u sed w as: COL ([1,2 ,3],[4,5,6], [7,8,9],3) In RPN mode , place the n vec tors in stac k le vels n 1, n , n-1,…,2 , and the number n in stac k lev el 1. W ith this set up , func tion C OL  places the v ecto rs as columns in the r esulting matr ix . T he f ollo w ing f i gur e sho ws the RPN stac k bef or e and after using f uncti on CO L  . Function COL F uncti on COL tak es as ar gument a matri x , a v ector w ith the s ame length as the number o f r ow s in the matr i x, and an integer number n r epr es enting the location o f a column. F uncti on COL inserts the v ector in column n of the matr i x. F or e xample , in AL G mode , we ’ll insert the second column in matr i x A w ith the v ector [-1,- 2 ,-3], i .e .,
Pa g e 1 0 - 2 0 In RPN mode , enter the matr i x fir st , then the v ector , and the column number , bef or e appl y ing fu nction C OL . T he fi gur e belo w sho w s the RPN stac k bef or e and after appl y ing functi on COL . Function COL - F uncti on COL - tak es as ar gument a matr ix and an intege r number r epr esenting the positi on of a column in the matr i x. F uncti on r etur ns the or iginal matr ix min us a column, as we ll as the e xtrac ted column sho w n as a vec tor . Her e is an e x ample in the AL G mode using the matr i x stor ed in A: In RPN mode , place the matri x in the s tack f irst , then enter the number r epr esenting a column locati on bef or e appl y ing func tion C OL -. The f ollow ing f igur e sho ws the RPN s tack bef ore and after appl y ing f uncti on COL -. Function CS WP F uncti on CS WP (Column S W aP) tak es as ar guments two indi ces , sa y , i and j, (r epr esen ting two distinct columns in a matr i x) , and a matr ix , and produces a ne w matr ix w ith columns i and j s wapped . The f ollo wing e xample , in AL G mode , sho ws an appli cation o f this functi on . W e use the matr ix s tor ed in var iable A for the e xample . This matr i x is listed fir st .
Pa g e 1 0 - 2 1 In RPN mode , functi on CS WP lets y ou s wap the columns of a matri x list ed in stac k le vel 3, who se indi ces ar e listed in s tac k lev els 1 and 2 . F or e x ample , the fo llo w ing fi gur e sho ws the RPN st ack bef or e and after a pply ing functi on CS WP to matr i x A in or der to s wap columns 2 and 3: As y ou can see , the columns that or iginally occ up ied positi ons 2 and 3 hav e been s wapped . S wapping o f columns, and of r ow s (s ee belo w) , is commonl y used w hen sol ving sy stem s of lin ear e quations w ith mat r ices. De tails of these oper ations w ill be gi v en in a sub seque nt Chap ter . M anipulating matr ices b y r o ws T he calculat or pr ov ides a menu w ith f unctio ns f or manipulating matri ces b y oper ating in their r o ws . This menu is a v ailable thr ough the MTH/MA TRI X/ RO W .. sequence: ( „´ ) sho wn in the f igur e belo w w ith s ys tem flag 117 s et to CHOOSE bo x es: or thr ough the MA TRICE S/CREA TE/RO W sub-men u: Both appr oa c hes w ill show the same func tions:
Pa g e 1 0 - 22 When s y st em flag 117 is set to S OFT menus , the R O W menu is acces sible thr ough „´ !) MATRX !)@@ROW@ , or thr ough „Ø !) @CREAT@ !) @@ROW@ . Both appr oache s w ill sho w the same s et of f uncti ons: The op er ation of these functions is presented b elo w . Function → RO W Fu n c ti o n → R O W tak es as ar gument a matri x a nd decom pose s it into vec tor s cor re sponding to its r ow s . An appli cation of f uncti on  RO W in AL G mode is sho w n belo w . T he matr i x us ed has been sto r ed earli er in v ari able A. T he matr i x is show n in the f igur e to the left . The f igur e to the ri ght sho ws the matr ix decomposed in r ow s. T o see the full r e sult , us e the line editor (tri gger ed b y pr essing ˜ ). In RPN mode , yo u need to list the matri x in the s tack , and the acti v ate func tion  RO W , i.e., @@ @A@@@  RO W . T he fi gur e belo w sho ws the RPN s tac k bef or e and after the applicati on of f unction  RO W . In this r esult , the fir st r ow occ upi es the hi ghest st ack le ve l af t er decompositi on, and stac k lev el 1 is occ upi ed by the n umber of r o w s of the or iginal matr i x . The
Pa g e 1 0 - 2 3 matr i x does not survi ve decompo sition , i .e ., it is no longer a vailable in the stack. Function RO W → Fu n c ti o n ROW → has the opposit e effec t of the f uncti on → RO W , i .e ., gi v en n v ector s of the s ame length , and the number n , func tion R O W  builds a matri x b y plac ing the input v ectors as r o ws o f the r esulting matr i x. Here is an ex ample in AL G mode . The command u sed w as: ROW ([1,2 ,3],[4,5,6], [7,8,9],3) In RPN mode , place the n vec tors in stac k le vels n 1, n , n-1,…,2 , and the number n in stac k lev el 1. W ith this set up , f unction R O W  places the v ector s as r o w s in the r esulting matr i x. The follo wing f igur e sho ws the RPN s tack be fo r e and after using f unction R O W  . Function RO W F uncti on RO W take s as argume nt a matri x, a v ecto r w ith the s ame length as the number o f r ow s in the matr i x, and an integer number n r epr es enting the location o f a r o w . F unction R O W inserts the v ect or in r o w n of the matri x. F or e x ample , in AL G mode , w e’ll ins er t the s econd r ow in matr i x A w ith the ve ctor [- 1,- 2 ,-3], i .e ., In RPN mode , enter the matr i x fir st , then the vect or , and the r o w number , bef or e appl y ing func tion R O W . The f igur e be low sho ws the RPN stac k bef or e and after appl y ing func tion R O W .
Pa g e 1 0 - 24 Function RO W- F uncti on RO W - tak es as ar gument a matri x and an integer number r epr esenting the positi on of a r o w in the matri x . The f unctio n re turns the or iginal matr i x , minu s a ro w , as w ell as the e xtr acted r o w sho w n as a v ector . H er e is an e x ample in the AL G mode using the matr i x stor ed in A: In RPN mode , place the matri x in the s tack f irst , then enter the number r epr esenting a r ow locatio n befor e apply ing f unction R O W -. The f ollow ing f igur e sho ws the RPN s tack bef ore and after appl y ing f uncti on RO W-. Function RS WP F uncti on R S WP (R o w S W aP) tak es as ar guments two indi ces , say , i and j, (r epr esen ting t w o d i stinct r o ws in a matr i x) , and a matri x , and produces a ne w matr i x wit h r o ws i and j s wa pped. T he fo llo w ing e xample , in AL G mode , sho w s an applicati on of this func tion . W e use the matr i x stor ed in v ar iable A fo r the e xample . This matr i x is listed f irs t . In RPN mode , functi on R S WP lets y ou s w ap the r o w s of a matri x listed in st ack le vel 3, w ho se indices ar e listed in stac k le vels 1 and 2 . F or e xample , the fo llo w ing fi gur e sho ws the RPN stac k be for e and af t er appl y ing func tion R S WP to matr i x A in or der to s w ap r o w s 2 and 3:
Pa g e 1 0 - 2 5 As y ou can see , the r ow s that or iginally occ up ied po sitions 2 and 3 ha ve been s wa pped. Function RCI F uncti on R CI stands f or m ultiply ing R ow I by a C onst ant value and r eplace the r esulting r o w at the same location . The f ollo wing e xample , wr itten in AL G mode , tak es the matr ix s tor ed in A, and multiplie s the constant v alue 5 int o r o w number 3, r eplac ing the r ow w ith this pr oduct . T his same e xer c ise done in RPN mode is sho w n in the next f igur e . The left-hand side f igur e show s the setting u p of the matri x, the f actor and the r ow number , in stac k lev els 3, 2 , and 1. The r ight-hand side f igur e sho w s the re sulting matri x after func tion R CI is acti v ated. Function RCI J F uncti on RCIJ s tands for “t ake R ow I and mu ltiply ing it by a const ant C and then add that multiplied r ow t o ro w J, r eplacing r ow J w ith the r esulting sum . ” This type o f r o w oper ation is ve r y co mmon in the pr ocess o f Gau ssi an or Gau ss- Jor dan elimination (mor e details on this pr ocedur e are pr esented in a subs equent Chapt er). The ar guments of the f uncti on are: (1) the matr ix , (2 ) the constant value , (3) the r o w to be multip lied b y the constant in(2), and ( 4) the r o w to be r eplaced by the r esulting sum as desc r ibed abov e . F or ex ample , taking the matr i x stor ed in v ari able A, w e are go ing to multipl y column 3 times 1. 5, and add it to column 2 . The f ollo wing e xample is perf ormed in AL G mode:
Pa g e 1 0 - 26 In RPN mode , enter the matr i x fir st , fo llo w ed by the constant v alue , then b y the r o w to be multiplied b y the co nstant v alue , and f inally ente r the ro w that will be r eplaced. T he fo llo w ing fi gur e sho w s the RPN stac k befor e and af t er apply ing func tion R CIJ under the same conditi ons as in the AL G ex ample sho w n abo ve:
P age 11-1 Chapter 11 M atr ix Oper ations and Linear Algebra In Chapte r 10 we intr oduced the concept of a matri x and pr esen ted a number of f uncti ons f or enter ing, c r eating, o r manipulating matri ces . In this Chapt er w e pr esen t ex a m ples of matr i x oper ations and appli cations t o problems of linear algebr a. Operations w ith matrices Matri ces , lik e other mathematical obj ects , can be added and subtr acted . T he y can be multiplied b y a scalar , or among themsel v es. T he y can also be r aised to a r eal po we r . An important op e r ation f or linear algebra a pplicatio ns is the in ve rse of a matr i x . Details of thes e oper ations ar e pr es ented next . T o illustr ate the operati ons w e will c r eate a number of matr ices that we will st or e in v ar iables . The gener ic name o f the matr ices w ill be A ij and Bij , w her e i r epr esents the n umber of r o w s and j the number of columns of the matri ces . The matr ices t o be used ar e generat ed b y using f unction RANM (r andom matri ces). If y ou try this e xer cis e in y our calculat or you w ill get differ ent matr ic es than the ones listed her ein , unless y ou stor e them into y our calc ulator ex actly as sho wn belo w . Her e ar e the matri ces A2 2 , B2 2 , A2 3, B2 3, A3 2 , B3 2 , A3 3 and B3 3 c r eated in AL G mode: In RPN mode , the steps to f ollo w are: {2,2} ` RN M '2 2 ' K {2,2} ` R NM 'B22' K {2,3} ` RN M '2 3 ' K {2,3} ` R NM 'B23' K {3,2} ` RN M '3 2 ' K {3,2} ` R NM 'B32' K {3,3} ` RN M '3 3 ' K {3,3} ` R NM 'B33' K
P age 11-2 Addition and subtr ac tion Consi der a pair of matr ices A = [a ij ] m ×n and B = [b ij ] m ×n . Additi on and subtr action of the se tw o matri ces is onl y pos sible if they ha v e the same number of r ow s and columns . The r esulting matr i x , C = A ± B = [c ij ] m ×n has el ements c ij = a ij ± b ij . Some e xample s in AL G mode are sho wn be low u sing the matri ces stor e d abo v e (e.g . , @ A22@ @B22@ ) In RPN mode , the steps to f ollo w are: 22 ` B22 ` 22 ` B22 `- 23 ` B23 ` 23 ` B23 `- 32 ` B32 ` 32 ` B32 `- T r anslating the AL G e xample s to RPN is st rai ghtfo r w ar d , as illustr ated her e . T he r emaining e x amples of matr i x oper ations w ill be per f or med in AL G mode only . Multiplication T here ar e numer ous multiplicati on oper ations that in vol v e matr ices . The se ar e desc r ibed ne xt . Multiplication by a scalar Multiplicati on of the matr i x A = [a ij ] m ×n b y a scalar k r esults in the matri x C = k A = [c ij ] m ×n = [k a ij ] m ×n . In par ti c ular , the negati v e of a matri x is defi ned by the oper ation - A =(-1) A = [-a ij ] m × n . Some e xample s of multipli cation of a matr i x by a sc alar are sho wn belo w .
P age 11-3 B y combining addition and subtr acti on w ith multiplicati on b y a scalar w e can fo rm linear combinati ons of matr ices of the same dimensions , e .g., In a linear combinati on of matr i ces, w e can multipl y a matr i x by an imaginary number to obtain a matri x of comple x n umbers, e .g ., M atr ix -vector multipli cation Matr i x -vec tor mul tiplicati on is poss ible only if the number o f columns of the matr i x is equal to the length of the v ector . This oper atio n follo w s the rules of matr ix multiplicati on as sho w n in the next s ection . A couple of e xamples o f matr i x -vect or multipli cation f ollo w: V ector -matri x multiplication , on the other hand , is not def ined . This multiplicati on can be perf ormed , ho w ev er , as a spec ial cas e of matr i x multiplicati on as def ined next .
P age 11-4 Matrix multiplication Matri x multipli cation is def ined b y C m ×n = A m ×p ⋅ B p ×n , wher e A = [a ij ] m ×p , B = [b ij ] p ×n , and C = [c ij ] m ×n . Noti ce that matri x multiplicati on is onl y possible if the number of columns in the f ir st oper and is equal to the number o f r o ws of the second oper and . T he gener al ter m in the pr oduct , c ij , is def ined as T his is the same as say ing that the ele ment in the i- th r o w and j-th column of the pr oduct , C , r esults fr om multiply ing ter m-b y-term the i-th r o w of A w ith the j- th colum n of B , and adding the pr oducts together . Matr ix multipli cation is no t c o mm u t at iv e, i. e. , i n g en e ra l, A ⋅B ≠ B ⋅A . F urthermor e, one of the multiplicati ons may not e v en ex ist . T he follo wing sc r een shots sho w the r esults of m ultiplicati ons of the matr ice s that w e stor ed earlier : !!! T he matri x -vec tor multiplicati on intr oduced in the pr ev i ous sec tion can be thought of as the pr oduct of a matr i x m × n with a matr i x n × 1 (i .e ., a column v ecto r) r esulting in an m × 1 matri x (i.e ., a nother v e c tor ) . T o v erify this asser ti on c heck the e x amples pr esent ed in the pre v iou s secti on . Thu s, the v ector s def ined in Cha pter 9 ar e basi call y column v ector s fo r the pur pose o f matr i x multiplicati on. T he pr oduct of a vec tor w ith a matri x is possible if the v ect or is a ro w vec tor , i. e. , a 1 × m matri x, w h i c h multiplied w ith a matri x m × n pr oduce s a 1xn matri x . , , 2 , 1 ; , , 2 , 1 , 1 n j m i for b a c p k kj ik ij K K = = ⋅ = ∑ =
P age 11-5 (another r o w vect or). F or the calculator to identify a r o w vector , y ou must us e double br ack ets to enter it: T erm-b y-term multiplication T erm-b y- t erm multiplicati on of two matr ice s of the same dimensions is pos sible thr ough the us e of f unction HAD AMARD . T he r esult is, o f course , another matri x of the sa me dimensions . T his functi on is av ailable thr ough F uncti on catalog ( ‚N ) , or thr ough the MA TRICE S/OPERA TION S sub-menu ( „Ø ). Appli cations of f uncti on HAD AMARD are pr esented ne xt: Raising a matri x to a real po wer Y ou can r aise a matr ix t o any po wer a s long as the po w er is either an integer or a r eal number w ith no f r actional part . T he follo w ing e xample sho ws the r esult of r aising matri x B2 2 , cr eated earli er , to the po w er of 5: Y ou can also r aise a matri x to a pow er withou t fir st stor ing it as a v ari able:
P age 11-6 In algebr aic mode , the k e y str ok es ar e: [enter or se lect the matr i x] Q [e nter the po w er] ` . In RPN mode , the ke ys tr ok es ar e: [enter or se lect the matr i x] † [ent er the po we r] Q` . Matri ces can be r aised to negati ve po wer s. In this cas e , the r esult is equi valent to 1/[matr i x]^AB S(po we r). The identity matri x In Chapt er 9 we introdu ce the identity matri x as the matri x I = [ δ ij ] n ×n , whe re δ ij is the Kr oneck er’s delta f unction . Identity matr ices can be obtained b y using func tion IDN desc r ibed in C hapter 9 . T he identity matri x has the pr opert y that A ⋅I = I ⋅A = A . T o ver if y this pr oper ty w e pr esent the f ollow ing ex amples using the matr ices s tor ed earlier on: The inv erse matrix T he inv erse o f a squar e matr i x A is the matri x A -1 suc h that A ⋅A -1 = A -1 ⋅ A = I , wher e I is the i dentity matr i x of the same dimensi ons as A . T he in v er se of a matr i x is obtained in the calc ulator by using the in v ers e functi on , INV (i .e ., the Y k ey). An ex ample of the in v erse o f one of the matr ices st ored ear lier is pr esen ted next:
P age 11-7 T o v er if y the pr operties of the in v erse matr ix , consider the f ollo w ing multiplicati ons: Characteri zing a matr ix (T he matri x NORM menu) T he matri x NORM (NORMALIZE) menu is accessed thr ough the k e ys tr ok e sequen ce „´ (s ys tem f lag 117 set t o CHOOSE bo xes): T his menu cont ains the fo llo w ing func tio ns: The se func tions ar e desc r ibed next . Becau se many o f these func tions us e concepts of matr i x theor y , suc h as singular values , r ank, etc., w e w ill include short desc ripti ons of thes e concepts intermingled w ith the descr iption of fu nct ion s.
P age 11-8 Function ABS F uncti on ABS calc ulate s what is kno w n as the F r obenius nor m of a matr i x. F or a matr i x A = [a ij ] m ×n , the F r obenius nor m of the matr i x is def ined as If the matr i x under consider ation in a r ow v ector or a column v ector , then the F r obe nius nor m , || A || F , is simply the v ector ’s magnitude . F uncti on ABS is access ible direc tly in the k ey b oar d as „Ê . T ry the f ollo w ing e x er c ises in AL G mode (using the matr i ces stor ed earlier f or matr i x operati ons): Function SNRM F uncti on S NRM calc ulates the Spec tr al NoRM of a matri x, w hic h is def ined as the matr i x ’s large st singular v alue , also kno wn a s the Eu clidean nor m of the matr i x. F or ex ample, ∑∑ == = n i m j ij F a A 11 2
P age 11-9 Functions RNRM and CNRM F uncti on RNRM r etur ns the Ro w NoRM o f a matr i x , whil e functi on CNRM r eturns the C olumn NoRM of a matr i x. Ex amples, Singular value decomposition T o unders tand the oper ation o f F uncti on SNRM, w e need to intr oduce the concept of matr i x decompositi on. Ba sicall y , matri x decompo sition in v olv es the deter minati on of two or mor e matr ices that , when multipli ed in a certain orde r (and, per haps, w ith some matr i x in ver sion or tr ansposition thr o wn in), pr oduce the or iginal matr i x . The Singular V alue Decompositi on (S VD) is such that a re ct a n gu l a r m a t rix A m ×n is wr it te n as A m ×n = U m ×m ⋅ S m ×n ⋅ V T n ×n , wh ere U and V ar e or thogonal matr ices, and S is a diagonal matr i x . The diagonal elements o f S are cal led the singular values of A and are u sually or der ed so that s i ≥ s i 1 , fo r i = 1, 2 , …, n -1. T he columns [ u j ] of U and [ v j ] of V ar e the corr es ponding singular vec tors . (Orthogonal matri ces ar e suc h that U ⋅ U T = I . A diagonal matr ix has non- z er o elements only along its main diagonal). T he rank o f a matri x can be determined f r om its S VD by co unting the numbe r of non -singular v alues . Ex amples of S VD w ill be pre sented in a subs equent section. Ro w norm and column norm of a matri x The r ow nor m of a matr i x is calc ulated by taking the sums of the absolute v alues of all elements in eac h r o w , and then, selec ting the maximum o f these sums. The column norm o f a ma tr ix is calc ulated by taking the sums of the absolute v alu e s of all elements in eac h column , and then, s electing the max imum of these sums.
P age 11-10 Function SR AD F uncti on SRAD de termine s the Spectr al R ADius o f a matri x, de fined as the lar gest of the a bsolute v alues of its e igen v alues . F or e x ample , Function COND F uncti on COND deter mines the conditi on number of a matr ix : Definition of eigenv alues and eigenvectors of a matri x T he eigen v alues of a sq uar e matr i x re sult fr om the ma tr ix eq uation A ⋅x = λ⋅ x . The v alues of λ that satisfy the equation ar e know n as the ei gen value s of the matr i x A . The v alues of x that r esult fr om the equation f or each v alue of l ar e kno wn as the e ige nv ector s of the matr ix . Further details on calc ulating ei gen values and e igen v ector s ar e pr esented late r in the cha pter . Condition number of a matri x T he condition number o f a squar e non-singular matri x is de fi ned as the pr oduct of the matr i x norm times the nor m of its in ve rse , i .e ., cond( A ) = || A ||×|| A -1 ||. W e w ill c hoos e as the matr i x nor m, || A ||, the max imum o f its r ow n orm (RNRM) and column no rm (CNRM), while the nor m of th e inv erse, || A -1 ||, w ill be sel ected as the minimum o f its r o w nor m and column norm . Th us, || A || = max(RNRM( A ), CN R M( A )), and ||A -1 || = min(RNRM( A -1 ), CN RM ( A -1 )) . T he conditio n number of a singular matr i x is inf init y . The conditi on number o f a non-singular matr i x is a measur e o f ho w clo se the matr i x is to be ing singular . The lar ger the v alu e o f the conditi on number , the c loser it is to singular ity . ( A singular matri x is one f or w hic h the in v ers e does not e xis t) .
P age 11-11 T ry the follo wing ex erc ise f or matri x condition n umber on matr i x A3 3 . The conditi on number is COND( A3 3) , ro w norm , and column norm f or A3 3 ar e sho w n to the le ft . The cor r esponding numbers f or the in ver se matr i x, INV( A3 3) , ar e sho wn to the ri ght: Since RNRM(A3 3) > CNRM(A3 3) , then w e tak e ||A3 3|| = RNRM(A3 3) = 21. Also , since CNRM(INV(A3 3)) < RNRM(INV(A3 3)) , then we tak e ||INV(A3 3)|| = CNRM(INV( A3 3)) = 0.2 61044... T hu s, the conditi on number is also calc ulated as CNRM(A3 3)*CNRM(INV(A3 3)) = COND(A3 3) = 6 .7 8 714 8 5… Function R ANK F uncti on R ANK deter mines the r ank of a squar e matri x . T r y the f ollo w ing exa mp l es : Th e ra nk of a m atr ix T he rank o f a squar e matr i x is the maximum n umber of linear ly independe nt r o w s or columns that the matr ix cont ains. Su ppose that y ou w r ite a squar e matr i x A n ×n as A = [ c 1 c 2 … c n ], whe re c i (i = 1, 2 , …, n) ar e vect ors r epr esenting the col umns of the matr i x A , then, if an y of thos e columns, sa y c k , can be w ritt en as , } ,..., 2 , 1 { , ∑ ∈ ≠ ⋅ = n j k j j j k d c c
P age 11-12 F or ex ample , try finding the r ank for the matr i x: Y ou w ill f ind tha t the rank is 2 . That is becaus e the second r o w [2 , 4, 6] is equal to the f irs t r ow [1,2 , 3] multiplied b y 2 , thu s, r o w tw o is linearl y dependent of r o w 1 and the max imum number o f linearl y independent r o ws is 2 . Y ou can c heck that the max imum number of linear ly independent col umns is 3 . T he r ank being the max imum number of linear ly independent r o w s or columns becomes 2 fo r this case . Function DE T F uncti on DET calc ulates the deter minant of a sq uare matr ix . F or e x ample , wher e the values d j ar e constant , we sa y that c k is linearl y dependent on t he columns included in the summati on . (Notice that the v alues of j inc lude an y v alu e in the s et {1, 2 , …, n}, in any comb ination , as long as j ≠ k. ) If the e xpr essi on sho wn abo ve cannot be w ritte n for an y of the column v ector s then w e sa y that all the columns are l inearl y independent . A similar de fin ition f or the linear independence of r o ws can be de veloped b y wr iting the matr i x as a column of r o w vec tors . Th us, if w e f ind that rank( A ) = n , then the matr ix ha s an in ve rse and it is a non-singular matr i x . If , on the other hand , r ank( A ) < n , then the matr i x is singular and no in v ers e e x ist .
P age 11-13 The determinant of a matr ix T he deter minant of a 2x2 and o r a 3x3 matr i x ar e r epr esen ted b y the same arr angement of elemen ts of the matr ices , but enc losed be t w een verti cal lines, i. e. , A 2 × 2 dete rminant is cal cul ated b y multiply ing the elemen ts in its diagonal and adding those pr oducts accompanied b y the positi ve or negati ve sign as indicat ed in the diagr am sho wn belo w . Th e 2 × 2 dete rminant is, the re for e, A 3 × 3 deter minant is calculat ed by augm ent ing the det erminant , an oper ation that consists on cop y ing the f irs t two columns of the determinant , and plac ing them to the ri ght of column 3, as show n in the diagr am below . T he diagr am also sho w s the elements t o be multiplied w ith the corr esponding sign t o attach to the ir pr oduct , in a similar f ashion a s done earli er for a 2 × 2 deter minant . Afte r multiplicati on the r esults ar e added together to obtain the deter minant . 33 32 31 23 22 21 13 12 11 22 21 12 11 , a a a a a a a a a a a a a 21 12 22 11 22 21 12 11 a a a a a a a a ⋅ − ⋅ =
P age 11-14 Function TR A CE F uncti on TRA CE calc ulates the tr ace of sq uare matr ix , def ined as the sum of the elements in its main diagonal , or . Ex amples: F or squar e matr i ces of hi gher or der de terminants can be calc ulated by u sing smaller or der deter minant called co fact ors . The gener al i dea is to "e xpand" a deter minant of a n × n matri x (also r efe rr ed to as a n × n deter minant) into a s um of t he cofa cto rs, wh ich a re ( n -1 ) × (n -1) dete rminants , multipli ed by the elements of a single r ow or column , w ith alter nating positi ve and negati ve signs . T his "expansi on" is then carr ied to the ne xt (lo w er ) lev el , w ith cofac tors o f order (n- 2) × (n - 2) , and so on, until w e ar e left only w i th a long sum of 2 × 2 de ter minants . T he 2 × 2 determinan ts ar e then calc ulated thr ough the method sho wn abo v e . T he method of calc ulating a deter minant b y cofac tor e xpansion is v ery ineff ic ient in the sense that it inv olv es a number of oper ations that gr ow s v er y fa st as the si z e of the determinant inc reas es. A mor e effi c ient method , a nd the one pr ef err e d in n umer ical appli cations , is to us e a re sult fr om Gau ssi an elimination . The method o f Gaussi an eliminati on is used to sol ve s ys tems of linear equati ons. Details o f this method ar e pre sented in a later part of this ch ap ter . T o r ef er to the deter minant of a matr i x A , we w r ite det( A ). A singular matr ix has a dete rminant eq ual to z er o . ∑ = = n i ii a tr 1 ) ( A
P age 11-15 Function TR AN F uncti on TRAN re turns the tr anspo se of a r eal or the conj ugate tr anspo se of a comple x matri x. TRAN is equi v alent t o TRN. The oper ation of func tion TRN w as pr es ented in Cha pter 10. Additional matri x oper ations (T he matri x OPER menu) T he matri x OPER (OP ER A TION S) is av ailable thr ough the ke y str ok e sequence „Ø (s ys tem f lag 117 set t o CHOOSE bo xe s) : T he OPERA TIONS men u inc ludes the fo llo w ing func tions: F uncti ons AB S, CNRM , COND , DET , RA NK , RNRM, S NRM, TR A CE , and TR AN ar e also f ound in the MTH/MA TRI X/NORM menu (the subj ect of the pr e v iou s secti on) . F uncti on SI ZE w as pr esented in C hapter 10. F unction HAD AM ARD w as pr esent ed earlier in the co nte xt of matr ix m ultiplicati on. F uncti ons LS Q ,
P age 11-16 MAD and RSD ar e relat ed to the soluti on of s y ste ms of linear equati ons and wil l be pr esen ted in a subseq uent secti on in this Chapt er . In this secti on w e ’ll disc us s only f uncti ons AXL and AXM. Function AXL F uncti on AXL con verts an arr a y (matri x) into a list , and v ice v ersa: Note : the latter oper ation is similar to that o f the pr ogr am CRMR pr es ented in Chapter 10. Function AXM F uncti on AXM conv erts an arr ay cont aining integer or fr acti on elements int o its cor re sponding dec imal , or appr o x imate , form: Function L CXM F uncti on L CXM can be used t o gener ate matr ices su ch that the element aij is a func tion o f i and j. The input to this function consis ts of tw o integer s, n and m, r epr esenting the number of r ow s and columns of the matr i x to be generated , and a pr ogram that t ake s i and j as input. T he numbers n , m , and the progr am occ up y stack le v els 3, 2 , an d 1, r especti v ely . F unction L CXM is accessible thr ough the command catalog ‚N . F or ex ample, t o gener ate a 2´ 3 matr i x wh ose e lements ar e gi v en b y a ij = (i j) 2 , f irst , stor e the f ollo w ing pr ogram int o var iable P1 in RPN mode . This is the w a y that the RPN st ack looks be for e pr essing K .
P age 11-17 T he implementati on of func tion L CXM fo r this case r equir es y ou to ente r: 2`3`‚ @@P1@@ LCXM ` T he follo w ing fi gur e show s the RPN s tack be fo r e and af t er appl y ing func tion LC X M : In AL G mode , this e x ample can be obtained b y using: T he progr am P1 must still ha ve been c r eated and stor ed in RPN mode . Solution of linear s ystems A s y st em o f n linear equations in m var ia bles can be wr itten as a 11 ⋅ x 1 a 12 ⋅ x 2 a 13 ⋅ x 3 … a 1,m-1 ⋅ x m-1 a 1,m ⋅ x m = b 1 , a 21 ⋅ x 1 a 22 ⋅ x 2 a 23 ⋅ x 3 … a 2, m - 1 ⋅ x m-1 a 2, m ⋅ x m = b 2 , a 31 ⋅ x 1 a 32 ⋅ x 2 a 33 ⋅ x 3 … a 3,m-1 ⋅ x m-1 a 3,m ⋅ x m = b 3 , . . . … . . !! . . . . … . . !! . a n-1 ,1 ⋅ x 1 a n-1 ,2 ⋅ x 2 a n-1 , 3 ⋅ x 3 … a n-1 ,m -1 ⋅ x m-1 a n -1,m ⋅ x m = b n- 1 , a n1 ⋅ x 1 a n2 ⋅ x 2 a n3 ⋅ x 3 … a n, m- 1 ⋅ x m-1 a n,m ⋅ x m = b n . T his sy stem of linear equati ons can be wr itten as a matr i x equati on, A n ×m ⋅ x m ×1 = b n ×1 , if w e def ine the fol lo w ing matri x and vec tor s:
P age 11-18 , , Using the num er ical solv er f or linear s ystems Ther e are man y w a ys to so lv e a s y stem of linear equatio ns w ith the calculator . One pos sibility is thr ough the numer i cal sol v er ‚Ï . F r om the numer ical sol v er scr een, sho w n belo w (left) , selec t the option 4. Sol v e lin s ys .., and pr ess @@@OK@@@ . The f ollo w ing input f orm w ill be pr o v ided (ri ght): T o solve the li near sy stem A ⋅x = b , en ter the matr i x A , in the for mat [[ a 11 , a 12 , … ], … [… .]] in the A: f ield . Also , e nter the vec tor b in t he B: field. When t he X: f ield is hi ghligh ted , pr ess [S OL VE]. I f a soluti on is av ailable , the soluti on vec tor x will be sho wn in the X: f ie ld. T he soluti on is also copi ed to stac k lev el 1. So me ex amples follo w . A square s y stem T he sy stem of li near equati ons 2x 1 3x 2 –5x 3 = 13, x 1 – 3x 2 8x 3 = -13, 2x 1 – 2x 2 4x 3 = -6 , can be w ritten as the matri x equati on A ⋅x = b , if m n nm n n m m a a a a a a a a a A × ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = L M O M M L L 2 1 2 22 21 1 12 11 1 2 1 × ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = m m x x x x M 1 2 1 × ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = n n b b b b M . 6 13 13 , , 4 2 2 8 3 1 5 3 2 3 2 1 ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − − = b x A and x x x
P age 11-19 T his sy st em has the same number o f equations as o f unknow ns , and will be r efer r ed to as a sq uare s ys tem. In gener al, ther e should be a unique solu tion to the s y stem . T he soluti on w ill be the po int of inter secti on of the three planes in the coor dinate s ys tem (x 1 , x 2 , x 3 ) r epr es ented b y the thr ee equati ons . T o en ter matr i x A y ou can acti vate the Matr i x W rit er while the A: f ield is se l e ct ed. Th e fol l owin g scre e n s h ows t h e Ma t rix Writ e r u se d fo r en te ri ng m a trix A , as well as the in p u t form f or the numer ical sol ver after entering matri x A (pr ess ` in the Matr i x W r iter ): Press ˜ t o selec t the B: fi eld . The v e c tor b can be ente r ed as a ro w vec tor w ith a single set of br ac k ets, i .e ., [13,-13,-6] @@@OK@@@ . After en ter ing matr i x A and vect or b , and w ith the X: fi eld highlight ed, w e can pr ess @ SOLVE! to attempt a soluti on to this s y stem of eq uations: A solu tion w as f ound as sho w n next . T o see the solu tion in the s tac k pr es s ` . T he soluti on is x = [1,2 ,-1].
P age 11-20 T o chec k that the solu tion is cor r ect , enter the matr i x A and multiply times this solu tion v ector (e xample in algebr aic mode): Under-det ermined s ystem T he sy stem of li near equati ons 2x 1 3x 2 –5x 3 = -10, x 1 – 3x 2 8x 3 = 8 5, can be w ritten as the matri x equati on A ⋅x = b , if T his sy stem has mor e unkno wns than eq uations , ther ef or e , it is not uniquel y deter mined. W e can visuali z e the meaning of this s tatemen t by r eali zing that eac h of the linear equations r epre sents a plane in the thr ee -dimensional Cartesi an coor dinate s y stem (x 1 , x 2 , x 3 ) . T he soluti on to the s y st em of equati ons sho wn abo ve w ill be the inte rsec tion o f two planes in space . W e kno w , ho w ev er , that the inter secti on of tw o (non -par allel) planes is a str aight line , and not a single point . Ther ef ore , ther e is mor e than one point that s atisfy the s y stem . In that sense , the sy ste m is not uniquel y deter mined. Let ’s use the numer ical s olv er to attempt a soluti on to this s y stem of equati ons: ‚Ï ˜˜˜ @@OK@@ . Enter matri x A and v e c tor b as illu str ated in the pr e vi ou s ex ample , and pr ess @SOLVE w hen the X: field is highli ghted: . 85 10 , , 8 3 1 5 3 2 3 2 1 ⎥ ⎦ ⎤ ⎢ ⎣ ⎡ − = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎥ ⎦ ⎤ ⎢ ⎣ ⎡ − − = b x A and x x x
P age 11-21 T o see the details of the so lutio n vect or , if needed, pr ess the @EDIT! butt on. T his w ill acti vat e the Matri x W r iter . W ithin this env ir onment , use the r ight- and left- arr o w k e y s to mo v e about the v ector : T hus , the solution is x = [15 . 3 7 3, 2 .46 2 6, 9 .6 2 6 8]. T o r eturn to the numer ical s olv er en v ir onment , pre ss ` . T he pr ocedur e that we des cr ibe ne xt can be us ed to cop y the matri x A and the solu tion v ecto r X into the stac k. T o chec k that the soluti on is corr ect , tr y the fo llo w ing: • Press —— , to highlight the A: field . • Press L @CALC@ ` , to cop y ma tr i x A onto the stac k. • Press @@@OK@@@ to r eturn to the n umer ical sol v er env i r onment . • Press ˜ ˜ @CALC@ ` , to cop y soluti on vec tor X onto the stac k. • Press @@@OK@@@ to r eturn to the n umer ical sol v er env i r onment . • Press ` to r eturn to the stac k. In AL G mode , the st ack w ill no w look lik e this:
P age 11-2 2 Let ’ s store the latest r esult in a var iable X, and the matr i x into var iable A, as fo llo w s: Press K~x` to stor e the solution v ector into var iable X Press ƒ ƒ ƒ to clear thr ee lev els of the stac k Press K~a` to st or e the matri x into v ar iable A No w , let’s v er ify the soluti on b y using: @@@A@@@ * @@@X@@@ ` , whic h r esults in (pr ess ˜ to s ee t he ve ct o r e l em e nt s ) : [- 9 . 99999999992 85 . ] , c lo se e no ug h to the ori gina l v ector b = [-10 8 5]. T ry also this, @@A@@@ * [15,10/3,10] ` ‚ï` , i .e ., This r esult indicates that x = [15,10/3,10] is also a soluti on to the s ys tem , conf irming our ob servati on that a s y ste m wi th mor e unkno wns than eq uations is not uniquel y determined (under -deter mined) . Ho w does the calc ulator came up w ith the soluti on x = [15 . 3 7… 2 .46… 9 .6 2…] sho w n earli er? Ac tually , the calc ulator minimi z es the dist ance fr om a point , whi ch w ill constitute the solu tion , to eac h of the planes r epres ented by the equati ons in the linear s ys tem . T he calculat or use s a least-squar e me thod , i.e ., minimi z es the sum of the squar es of tho se dist ances or err ors . Over-determin ed s ystem T he sy stem of li near equati ons x 1 3x 2 = 15, 2x 1 – 5x 2 = 5, -x 1 x 2 = 2 2 ,
P age 11-2 3 can be w ritten as the matri x equati on A ⋅x = b , if This s yst em has mor e equations than unkno w ns (an ov er -determined s yste m) . T he sy stem does not ha v e a single s oluti on. E ac h of the linear equations in the s y stem presented abo v e r epresen ts a s tr aight line in a two -dimensi onal Cartesi an coor dinate s y stem (x 1 , x 2 ) . Unles s t w o o f the three eq uations in the s y stem r e pr esent the same equati on, the thr ee lines will hav e mo r e than one inter secti on points . F or that r eason , the solu tion is not uni que . S ome numer ical algor ithms can be used to f or ce a solution t o the sy stem b y minimi zing the distance f r om the pr esumpti v e soluti on point t o each o f the lines in the s y stem . Suc h is the approac h f ollo w ed by the calc ulator numer ical sol v er . Let ’s use the numer ical s olv er to attempt a soluti on to this s y stem of equati ons: ‚Ï ˜˜˜ @@OK@@ . Enter matri x A and v e c tor b as illu str ated in the pr e vi ou s ex ample , and pr ess @SOLVE w hen the X: field is highli ghted: T o see the details of the so lutio n vect or , if needed, pr ess the @EDIT! butt on. T his w ill acti vat e the Matri x W r iter . W ithin this env ir onment , use the r ight- and left- arr o w k e y s to mo v e about the v ector : . 22 5 15 , , 1 1 5 2 3 1 2 1 ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎥ ⎦ ⎤ ⎢ ⎣ ⎡ = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − = b x A and x x
P age 11-2 4 Press ` to retur n to the numer ical sol v er env ironment . T o check that the solu tion is corr ect , try the follo wing: • Press —— , to highlight the A: field . • Press L @CALC@ ` , to cop y ma tr i x A onto the stac k. • Press @@@OK@@@ to r eturn to the n umer ical sol v er env i r onment . • Press ˜ ˜ @CALC@ ` , to cop y soluti on vec tor X onto the stac k. • Press @@@OK@@@ to r eturn to the n umer ical sol v er env i r onment . • Press ` to r eturn to the stac k. In AL G mode , the st ack w ill no w look lik e this: Let ’ s store the latest r esult in a var iable X, and the matr i x into var iable A, as fo llo w s: Press K~x` to stor e the solution v ector into var iable X Press ƒ ƒ ƒ to clear thr ee lev els of the stac k Press K~a` to st or e the matri x into v ar iable A No w , let’s v er if y the soluti on b y using: @@@A@@@ * @@@X @ @@ ` , w hic h r esults in the v ector [8.6 917… -3 .4109… -1.13 01…], wh i ch is no t equal to [15 5 2 2], the or iginal v ector b . T he “ soluti on ” is simpl y the point that is clo sest t o the three lines r epr esent ed by the thr ee equati ons in the s y stem , and not an ex ac t solut i on. Least-square solution (function LSQ) T he LS Q f unction r eturns the minim um-norm leas t -s quar e solu tion of a linear s ys tem Ax = b , accor ding to the follo wing c r iter ia:
P age 11-2 5 • If A is a squar e matr i x and A is non -singul ar (i .e ., it’s in ver se matr i x e xis t , or its determinant is non - z er o) , LS Q r etur ns the ex act so lution to the linear s y stem . • If A has les s than full r ow r ank (u nde rde termined s y st em of equatio ns) , LS Q r eturns the solu tion w ith the minimum E ucl idean length out of an inf init y n umber of soluti ons . • If A has les s than full column rank (o v er -determined s y st em of equati ons) , LS Q retur ns the "soluti on" w ith the minimum re sidual v alue e = A ⋅x – b . The s y stem o f equati ons may not ha ve a s olution , ther ef or e , the v alue r eturned is not a r eal soluti on to the s y stem , ju st the one w ith the smalles t re sidual . F uncti on LS Q tak es as input v ect or b and matri x A , in that order . F unction L S Q can be f ound in F uncti on catalog ( ‚N ) . Ne xt , we use f unction L SQ to r epeat the soluti ons found ear lier w ith the numer ical so lv er : Square s ystem Consi der the s ys tem 2x 1 3x 2 –5x 3 = 13, x 1 – 3x 2 8x 3 = -13, 2x 1 – 2x 2 4x 3 = -6 , wi th T he soluti on using LS Q is sho wn ne xt: . 6 13 13 , , 4 2 2 8 3 1 5 3 2 3 2 1 ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − − = b x A and x x x
P age 11-2 6 Under-det ermined s ystem Consi der the s ys tem 2x 1 3x 2 –5x 3 = -10, x 1 – 3x 2 8x 3 = 8 5, wi th T he soluti on using LS Q is sho wn ne xt: Over-determin ed s ystem Consi der the s ys tem x 1 3x 2 = 15, 2x 1 – 5x 2 = 5, -x 1 x 2 = 2 2 , wi th T he soluti on using LS Q is sho wn ne xt: . 85 10 , , 8 3 1 5 3 2 3 2 1 ⎥ ⎦ ⎤ ⎢ ⎣ ⎡ − = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎥ ⎦ ⎤ ⎢ ⎣ ⎡ − − = b x A and x x x . 22 5 15 , , 1 1 5 2 3 1 2 1 ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎥ ⎦ ⎤ ⎢ ⎣ ⎡ = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − = b x A and x x
P age 11-2 7 Compar e these thr ee solu tions w ith the ones calc ulated wi th the numer ical solv er . Solution with the in v erse matri x T he soluti on to the s ys tem A ⋅x = b , w her e A is a squar e matr i x is x = A -1 ⋅ b . T his re sults fr om multiply ing the f irst eq uation b y A -1 , i .e ., A -1 ⋅ A⋅ x = A -1 ⋅ b . B y def inition , A -1 ⋅ A = I , th us w e wr ite I ⋅x = A -1 ⋅ b . Also , I ⋅x = x , thus , w e ha v e , x = A -1 ⋅ b . F or the ex ample us ed earlier , namely , 2x 1 3x 2 –5x 3 = 13, x 1 – 3x 2 8x 3 = -13, 2x 1 – 2x 2 4x 3 = -6 , w e can find the solu tion in the calc ulator as fo llo ws: w hich is the same r esult found ear lier . Solution b y “div ision” of matrices While the oper ation o f di visi on is not def ined for matr ices , w e can use the calc ulat or ’s / ke y t o “ d i vi d e ” v e c t o r b by ma t rix A to solv e for x in the matr i x equation A ⋅x = b . This is an ar bitr ary exte nsion of the algebrai c div ision oper ation to matr i ces, i .e ., fr om A ⋅x = b , we dare t o w r ite x = b /A (Mathemati c ians w ould c ringe if the y see this!) T his , of cour se is inter pr eted a s (1/ A ) ⋅ b = A -1 ⋅ b , w hic h is the same as usi ng the inv ers e of A as in the pr e v iou s sect ion.
Pa g e 1 1 - 2 8 T he pr ocedure f or the cas e of “ di v iding ” b by A is illustr ated belo w f or the ca se 2x 1 3x 2 –5x 3 = 13, x 1 – 3x 2 8x 3 = -13, 2x 1 – 2x 2 4x 3 = -6 , The pr ocedu r e is sho wn in the follo wing s cr een shots: T he same solu tion as f ound abo ve w ith the in ver se matr i x . Solv ing multiple set of equations with the sam e coefficient matr ix Suppos e that yo u want t o solv e the f ollo w i ng thr ee sets of equati ons: X 2Y 3Z = 14 , 2X 4Y 6Z = 9 , 2X 4Y 6Z = - 2 , 3X - 2 Y Z = 2 , 3X - 2Y Z = -5, 3X - 2Y Z = 2 , 4X 2Y -Z = 5, 4X 2Y -Z = 19 , 4X 2Y -Z = 12 . W e can wr ite the thr ee s y stems o f equations as a single matr i x equation: A ⋅X = B , w her e T he sub-indice s in the va ri able names X, Y , and Z , det ermine to whi ch equati on s y stem the y r ef er to . T o sol v e this expanded s yst em we u se the f ollo w ing pr ocedur e , in RPN mode , , , 1 2 4 1 2 3 3 2 1 ) 3 ( ) 2 ( ) 1 ( ) 3 ( ) 2 ( ) 1 ( ) 3 ( ) 2 ( ) 1 ( ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − = Z Z Z Y Y Y X X X X A . 12 19 5 2 5 2 2 9 14 ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − = B
P age 11-29 [[14,9,- 2],[2,-5,2], [5,19,12]] ` [[1,2,3], [3,-2,1],[4,2 ,-1]] `/ T he re sult of this oper ation is: Gaussian and Gauss-Jordan elimination Gaus sian elimination is a pr ocedure b y w hic h the squar e matri x of coe ff ic ients belonging to a s y stem of n linear eq uations in n unkno wns is r educed to an upper - tr iangular matr i x ( echelon f or m ) through a s eri es of r o w oper ations . This pr ocedure is kno wn as f orwar d elimination . The r educti on of the coeff ic ien t matr i x to an upper - tr iangular for m allo ws f or the so lution of all n unkno wns , utili zing onl y one equati on at a time, in a pr ocedure kno w n as back war d subs titution . Ex ampl e of Gaussian elimination using equ ations T o illus tr ate the Gau ssian eliminati on pr ocedur e w e w ill us e the fo llo w ing s ys tem of 3 eq uations in 3 unkno wns: 2X 4Y 6Z = 14 , 3X - 2 Y Z = -3, 4X 2Y -Z = -4. W e can stor e these equations in the calc ulator in v ari ables E1, E2 , and E3, r especti vel y , as sho wn belo w . F or back up purpos es, a lis t containing the thr ee equations w as also c r eated and stor ed int o var iable E QS . This w a y , if a mistak e is made , the equati ons w ill still be a vaila ble to the us er . . 2 1 3 1 5 2 2 2 1 ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − = X
P age 11-30 T o start the pr ocess o f forw ar d elimination , w e di vi de the f irst equati on (E1) b y 2 , and s tor e it in E1, an d sho w the thr ee equ ation s again to pr oduce: Ne xt, w e r eplac e the s econd equation E2 b y (equ ati on 2 – 3 × equation 1, i . e ., E1-3 × E2) , and the thir d by (eq uation 3 – 4 × equation 1) , to get: Ne xt , div ide the second equation b y – 8 , to get: Ne xt , replace the thir d equation , E3, w ith (equation 3 6 × eq uation 2 , i .e. , E2 6 × E3) , to get: Notice that w hen w e perfor m a linear combinati on of equations the calc ulator modif ies the r esult to an e xpr essi on on the left-hand si de of the equal si gn , i .e .,
P age 11-31 an e xpre ssi on = 0. Thu s, the las t set of equati ons is interpr eted to be the fo llo w ing equiv alent set of equatio ns: X 2Y 3Z = 7 , Y Z = 3, - 7Z = -14. T he pr ocess o f back war d subs titution in Ga ussian e limination consis ts in finding the value s of the unkno wns , starting fr om the last equation and w or king up war ds. Th us, w e solve f or Z first: Ne xt , we subs titute Z=2 into equation 2 (E2), and solv e E2 f or Y : Ne xt , we su bstitut e Z=2 and Y = 1 into E1, and sol v e E1 for X: T he soluti on is, ther efor e , X = -1, Y = 1, Z = 2 . Ex ampl e of Gaussian elimination using ma tr ices The s ys tem of equations us ed in the e xample abo v e can be wr it te n as a matr ix equation A ⋅x = b , if w e us e:
P age 11-3 2 T o obtain a solution t o the sy stem matr i x equation us ing Gaussi an elimination , we f i r st c re a t e w h a t i s k n ow n a s t h e augmente d matr i x corr esponding to A , i .e ., T he matri x A aug is the same as the or iginal matri x A wi th a new r o w , cor re sponding to the elements o f the vec tor b , added (i.e ., augmented) t o the r ight of the ri ghtmost column of A . Once the augmented matr i x is put together , w e can pr oceed to perfor m r o w oper ations on it that w ill r educe the or iginal A matr i x into an upper -tri angular matr i x. F or this e xer c ise , w e w ill use the RPN mode ( H\ @@OK@ @ ), w it h s y st e m flag 117 set to S O FT men u . In yo ur calculator , use the f ollo w ing k e ystr oke s. F i r st , en ter the augmented matr ix , and make an extr a copy o f the same in the stac k (T his step is not necess ar y , e x cept as an insurance that y ou ha ve an e xtr a cop y of the augme nted matr ix s av ed in case y ou mak e a mistak e in the forwar d elimination pr ocedure that w e ar e about to undertak e .) : [[2,4,6,14 ],[3,-2,1,-3] ,[4,2,-1,-4] ] `` Sav e augmented matr i x in var iable AA UG: ³~~aaug~ K W ith a copy o f the augmented matr i x in the stac k, pre ss „´ @MATRX! @ROW! to acti v ate the R O W oper ati on menu . Ne xt , perfo rm the f ollo w ing r o w oper ations on y our augmented matr i x. Multiply r o w 1 by ½: 2Y 1 @RCI! Multiply r ow 1 b y –3 add it to r ow 2 , replac ing it: 3\ # 1 #2 @RCIJ! Multiply r o w 1 b y –4 add it to r o w 3, r eplacing it: 4\#1#3 @RCIJ! . 4 3 14 , , 1 2 4 1 2 3 6 4 2 ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎟ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎜ ⎝ ⎛ − − = b x A Z Y X ⎟ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎜ ⎝ ⎛ − − − − = 4 3 14 1 2 4 1 2 3 6 4 2 aug A
P age 11-3 3 Multiply r o w 2 by –1/8: 8\Y2 @RCI! Multiply r ow 2 b y 6 add it to ro w 3, r eplacing it: 6#2#3 @RCIJ! If y ou w er e perfor ming these oper ati ons by hand , y ou w ould wr ite the fo llo w ing: Th e symb ol ≅ ( “ is eq ui vale nt to ”) indicate s that what f ollo ws is equi valent to the pr e vi ou s matri x w ith so me r o w (or column) oper ations in v olv ed. T he re sulting matr ix is u pper - tr i angular , and eq ui vale nt to the set of equati ons X 2Y 3Z = 7 , Y Z = 3, - 7Z = -14 , w hich can no w be sol ved , one equation at a time , b y back war d substituti on, as in the pr e v iou s ex ample . Gauss-Jordan elimination using matr ices Gaus s-Jordan el imination consis ts in continuing the r o w oper ations in the upper - tr iangular matr i x re sulting fr om the forw ard el imination pr ocess until an i dentity matr i x r esults in place of the ori ginal A matr ix . F or e xample , for the case w e ju st pr esented , we can continue the ro w operati ons as follo ws: ⎟ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎜ ⎝ ⎛ − − − − ≅ ⎟ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎜ ⎝ ⎛ − − − − = 4 3 7 1 2 4 1 2 3 3 2 1 4 3 14 1 2 4 1 2 3 6 4 2 aug A ⎟ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎜ ⎝ ⎛ − − − ≅ ⎟ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎜ ⎝ ⎛ − − − − − − ≅ 32 3 7 13 6 0 1 1 0 3 2 1 32 24 7 13 6 0 8 8 0 3 2 1 aug A ⎟ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎜ ⎝ ⎛ − − ≅ 14 3 7 7 0 0 1 1 0 3 2 1 aug A
P age 11-34 Multiply r o w 3 by –1/7 : 7\Y 3 @RCI! Multiply r ow 3 b y –1, add it to r o w 2 , r eplac ing it: 1\ # 3 #2 @RCIJ! Multiply r ow 3 b y –3, add it to ro w 1, r eplacing it: 3\#3#1 @RCIJ! Multiply r ow 2 b y –2 , add it to r ow 1, r e plac ing it: 2\#2#1 @RCIJ! W r iting this pr ocess b y hand w ill r esult in the follo w ing s teps: Pivo ti n g If y ou look car ef ull y at the r o w oper ations in the e x amples sho w n abo ve , y ou w ill noti ce that many o f those ope rati ons di v ide a r o w b y its corr es ponding element in the main diagonal . T his element is called a pi vot element , or simply , a piv ot . In many situations it is po ssible that the p i vo t element become z er o , in w hich cas e we cannot div ide the r ow b y its pi v ot . Also , to impr o ve the numer ical s oluti on of a s ys tem of eq uations using Gaus sian or Gaus s-Jor dan elimination , it is recommended that the p iv ot be the element w ith the lar ges t absolute v alue in a gi v en column . In such case s, w e ex change r o ws bef ore perfor ming r o w oper atio ns. T his ex change of r ow s is called partial pi voting . T o fo llo w this r ecommendation is it often necessary to e xch ange r o ws in the augment ed matri x while perf orming a Gau ssi an or Gauss-Jor d an el imination . . 2 1 1 1 0 0 0 1 0 0 0 1 2 1 1 1 0 0 0 1 0 0 2 1 ⎟ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎜ ⎝ ⎛ − ≅ ⎟ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎜ ⎝ ⎛ ≅ aug A
Pa g e 1 1 - 3 5 While perf orming p iv oting in a matr i x elimination pr ocedure , yo u can impro ve the numer i cal soluti on ev en mor e b y selecting a s the pi vo t the element w ith the lar gest ab solut e value in the column and r o w of inte r est . This oper ation ma y r equir e e xc h anging not onl y r o w s, but also columns , in some pi v oting oper ations . When r ow and column e x changes ar e allow ed in pi v oting , the pr ocedure is kno wn as f ull pi v oting . When e x c hanging r o ws and columns in partial or f ull pi voting , it is necess ar y to k eep tr ack o f the e xc hanges beca use the or der o f the unkno wns in the so lutio n is alter ed b y thos e e x changes . One w a y to k eep tr ack of column e x changes in partial or full pi voting mode , is to c r eate a per mutati on matr i x P = I n ×n , at the beginning of the pr ocedure . An y r o w or column e x change r equir ed in the augmented matri x A aug is also r egister ed as a ro w or column ex change , r especti vel y , in the perm utation matr i x . When the solu tion is ac hie v ed, the n, w e multiply the per mutati on matri x by the unkno wn v ector x to obtain the order of the unkno wns in the soluti on. In o ther wo rds , the f inal soluti on is giv en b y P ⋅x = b ’ , wher e b ’ is the last column of the augmented matr ix after the solu tion has been f ound . Ex ample of G auss-Jor dan elimination with full piv oting Let ’s illustr ate f ull pi voting w ith an e x ample . Sol v e the follo wing s ys tem of equati ons using full p i voting and the Gau ss-Jor dan eliminati on procedur e: X 2Y 3Z = 2 , 2X 3Z = -1, 8X 16Y - Z = 41. T he augmented matr i x and the per mutation matr ix ar e as follo ws: Stor e the augmented matr i x in var ia ble AA UG , then pr ess ‚ @AAUG to get a cop y in the stac k . W e want to ke ep the CS WP (Column S w ap) command r eadil y av ailable , f or w hic h w e us e: ‚N~~cs~ (find CS WP ), @@OK@ @ . Y ou ’ll get an er r or mess age , pre ss $ , and ignor e the m essage . Ne xt , get the RO W me nu a vailabl e by pr essing: „Ø @ ) CREAT @)@ROW@ . . 1 0 0 0 1 0 0 0 1 , 41 1 16 8 1 3 0 2 2 3 2 1 ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − = P A aug
Pa g e 1 1 - 3 6 No w we are r eady to st ar t the Ga uss-Jor dan elimination w ith full p i vo ting . W e w ill need to k eep trac k of the permutati on matr ix b y hand , so tak e yo ur notebook and w r ite the P m a t rix s h own ab ov e. F i r st , w e chec k the pi vo t a 11 . W e notice that the ele ment wi th the large st abs olute v alue in the fir st r ow and f i r st co lumn is the v alue of a 31 = 8. Since we w ant this number to be the pi v ot , then w e ex change r o w s 1 and 3, by using: 1#3L @RSWP . T he augmented matr i x and the permut ation matr i x no w are: Chec king the pi v ot at positi on (1,1) we no w find that 16 is a better pi vot than 8 , thus , w e per f or m a column sw ap as f ollo ws: 1#2‚N @@OK@ @ @RSWP . T he augmente d matri x a n d the pe rmu tatio n matri x no w ar e: No w we ha v e the larges t possible v alue in positi on (1,1) , i .e ., w e perfor med f ull pi votin g at (1,1). Ne xt , w e pr oceed to di v ide by the pi vo t: 16Y1L @RCI@ . T he per mutati on matri x does not change , but the augmented matr i x is no w: T he ne xt step is to e liminate the 2 fr om position ( 3,2) by using: 2\#1#3 @RCIJ 8 1 6 - 1 4 1 001 2 0 3 - 1 010 1 2 3 2 100 1 6 8 - 1 4 1 001 0 2 3 - 1 100 2 1 3 2 010 1 1/2 -1/16 41/16 001 02 3 - 1 100 21 3 2 010 1 1/2 -1/16 41/16 00 1 02 3 - 1 10 0 00 2 5 / 8 - 2 5 / 8 01 0
P age 11-3 7 Hav ing f illed up w ith z er os the elements of column 1 below the p i v ot , now w e pr oceed to c heck the pi vot at po sition (2 ,2) . W e find that the number 3 in positi on (2 , 3) will be a better pi v ot , thus , w e ex change columns 2 and 3 b y using: 2#3 ‚N @ @@OK@ @ Chec king the pi v ot at positi on (2 ,2) , we no w find that the v alue of 2 5/8, at positi on (3,2), is larger than 3 . Thu s, w e ex change r o w s 2 and 3 by u sing: 2#3 L @RSWP No w , we ar e read y to di v ide r o w 2 by the pi vot 2 5/8 , by u sing ³ 8/25™#2 L @RCI Ne xt , we el iminate the 3 fr om position ( 3,2) by u sing: 3\#2#3 @RCIJ Hav ing f illed w ith z er oes the po sition belo w the pi v ot , w e proceed t o chec k the pi v ot at positi on (3, 3) . T he cu rr ent v alue of 2 is lar ger than ½ or 0, thu s, w e k eep it unc hanged. W e do di vi de the w hole thir d r o w b y 2 to con v ert the pi v ot to 1, by u sing: 2Y3 @RCI Ne xt , we pr oceed to eliminate the ½ in positi on (1, 3) by u sing: 1 -1/16 1/2 41/16 0 1 0 03 2 - 1 1 0 0 0 2 5/8 0 - 2 5/8 0 0 1 1 -1/16 1/2 41/16 0 1 0 0 2 5/8 0 - 2 5/8 0 0 1 03 2 - 1 1 0 0 1 -1/16 1/2 41/1 6 010 01 0 - 1 001 03 2 - 1 100 1 -1/16 1/ 2 41/1 6 01 0 01 0 - 1 00 1 00 2 2 10 0 1 -1/16 1/ 2 41/1 6 010 01 0 - 1 001 00 1 1 100
P age 11-38 2 Y \#3#1 @RCIJ F i nall y , w e eliminate the –1/16 f r om positi on (1,2) by using: 16 Y # 2#1 @RCIJ W e no w hav e an identity matri x in the por ti on of the augmented matr i x cor re sponding to the or i ginal coeff ic ient matr i x A, thus w e can pr oceed to obtain the sol ution w hile accounting f or the ro w and column ex c hanges coded in the perm utati on matri x P . W e identify the unkno wn v ecto r x , the modif ied independent v ector b ’ and the per mutati on matr i x P as: Th e so lu tio n i s g i ve n by P ⋅x =b ’, o r Whi ch r esults in Step-b y-step calc ulator pr ocedure f or solv ing linear s ystems The e xample w e jus t wo rk ed is, o f c our se , the step-b y-step , u ser -dr iv en pr ocedur e to us e f ull pi v oting f or Gau ss-Jor dan eliminati on solu tion o f linear equation s ys tems . Y ou can see the step-b y-st ep pr ocedure u sed b y the calc ulator to so lv e a s ys tem of equati ons, w i tho ut use r inter v ention , by setting the step-b y-step option in the calc ulator’s CAS , as fo llow s: 1 -1/16 0 3 3/16 010 01 0 - 1 001 00 1 1 100 1 0 0 2 010 0 1 0 - 1 001 0 0 1 1 100 . 0 0 1 1 0 0 0 1 0 , 1 1 2 ' , ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = P b x Z Y X . 1 1 3 0 0 1 1 0 0 0 1 0 ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ ⋅ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ Z Y X . 1 1 3 ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ X Z Y
P age 11-3 9 T hen, f or this partic ular e x ample , in RPN mode , use: [2,-1,41] ` [[1,2,3],[ 2,0,3],[8,16 ,-1]] `/ T he calculat or sho ws an a ugmented matr i x consisting o f the coeff ic ients matr ix A and the iden tit y matr ix I , while , at the s ame time , sho w ing the ne xt pr ocedur e to ca lc ulate: L2 = L2 - 2 ⋅ L1 stands f or “ r eplace r o w 2 (L2) w ith the oper ati on L2 – 2 ⋅ L1. If w e had done this oper ation b y hand, it w ould hav e corr es ponded to: 2\#1#1 @RCIJ . Pr es s @@@OK@@@ , and follo w the oper ations in y our calc ulato r’s sc r een . Y ou w ill see the f ollo wi ng oper ations perfor med: L3=L3-8 ⋅ L1, L1 = 2 ⋅ L1--1 ⋅ L2 , L1=2 5 ⋅ L1--3⋅ L3, L2 = 2 5 ⋅ L2 -3 ⋅ L3, and fi nally a mess age indicating “R educti on r esult” sho wing: When y ou press @@@OK@@@ , the calc ulator r eturns the f inal r esult [1 2 –1]. Calc ulating the inv erse matrix step-b y-step T he calculati on of an in ve rse matr i x can be consi der ed as calc ulating the solu tion to the augme nted s y stem [ A | I ]. F or e x ample , for the matr ix A used in the pr ev ious ex ample , w e w ould w rit e this augmented matr i x as
P age 11-40 T o see the in ter mediate s teps in calc ulating and inv er se , j ust e nter the matr ix A fr om abov e, and pr ess Y , w hile keep ing the step-b y-st ep op ti on acti v e in the calc ulator’s CA S . Use the f ollo w ing: [[ 1,2,3],[ 3,-2,1],[4,2 ,-1]] `Y After go ing thr ough the diffe rent s teps , the soluti on r eturned is: What the calc ulator sho wed w as no t ex actly a Gaus s-Jor dan elimination wi th ful l pi vo ting , but a wa y to calc ulate the in v er se of a matr i x b y perfor ming a Gauss-Jor dan elimination , w ithout pi v oting . This pr ocedure f or calc ulating the in ver se is based on the augmented matr i x ( A aug ) n ×n = [ A n × n | I n ×n ]. The calc ula t or sho w ed you the s teps up to the point in w hi ch the left-hand half of the augment ed matri x ha s been conv erted to a diagonal matr i x . F r om ther e , the f inal step is to di v ide eac h r o w by the cor r esponding main di agonal pi vot . In other w or ds , the calculat or has tr ansfo rmed ( A aug ) n ×n = [ A n × n | I n ×n ], into [ I | A -1 ]. Inv erse matrices and deter minants Notice that all the elements in the in v erse matri x calculat ed abov e ar e di vi ded b y the value 5 6 or one of its factors (2 8 , 7 , 8 , 4 or 1) . If you calculate th e deter minant of the matr i x A , you get det ( A ) = 5 6 . W e could wr ite , A -1 = C / det( A ) , w her e C is the matri x . 1 0 0 0 1 0 0 0 1 1 2 4 1 2 3 3 2 1 ) ( ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − = I aug A . 8 6 14 8 13 7 8 8 0 ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − = C
P age 11-41 T he r esult ( A -1 ) n ×n = C n × n / det ( A n × n ) , is a gener al result that appli es to an y non -singular matr i x A . A gener al for m for the ele ments of C can be w r it te n based on the Gaus s-Jor dan algorithm . Based on the equation A -1 = C /det(A ), sketc hed abo v e, the in ver se matr i x , A -1 , is not def ined if det ( A ) = 0. Th us, the condition det ( A ) = 0 de fine s also a singular matr i x. Solution to linear s y stems using calc ulator functions The simpl e st way to solv e a sy stem of li near equa tions, A ⋅x = b , in the calculator is to enter b , enter A , a nd then u se the di v ision f uncti on /. If the s ystem of li near equations is o ver -dete r mi ned or under-determin ed, a “ sol ution ” can be pr oduced by u sing F uncti on LS Q (Lea st-S Quar es) , a s sho wn ear lie r . The calc ulato r , ho w ev er , offe rs other po ssib ilitie s fo r sol v ing linear s y stems o f equations b y using F uncti ons included in the MA TRICE S’ LINEAR S Y S TEMS .. menu acces sible thr ough „Ø (Set s yst em flag 117 to CHOOSE bo xes): T he functi ons inc luded ar e LINS OL VE , REF , rr ef , RREF , and S Y S T2MA T . Function LI NS OL VE F uncti on LINS OL VE tak es as ar guments an arr ay of equati ons and a vec tor containing the names o f the unkno wns , and produce s the soluti on to the linear s y stem . T he follo w ing s cr eens show the help-f ac ility entr y (see C hapter 1) fo r func tion LINS OL VE , and the corr esponding e x ample listed in the entr y . The r ight-hand side sc r een show s the r esult us ing the line edit or (p r ess ˜ to acti v ate) : Her e is another ex ample in AL G mode . Enter the fo llo w ing:
P age 11-4 2 LINSOLVE([ X-2*Y Z=-8,2 *X Y-2*Z=6,5* X-2*Y Z=-12], [X,Y,Z]) to pr oduce the s oluti on: [ X=-1,Y=2,Z = - 3]. F uncti on LINS OL VE w or ks wi th sy mb o lic e xpr es sions . F uncti ons REF , rr e f , and RREF , w ork w ith the augment ed matri x in a G a ussi an eliminati on appr oach . Functions REF , rref , RREF T he upper tr iangular f or m to w hic h the augmented matr i x is r educed dur ing the fo rwar d elimin ation part of a Gaus sian eliminati on pr ocedur e is kno w n as an "ec helon" for m. F unctio n REF (R educe to E chel on F orm) pr od u ces suc h a matri x gi v en the augmen ted matr i x in stac k le ve l 1. Consi der the augmented matr i x , Representing a linea r s ystem of equ ations, A ⋅x = b , w her e A = [[1,-2,1 ],[2,1,-2],[ 5,-2,1]] , and b = [[0],[ -3],[12]] . Enter the augmented matr i x , and sav e it into var iable AA UG , in AL G mode: [[1,-2,1, 0],[2,1,-2,- 3][5,-2,1,12] ]  UG Appli cation o f f unctio n REF pr oduces: T he re sult is the upper tr iangular (ec helon f orm) matr i x of coe ffi c ie nts r esulting fr om the forw ar d elimination s tep in a Gaus sian eliminati on pr ocedur e . . 12 3 0 1 2 5 2 1 2 1 2 1 ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − − − = aug A
P age 11-4 3 T he diagonal matr i x that r esults f r om a Gaus s-Jor dan elimination is called a r o w-r educed echelon f or m. F unction RREF ( R o w-Redu ced E che lon F or m) The r esult of this functi on call is to pr oduce the r o w-r educed echelon f orm so that the matr i x of coeff ic ients is r educed to an identity matri x. T he e xtra column in the augmented matr i x w ill contain the solution t o the sy stem of equatio ns. As an e xample , we sh ow the re sult of appl y ing func tion RREF to matr ix AA UG in AL G mode: T he r esult is f inal augment ed matri x re sulting fr om a Ga uss-Jor dan eliminati on w ithout pi vo ting. A r ow - r educed e ch el on f or m for an augme nted matri x can be obtained b y using functi on rref . T his func tion pr oduces a list of the pi v ots and an equi v alent matr i x in r o w-r educed ec helon f orm so that the matr ix o f coeff ic ients is r educed to a diagonal matr i x . F or ex ample , f or matr i x AA UG , func tion rr ef pr oduces the f ollo w ing r esult: T he second sc r een abo v e is obtained b y acti vati ng the line editor (pr ess ˜ ). T he r esult sho ws p i vo ts of 3, 1, 4 , 1, 5, and 2 , and a reduced di agonal matri x. Function S Y ST2MA T T his functi on conv er ts a s yst em of linear equations int o its augmented matri x equi v alent . The f ollo w ing e x ample is av ailable in th e help fac ilit y of the calc ulat or :
P age 11-44 T he re sult is the augmented matr i x corr esponding to the s yst em of equations: X Y = 0 X- Y =2 Residual er rors in linear s ystem solutions (F unc tion RSD) F uncti on R SD calculate s the Re SiDuals or err ors in the soluti on of the matr i x equation A ⋅x =b , r epr esen ting a sy stem of n linear equati ons in n unkno wns . W e can think of so lv ing this sy stem as so lv ing the matr i x equati on: f( x ) = b - A ⋅x = 0. Suppos e that, thr ough a numeri cal method , we pr od u ce as a fir st appr o x imation the so lution x (0) . E valuating f( x (0)) = b - A ⋅x (0) = e ≠ 0. Thus , e is a vec tor of r esi duals of F unction f or the v ector x = x (0) . T o us e F uncti on R SD y ou need the te rms b , A , and x (0) , as ar gum ents . T he ve ctor r eturned is e = b - A ⋅x (0). F or e x ample , using A = [[2,- 1][0,2]] , x (0) = [ 1.8,2.7] , and b = [1,6] , we can find the v ector of r esiduals as follo ws: T he r esult is e = b - A ⋅x (0) = [ 0.1 0.6 ]. Not e : If w e let the vect or Δ x = x – x (0) , r epr esent the cor r ecti on in the va lu e s o f x ( 0 ) , we ca n wri te a new m at rix eq u at io n for Δ x , namel y A ⋅Δx = e . Solvin g for Δ x we can f ind the actual so lution o f the ori ginal sy st em as x = x (0) Δx .
P age 11-45 Eigenv alues and eigenv ectors Gi v en a sq uar e matri x A , we can wr ite the eige nv alue equation A ⋅x = λ⋅ x , w here the v alues of λ that satisfy the equation ar e know n as the ei gen value s of matr i x A . F or eac h value o f λ , we can f ind , fr om the same equation , values o f x that satisfy the ei gen v alue equati on. Thes e v alues of x ar e kno w n as the ei genv ector s of matr i x A . The e igen values equation can be w r itten also as ( A – λ⋅ I) x = 0. T his equation w ill hav e a non -tri vi al soluti on only if the matr ix ( A – λ⋅ I ) is singular , i .e ., if det( A – λ⋅ I ) = 0. T he last eq uation gener ates an algebr ai c equation in v ol ving a pol y nomial o f or der n f or a squar e matri x A n ×n . The r esulting equati on is kno wn as the char act eri stic pol ynomi al of mat r i x A . Sol ving the c har acter is tic poly nomial pr oduces the e igen value s of the matr ix . T he calculat or pr ov ides a number o f functi ons that pr o vi de inf ormati on r egarding the e igen values and e igen vecto rs of a s quar e matr i x. Some of the se func tions ar e located unde r the menu MA TRICE S /E IGEN acti vate d through „Ø . Function P CAR F uncti on P CAR gener ates the c harac ter ist ic pol yn omial of a squar e matri x using the contents of var iable VX (a CAS r eserve d v ari able , t y picall y equal to ‘X’) as the unkno wn in the pol y nomial . F or e x ample , enter the f ollo wing matr i x in AL G mode and find the c har ac ter isti c equation u sing PCAR: [[1,5,-3], [2,-1,4],[3, 5,2]]
Pa g e 1 1 - 4 6 Using the var iable λ to r e pr esent e igen v alues, this c har acter istic pol y nomial is to be interpr eted as λ 3 -2 λ 2 -2 2 λ 21=0. Function EG VL F uncti on E G VL (E iGenV aL ues) pr oduces the ei gen value s of a sq uar e matri x. F or e x ample , the ei gen value s of the matr ix sho wn belo w a r e calc ulated in AL G mode using f uncti on E G VL: Th e ei ge nval ue s λ = [ - √ 10, √ 10 ]. F or ex ample , in e xac t mode , the follo wi ng ex erc ise pr oduces an empty list as the solu tion: Change mode to Appr ox and r epeat the entry , to get the follo wing e igen v alues: [(1.38,2.2 2), (1.38,-2.2 2), (-1.76,0)] . Function EG V F uncti on E G V (E iGenV alues and eige nv ecto rs) pr oduces the ei gen values and eigenvectors of a squ ar e m atri x. T he eigen vectors ar e return ed as th e colu mns Not e : In some cas es , yo u ma y not be able to f ind an ‘ e x act’ s oluti on to the c harac ter isti c poly nomial , and yo u wi ll get an empty list as a r esult w hen using F u nc tion E G VL . If that w er e to happen t o y ou , c hange the calc ulati on mode to Appr ox in the CA S , and r epeat the calc ulation .
P age 11-4 7 of a matr i x , while the corr esponding ei gen values ar e the components of a vec tor . F or ex ample , in AL G mode , the ei gen vect ors and e igen v alues of the matr i x listed be lo w ar e found by a pply ing functi on E G V : T he re sult sho ws the e igen v alues as the columns of the matr i x in the re sult list . T o see the ei gen v alues w e can use: GET( ANS(1),2) , i .e ., get the seco nd element in the list in the pr ev io us r esult . T he eigen v alues ar e: In summar y , λ 1 = 0.2 9 , x 1 = [ 1. 00, 0.7 9 ,–0.91] T , λ 2 = 3 .16 , x 2 = [1. 00,-0.5 1, 0.6 5] T , λ 3 = 7 .54, x 1 = [-0. 0 3, 1. 00, 0.84] T . Function JORD AN F uncti on JORD AN is intended to pr oduce the diagonali z ation or Jor d an-cy c le decompositi on of a matr i x. In RPN mode , giv en a sq uar e matri x A , func tion JORD AN pr oduce s four ou tputs, namel y : • T he minimum poly nomi al of matr i x A (stac k le v el 4) • The c har act eris tic pol y nomial o f matri x A (stac k lev el 3) Not e : A s ymmetr ic matr ix pr oduces all r eal ei gen value s, and its e i gen vect ors ar e mutuall y perpendi c ular . F or the ex ample ju st w ork ed out , yo u can chec k that x 1 • x 2 = 0, x 1 • x 3 = 0, and x 2 • x 3 = 0.
P age 11-48 • A list w ith the e igen v ecto rs cor r espo nding to eac h ei gen value o f matri x A (stac k lev el 2) • A v ector w ith the eige nv ector s of matr i x A (st ack lev el 4) F or ex ample , try this ex erc ise in RPN mode: [[4,1,-2], [1,2,-1],[-2 ,-1,0]] JORD N T he output is the f ollo w ing: 4: ‘X^3 -6*x^2 2*X 8’ 3: ‘X^3 -6*x^2 2*X 8’ 2: { } 1: { } T he same e xer c ise , in AL G mode , looks as in the f ollo w ing sc r een shots: Function MAD T his functi on, although not a v ailable in the EIGEN me nu , also pr o v ides inf ormatio n r elated to the ei gen values o f a matri x. F u nc tion MAD is a vailable thr ough the MA TRICE S OP ER A TIONS su b-menu ( „Ø ) and is intended to pr oduce the adj oint matr ix o f a matri x. In RPN mode , functi on MAD gener ates a number of pr opertie s of a squar e matr i x, namel y : • the deter minant (stack le ve l 4) • the fo rmal inv ers e (stack le v el 3) , • in stac k le v el 2 , the matri x coeffi c i ents of the poly nomi al p( x ) def i ned by ( x ⋅I - A ) ⋅ p( x )= m( x) ⋅ I, • the char acter isti c pol yno mial of the matr ix (s tac k lev el 1)
P age 11-4 9 Notice that the equati on ( x ⋅I -A ) ⋅ p(x )=m (x ) ⋅I is simi lar , in f orm , t o the ei gen value equati on A ⋅x = λ⋅ x . As an e x ample , in RPN mode , try: [[4,1,-2] [ 1,2,-1][-2,- 1,0]] M D T he r esult is: 4: -8. 3: [[ 0.13 –0.2 5 –0.3 8][-0.25 0. 50 –0.2 5][-0.3 8 –0.2 5 –0.88]] 2: {[[1 0 0][0 1 0][0 0 1]] [[ - 2 1 –2][1 –4 –1][- 2 –1 –6] [[-1 2 3][2 –4 2][3 2 7]]} 1: ‘X^3 -6*x^2 2*X 8’ T he same e x er c ise , in AL G mode , w ill look as f ollo ws: M atr ix f ac t ori zation Matr i x fac tor i z ation or decompo sition consists o f obtaining matr ices that when multiplied r esult in a gi ven matr ix . W e pr esent matr i x decomposition through the use o f F uncti ons cont ained in the matr i x F A CT menu . This menu is acces sed thr ough „Ø . F uncti on contained in this menu ar e: LQ, L U , QR ,S CHUR, S VD , S VL .
P age 11-50 Function L U F uncti on L U tak es as input a s quar e matr ix A , and r eturns a lo wer - tr iangular matr i x L , an upper tr i angular matri x U , and a p e rmut ation matr i x P , in s tack le vels 3, 2 , and 1, re specti v el y . The r esult s L , U , and P , satisfy the equati on P ⋅A = L ⋅U . When y ou call the L U f unc tion , the calc ulator perf orms a Cr out L U dec omposition of A u sing par ti al pi voting . F or ex ample, in RPN mode: [[ -1,2,5][3,1, -2][7,6,5]] L U pr oduces: 3:[[7 0 0][-1 2 .8 6 0][3 –1.5 7 –1 ] 2 : [[1 0.86 0.71][0 1 2][0 0 1]] 1: [[0 0 1][1 0 0][0 1 0]] In AL G mode , the same ex er c ise w ill be sho w n as follo w s: Or thogonal matrices and singular v alue decomposition A squar e matr i x is said to be orth ogonal if its columns r epr esent unit vectors that ar e mutuall y orthogonal . Th us , if w e let matr i x U = [ v 1 v 2 … v n ] w here the v i , i = 1, 2 , …, n , ar e co lumn vec tors , an d if v i • v j = δ ij , whe re δ ij is the K r oneck er’s delta f unction , the n U w ill be an orthogonal matr ix . T his conditions als o impl y that U ⋅ U T = I . The Singular V alue Decompositi on (S VD) of a r ect angular matr ix A m × n consists in dete rmin ing the matr ic es U , S , and V , suc h that A m × n = U m × m ⋅ S m × n ⋅ V T n × n , wher e U and V ar e or thogonal matr i ces, and S is a diagonal matr ix . T he diagonal eleme nts of S ar e called the singular values of A and ar e usuall y or der ed so that s i ≥ s i 1 , f or i = 1, 2 , … , n - 1 . The columns [ u j ] of U and [ v j ] of V ar e the cor r espo nding singular v e c tors . Function S VD In RPN, f unction S VD (Singular V alue D ecompo sition) tak es as input a matri x A n ×m , and r eturns the matr ices U n ×n , V m ×m , and a v ector s in st ack le v els 3, 2 , and 1, r especti vel y . The dimension of v ecto r s is eq ual to the minimum of the value s n and m. The matr i ces U and V ar e as def ined earli er f or singular v alue
P age 11-51 decompositi on, w hile the v ector s r epr esents the main diagonal of the matr i x S used earli er . F or ex ample, in RPN mode: [[ 5,4,-1],[2,- 3,5],[7,2,8] ] SVD 3: [[-0.2 7 0.81 –0. 5 3][-0. 3 7 –0. 5 9 –0.7 2][-0.8 9 3 . 09E -3 0.46]] 2 : [[ -0.68 –0.14 –0.7 2][ 0.4 2 0.7 3 –0. 54][-0.6 0 0.6 7 0.4 4]] 1: [ 12 .15 6 .88 1.4 2] Function S VL F uncti on S VL (Singular V aL ues) r eturns the singular values o f a matr i x A n ×m as a vec tor s who se dimension is eq ual to the minimum of the v alues n and m . F or e x ample , in RPN mode , [[5,4,-1 ],[2,-3,5],[ 7,2,8]] SVL pr oduces [ 12 .15 6.8 8 1.4 2]. Function SCHUR In RPN mode , functi on S CHUR pr oduces the Sch ur de compositi on of a squar e matr i x A r etur ning matri ces Q and T , in stack le vels 2 and 1, r espec ti vel y , suc h that A = Q ⋅T ⋅Q T , whe re Q is an orthogonal matri x, and T is a tri angular matr i x. F or ex ample, in RPN mode , [[2,3,-1] [5,4,-2][7,5 ,4]] SCHUR re su l t s in : 2 : [[0.66 –0.2 9 –0.7 0][-0.7 3 –0.01 –0.6 8][ -0.19 –0.9 6 0.21]] 1: [[-1. 03 1. 0 2 3 .8 6 ][ 0 5 . 5 2 8.2 3 ][ 0 –1.8 2 5 . 5 2]] Function LQ T he LQ functi on pr oduces the LQ fact ori zat ion of a matri x A n ×m r etur ning a lo w er L n ×m tr apez oidal matr i x, a Q m ×m orthogonal matri x , and a P n ×n permu tation matr i x , in stac k lev els 3, 2 , and 1. The matr ices A , L , Q and P ar e r elated b y P ⋅A = L ⋅Q . (A tr apez o idal matr i x out of an n × m matri x is the equi v alent of a tri angular matr i x out o f an n × n matr i x) . F or ex ample, [[ 1, -2, 1][ 2, 1, -2][ 5, -2, 1]] LQ pr oduce s 3: [[-5 .48 0 0] [-1.10 –2 .7 9 0][-1.8 3 1.4 3 0.7 8]] 2: [[-0.91 0. 3 7 -0.18] [-0.3 6 -0.5 0 0. 7 9] [-0. 20 -0.7 8 -0. 5 9]] 1: [[0 0 1][0 1 0][1 0 0]]
Pa g e 1 1 - 52 Function QR In RPN, f unction QR produces the QR fa ctoriz a tio n of a ma tr ix A n ×m r etur ning a Q n ×n orthogonal matri x , a R n ×m upper tr apez oi dal matr i x, and a P m ×m permu tation matr i x, in stac k le vels 3, 2 , and 1. The matr ices A , P , Q and R ar e re la t ed by A ⋅P = Q ⋅R . F or e x ample , [[ 1,-2,1] [ 2,1,-2][ 5,- 2,1]] QR pr oduce s 3: [[-0.18 0.3 9 0. 9 0][-0. 3 7 –0.88 0. 30][-0.91 0.2 8 –0. 30]] 2 : [[ -5 .48 –0. 3 7 1.8 3][ 0 2 .4 2 –2 .20][0 0 –0.9 0]] 1: [[1 0 0][0 0 1][0 1 0]] M atr ix Quadr atic F orms A q uadrati c f orm fr om a squar e matr ix A is a pol y nomial e xpr essi on or iginated fr om x ⋅A ⋅x T . F or ex ample , if w e use A = [[2 ,1,–1][5, 4,2][3,5,–1]], and x = [X Y Z] T , the corr esponding quadr a ti c fo rm is calc ulated as F i nall y , x ⋅A ⋅x T = 2X 2 4Y 2 -Z 2 6XY 2XZ 7ZY T he QUADF menu T he calculat or pr ov ides the QU AD F men u for oper atio ns r elated to QU ADrati c F orms . The QU AD F men u is accesse d thr ough „Ø . Note : Ex amples and def initions f or all f uncti ons in this menu ar e av ailable thr ough the help f ac ility in the calculat or . T r y thes e ex er c ises in AL G mode to see the r esults in that mode . [] ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ ⋅ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − ⋅ = ⋅ ⋅ Z Y X Z Y X T 1 5 3 2 4 5 1 1 2 x A x [] ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − ⋅ = Z Y X Z Y X Z Y X Z Y X 5 3 2 4 5 2
Pa g e 1 1 - 5 3 T his menu includes f uncti ons AXQ, CHOLE SKY , G A US S , QX A, and S YL VE S TER. Function AX Q In RPN mode , f unction AXQ pr oduces the quadr ati c f orm cor r esponding to a matr i x A n ×n in stac k le ve l 2 using the n var iable s in a vec tor placed in stac k le vel 1. F uncti on r eturns the quadr atic f orm in stac k le ve l 1 and the vec tor of var iables in st ack le ve l 1. F or e xample , [[2,1,-1] ,[5,4,2],[3, 5,-1]] ` ['X','Y',' Z'] ` XQ re t ur ns 2 : ‘2*X^2 (6*Y 2 *Z)*X 4*Y^2 7*Z*y-Z^2’ 1: [‘X’ ‘Y ’ ‘Z’] Function QX A F uncti on QX A tak es as ar guments a quadr atic f orm in s tack le vel 2 and a v ector of v ar iables in s tac k lev el 1, r etur ning the squar e matri x A fr om w h ic h t he quadr atic f orm is der iv ed in st ack le v el 2 , and the list o f var i ables in st ack le v el 1. F or e x ample , 'X^2 Y^2-Z ^2 4*X*Y-16* X*Z' ` ['X','Y', 'Z'] ` QX re t ur ns 2 : [[1 2 –8][2 1 0][-8 0 –1]] 1: [‘X’ ‘Y ’ ‘Z’] Diagonal repr esentation of a quadratic for m Gi v en a s y mmetr ic s quar e matr i x A , it is possible to “ diagonali z e ” the matri x A b y finding an orthogonal matr i x P such that P T ⋅ A⋅ P = D , wher e D is a d i agonal matr i x. If Q = x ⋅A ⋅x T is a quadr atic f orm ba sed on A , it is pos sib le to wr ite the quadr atic f or m Q so that it only contains s quar e ter ms fr om a v ari able y ,
P age 11-54 suc h that x = P ⋅y , b y using Q = x ⋅A ⋅ x T = ( P ⋅y ) ⋅A ⋅ (P ⋅y ) T = y ⋅ (P T ⋅ A⋅ P )⋅ y T = y ⋅D ⋅y T . Function S YL VE STER F uncti on S YL V E S TER tak es as ar gument a s y mmetr ic s quar e matr ix A and r eturns a v ector cont aining the diagonal te rms of a diagonal matr i x D , and a matri x P , so that P T ⋅ A⋅ P = D . F or ex ample: [[2,1,-1], [1,4,2],[-1, 2,-1]] SYLVES TER pr oduce s 2 : [ 1/2 2/ 7 - 2 3/ 7] 1: [[2 1 –1][0 7/2 5/2][0 0 1]] Function G A US S F uncti on G A US S r eturns the di agonal r epre sent ation of a qu adrati c fo rm Q = x ⋅A ⋅x T taking as ar guments the quadrati c for m in stac k le ve l 2 and the vect or of v ari ables in st ack le v el 1. The r esult of this f unction call is the f ollo w ing: • An arr ay of coeff ic ie nts r epre senting the di agonal ter ms of D (stack le vel 4) • A matr i x P such that A = P T ⋅ D⋅ P (stack lev el 3) • The di agonali z ed quadr atic f orm (s tac k lev el 2) • T he list of v ar ia bles (st ack lev el 1) F or ex ample: 'X^2 Y^2-Z ^2 4*X*Y-16*X *Z' ` ['X','Y',' Z'] ` GU S S re t ur ns 4: [1 –0.3 3 3 20.3 3 3] 3: [[1 2 –8][0 –3 1 6][0 0 1]] 2 : ’61/3*Z^2 -1/3*(16*Z -3*Y)^2 (-8*z 2*Y X)^2‘ 1: [‘X’ ‘Y ’ ‘Z’] Linear Applications T he LINEAR APP LICA T IONS menu is a vailable thr ough the „Ø .
Pa g e 1 1 - 5 5 Inf ormati on on the func tions list ed in this menu is pr esen ted belo w b y using the calc ulator ’s o w n help fac ility . The f igur es sho w the he lp fac ility entry and the attached e xamples . Function IMAGE Function ISOM
P age 11-5 6 Function KER Function MKISOM
Pa g e 1 2 - 1 Chapter 12 Gr a phi cs In this c hapter w e intr oduce some o f the gr aphic s capabiliti es of the calculat or . W e w ill pr esent gr aphics of f uncti ons in Cartesian coor dinates and polar coor dinates , par ametr ic plots , gr aphic s of coni cs , bar plots, scatter plots , and a v ari ety of thr ee -dimensi onal gr aphs . Graphs options in the calc ulator T o acces s the list of gra phic f or mats av ailable in the calc ulator , use the k ey str oke sequen ce „ô ( D ) Plea se notice that if y ou ar e using the RPN mode these two k ey s must be pr esse d simultaneo usly to acti vate an y of th e gr aph func tions . Afte r acti vating the 2D/3D f uncti on , the calculator w ill produce the P LOT S E T U P w indo w , w hic h inc ludes the TYP E fi eld as illustr ated belo w . R ight in f r ont of the TYP E fi eld y ou w ill, mo st lik el y , see the opti on Fu n c t io n highli ghted. T his is the def ault type of gr aph f or the calculator . T o see the lis t of a vaila ble gr aph t y pes, pr ess the s oft menu k e y labeled @CHOO S . This w ill pr oduce a dr op do wn men u w ith the fo llow ing options (us e the up- and do w n - arr o w k e ys to see all the options):
Pa g e 1 2 - 2 T hese gr aph opti ons ar e desc ri bed bri ef ly ne xt . Fu n c ti o n : f or equations o f the for m y = f(x) in plane Cartesi an coordinates P olar : for equati ons of the fr om r = f( θ ) in polar coor dinates in the plane Pa r a m e t r i c : for plotting equati ons of the fo rm x = x(t) , y = y(t) in the plane Diff E q : f or plotting the numer ical so lution of a linear differ ential eq uation Con ic : fo r plotting conic equations (c ir c les, ellipse s, h yper bolas, par abolas) T ruth : f or plotting inequalities in the plane His togr am : fo r plotting fr equenc y histogr ams (st atistical a pplicati ons) Bar : fo r plot ting simple bar c harts Scat ter : f or plotting scatter plots of disc r ete data sets (s tatisti cal applicati ons) Slopef ield : f or plotting tr aces of the slopes of a f unction f(x ,y) = 0. Fa st 3 D : f or plotting curv ed surfaces in space Wi r efra m e : for plotting c urved surface s in space show ing wir efr ame gr ids Ps - C o n t o u r : for plotting con tour plots of surface s Y- S l i c e : for plotting a slic ing v ie w of a func tion f(x ,y) . Gr idm ap : f or plotting real and imaginary par t tr aces o f a comple x functi on Pr - Surface : f or par ametr ic surf aces gi v en b y x = x(u ,v) , y = y(u ,v) , z = z(u ,v). P lot ting an e xpres sion of the for m y = f(x) In this secti on w e pr esent an e xample of a plot o f a functi on of the f or m y = f(x) . In or der to pr oceed w i th the plot , f irst , purge the v ar iable x, if it is def ined in the c urr en t direc tory (x w ill be the indepe ndent var iable in the calc ulator's PL O T featur e, the re fo r e , y ou don't want t o hav e it pr e -def ined) . Cr eate a sub- dir ectory called 'TPL O T' (for te st plot) , or other meaningf ul name, to pe rform the fo llo w ing ex erc ise . As an e xample , let's plot the f uncti on, Θ F irst , ente r the PL O T SETUP env ironment by pressing, „ô . Mak e sur e that the option F uncti on is selec ted as the TYP E , and that ‘X’ is selected as the independent v ari able (INDEP) . Pr ess L @@@OK@@@ to r eturn to nor mal calc ulator displa y . T he PL O T SET UP w indow should look similar to this: ) 2 exp( 2 1 ) ( 2 x x f − = π
Pa g e 1 2 - 3 Θ Ente r the PL O T en v ir onment b y pr es sing „ñ (pr ess them simultaneou sly if in RPN mode). Pr ess @ADD to get y ou into the equati on w riter . Y ou will be pr ompted to fill the r ight-hand side of an equati on Y1(x) =  . T ype the f unction t o be plotted so that the E quatio n W rit er sho ws the follo wing: Θ Press ` to ret urn t o th e PL OT - F UNC TION wind o w . The ex pression ‘ Y1(X) = EXP(-X^2/2) / √ (2 *π )’ wi ll be highlighted . Pr ess L @@@OK@@@ to r eturn to nor mal calc ulator displa y . Θ Not e : Y ou w ill no tice that a ne w var iable , called PP AR , sho w s up in y our soft men u k e y labels . This s tands fo r P lot P ARamet ers . T o see its contents , press ‚ @PPAR . A detailed explanati on of the conte nts of PP AR is pr o v ided later in this Chapter . Pres s ƒ to dr op this line f r om the stac k . Note : T wo ne w var ia bles sho w up in y our so ft menu k e y labels , namel y EQ and Y1. T o see the contents of E Q, us e ‚ @@@EQ@@ . T he content of E Q is simply the f uncti on name ‘Y1(X)’ . The v ar iable E Q is used b y the calculator to s tor e the equati on, or equatio ns, to plo t . T o see the contents o f Y1 pre ss ‚ @@@Y1@@ . Y ou w ill get the fu nction Y1(X) def ined as the pr ogram:
Pa g e 1 2 - 4 Θ Enter the P L O T WINDOW e nv ironme nt by ent er ing „ò (pr ess them simultaneousl y if in RPN mode). Us e a range of –4 to 4 f or H- VI EW , then press @AUT O to generate the V - VI EW automaticall y . The PL O T WINDO W sc r een looks as f ollo ws: Θ Pl ot t he g rap h : @ER ASE @DRAW ( wait till the calc ulator f inishes the gr aphs) Θ T o see labe ls: @EDIT L @LABEL @MENU Θ T o r eco v er the f irst gr aphics menu: LL @) PICT Θ T o trace the c ur v e: @TRACE @@X,Y@@ . T hen u se the r ight- and left -ar r o w k e y s ( š™ ) to mo ve abou t the curv e . The coor dinates o f the points y ou tr ace w ill be sho wn at the bottom of the sc r een . Check that f or x = 1. 0 5 , y = 0.2 31. Also , chec k that f or x = -1.4 8 , y = 0.13 4. Her e is pi ctur e of the gr aph in tr ac ing mode: Θ T o r eco v er the menu , and r eturn t o the PL O T WINDO W en vir onment , pr ess L @CAN CL@ . << → X ‘ EXP(-X^2/2)/ √(2* π) ‘ >>. Press ƒ , t w ice , to dr op the contents of the s tack .
Pa g e 1 2 - 5 Some useful PL O T operations f or FUNCTION plots In or der to disc u ss these P L O T options , w e'll modif y the func tion to f or ce it to hav e some r eal r oots (Since the cur r ent curve is totall y contained abov e the x ax is, it has no r e al r oots.) Pr ess ‚ @@@Y1 @@ to lis t the contents of the functi on Y1 on the stac k: << → X ‘EXP( -X^2/2)/ √ (2 * π) ‘ >>. T o edit this expr essi on use: ˜ L aunc hes the line edito r ‚˜ M o ves c ursor to the e nd of th e line ššš-0.1 Modif ie s the e xpre ssio n ` Retur ns to calc ulator displa y Ne xt , stor e the modifi ed ex pr essi on into v ar iable y b y using „ @@@Y1@@ if in RPN mode , or „îK @ @@Y1@@ in AL G mode . T he func tion t o be plotted is no w , Enter the P L O T WINDO W en v ir onment b y ente ring „ò (pr ess them simultaneou sly if in RPN mode .) K eep the r ange o f –4 to 4 fo r H- VIEW , pre ss ˜ @AUTO to ge nerate the V - VIEW . T o plot the gr aph , pre ss @ERASE @DRA W Θ Once the gr aph is plot t ed, pr ess @) @FCN! to access the fu nct ion men u . W ith this menu yo u can obtain additional inf ormati on about the plot such as intersects w ith the x -axis, roots , slo pes of the tangent line, ar ea under the c ur v e , et c. Θ F or e xample , to fi nd the root on the le ft side of the c urve , mov e the c ursor near that point , and pre ss @ROOT . Y ou w ill get the r esult: ROO T : - 1.6 6 3 5…. P r ess L to r e co ver the menu . H er e is the re sult of R OO T in the c urr ent plot: Θ If y ou mo v e the c urs or to war ds the r ight-hand side of the c ur v e , b y pr essing the r ight-arr o w k e y ( ™ ) , and pre ss @ROOT , the r esult no w is 1 . 0 ) 2 exp( 2 1 ) ( 2 − − = x x f π
Pa g e 1 2 - 6 R OO T : 1.66 3 5 ... The calc ulator indicated , bef or e sho w ing the r oot , that it w as found thr ough SIGN REVER S A L . Press L to r eco ve r the menu . Θ Pr es sing @ISE CT w ill gi ve y ou the int ersecti on of the c urve w ith the x -ax is, w hic h is esse ntiall y the roo t . Place the c urs or e xac tly at the r oot and press @ISECT . Y ou w ill get the same mess age as bef or e , namel y SI GN REVER S AL , be for e get ting the r esult I-SE CT : 1.66 3 5…. The @ISECT functi on is intended to determine the in tersection of an y t w o curves closest to the location of the c u r sor . In this case , wher e onl y one c ur v e , namel y , Y1(X) , is inv ol ved , the intersec tion sought is that o f f(x) w ith the x -ax is, ho w e ver , y ou must place the c urs or r ight at the r oot to pr oduce the same r esult . Pr es s L to r eco ver the menu . Θ P lace the c ursor on the c urve at an y point and pr es s @S LOPE to get the v alue of the slope at that point . F or e x ample , at the negati ve r oot, SL OP E: 0.16 6 7 0…. Pr ess L to r e co v er the menu . Θ T o deter mine the highest po int in the c ur v e, place the c ursor near the v erte x and pr es s @EXTR The r esult is E XTRM: 0.. Pr ess L to r ecov er the men u . Θ Other buttons a vaila ble in the fir st menu ar e @ AREA to calc ulate the ar ea under the c ur v e , and @SHADE to shade an ar ea under the c urve . Pre ss L to see mor e optio ns. T he second menu include s one button called @VIEW that f lashes fo r a fe w seconds the equation plotted . Pr ess @VIEW . Alt ernati vel y , y ou can pr ess the butt on @NEX Q (NE Xt eQuation) to s ee the name of the f unction Y1(x). Pre ss L to r ecov er the menu . Θ T he button giv es the v alue of f(x) corr esponding to the c ursor positi on. P lace the cur sor an yw her e in the curve and pr ess . The v alue wil l be sho wn in the lo wer le ft corner of the displ ay . P r ess L to r ecov er the menu . Θ P lace the c ursor in an y giv en po int of the tr aject or y and pr ess T A NL t o obtain the equation of the tangent line t o the curve at that po int . The equatio n w ill be displa yed on the lo w er left corner o f the display . Pr ess L to r ecov er the menu . Θ If y ou pr ess the calc ulator w ill plot the der iv ati v e func tio n, f'(x) = df/dx , as w ell as the or iginal functi on , f(x) . Noti ce that the two c ur v es inte rcept at tw o points . Mo ve the c urs or near the left inter cept point and pr ess @) @ FCN! @ISECT , to get I-SE CT : (-0.6 8 34…, 0.215 8 5). Pr ess L to r ecov er the menu . Θ T o leav e the FCN env iro nment , pr ess @) PICT (o r L ) P ICT ). Θ Pr es s @CANCL to re t ur n to t h e PL OT WI N D OW e nvi ro nm e n t. T he n, p re ss L @@@OK@@@ to r eturn t o normal calc ulator display .
Pa g e 1 2 - 7 Θ Enter the PL O T env ironment b y pres sing, simultaneousl y if in RPN mode , „ñ . Noti ce that the highli ghted fi eld in the PL O T en vir onment no w contain s the der i vati ve of Y1(X) . Pr ess L @@@OK@@@ to r etu rn to r eturn to nor mal calculat or displa y . Θ Press ‚ @@EQ@@ to chec k the contents of E Q. Y ou w ill notice that it cont ains a list instead o f a single e xpr essi on . The list ha s as elements an e xpr essi on f or the der i vati ve of Y1(X) and Y1(X) its elf . Or iginall y , E Q contained onl y Y1(x) . After w e pr essed in the @) FCN@ en vi r onment , the calculat or automati cally added the der i v ati ve of Y1(x) to the list of equations in E Q. Sav ing a graph f or future use If you w ant to sav e your gr aph to a var iable, get into the PICTUR E en v iro nm ent by pre ss in g š . T hen, pr ess @EDIT LL @P ICT  . This captur es the c urr ent pi ctur e into a gr aphics objec t . T o r eturn t o the stac k , pr ess @) PICT @CANCL . In le ve l 1 of the s tack y ou w ill see a gr aphi cs ob ject de sc r ibed as Graphic 131 × 64 . This can be stor ed into a var iable name , sa y , PIC1. T o displa y y our fi gur e again , recall the conte nts of var iable P IC1 to the stac k. T he stac k wil l sho w the line: Graphic 131 × 64 . T o see the graph , enter the PICTURE en v ir onment , by pr essing š . Clear the c urr ent pi ctur e, @ EDIT L @ERASE . Mo ve the c ur sor to the upper le ft corner of the dis play , by u sing the š an d — ke y s. T o displa y the fi gur e c urr entl y in le vel 1 of the stac k pr ess L REP L . Not e : the stac k w ill sho w all the gra ph oper ations perf ormed , pr oper l y identi f ied.
Pa g e 1 2 - 8 T o r etur n to nor mal calc ulator f uncti on , pr ess @) PICT @CANCL . Graphics of tr anscendental functions In this secti on w e us e some of the gr aphics f eatur es of the calc ulator to sho w the typi cal beha vi or of the natur al log, e xponential , tri gonometr ic and h yper bolic func tions . Y ou w ill not see mor e gr aphs in this chapt er , instead the user sho uld see them in the calc ulator . Graph of ln(X) Pr ess , simultaneousl y if in RPN mode , the left-shift ke y „ and the ô (D ) k e y to produce the P L O T SETUP w indow . The f ield labeled Type w ill be highl ighted . If the opti on Function is not alr eady se lected pr ess the so ft ke y labeled @CHOOS , use the up and do wn k ey s to se lect Function , and pre ss @@@OK@@@ to complet e the selecti on . Check that the f iel d labeled Indep: contains the v ari able ‘X’ . I f that is not so , pr ess the do w n arr o w ke y tw ice until the Indep f ield is highlight ed, pr ess the soft k e y labeled @EDIT and modify the value o f the independent v ari able to r ead ‘X’ . Pr ess @@@OK@@@ when done . Pr ess L @@@OK@@@ to r eturn to normal calc ulator displa y . Ne xt, w e’ll r esiz e the plot w indo w . F i r st , pr ess , simultaneou sly if in RPN mode , the left-shift ke y „ and the ñ (A ) k e y to pr oduce the P L O T -FUNCTION w indo w . If there is an y equation hi ghlighted in this windo w , pr ess @@DEL@@ as needed to c lear the windo w c o mpletely . When the PL O T -FUNCTION w indo w is empty yo u wi ll get a prompt me ssage that r eads: No Equ., Press ADD . Pr ess the s oft k e y labeled @@ADD@ ! . T his w ill tri gger the equatio n wr iter w ith the e xpr es sion Y1(X)=  . T ype LN(X) . Pr ess ` to r eturn to the PL O T-FUNCTION w indo w . Pr ess L @@@OK@@@ to r eturn to nor mal calculat or display . T he next s tep is to pr ess , simultaneousl y if in RPN mode , the left-shif t k ey „ and the ò (B ) k ey to pr oduce the PL O T WINDO W - FUNCTION windo w . Mos t lik el y , the displa y will sho w the hor i z ontal (H- Vi e w) and v ertic al ( V-View ) r anges as: H- Vi ew : -6 .5 6 . 5, V- Vie w : -3.9 4. 0 T hese ar e the defa ult v alues f or the x - and y-range , r espec tiv el y , of the c urr ent gr aphi cs displa y w indo w . Next , change the H- V ie w v alues to r ead: H - V i e w : - 1 Note : T o sa v e printing s pace, w e will not inc lude mor e gra phs pr oduced by f ollow ing the instructi ons in this Chapter . The user is inv i ted to pr oduce those gr aphics on his or her o wn .
Pa g e 1 2 - 9 10 by u si n g 1\ @@@OK@@ 10 @@@OK@@@ . Ne xt , pr ess the s oft k e y labeled @AUTO to let the calc ulator det ermine the cor r esponding v ertical r ange . After a cou ple of seconds this r ange w ill be sho wn in the P L O T WINDOW -FUNCTION w indo w . At this po int w e ar e r eady to pr oduce the graph of ln(X) . Pre ss @ERASE @DRAW to plot the natur al logarithm f uncti on. T o add labels to the gr aph pr ess @EDI T L @)LABEL . Pr ess @MENU to r emo ve the menu labels , and get a f ull v ie w of the gr aph . Pr ess L to r ecov er the cur r ent gr aphi c menu . Pr ess L @) PICT to r ecov er the or iginal graphi cal menu . T o deter mine the coor dinates o f points on the curv e pr es s @TRA CE (the c ursor mo ve s on top of the c urve at a po int located near the center o f the hori z ontal r ange) . Next , pres s (X,Y) to see the coordinates o f the cur r ent cur sor location . T hese coor dinate s w ill be show n at the bottom o f the sc r een. U se the r ight- and left-arr o w k e y s to mo v e the c ursor along the c ur v e . As y ou mo v e the c urs or along the c urve the coor dinates o f the cu r v e ar e displa y ed at the bottom of the scr een. Check that when Y :1.00E0, X:2 . 7 2E0. This is the point ( e, 1 ), si nc e ln(e) = 1 . Pr ess L to reco ver the gr aphics menu . Ne xt , we w ill find the inte rsec tion o f the curve w ith the x -ax is by pr essing @) FCN @ROOT . T he calculat or r eturns the v alue Root: 1 , conf ir ming that ln(1) = 0 . Pr ess LL @) PICT @CANCL to r eturn to the P L O T WINDO W – FUNCT ION. Pr ess ` to r etur n to nor mal calculat or displa y . Y ou w ill notice that the r oot found in the gr aphi cs env iro nment wa s copied t o the calculator s tac k. Not e : When y ou pr es s J , y our var iables list w ill sho w new v ari ables called @@@X@@ and @@Y1@ @ .Pr ess ‚ @@ Y1@@ to see the contents of this var iable . Y ou w ill get the pr ogr am << → X ‘LN(X)’ >> , whi ch y ou w ill re cogni z e as the pr ogr am that ma y r esult fr om def ining the functi on ‘Y1(X) = LN( X)’ by us ing „à . T his is basicall y what happens w hen y ou @@ADD@! a func tion in the P L O T – FUNCTION w indow (the w indo w that re sults fr om pr essing  ñ , simult aneousl y if in RPN mode) , i . e ., the func tion gets def i ned and added to y our v ari able list .
Pa g e 1 2 - 1 0 Graph of the e xponential function F irst , load the f uncti on e xp(X) , b y pr essing , simultaneous ly if in RPN mode , the left-shif t k e y „ and the ñ ( V ) ke y to access the P L O T-FUNCT ION w indo w . Pres s @@DEL@ @ to r emo v e the func tion LN(X), if y ou didn ’t delete Y1 a s suggest ed in the pre vi ous n ote . Pr ess @@ADD@! and type „¸~x` to enter EXP(X) and r etur n to the P L O T -FUNCTION w indo w . Pr ess L @@@OK @@@ to r eturn to normal calc ulator displa y . Ne xt, pr ess, simultaneously if in RPN mode , the left -shift k e y „ and the ò (B ) k ey t o pr oduce the P L O T WINDO W - FUNCTION w indow . Change the H- Vi e w values to r ead: H- Vie w: -8 2 by us in g 8\ @@@ OK @@ @ 2 @@@OK@@@ . Ne xt, pr ess @AUTO . After the vertical r ange is calc ulated , pre ss @E RASE @DRAW to plot the ex ponential f uncti on . T o add labels t o the gr aph pr es s @EDIT L @) LABEL . Pr es s @ M E N U to r em o ve the menu labels , and get a full v i ew o f the gra ph. Pr ess LL @) PICT! @CANCL to r eturn to the PL O T WINDO W – FUNCT ION. Pr ess ` to r eturn to normal calc ulat or dis pla y . Ne xt , pr ess ‚ @@@X@@@ to see the co ntents of this vari abl e . A v alu e of 10.2 7 5 is placed in the stac k . This v alue is det ermined b y our selec tion f or the hori z ontal displa y range . W e select ed a range betw een -1 and 10 for X. T o produce the gr aph, the calc ulator gener ates value s bet w een the r ange limits using a constant inc r ement , and s tor ing the value s generat ed, one at a time , in the va ria b le @@@X@@@ as the gr aph is dra w n. F or the hori z ontal range ( –1,10) , the inc rement u sed seems to be 0.2 7 5 . When the v alue of X becomes lar ger than the max imum v alue in the r ange (in this case , when X = 10.2 7 5) , the dr aw ing of the gr aph stops . T he last v alue of X f or the gr aphi c under consider ation is k ept in var iable X. Delete X and Y1 bef or e continuing .
Pa g e 1 2 - 1 1 T he PP AR var iable Press J to reco v er y our var iable s menu , if needed. In y our var iables menu y ou should ha v e a v ar iable labe led PP AR . Pr ess ‚ @PPAR to get the contents of this v ariable in the stac k . Pres s the do wn-arr o w k ey , , to launc h the stack editor , and u se the up- and do w n -ar r o w ke ys t o vi e w the full contents of P P AR. Th e sc re en wi l l s h ow th e fo ll owi n g va l ue s : PP AR stands f or Pl ot P A Ra m e te rs , and its contents inc lude two or dered pair s of re a l nu m b er s, (-8.,-1.10 79726 328 1 ) a n d ( 2. ,7 . 3 8 9 0 56 0 98 93 ) , w hich r epre sent the coor dinates of the lo w er left cor ner and the upper r ight cor ner o f the plot , r especti v ely . Next , PP AR lists the name o f the independent va riab le , X, fo llo w ed by a number that spec ifi es the inc r ement of the independent v ar iable in the gener ation of the plot . The v alue sho wn he re is the def ault value , z ero (0.), whi ch s pec ifi es incr ements in X corr esponding t o 1 pi x el in the gr aphic s display . The ne xt element in PP AR is a lis t cont aining fi rst the coor dinates o f the point o f inters ection o f the plot ax es , i .e ., (0., 0.) , f ollo w ed b y a list that s pec ifi es the tic k mar k annotati on on the x - and y-ax es, r especti vel y {# 10d # 10d}. Ne xt , P P AR li sts the ty pe of plot that is to b e gene r ated, i .e ., FUNCT ION, and , finall y , the y-axis label , i.e ., Y . T he var i able P P AR , if non -e xis tent , is generat ed ev ery time y ou cr eate a plot . T he contents of the func tion w ill change depending on the type of plot and on the options that y ou select in the PL O T w indow (the w indow ge ner ated b y the simultaneou s acti v ation of the „ and ò (B ) k ey s. In verse functions and th eir gr aphs Let y = f(x) , if we can f ind a f unction y = g(x) , suc h that , g(f(x)) = x , then w e sa y that g(x) is the inv ers e functi on of f(x) . T y picall y , the notati on g(x) = f -1 (x) is used to denote an in vers e f un c tion. Using this n otation we can w rite: if y = f(x) , then x = f -1 (y) . Als o, f(f -1 (x)) = x , and f -1 (f(x)) = x .
Pa g e 1 2 - 1 2 As indicated ear lier , the ln(x) and exp(x) f uncti ons ar e in v erse o f each othe r , i .e ., ln(e xp(x)) = x , and e xp(ln(x)) = x. T his can be v er if ied in the calc ulator b y typing and e v aluating the follo wi ng expr essi ons in the Eq uation W rit er: LN(EXP(X)) and EXP(LN( X)) . T he y should both ev aluate to X. When a func tion f(x) and its in v ers e f -1 (x) ar e plotted simultaneou sly in the same set of axes , their gr aphs ar e r eflec tions o f each other a bout the line y = x . Let ’s chec k this fac t w ith the calculat or fo r the functi ons LN(X) and EXP(X) b y fo llo w ing this pr ocedure: Pr ess , simult aneousl y if in RPN mode , „ñ . T he f uncti on Y1(X) = EXP(X) should be a vailable in the P L O T - FUNCT ION w indo w fr om the pr ev iou s e xer cis e. Pr ess @@ADD@! , and type the func tion Y2( X) = LN(X) . Also , load the func tion Y3(X) = X. Pr ess L @@@OK@@@ to re turn to nor mal calculat or display . Pr es s, simu ltaneousl y if in RPN mode , „ò , and c hange the H- V ie w range to r ead: H- V ie w: -8 8 Press @AUTO t o g e n e r a t e t h e v e r t i c a l r a n g e . P r e s s @ERASE @DRAW to pr oduce the gr aph of y = ln(x), y = exp(x), and y =x , sim ultaneou sly if in RPN mode . Y ou w ill notice that onl y the gr aph of y = e xp(x) is clear ly v isible . Something we nt wro ng wi th t h e @AUTO selec tion o f the v ertical r ange . What happens is that , when you press @AUTO in the P L O T FUNCTION – WINDO W scr een, the calc ulator pr oduces the ve rtical r ange corr esponding to the f irs t functi on in the list of f uncti ons to be plotted. Whic h, in this cas e, ha ppens to be Y1(X) = EXP(X). W e w ill hav e to e nter the vertical r a nge our sel ves in or der to display the other tw o functi ons in the same plot . Press @CANCL to r eturn to the P L O T FU NCT ION – WINDO W scr een. Modify the ve r ti cal and hori z ontal r anges to r ead: H-V iew : -8 8, V - Vi ew : - 4 4 B y selecting these r anges we e nsur e that the scale of the gr aph is k ept 1 v ertic al to 1 hori z ontal. Pr ess @ERAS E @DRAW and y ou w ill get the plots of the natur al logar ithm, e xponential , and y = x f unc tions . It w i ll be e vi dent f r om the gr aph that LN(X) and EXP(X) ar e r eflec tions o f each other abou t the line y = X. Pre ss @CANCL t o r eturn to the PL O T WINDO W – FUNCT ION. Pr ess ` to retur n to normal calc ulator displa y .
Pa g e 1 2 - 1 3 Summary of FUNCT I ON plot oper ation In this secti on w e pr esent inf ormati on r egar ding the PL O T SETUP , P L O T- FUNCT ION, and P L O T WINDO W sc r eens accessible thr ough the left-shif t k ey comb ined w ith the soft-menu k e y s A through D . Based on the gr aphing e x amples pr esented abo ve , the procedur e to fo llo w to pr oduce a FUNCT ION plot (i .e ., one that plots one or mor e functi ons of the f or m Y = F(X)) , is the fo llo w ing: „ô , simultaneously if in RPN mode: Access to the P L O T SE TUP windo w . If needed , change TYPE to FUNCTION , and enter the name of the indep e ndent va riab le. Setti ngs : Θ A chec k on _Simult means that if y ou hav e two or mor e plots in the s ame gr aph , they w ill be plot t ed simultaneously w h en pr oducing the gr aph. Θ A chec k on _Connect means that the c urve w ill be a continuou s cu r v e r ather than a set of indi vi dual points . Θ A chec k on _Pixels means that the marks indi cated b y H-Tick and V- Tick w ill be separ ated by that man y pi xe ls. Θ The de fault v alue for bo th by H-Tick and V-Tick is 10. Soft k e y menu optio ns : Θ Use @EDIT to edit f uncti ons of v alues in the selected f ield . Θ Use @CHOOS t o selec t the t y pe of plot to u se w hen the Type: fie ld i s highli ghted . F or the c urr ent e x er c ises , w e w ant this f ield se t to FUNCT ION. Θ Pr ess the AXE S soft menu k e y to select or deselec t the plot ting of ax es in the gra ph. If the option ‘ plot ax es ’ is s elect ed, a sq uar e dot w ill appear in the k e y label: @AXES  . Absence o f the squar e dot indicates that ax es w ill not be plotted in the gra ph. Θ Use @ERASE to er ase an y graph c urr ently e x isting in the gr aphics disp la y wi n dow . Θ Use @ DRAW to pr oduce the gr aph accor ding to the c urr ent cont ents of PP AR f or the equations lis ted in the P L O T -FUNCTION w indo w . Θ Press L to acc ess the secon d set of soft m enu ke y s i n thi s scr een. Θ Use @RESET to r eset an y selected f ield to its de fault v alue . Not e : the so ft me nu k ey s @EDIT and @CHOOS ar e not av ailable at the s ame time . One or the other w ill be select ed depending on w hich in put f ield is highli ght ed.
Pa g e 1 2 - 1 4 Θ Use @CANCL to cancel an y change s to the P L O T SETUP w indo w and r eturn t o nor mal calc ulator dis play . Θ Press @@@OK@@@ to sa ve c hanges to the options in th e P L O T SETUP windo w and r etur n to normal calc ulator displa y . „ñ , simultaneousl y if in RP N mode: Ac cess to the PL O T windo w (in this case it wil l be called PL O T –FUNCTION w indow). Soft me nu k ey opti ons : Θ Use @EDIT to edit the highligh ted equation . Θ Use @@ADD@! to add ne w equations t o the plot . Θ Use @@DEL@@ to r emo v e the highligh ted equation . Θ Use @CHOOS to add an equation that is alr ead y def ined in y our var iables menu , but not listed in the PL O T – FUNCT ION w indow . Θ Use @ERASE to er ase an y graph c urr ently e x isting in the gr aphics disp la y wi n dow . Θ Use @ DRAW to pr oduce the gr aph accor ding to the c urr ent cont ents of PP AR f or the equations lis ted in the P L O T -FUNCTION w indo w . Θ Press L to acti vate the second menu list . Θ Use and to mo ve the se lected eq uation one location u p or do wn , res pecti v ely . Θ Use @CLEAR if y ou w ant to c lear all the equations c urr ently ac tiv e in the P L O T – FUNCT ION wi ndo w . The calc ulator w ill v er i fy w hether or no t y ou w ant to c lear all the func tions be for e erasing all o f them . Selec t YE S , and pre ss @@@OK@@@ to pr oceed w ith clear ing all f unctio ns. Selec t NO , and pr ess @@@OK@@@ to de -acti vate the opti on CLEAR . Θ Press @@@O K@@@ w hen done to r eturn to normal calc ulator displa y . „ò , simultaneously if in RPN mode: Access to the P L O T W INDO W scr een. Setti ngs : Θ Enter lo wer and u pper limits f or hor i z ontal v ie w (H- Vi e w) and v ertical v ie w (V - V ie w) range s in the plot w indo w . Or , Not e : @@ADD@! or @EDIT w ill trig ger the equation w r iter E QW that y ou can us e to wr ite new eq uations or edi t old equations .
Pa g e 1 2 - 1 5 Θ Enter lo w er and upper limits for h or i z ontal v ie w (H- V ie w), and pr es s @ AUTO , w hile the c urso r is in one of the V - Vi e w f ields , to ge ner ate the v ertical v i e w (V - Vie w) range automaticall y . Or , Θ Enter lo wer and u pper limits fo r verti cal vi e w (V - Vi e w) , and pr ess @AUTO , w hile the c ursor is in one of the H- Vi e w fi elds, to gener ate the h or i z ontal v ie w (H- Vi e w) r ange automati cally . Θ The calc ulator w ill use the hor i z ontal v ie w (H- Vi ew) r ange to gener ate data value s for the gr aph, unle ss y ou change the opti ons Indep Lo w , (Indep) High , and (Indep) Ste p . T hese v alues deter mine , r espec ti vel y , the minimum , max imum , and inc r ement v alues of the independen t var i able to be u sed in the plot . If the opti on Default is lis ted in the fi elds Indep L ow , (Indep) High , and (Indep) Ste p , the calc ulator w ill u se the minimum and max imum v alues deter mined by H- Vi e w . Θ A chec k on _P ix els means that the v alues of the independe nt v ari able incr ements ( Step : ) ar e gi v en in pi xels r ather than in plot coordinat es. Soft me nu k ey opti ons : Θ Use @EDIT to edit any entry in the w indo w . Θ Use @AUTO as explained in Set tings , abo ve . Θ Use @ERASE to er ase an y graph c urr ently e x isting in the gr aphics disp la y wi n dow . Θ Use @ DRAW to pr oduce the gr aph accor ding to the c urr ent cont ents of PP AR f or the equations lis ted in the P L O T -FUNCTION w indo w . Θ Press L to acti vate the second menu list . Θ Use @RESET to r eset the field selected (i .e ., wher e the cur sor is positioned) to its def ault v alue . Θ Use @CALC t o access calc ulator s tac k to perfo rm calc ulations that ma y be neces sary to ob t ain a value f or one o f the options in this w i ndo w . When the calc ulator stac k is made av ailable to y ou , yo u will als o hav e the so ft menu k ey opti ons @CANCL and @@@OK@@@ . Θ Use @CANCL in case y ou want to cance l the cur r ent calc ulation and re turn to the PL O T WINDO W scr een. Or , Θ Use @@@OK@@@ to accept the r esults o f y our calc ulati on and r etur n to the P L O T WINDO W scr een. Θ Use @TYPES to get inf ormati on on the type of ob jects that can be used in the sele cted o ption field. Θ Use @CAN CL to cancel an y changes t o the PL O T WINDO W scr een and r eturn to normal calc ulator displa y . Θ Press @@@OK@@@ to accept chan ges to the P L O T WINDO W sc r een and r etur n to nor mal calc ulator dis play .
Pa g e 1 2 - 1 6 „ó , simult aneousl y if in RPN mode: Plots the gr aph based on the setting s stor ed in var ia ble PP AR and the cur r ent f unctions de fined in the PL O T – FUNCT ION scr een. I f a gr aph, diff er en t fr om the one y ou ar e plotting , alr eady e xis ts in the graphi c display s cr een, the ne w plot w ill be superimpo sed on the e xis ting plot . This ma y not be the r esult y ou desir e, ther ef ore , I r ecommend to use the @ ERASE @DRAW soft menu k ey s a vailable in the PL O T SETUP , P L O T- FUNCT ION or PL O T WINDO W sc r eens . P lots of tr igonometric and h yper bolic functions T he procedur es used abo ve to plot LN(X) and EXP(X), separ ately or simultaneou sly , can be used t o plot an y functi on of the f or m y = f(x) . It is left as an e xe r c ise to the r eader to pr oduce the plots of tr igonometr ic and h y perboli c func tions and their in ver ses . The table belo w suggests the value s to use f or the v ertical and hori z ontal ranges in eac h cas e . Y ou can include the f unctio n Y=X w hen plotting sim ultaneousl y a func tion and its in ve rse to v er ify their ‘ r ef lection ’ about the line Y = X . H-V ie w r ange V - Vi ew r ange Fu nc tion M i nimum Max imum Minimum Max imum S IN(X) -3 .15 3 .15 A UT O ASIN (X ) -1 .2 1 .2 A U T O SIN & A S IN -3.2 3 .2 -1.6 1.6 CO S(X) -3 .15 3 .15 A UT O A CO S(X) -1.2 1.2 A UT O CO S & A CO S -3 .2 3 .2 -1.6 1.6 T AN(X) -3.15 3 .15 -10 10 A T AN(X) -10 10 -1.8 1.8 TA N & ATA N -2 -2 -2 -2 S INH(X) - 2 2 A U T O A SI NH(X) -5 5 A UT O SI NH & ASI NH - 5 5 - 5 5 CO SH(X) - 2 2 A U T O A CO SH(X) -1 5 A UT O C O S & A C O S - 55- 15
Pa g e 1 2 - 1 7 Generating a table of v alues for a function T he combinati ons „õ ( E ) and „ö ( F ) , pr essed simultaneousl y if in RPN mode , let’s the us er pr oduce a table o f values o f functi ons . F or e x ample , w e wi ll pr oduce a table of the f unction Y(X) = X/(X 10), in the r ange -5 < X < 5 f ollo w ing thes e instruc tio ns: Θ W e w ill gener ate v alues o f the functi on f(x), defined a bo ve , for v alues o f x fr om –5 to 5, in inc r ements o f 0.5 . F irst , we need to ensur e that the gr aph type is set to FUNCTION i n t h e P L O T S E T U P s c r e e n ( „ô , pre ss them simult aneousl y , if in RPN mode) . T he f ield in f r ont o f the Ty p e option w ill be highli ghted . If this fi eld is not alread y set to FUNCTION , pr ess the so ft k ey @CHOOS and s elect the FUNCTION option , then pr ess @@@ OK @@@ . Θ Next , pre ss ˜ to highli ght the fi eld in fr ont of the option E Q, ty pe the fu nctio n expr essi on ‘X/(X 10)’ and pr es s @@@OK@@ @ . Θ T o accept the change s made to the PL O T SETUP sc r een pr ess L @@@OK@@@ . Y ou will be r eturned t o normal calc ulator displa y . Θ The ne xt step is to access the T able Set -u p scr een by using the k e y str ok e combinati on „õ (i .e ., soft k e y E ) – simultaneou sly if in RPN mode . T his will pr oduce a s cr een wher e y ou can selec t the starting value ( Sta r t ) and the inc rement ( St ep ). Enter the follo w in g: 5\ @@@OK@@@ 0.5 @@@OK@@@ 0.5 @@@OK@@@ (i .e ., Z oom facto r = 0.5 ) . T oggle the @ @CH K soft menu k ey until a chec k mar k appears in fr ont of the optio n Sma ll F ont if yo u so desir e. T hen pr ess @@@OK@@@ . T his will r eturn y ou to normal calc ulator displa y . T he TP AR var iable Θ T o see the table , pr ess „ö (i .e., s oft menu k ey F ) – simult aneousl y if in RPN mode . This w ill pr oduce a table o f value s of x = -5, - 4. 5, …, and T ANH(X) -5 5 A UT O A T ANH(X) -1.2 1.2 A UT O T AN & A T AN -5 5 - 2 . 5 2 . 5 After f inishing the table set up , y our calculator w ill c r eate a v ari able calle d TP AR (T able P AR ameter s) that stor e inf ormati on r elev ant to the table that is to be gener ated. T o see the contents of this v ari able , pre ss ‚ @TPAR .
Pa g e 1 2 - 1 8 the corr esponding value s of f(x) , listed as Y1 b y de fault . Y ou can use the up and do wn ar r o w k ey s to mov e about in the t able . Y ou w ill notice that w e did not ha ve to indicate an ending value f or the independent v ar iable x . Th us, the table co ntinues be y ond the max imum v alue fo r x suggested earl y , namely x = 5 . Some opti ons av ailable while the table is v isible ar e @ ZOOM , @@BIG@ , and @DEFN : Θ Th e @DEFN , w hen select ed, sho w s the def inition of the independent v ari able . Θ Th e @@BIG@ k ey simpl y changes the f ont in the t able fr om small to bi g, and v ice v er sa. T r y it . Θ Th e @ZOOM k e y , when pr ess ed, produce s a menu w ith the opti ons: In , Out , Dec imal, Integer , and Tr i g . T ry the follo wing e xer c ises: Θ W ith the option In hi ghlighted, pr ess @@@OK@@@ . T he table is e xpanded so that the x -incr ement is no w 0.2 5 rather than 0. 5 . Simply , what the calc ulato r does is to multipl y the ori ginal inc r ement , 0. 5, b y the z oom fac tor , 0. 5, to produ ce the new inc r ement of 0.2 5 . Thu s, the z oom in option is u sef ul when y ou w ant more r esoluti on for the v alues of x in y our table . Θ T o inc r ease the r esolu tion b y an additional f actor o f 0.5 pr ess @ZOOM , sele ct In once mor e , and pr ess @@@OK@@@ . T he x -inc r emen t is no w 0. 012 5 . Θ T o r eco ver the pr ev i ous x -inc remen t , pr ess @ZOOM — @ @@OK@@ @ to select the option Un- z oom . T he x -inc r ement is inc reas ed to 0.2 5 . Θ T o r ecov er the or iginal x -incr ement o f 0. 5 y ou can do an un - z oom again , or use the option z oom out by pre ss in g @ZOOM @@@ OK@@@ . Θ T he option Dec imal in @ZOOM pr oduces x -inc rements o f 0.10. Θ T he option In teger in @ZOOM produce s x-inc r ements of 1. Θ T he option T ri g in produce s incr ements re lated to f rac tions o f π , thu s being us eful w hen plot ting tr igonometr ic functi ons. Θ T o r etur n to normal calc ulator display pr ess ` . P lots in polar coor dinates F i r st of all , y ou ma y want to dele te the var iable s used in pr ev io us e xample s (e .g ., X, EQ, Y1, P P AR) u sing functi on P URGE ( I @PURGE ) . By do ing this , all parameters r elated to gr aphics w ill be clear ed. Pr ess J to c hec k that the var iables w er e indeed pur ged.
Pa g e 1 2 - 1 9 W e w ill tr y to plot the f uncti on f( θ ) = 2(1-sin( θ )), as follo ws: Θ F irst , mak e sure that y our calc ulator’s angle measur e is set to radi ans. Θ Press „ô , simultaneou sly if in RPN mode , to acces s to the PL O T SE TUP wi ndo w . Θ Chang e TYPE to Polar , b y pr essing @CHOO S ˜ @@@OK@@@ . Θ Press ˜ and t y pe: ³2* „ Ü1-S~‚t @@@OK@@@ . Θ T he c urs or is no w in the Indep f ield. P r ess ³~‚t @@@OK@@@ to change the independent var iable to θ . Θ Press L @@@OK@@@ to r eturn t o normal cal cul ator displa y . Θ Press „ò , simultaneo usl y if in RPN mode , to access the P L O T w indo w (in this case it w ill be called PL O T –P OL AR w indo w) . Θ Change the H- VI EW r ange to –8 to 8 , b y using 8\ @@@OK@@@ 8 @@@OK@@@ , and the V- VIEW r ange to -6 to 2 b y using 6\ @@@OK@@@ 2 @@@OK@@@ . Θ Ch ang e t he Indep Low v alue to 0, and the High v alue to 6 .2 8 ( ≈ 2 π ), b y usi ng : 0 @@@OK@@@ 6.28 @@@OK@@@ . Θ Press @ERASE @DRAW to plot the fu nctio n in polar coor dinates . T he r esult is a c urve shaped lik e a hearth. T his curv e is know n as a cardi od ( cardios , Gr eek f or hear t). Θ Press @EDIT L @LAB EL @MENU t o see the gr aph w ith labels. Pr ess L to re c over t he m e nu. Pre ss L @ ) PICT to r ecov er the o ri ginal gr aphics menu . Θ Press @TRACE @x,y@ to tr ace the c urve . The dat a show n at the bottom of the displa y is the angle θ and the r a dius r , although the lat t er is lab eled Y (def ault name o f dependent v ari able) . Note : the H- VI E W and V- VIEW determine the s cales of the display w indo w onl y , and their r anges ar e not r elated to the r ange of values o f the independent var iable in this case .
Pa g e 1 2 - 2 0 Θ Press L @CANCL to r et u rn t o t he PL O T WI N DOW s creen. Pres s L @@@OK@@@ to r etur n to normal calc ulator displa y . In this e xe r c ise w e enter ed the eq uation to be plotted dir ectl y in the PL O T SETUP w indo w . W e can also enter equati ons f or plotting using the P L O T wi ndow , i .e ., simultaneou sly if in RPN mode , pre ssing „ñ . F or ex ample, w hen y ou pr ess „ñ after fini shing the pr ev iou s ex er c ise , y ou w ill get the eq uation ‘2*(1-S IN( θ ))’ highli ghted. L et’s say , we w ant to plot also the func tion ‘2*(1- COS( θ ))’ along w ith the pr ev ious equati on. Θ Press @@ADD@! , and t y pe 2*„Ü1- T~‚t` , to enter the new equati on. Θ Press @ERASE @ DRAW to see the tw o equati ons plotted in the same fi gur e . The r esult is tw o inte rs ecting car dio ids . Pr ess @ CANCL $ to retur n to normal calc ulat or dis pla y . P lot ting conic cur v es T he most gener al for m of a coni c curv e in the x-y plane is: Ax 2 By 2 Cxy Dx Ey F = 0. W e als o recogni z e as conic equations thos e gi v en in the canoni cal for m fo r the fol low ing fi gur es: Θ ci rcl e : (x-x o ) 2 (y-y o ) 2 = r 2 Θ ellipse: (x -x o ) 2 /a 2 (y-y o ) 2 /b 2 = 1 Θ para bola: (y-b) 2 = K(x -a) or (x -a) 2 = K(y-b) Θ hy perbola: (x - x o ) 2 /a 2 (y-y o ) 2 /b 2 = 1 or xy = K, wher e x o , y o , a, b , and K are cons tant . Th e n am e coni c cu rves follow s be cause these figur es ( c irc les, elli pses , pa r abolas or h y perbolas) r esult f r om the inters ection o f a plane w ith a cone . F or ex ample, a c ir cle is the inter secti on of a cone w ith a plane pe rpendic ular to the cone's main ax is.
Pa g e 1 2 - 2 1 T he calculator ha s the ability of plotting one or more coni c c ur v es b y selecting Con ic as the functi on TYPE in the PL O T e nv ir onment . Mak e sure to dele te the var iables P P AR and E Q bef or e continuing . F or e x ample , let's sto r e the list o f equations { ‘(X-1)^2 (Y - 2)^2=3’ , ‘X^2/4 Y^2/3=1’ } into the v ar iable E Q. T hese eq uations we r ecogni z e as thos e of a c ir cle cen ter ed at (1,2) w ith r adius √ 3, and of an ellipse center ed at (0, 0 ) w ith semi-ax is lengths a = 2 and b = √ 3. Θ Enter the PL O T envir onment, b y p r essing „ô , simultaneously if in RPN mode , and select Conic as the TYPE . The lis t of eq uations w ill be lis ted in the E Q f ield . Θ Make sur e that the independent var ia ble ( Indep ) is set to ‘X’ and the dependent var iable ( Depnd ) to ‘Y ’ . Θ Press L @@@OK@@@ to r eturn to nor mal calculator dis play . Θ Enter the P L O T WINDO W en v ir onment , by pr es sing „ò , simult aneousl y if in RPN mode. Θ Change the r ange for H- VI E W to - 3 to 3, b y using 3\ @@@OK @ @@ 3@@@OK @@@ . Also , change the V - VIEW r ange to -1. 5 to 2 b y using 1.5\ @@@OK@@@ 2 @@@OK@@@ . Θ Ch ang e t he Indep L o w : and High: f ields to Default b y using L @RESET w hile each o f those f ie lds is highli ghted . Selec t the option Re set v alue after pr es sing @RESET . Pr ess @@@OK@@@ to com plete the r esetting of v alues. Pr ess L to r eturn t o the main menu . Θ Pl o t t h e g ra p h : @ERASE @ DRAW .
Pa g e 1 2 - 2 2 Θ T o see labels: @EDIT L @)LABEL @ MENU Θ T o reco ver the men u: LL @) P ICT Θ T o estimate the coor dinates of the point o f inter section , pres s the @ ( X,Y )@ menu k ey and mo v e the cur sor as c lose as po ssible to thos e points using the arr ow k ey s . The coor dinates of the c ursor ar e show n in the display . F or e xample , the lef t po int of intersec tion is cl ose to (-0.6 9 2 , 1.6 7) , w hile the r ight inte rsec tion is near (1.8 9 , 0. 5). Θ T o r ecov er the menu and r eturn to the P L O T env i r onment , pre ss L @ CANCL . Θ T o r eturn to nor mal calculat or displa y , pre ss L @@@OK@@@ . P arametr ic plots P arametr i c plots in the plane ar e those plots w hose coor dinates ar e gener ated thr ough the s ys tem of equati ons x = x(t) and y = y(t) , w here t is kno wn as the par ameter . An ex ample of suc h gr aph is the tr aject ory of a pr ojec tile , x(t) = x 0 v 0 ⋅ COS θ 0 ⋅ t, y ( t) = y 0 v 0 ⋅ sin θ 0 ⋅ t – ½⋅ g⋅ t 2 . T o plot equations lik e these , Not e : Th e H-View and V-View ra n g es we re se l e ct e d t o s h ow t h e i nt e rs ec t io n of the tw o curv es . Ther e is no gene ral r ule to select tho se r anges , ex cept bas ed on w hat we kno w about the c ur v es . F or ex ample , f or the equations sho w n abo v e , w e kno w that the c ir cl e will e xtend fr om -3 1 = - 2 to 3 1 = 4 in x , and fr om -3 2=-1 to 3 2=5 in y . In additi on , the ellipse , w hic h is center ed at the or igin (0, 0) , w ill e xtend fr om - 2 to 2 in x, and fr om - √ 3 to √ 3 in y . Notice t hat fo r the c ir cle and t he ellipse the r egi on corr es ponding to the left and r ight e xtr emes of the c ur v es ar e not plotted. T his is the case w ith all c ir cles or ellip ses plotted us ing Conic as the TYPE .
Pa g e 1 2 - 23 whi ch in vol ve constant values x 0 , y 0 , v 0 , and θ 0 , w e need to stor e the values of those par ameters in v ar iables . T o de velop this e xample , cr eate a sub-dir ect or y called ‘PR O JM’ fo r PR O Jectile Motion , and w ithin that sub-dir ectory stor e the fo llo w ing var iable s: X0 = 0, Y0 = 10, V0 = 10 , θ 0 = 30, and g = 9 .806 . Mak e sur e that the calc ulato r’s angle measur e is set to DE G . Ne xt , def ine the fu nct ions (us e „à ): X(t) = X0 V0*CO S( θ 0)*t Y(t) = Y0 V0*SI N( θ 0)*t – 0. 5*g*t^2 w hich w ill add the var iable s @@@Y@@@ and @@@X@@@ to the soft menu k e y labels. T o pr oduce the gr aph itself , follo w these st eps: Θ Press „ô , sim ultaneousl y if in RPN mode , to access to the P L O T SETUP wi n dow . Θ Ch ang e TYPE to Parametric , b y pr essing @CHOOS ˜˜ @@@OK@@@ . Θ Press ˜ and t y pe ‘X(t) i*Y(t)’ @@@OK@@@ to def ine the par ametr ic plot a s that of a comple x v ar iable . (T he r eal and imaginar y parts of the comple x var iable cor r espond to the x - and y-coor dinates o f the curve .) Θ The c urs or is no w in the Indep fie ld. Pre ss ³~„t @@@OK @ @@ to c hange the independent var ia ble to t . Θ Press L @@@OK@@@ to r eturn to nor mal calculator dis play . Θ Press „ò , simult aneousl y if in RPN mode , to acces s the PL O T w indo w (in this case it w ill b e called P L O T –P ARAM E TRIC w indo w) . Instead of modif y ing the hori z ontal and vertical v ie ws f irst , as done for other ty pes of plot , w e wi ll set the lo wer and u pper value s of the independent v ari able fi rst as fol l ows: Θ Select the Indep Low f i eld by pr essing ˜˜ . Change this v alue to 0 @@@OK@@@ . Then , c hange the va lue of High to 2 @@@OK@@@ . Enter 0. 1 @@@OK@@@ fo r t he Step v alue (i .e ., step = 0.1) .
Pa g e 1 2 - 24 Θ Press @AUTO . This w ill generate automatic v alues of the H- Vie w and V- Vie w r anges based on the v alues of the independent var iable t and the def initi ons of X(t) and Y(t) u sed . The r esult w ill be: Θ Press @ERASE @DRAW t o dra w the par ametri c plot . Θ Press @EDIT L @LABE L @MENU to see the gr aph w ith labels . The windo w par ameter s ar e such that y ou only see half o f the labels in the x -ax is. Θ Press L to r ecov e r the menu . Pr ess L @) PICT to r eco ver the original gr aphics menu . Θ Press TRACE @ ( X,Y) @ to deter min e coordinates of any point on the gr aph. Use ™ and š t o mov e the c ursor abou t the curv e . At the bottom of the sc r een y ou w ill see the v alue of the par ameter t and coor dinate s of the c ur sor a s (X,Y ) . Θ Press L @CANCL to r eturn to the P L O T WINDO W en v ir onment . Then , pr ess $ , or L @@ @OK @@ @ , to r etur n to nor mal calc ulator dis play . A r e v ie w of y our so ft menu k e y labels sho w s that y ou no w ha v e the follo w ing varia bl es: t , E Q, PP A R, Y , X , g, θ 0, V0, Y0, X0. V a r iable s t , E Q, and P P AR ar e gener ated b y the calculat or to stor e the c ur r ent values o f the paramet er , t , of the equati on to be plotted E Q (w hic h contains ‘X(t) I ∗ Y(t)’) , an d the plot Not e : Thr ough these setting s we ar e ind i cating that the paramet er t w ill tak e value s of t = 0, 0.1, 0.2 , …, etc., until r eaching the v alue of 2 . 0.
Pa g e 1 2 - 2 5 par ameters . The other v ar iables contain the v a lues o f constants us ed in the def initions o f X(t) and Y(t) . Y ou can stor e differ ent v alues in the v ari ables and pr oduce ne w par ametr ic plots of the pr o jectile eq uations us ed in this e xample . If you w ant to er as e the c urr en t pic tur e contents bef ore pr oducing a ne w plot , y ou need to access either the PL O T , P L O T WINDO W , or P L O T SETUP s cr eens, b y pre ssing , „ñ , „ò , or „ô (the tw o k ey s must be pr essed simultaneou sly if in RPN mode) . T hen , pr ess @ERASE @ DRAW . Pr es s @CANCL to r eturn to the PL O T , P L O T WINDO W , or P L O T SETUP scr een. Pr ess $ , or L @@@OK@@@ , to re turn to normal calc ulator displa y . Generating a table f or parametr ic equations In an ear lier e x ample w e gener ated a table o f value s (X,Y) f or an e xpr essi on of the f orm Y=f(X) , i .e., a F uncti on type of gr aph . In this section , w e pr esent the pr ocedur e for gener ating a table cor r esponding to a parame tri c plot . F or this purpo se , we ’ll tak e adv antage of the par ametr ic equatio ns def ined in the exa mp l e ab ove. Θ F irst , let’s acces s the T ABLE SE TUP wi ndow b y pres sing „õ , simultaneou sly if in RPN mode . F or the independent v ar iable c hange the Sta r t ing v alue to 0. 0, and the Ste p value to 0.1. Pr ess @@@OK@@@ . Θ Gener ate the table b y pr essing , simultaneou sly if in RPN mode , „ö . T he re sulting table has three columns r epr esenting the par ameter t , and the coor dinates o f the corr esponding points . F or this table the coor dina te s are la beled X1 and Y1. Θ Us e the arr ow k ey s, š™—˜ , to mov e about the table . Θ Press $ to r etur n to nor mal calc ulator displa y . T his procedur e for c r eating a table cor r es ponding to the cur r ent type o f plot can be applied to other plot t y pes .
Pa g e 1 2 - 26 P lotting th e solution to simple differ ential equations T he plot of a simple differ ential equati on can be obtained by selec ting Diff Eq in the TYPE f ield o f the PL O T SETUP en v ir onment as f ollo ws: suppo se that w e w ant to plot x(t) fr om the diff er ential equati on dx/dt = exp(-t 2 ), w i th in i t i a l conditi ons: x = 0 at t = 0. The calc ulator allo ws f or the plotting of the so lution of diff er ential equati ons of the f orm Y'(T) = F(T ,Y) . F or our case , we let Y  x and T  t, t h ere fo re, F ( T , Y )  f(t,x) = e xp(- t 2 ). Bef or e plotting the soluti on , x(t) , for t = 0 to 5, delete the v ari ables E Q and PP AR. Θ Press „ô , sim ultaneousl y if in RPN mode , to access to the P L O T SETUP wi n dow . Θ Ch ang e TYPE to Diff Eq . Θ Press ˜ and ty pe ³„ ¸-~ „tQ2 @@@OK@@@ . Θ The c ursor is no w in the H-Var f ield . It should show H-Var:0 and also V- Var:1 . T his is the code us ed b y the calculat or to i dentify the var ia bles to be plotted. H-Var:0 means the independent v ar iable (to be selec ted later ) w ill be plotted in the hor iz ontal ax is . Also , V-Var:1 means the dependent var iable (def ault name ‘ Y’) w ill be plotted in the v ertical ax is. Θ Press ˜ . T he c urs or is no w in the Indep f ield. Pr ess ³~ „t @@@OK@@@ to c hange the independent var iable to t . Θ Press L @@@OK@@@ to r eturn to nor mal calculator dis play . Θ Press „ò , simult aneousl y if in RPN mode , to acces s the PL O T w indo w (in this case it w ill be called P L O T WINDO W – D IFF E Q) . Θ Change the H- VIEW and V - VIEW parame ters to r ead: H- VIEW : -15 , V-V I E W: -11.5 Θ Ch ang e t he Init value t o 0, and the F inal v alue to 5 b y using: 0 @@@OK@@@ 5 @@@OK@@@ . Θ The v alues S tep and T ol r epr es ent the step in the indepe ndent var iable and the toler ance for conv er gence to be us ed by the n umeri cal soluti on . Let’s leav e thos e values w ith the ir default s ettings (if the wor d default is not sho wn in the S tep: f ield , use L @RESET t o re set that v alue to its def ault value. Press L to retur n to the main menu .) Pr ess ˜ . Θ The Init-Soln v alue r epr esen ts the initi al value of the soluti on to st ar t t he numer i cal r esult . F or the pr es ent case , we ha ve f or initial conditions x(0) = 0, thus , we need to change this value to 0. 0, b y using 0 @@@OK@@@ . Θ Press @ERASE @DRAW t o plot the soluti on to the differ enti al equati on. Θ Press @EDIT L @LABEL @ME NU to see the gr aph w ith labels.
Pa g e 1 2 - 27 Θ Press L to r ecov e r the menu . Pr ess L @) PICT to r eco ver the original gr aphics menu . Θ When w e observ ed the gr aph being plotted , y ou'll notice that the gr aph is not v ery smooth . T hat is becaus e the plotter is using a time step that is too lar ge . T o r ef ine the gr aph and mak e it smoother , use a st ep of 0.1. T r y the f ollo w ing k e y str ok es: @CA NCL ˜˜˜.1 @@@ OK@@@ @ ERASE @DRAW . The plot w ill take longer to be completed, but the shape is definitel y smo other than bef or e. Θ Press @EDIT L @ LABEL @MENU , to see axe s lab e ls and range . Notice that the labels for the ax es ar e sho wn as 0 (hori z ontal) and 1 (v er ti cal) . Thes e ar e the def initions f or the ax es as gi v en in the P L O T WINDO W scr een (see abo ve), i.e ., H- V AR (t) : 0 , and V-V A R ( x) : 1 . Θ Press LL @) PICT to r eco v er menu and r eturn t o PICT env iro nment . Θ Press ( X,Y ) to deter mine coor dinates of an y point on the gr aph . Use ™ and š to mo ve t he c ursor in the plot ar ea . At the botto m of the sc r een y ou w ill see the coor dinates o f the cu rsor as (X,Y ) . T he calculator u ses X and Y as the de fault name s fo r the hor i z ontal and v er ti cal ax es , re sp e ct ive ly . Θ Press L @) CANCL to r eturn to the PL O T WINDO W en v ir onment . Then , pr ess $ to r eturn to normal calc ulator displa y . Mor e details on using gr aphical solu tions of diff er ential eq uations ar e pr esente d in Chapte r 16.
Pa g e 1 2 - 28 T ruth plots T ruth plots ar e used to pr oduce two -dimensi onal plots of r egio ns that satisfy a certain mathemati cal condition that can be e ither true or f alse . F or ex a m ple , suppo se that y ou w ant to pl ot the regi on f or X^2/3 6 Y^2/9 < 1, pr oceed as fo llo w s: Θ Press „ô , sim ultaneousl y if in RPN mode , to access to the P L O T SETUP wi n dow . Θ Ch ang e TYPE to Tr u t h . Θ Press ˜ and type {‘(X^2/3 6 Y^2/9 < 1)','(X^2/16 Y^2/9 > 1)’} @@@OK@@@ to de fine the conditions t o be plotted . Θ The c ursor is no w in the Indep f ield . L eav e that as ‘X’ if alr eady s et to that var iable , or change it t o ‘X’ if needed . Θ Press L @@@OK@@@ to r eturn to nor mal calculator dis play . Θ Press „ò , simult aneousl y if in RPN mode , to access the P L O T w indo w (in this case it w ill be called PL O T WINDO W – TRUTH w indow). Let ’s k eep the def ault v alue for the w indow ’s r anges: H -View: -6.5 6.5, V-Vi ew: -3.9 4.0 (T o r eset them use L @RE SET (selec t Re set all) @@OK@@ L ). Θ Press @ERASE @DRAW t o dr aw the tr uth plot . Beca use the calc ulator sample s the entir e plotting domain, poin t by po int , it tak es a f ew min utes t o pr oduce a truth plot . The pr esent plot should pr oduce a sha ded ellip se of s emi-axe s 6 and 3 (in x and y , r especti v el y) , center ed at the or igin . Θ Press @EDIT L @ LABEL @MENU to see the gr aph w ith labels. T he w indo w par ameter s ar e such that y ou only s ee half of the label s in the x -ax is. Pr es s L to r eco v er the men u . Pr es s L @) PICT to r ecov er the or ig inal gr aphics menu . Θ Press ( X,Y ) to det ermine coor dinate s of an y point on the gr aph. Us e the arr ow k e y s to mo ve the c urs or about the r egion plotted. At the bottom of the sc r een yo u will see the v alue of the coor dinates of the cur sor as (X,Y) . Θ Press L @) CANCL to r eturn to the PL O T WINDO W en v ir onment . Then , pr ess $ , or L @@ @OK @@ @ , to r etur n to nor mal calc ulator dis play . Y ou can ha ve mor e than one condition plott ed at the same t ime if yo u multipl y the conditi ons . F or ex ample , to plot the gr aph o f the points f or whi c h X 2 /3 6 Y 2 /9 < 1, and X 2 /16 Y 2 /9 > 1, use the f ollo wing: Not e : if the w indo w’s r anges ar e not set to de fa ult values , the q uic k est w ay to r eset them is b y using L @R ESET@ (s elect Res et all ) @@@ OK@@@ L .
Pa g e 1 2 - 2 9 Θ Press „ô , sim ultaneousl y if in RPN mode , to access to the P L O T SETUP wi n dow . Θ Press ˜ and type ‘(X^2/3 6 Y^2/9 < 1) ⋅ (X^2/16 Y^2/9 > 1)’ @ @@OK @ @@ to def ine the conditions t o be plot t ed. Θ Press @ERASE @DRAW t o dra w the tr uth plot . Again , y ou ha v e to be patient w hile the calc ulato r produce s the gr aph . If y ou want to inter rupt the plo t, press $ , once . Then pr es s @CANCEL . P lot ting hist ogr ams, bar plots, and scat ter plots Histogr ams, bar plots and scatter plots ar e used to plot dis cr ete data stor ed in t h e res er ve d va ria b l e Σ D A T . T his v ari able is u sed not onl y f or these ty pes of plots, bu t also f or all kind of s tatisti cal applicati ons as w ill be show n in Chapter 18. As a matter of fac t , the use o f histogr am p l ots is postponed until w e get to that chapte r , for the plotting of a histogr am requir es to perfor m a grou ping of data and a f r equenc y analy sis bef or e the ac tual plot . In this s ecti on w e will sho w ho w to load data in the v ar iable Σ D A T and ho w to plot bar plots and scatter plots . W e w ill use the f ollo w ing data fo r plot ting bar plots and scatte r plots: Bar plots F irst , ma k e sure y our calculator’s C A S is in Exact mode . Next , enter the dat a sho w n abov e as a matri x, i .e . , [[3 .1,2 .1 ,1.1],[3 .6, 3 .2 ,2 .2],[ 4.2 , 4. 5, 3 . 3], xy z 3. 1 2 . 1 1 . 1 3. 6 3. 2 2 . 2 4.2 4.5 3 .3 4. 5 5 .6 4.4 4.9 3.8 5 . 5 5. 2 2 . 2 6. 6
Pa g e 1 2 - 3 0 [4. 5,5 .6, 4.4 ],[4.9 , 3.8 ,5 . 5],[5 .2 ,2 .2 , 6.6]] ` to stor e it in Σ D A T , use the f uncti on S T O Σ (av ailable in the function catalog , ‚N ) . Pr ess V AR to reco v er y our var iable s menu . A soft menu k ey labeled Σ D A T should be a vailable in the stac k. T he f igur e belo w sho ws the stor age of this matri x in AL G mode: T o pr oduce the gr aph: Θ Press „ô , sim ultaneousl y if in RPN mode , to access to the P L O T SETUP wi n dow . Θ Ch ang e TYPE to Bar . Θ A matri x will be sh o wn at the Σ D A T f ield . This is the matr ix w e sto r ed earli er into Σ DA T . Θ Highli ght the Col: f ield . This f ield lets y ou c hoose the column of Σ D A T that is to be plotte d . T he def ault value is 1. K eep it to plot column 1 in Σ DA T . Θ Press L @@@OK@@@ to r eturn to nor mal calculator dis play . Θ Press „ò , simultaneou sly if in RPN mode , to access the PL O T WINDO W sc r een. Θ Change the V - V ie w t o r ead , V-View: 0 5 . Θ Press @ERASE @DRAW t o dra w the bar plot . Θ Press @CA NCL to r eturn to the PL O T W INDO W env ir onment . Then , pre ss $ , or L @@ @OK @@ @ , to r etur n to nor mal calc ulator dis play . T he number of bars t o be plot t ed determines the w idth of the bar . The H- and V - VIEW ar e set to 10, b y def ault . W e c hanged the V - VI EW to better
Pa g e 1 2 - 3 1 accommodate the max imum v alue in column 1 of Σ D A T . Bar plots ar e usef ul when plotting categori cal (i .e ., non -numeri cal) data. Suppo se that y ou w ant to plot the data in co lumn 2 o f the Σ DA T m a t rix : Θ Press „ô , sim ultaneousl y if in RPN mode , to access to the P L O T SETUP wi n dow . Θ Press ˜˜ to highli ght the Col: f ield and ty pe 2 @@@OK@@@ , follo wed b y L @@@OK@@@ . Θ Press „ò , sim ultaneousl y if in RPN mode , to access to the P L O T SETUP wi n dow . Θ Change V -V ie w to r ead V-View: 0 6 Θ Press @ERASE @DRAW . Θ Press @ CANCL to r eturn to the P L O T WINDO W sc r een, then $ to r eturn to nor mal calc ulator dis play . Scatter plots W e w ill use the same Σ D A T matri x to pr oduce scatter plots . F irs t , we w ill plot the v alues of y v s. x , then thos e of y vs . z , as follo ws: Θ Press „ô , sim ultaneousl y if in RPN mode , to access to the P L O T SETUP wi n dow . Θ Ch ang e TYPE to Scatter . Θ Press ˜˜ to highlight the Cols : f ield . Ente r 1 @@@ OK @@@ 2 @@@OK@@@ to selec t column 1 as X and co lumn 2 as Y in the Y -vs .-X scatter plo t . Θ Press L @@@OK@@@ to r eturn to nor mal calculator dis play . Θ Press „ò , simultaneou sly if in RPN mode , to access the PL O T WINDO W sc r een. Θ Change the plot w indo w ranges t o read: H- V iew : 0 6 , V-Vi ew: 0 6.
Pa g e 1 2 - 32 Θ Press @ERASE @DRAW to dr a w the bar plot . Pr es s @EDIT L @LABEL @MENU to see the plot unenc umber ed b y the menu and w ith identify ing la bels (the c ursor w ill be in the middle of the plot , ho w e ver ) : Θ Press LL @) PICT to lea v e the EDIT e n vir onment . Θ Press @CANCL to re turn to the PL O T W INDO W env ir onment . Then , pre ss $ , or L @@ @OK @@ @ , to r etur n to nor mal calc ulator dis play . T o plo t y vs . z , u se: Θ Press „ô , sim ultaneousl y if in RPN mode , to access to the P L O T SETUP wi n dow . Θ Press ˜˜ to highli ght the Cols: f i e l d . E n t e r 3 @@@OK @@@ 2 @@@OK@@@ to selec t column 3 as X and co lumn 2 as Y in the Y -vs .-X scatter plo t . Θ Press L @@@OK@@@ to r eturn to nor mal calculator dis play . Θ Press „ò , simultaneou sly if in RPN mode , to access the PL O T WINDO W sc r een. Θ Change the plot w indo w ranges t o read: H- V iew : 0 7 , V - Vi ew : 0 7 . Θ Press @ERASE @DRAW to dr aw the bar plot . Pre ss @ EDIT L @LABEL @MENU to see the plot unenc umber ed by the men u and wi th identifying la bels. Θ Press LL @) PICT to lea v e the EDIT e n vir onment . Θ Press @CANCL to r eturn to the PL O T WINDO W env ir onment . The n, pr ess $ , or L @@ @OK @@ @ , to r etur n to nor mal calc ulator dis play .
Pa g e 1 2 - 3 3 Slope fields Slope fi elds ar e used to v isuali z e the solutio ns to a differ ential equati on of the fo rm y’ = f(x ,y) . Basi call y , what is pres ented in the plot ar e segmen ts tangenti al to the so lution c ur v es, since y’ = dy/dx , ev aluated at an y po int (x,y), repr esents the slope of the tangent line at point (x ,y) . F or ex ample , to v i suali z e the soluti on to the diff er ential equati on y’ = f(x ,y) = x y , use the f ollo w ing: Θ Press „ô , sim ultaneousl y if in RPN mode , to access to the P L O T SETUP wi n dow . Θ Ch ang e TYPE to Slopefield. Θ Press ˜ and ty pe ‘X Y ’ @@@OK@@@ . Θ Make sur e that ‘X’ is s elected as the Indep: and ‘Y ’ a s the Depnd: varia bl es. Θ Press L @@@OK@@@ to r eturn to nor mal calculator dis play . Θ Press „ò , simult aneousl y if in RPN mode , to access the P L O T WINDO W sc r een. Θ Change the plot w indo w r anges to r e ad: X-L eft:-5, X-R ight:5, Y -Near :-5, Y -F ar: 5 Θ Press @ERASE @DRA W to dr aw the slope f ield plot . Pr ess @EDIT L @LABEL @MENU to s ee the plot unenc umber ed by the men u and w ith identify ing labels. Θ Press LL @) PICT to lea v e the EDIT e n vir onment . Θ Press @CANCL to re turn to the PL O T W INDO W env ir onment . Then , pre ss $ , or L @@@OK@@@ , to retur n to norma l calc ulator display . If y ou could r eprodu ce the slope f ield plot in paper , y ou can tr ace b y hand line s that ar e tangent t o the line segments sho wn in the plo t . This lines constitute lines
Pa g e 1 2 - 3 4 of y(x ,y) = constant , for the soluti on of y ’ = f(x ,y) . Th us, slope f ie lds are u sef ul tools f or v isuali zing par ti c ularl y diffi cult equations t o sol v e . T ry als o a slope fi eld plot for the f uncti on y’ = f(x ,y) = - (y/x) 2 , b y using: Θ Press „ô , sim ultaneousl y if in RPN mode , to access to the P L O T SETUP wi n dow . Θ Ch ang e TYPE to Slopefield. Θ Press ˜ and ty pe ‘ − ( Y/X)^2’ @@@OK@@@ . Θ Press @ ERASE @DRAW to dr aw the slope field plot . Pr ess @ED IT L @LABEL @MENU to s ee the plot unenc umber ed by the men u and w ith identify ing labels. Θ Press LL @) PICT to lea v e the EDIT e n vir onment . Θ Press @CA NCL to r eturn to the PL O T W INDO W env ir onment . Then , pre ss $ , or L @@ @OK @@ @ , to r etur n to nor mal calc ulator dis play . F ast 3D plots F ast 3D plots ar e u sed to v isuali z e thr ee -dimensional surface s r epr esen ted by equati ons of the for m z = f(x ,y) . F or ex ample, if y ou want to visuali z e z = f(x,y) = x 2 y 2 , w e can use the f ollo wing: Θ Press „ô , sim ultaneousl y if in RPN mode , to access to the P L O T SETUP wi n dow . Θ Ch ang e TYPE to Fa s t 3D. Θ Press ˜ and ty pe ‘X^2 Y^2’ @ @@OK @ @@ . Θ Make sur e that ‘X’ is s elected as the Indep: and ‘Y ’ as the Depnd: va riabl es. Θ Press L @@@OK@@@ to r eturn to nor mal calculator dis play . Θ Press „ò , simultaneou sly if in RPN mode , to access the PL O T WINDO W sc r een. Θ K e ep the de fault plot w indo w r anges to r ead: X-Left:-1, X -Ri ght:1, Y -Near:-1, Y - F ar : 1, Z -Lo w : -1, Z -High: 1, S tep Indep: 10, Depnd: 8
Pa g e 1 2 - 3 5 Θ Press @ERASE @DRAW t o dr aw the thr ee -dimensional surf ace. The r esult is a w ir ef rame p ictur e of the surface w ith the re fer ence coor dinate sy stem sho w n at the lo w er left corner of the s cr e e n. B y using the arr ow k ey s ( š™— ˜ ) yo u can change the or ientati on of the surface . T he or ientati on of the r ef er ence coor dinate s y st em w ill change accor dingly . T ry changing the surface or ientation on y our o w n. The f ollo wing f igur es show a couple of view s o f th e g rap h : Θ When done , pr ess @EXIT . Θ Press @CANCL to r eturn to the PL O T WINDO W env i r onment. Θ Change the Step data to r ead: Step Indep: 20 Dep nd: 16 Θ Press @ERASE @DRAW to s ee the surface plot . Sample v ie ws: Θ When done , pr ess @EXIT . Θ Press @CANCL to r eturn to PL O T WINDOW . Θ Press $ , o r L @@@OK@@@ , to r eturn to normal calc ulator displa y . T ry als o a F ast 3D plot f or the surface z = f(x,y) = sin (x 2 y 2 ) Note : The S tep Indep: and Depnd: v alues r epre sent the number of gri dlines to be used in the plot . The lar ger these number , the slo wer it is to pr oduce the gr aph, although , the times utili z ed f or gr aphic gener ation ar e r elati v el y fas t . F or the time be ing w e ’ll k eep the defa ult v alues of 10 and 8 for the S tep data .
Pa g e 1 2 - 3 6 Θ Press „ô , simultaneou sl y if in RPN mode , to acces s the P L O T SE TUP wi n dow . Θ Press ˜ and ty pe ‘S IN(X^2 Y^2)’ @@@OK@@@ . Θ Press @ERASE @DRAW to dr aw the plot . Θ When done , pr ess @EXIT . Θ Press @CANCL to r eturn to PL O T WINDOW . Θ Press $ , o r L @@@OK@@@ , to r eturn to normal calc ulator displa y . Wi re frame plots Wi r efra m e plots ar e plots of thr ee -dimensio nal sur f aces desc r ibed b y z = f(x,y). Unlik e Fas t 3 D plots , wir efr ame plots ar e stati c plots. T he user can c hoose the v ie wpoint f or the plot , i .e ., the point fr om whi ch the surface is seen . F or e x ample , to pr oduce a w ir ef rame plot f or the sur f ace z = x 2y –3, use the fo llo w ing: Θ Press „ô , simu ltaneous ly if i n RPN mode , to acce ss to the PL O T SETUP w indow . Θ Ch ang e TYPE to Wireframe. Θ Press ˜ and type ‘X 2*Y - 3’ @@@OK@@@ . Θ Make sur e that ‘X’ is s elected as the Indep: and ‘Y ’ a s the Depnd: varia bl es. Θ Press L @@@OK@@@ to r eturn to nor mal calculator dis play . Θ Press „ò , simultaneousl y if in RPN mode , to acces s the PL O T WINDO W sc r een. Θ K e ep the de fault plot w indo w r anges to r ead: X-Left:-1, X -Ri ght:1, Y -Near:-1, Y - F ar : 1, Z -Lo w : -1, Z -High: 1, XE:0,YE:- 3, ZE:0, S tep Indep: 10 Depnd: 8 T he coordinat es XE , YE , ZE , stand fo r “ e y e coor dinates, ” i .e. , the coordinat es fr om whic h an obs er v er se es the plot . The v a lues sho wn ar e the def ault value s. T he Step Indep: and Depnd: v alues r e pr esent the n umber of gr idlines to be u sed in the plot . The lar ger these number , the slow er it is to pr oduce the graph . F or the time being w e’ll k eep the de fault v alues o f 10 and 8 for the S tep Θ Press @ERASE @DRAW to dra w the thr ee -dimensi onal surface . The r esul t is a w ir efr ame pi ctur e of the sur f ace .
Pa g e 1 2 - 37 Θ Press @EDIT L @LABEL @MENU to see the gr aph w ith labels and r anges . T his partic ular v ersi on of the gr aph is limited to the lo wer part of the dis play . W e can change the v ie wpoint to see a differ ent versi on of the gr aph. Θ Press LL @) PICT @CANCL to r eturn to the PL O T WINDOW en v ir onment . Θ Change the e y e coordinat e data to r ead : XE:0 YE:-3 ZE :3 Θ Press @ERASE @DRAW t o see the surf ace plot . Θ Press @EDIT L @LABEL @ME NU to see the gr aph w i th la bels and r anges. T his ver sio n of the gr aph occ up ies mor e ar ea in the display than the pr e v iou s one. W e can change the v ie wpoint , once mor e , to s ee another ve rs ion of t he g rap h. Θ Press LL @) PICT @CANCL to r eturn to the PL O T WINDOW en v ir onment . Θ Change the e y e coordinat e data to r ead : XE:3 YE:3 ZE: 3 Θ Press @ERASE @DRA W to see the surface plot . T his time the bulk of the plot is located to war ds the r igh t –hand side of the displa y . Θ Press @CANCL to r eturn to the PL O T WINDO W env i r onment. Θ Press $ , o r L @@@OK@@@ , to r eturn to normal calc ulator displa y .
Pa g e 1 2 - 3 8 T ry also a Wir ef r ame plot f or the surface z = f(x,y) = x 2 y 2 Θ Press „ô , simultaneou sl y if in RPN mode , to acces s the P L O T SE TUP wi n dow . Θ Press ˜ and t y pe ‘X^2 Y^2’ @@@OK@@@ . Θ Press @ERASE @DRAW t o dra w the slope f ield plo t . Pre ss @EDIT L @)MENU @LAB EL to see the plot unenc umb e red b y the menu and wi th identify ing labels. Θ Press LL @) PICT to lea v e the EDIT e n vir onment . Θ Press @CANCL to re turn to the PL O T W INDO W env ir onment . Then , pre ss $ , or L @@ @OK @@ @ , to r etur n to nor mal calc ulator dis play . P s-Contour plots Ps - C o n t o u r plots ar e contour plo ts of thr ee -dimensio nal surfaces des cr ibed b y z = f(x ,y) . T he contour s pr oduced ar e pr oj ecti ons of le vel surf aces z = constan t on the x -y plane . F or ex ample, t o produce a P s-Cont our plot f or the surface z = x 2 y 2 , us e the fo llow ing: Θ Press „ô , simu ltaneous ly if i n RPN mode , to acce ss to the PL O T SETUP w indow . Θ Ch ang e TYPE to Ps - C o n t o u r. Θ Press ˜ and t y pe ‘X^2 Y^2’ @@@OK@@@ . Θ Make sur e that ‘X’ is s elected as the Indep: and ‘Y ’ a s the Depnd: varia bl es. Θ Press L @@@OK@@@ to r eturn to nor mal calculator dis play . Θ Press „ò , simultaneousl y if in RPN mode , to acces s the PL O T WINDO W sc r een. Θ Change the de fa ult plot windo w ra nges to r ead: X-Lef t:- 2 , X- R igh t:2 , Y -N ear:-1 Y -F ar: 1, S tep Indep: 1 0, Depnd: 8 Θ Press @ERASE @ DRAW to dr a w the contour plot . This oper ation w ill take so me time , so , be patient . T he r esult is a cont our plot of the surface . Notice that the contour ar e not necessaril y continuous , ho we v er , they do pr o vi de a good pi ctur e of the le v el surfaces o f the functi on .
Pa g e 1 2 - 3 9 Θ Press @EDIT ! L @LABEL @MENU to see the gr aph w ith labels and r anges . Θ Press LL @) PICT@CANCL to r etur n to the P L O T WINDOW en v ironment . Θ Press $ , o r L @@@OK@@@ , to r eturn to normal calc ulator displa y . T ry als o a P s-Conto ur plot for the surf ace z = f(x,y) = sin x cos y . Θ Press „ô , simultaneou sl y if in RPN mode , to acces s the P L O T SE TUP wi n dow . Θ Press ˜ and t y pe ‘SIN(X)*CO S(Y)’ @@@OK@@@ . Θ Press @ ERASE @DRAW to dr aw the slope f iel d plot . Pre ss @EDIT L @) LABEL @MENU to see the plo t unenc umber ed b y the menu and w ith identify ing labels . Θ Press LL @) PICT to lea v e the EDIT e n vir onment . Θ Press @CANCL to re turn to the PL O T W INDO W env ir onment . Then , pre ss $ , or L @@ @OK @@ @ , to r etur n to nor mal calc ulator dis play . Y -Slice plots Y- S l i c e plots ar e animated plots o f z - v s .-y for diff er ent v alues of x fr om the func tion z = f(x ,y) . F or e x ample , to pr oduce a Y -Sli ce plot fo r the sur f ace z = x 3 -x y 3 , us e the f ollo w ing: Θ Press „ô , simu ltaneous ly if i n RPN mode , to acce ss to the PL O T SETUP w indow . Θ Ch ang e TYPE to Y- S l i c e . Θ Press ˜ and t y pe ‘X^3 X*Y^3’ @@@OK@@@ .
Pa g e 1 2 - 4 0 Θ Make sur e that ‘X’ is s elected as the Indep: and ‘ Y’ as the Depnd: varia bl es. Θ Press L @@@OK@@@ to r eturn to nor mal calculator dis play . Θ Press „ò , simultaneousl y if in RPN mode , to acces s the PL O T WINDO W sc r een. Θ Change the de fa ult plot w indo w r anges to r ead: X-L eft:-1, X-Ri ght:1, Y -Near:- 1, Y -F ar: 1, Z -Lo w :-1, Z -High:1, St ep Indep: 10 Depnd: 8 Θ Press @ERASE @ DRAW to dr aw the three-dimensional surface . Y ou will see the calc ulator pr oduce a ser ies of c urves on the sc r een , that will immedi atel y disappear . When the calc ulator f inishes pr oduc ing all the y-sli ce c ur v es , then it w ill auto maticall y go int o animating the diffe r ent c urve s. One o f the cu r ves i s sh own b el ow . Θ Press $ t o stop the animation . Pr ess @CANCL to r eturn to the P L O T WINDO W env ir onment . Θ Press $ , o r L @@@OK@@@ , to r eturn to normal calc ulator displa y . T ry als o a P s-Conto ur plot for the surf ace z = f(x,y) = (x y) sin y . Θ Press „ô , simultaneou sl y if in RPN mode , to acces s the P L O T SE TUP wi n dow . Θ Press ˜ and t y pe ‘(X Y)*SIN( Y)’ @ @@OK@@ @ . Θ Press @ERASE @DRAW to pr oduce the Y -Slice animation . Θ Press $ to stop the animation . Θ Press @CA NCL to r eturn to the PL O T W INDO W env ir onment . Then , pre ss $ , or L @@ @OK @@ @ , to r etur n to nor mal calc ulator dis play . Gridmap plots Gr idm ap plots pr oduce a gr id of orthogonal curv es desc r ibing a functi on of a comple x v ar iable of the f orm w =f(z) = f(x iy) , w her e z = x iy is a complex var iable . T he functi ons plotted cor r espond to the r eal and imaginar y part of w = Φ (x ,y) i Ψ (x,y), i .e ., they r epre sent c ur v es Φ (x,y) =cons tant , and Ψ (x,y) = cons tant . F or ex ample, t o pr oduce a Gri dmap plot f or the func tion w = sin(z), use the follo wing:
Pa g e 1 2 - 4 1 Θ Press „ô , simu ltaneous ly if i n RPN mode , to acce ss to the PL O T SETUP w indow . Θ Ch ang e TYPE to Gr idmap . Θ Press ˜ and t y pe ‘SIN(X i*Y)’ @ @@OK @ @@ . Θ Make sur e that ‘X’ is s elected as the Indep: and ‘Y ’ as the Depnd: va riabl es. Θ Press L @@@OK@@@ to r eturn to nor mal calculator dis play . Θ Press „ò , simultaneousl y if in RPN mode , to acces s the PL O T WINDO W sc r een. Θ K e ep the def ault plot w indo w r anges to r e ad: X-L eft:-1, X-R ight:1, Y -Near :-1 Y - F ar : 1, XXLeft:-1 XXR ight:1, YYN ear:-1, yyF ar: 1, St ep Indep: 10 Depnd: 8 Θ Press @ERASE @ DRAW to dr a w the gr idmap plot . T he r esult is a gr id of f uncti ons corr esponding to the r eal and imaginary par ts of the comple x functi on. Θ Press @EDIT L @LABEL @ME NU to see the gr aph w ith labels and r anges. Θ Press LL @) PICT @CANCL to r eturn to the PL O T WINDOW en v ir onment . Θ Press $ , o r L @@@OK@@@ , to r eturn to normal calc ulator displa y . Other func tions of a complex v ar iable w orth tr y ing fo r Gr idmap plots ar e: (1) S IN((X,Y)) i .e., F(z) = sin(z) (2)(X,Y )^2 i .e ., F(z) = z 2 (3) E XP((X,Y)) i .e ., F(z) = e z ( 4) SI NH((X,Y)) i .e., F(z) = sinh(z) (5) T AN((X,Y)) i .e ., F(z) = tan(z) (6) A T AN((X,Y)) i .e ., F(z) = tan -1 (z) ( 7) (X,Y)^3 i .e ., F(z) = z 3 (8) 1/(X,Y) i .e., F(z) = 1/z (9) √ (X,Y) i .e ., F(z) = z 1/2 Pr- Sur f ace plots Pr - Surface (par ametr ic surf ace) plots ar e used to plot a thr ee -dimensional surface w hos e coordinat es (x,y ,z) are de sc ribed b y x = x(X,Y) , y = y(X,Y), z=z(X,Y), wher e X and Y are independen t paramet ers .
Pa g e 1 2 - 4 2 F or ex ample, t o pr oduce a Pr- Surface plot f or the surface x = x(X,Y ) = X sin Y , y = y(X,Y) = x cos Y , z=z(X,Y)=X, u se the f ollo w ing: Θ Press „ô , simu ltaneous ly if i n RPN mode , to acce ss to the PL O T SETUP w indow . Θ Ch ang e TYPE to Pr -Surf ace . Θ Press ˜ and t y pe ‘{X*SIN(Y ) , X*C OS( Y) , X}’ @@@OK@@@ . Θ Make sur e that ‘X’ is s elected as the Indep: and ‘ Y’ a s the Depn d : varia ble s. Θ Press L @@@OK@@@ to r eturn to nor mal calculator dis play . Θ Press „ò , simultaneou sly if in RPN mode , to access the PL O T WINDO W sc r een. Θ K e ep the de fault plot w indo w r anges to r ead: X-Left:-1, X -Ri ght:1, Y -Near:-1, Y - F ar : 1, Z -Lo w : -1, Z -High:1, XE: 0, YE:-3, zE: 0, St ep Indep: 10, Depnd: 8 Θ Press @ERASE @DRAW t o dra w the thr ee -dimensional surface . Θ Press @EDIT ! L @LABEL @MENU to see the gr aph w ith labels and r anges . Θ Press LL @) PICT @CANCL to r eturn to the PL O T WINDOW en v ir onment . Θ Press $ , o r L @@@OK@@@ , to r eturn to normal calc ulator displa y . T he VP AR v ariable Th e V P A R ( V o lu me P a ram et er) varia bl e c o nta in s in form at ion reg a rdi ng th e “ v olume ” us ed to pr oduce a thr ee dimensi onal gr aph . Ther efor e , y ou w ill see it pr oduced w henev er you c r eate a thr ee dimensi onal plot such a s F ast3D , Wi r efra me, or Pr-S ur fac e . Not e : The equations x = x(X,Y ) , y = y(X,Y ) , z=z(X,Y ) re pr esent a par ametri c desc r iptio n of a surface . X and Y are the independent par ameters . Most te xtbooks w ill use (u ,v) as the par ameters , r ather than (X,Y) . T hus , the par ametr ic desc r iption o f a surface is gi ven a s x = x(u ,v) , y = y(u ,v) , z=z(u ,v) .
Pa g e 1 2 - 4 3 Inter ac ti ve dr a wing Whene v er w e pr oduce a tw o -dimensi onal gr aph , w e f ind in the gr aphic s sc r een a so ft men u k e y labe led @) EDIT . Pr essing @) EDIT produce s a menu that include the fo llo w ing options (pr ess L to see additi onal functi ons): T hro ugh the ex amples abo v e , yo u hav e the opportunit y to try out func tions L ABE L, MENU , P ICT  , and REPL . Many of the r emaining f unctions , such as DO T , DO T-, LINE , BOX, CIR CL , MARK, DEL , etc., can be u sed to dr aw po ints, lines , cir cles , etc. on the gr aphics sc r een, as des cr ibed below . T o see ho w to use thes e func tions w e w ill try the f ollo wing e x er c ise: F i r st , w e get the graphi cs s cr e en cor r esponding t o the follo w ing instruc tions: Θ Press „ô , simultaneou sly if in RPN mode , to acces s to the PL O T SE TUP wi ndo w . Θ Chang e TYPE to Function , if needed Θ Change E Q to ‘X’ Θ Mak e sur e that Indep: is set to ‘X’ also Θ Press L @@@OK@@@ to r eturn t o normal cal cul ator displa y . Θ Press „ò , simultaneo usl y if in RPN mode , to access the P L O T w indo w (in this case it w ill be called PL O T –P OL AR w indo w) . Θ Change the H-VIEW r ange to – 10 to 10, b y using 10\ @@@OK@@@ 10 @@@OK@@@ , and the V -VIEW r a nge to -5 to 5 b y using 5\ @@@OK@@@ 5 @@@OK@@@ . Θ Press @ERASE @ DRAW to plot the func tion . Θ Press @EDIT L @L ABEL to add labels to the gr aph . Pr ess LL (o r „« ) to r ecov er the or i ginal ED I T menu .
Pa g e 1 2 - 4 4 Ne xt , we illus tr ate the use o f the differ ent dr a w ing functi ons on the r esulting gr aphi cs sc r een . The y req uir e use of the c ursor and the ar r o w k ey s ( š™— ˜ ) to mo ve the c ursor about the gr aphic s scr een. DO T and DO T - When DO T is selec ted , pi xels w ill be ac ti vat ed wher ev er the c urs or mo ve s leav ing behind a trace of the c urs or positi on . When DO T - is select ed, the opposite eff ect occ urs, i .e., as y ou mo ve the cur sor , pi x els w ill be deleted. F or ex a m ple , use the ™— k e y s to mo ve the c ursor s ome wher e in the mi ddle of the f irs t quadrant o f the x -y plane , then pre ss @DOT @@ . The labe l wil l be sele cted ( DOT  @ ) . Pr ess and hold the ™ k e y to see a hor i z ont al line being tr aced. No w , pr ess @ DOT-@ , to s elect this opti on ( @DOT-  @ ) . Pre ss and hold the š ke y to s ee the line y ou j ust tr aced be ing er ased. Pr ess @ DOT- , w hen do ne , to dese lect this option . MARK T his command allow s the user t o set a mark po int whi ch can be us ed for a number o f purpo ses , such as: Θ Start of line w ith the LINE or TLINE command Θ Cor ner for a BO X command Θ Cent er f or a CIR CLE command Using the MARK command b y itself simpl y leav es an x in the location o f the mark (Pr ess L @MARK to se e it in actio n) . LINE T his command is u sed to dr aw a line betw een two po ints in the gr aph . T o see it in acti on, po sition the c ursor s ome wher e in the fir st quadr ant , and pre ss „« @LINE . A MARK is placed ov er the c ursor indi cating the or igin of the line . Us e the ™ k e y to mo ve the c urs or to the r ight of the c urr ent positi on, s ay about 1 cm to the r igh t , and pre ss @LINE . A line is dra w betw een the f irst and the last po ints. Notice that the c urs or at the end of this line is still acti ve indi cating that the calc ulator is r eady to plot a line st ar ting at that point . Pre ss ˜ to mov e the c ursor do wn w ar ds, sa y about another cm , and pre ss @LINE again . No w y ou
Pa g e 1 2 - 4 5 should ha ve a s tr aight angle tr aced b y a hori z ontal and a v ertical segme nts. T he cur sor is still acti ve . T o deacti vat e it , w ithout mov ing it at all, pr ess @LINE . T he cu rsor r eturns to its n ormal sha pe (a cr o ss) and the LINE func tion is no longer acti ve . TLINE (T oggle LINE) Mo v e the cur sor to the s econd quadr ant to see this f uncti on in acti on. Pr ess @TLINE . A M ARK is placed at the st art of the toggle line . M o ve the c urs or w ith the arr o w k e y s aw a y fr om this po int , and pr ess @ TLINE . A line is dr aw n f r om the c urr ent c urso r position t o the r ef er ence point s elected ear lie r . P ix els that ar e on in the line path w ill be turned off , and v ice v ers a. T o remo ve the mos t r ecent line tr aced , pre ss @ TLINE again. T o deacti vate TLINE , mo v e the c ursor t o the o ri ginal point wher e TLINE w as acti vated , and pr ess @LINE @LINE . BO X T his command is u sed to dr aw a bo x in the gr aph . Mo ve the c ur sor to a clear ar ea of the gr aph , and pr ess @ BOX@ . This hi ghlights the c ursor . Mov e the cur sor w ith the arr o w ke ys to a po int a wa y , and in a diagonal dir ection , fr om the c urr ent c urs or position . Pr ess @BOX@ again . A r ectangl e is dr aw n w hose diagonal j oins the initi al and ending c ursor po sitio ns. The initi al positi on of the bo x is still mark ed with and x . Mov ing the curs or to another position and pr essing @BOX@ w ill gener ate a ne w bo x containing the initi al point . T o deselect BO X, mo ve the cur sor to the or iginal po int wher e BOX w as acti vated , then pr es s @LINE @LINE . CIRCL T his command produce s a c ir cle . Mark the center o f the c irc le w ith a MARK command , then mo ve the c ursor to a point that w ill be part of the periphery of the c ir cle , and pre ss @ CIRCL . T o deac ti vate CIRCL , r eturn the c ursor to the MARK positi on and pr es s @LINE . T ry this command by mo ving the c ursor to a c lear part of the gr aph , pr ess @ MARK . Mov e the cursor to anoth er point, th en press @CIRCL . A ci rc le center e d at the MARK, and passing thr ough the last po int w ill be dr a wn . LAB EL Pr es sing @LABEL places the la bels in the x- and y-axes o f the c urr ent plot . T his featur e has been us ed e xtensi vel y thr ough this c hapter .
Pa g e 1 2 - 4 6 DEL T his command is u sed to r emov e parts of the gr aph betw een two MARK positi ons. Mo v e the cur sor to a po int in the gr aph, and pr ess @MARK . Mov e the c ursor t o a diff er ent point , pres s @M ARK again . Then , pr ess @@DEL@ . The s ection o f the gr aph bo x ed between the tw o marks w i ll be de leted. ERASE T he functi on ERASE c lears the en tir e gra phic s w indow . This co mmand is a vailable in the P L O T menu , as w ell as in the plotting w indo w s accessible thr ough the so ft menu k e ys . MENU Pr es sing @MENU will r emov e the soft k ey men u labels to sho w the graphi c unenc umber ed b y those labels . T o r ecov er the labe ls, pr es s L . SUB Use this command to e x tr act a subset o f a gra phics object . T he e xtr acted obj ect is automati call y placed in the stac k. Se lect the subs et y ou want to extr act by plac ing a MARK at a point in the gr aph, mo ving the c ursor to the di agonal cor ner of the r ectangle enc losing the gr aphi cs sub set , and pr ess @@SUB@ . T his featur e can be u sed to mo v e parts of a gr aphic s objec t ar ound the gr aph. REP L T his command places the contents of a graphi c obj ect c urr ently in stac k lev el 1 at the c ursor locati on in the graphi cs w indo w . The upper le ft cor ner of the gr aphi c obj ect being ins erted in the gr aph w ill be placed at the cu rsor po sition . Th us, if y ou w ant a gr aph fr om the stac k to completel y fill the gr aphi c windo w , mak e sur e that the cu rsor is placed at the upper left corner o f the displa y . PI C T  T his command places a copy o f the gr aph c urr en tly in the gr aphics w indow on to the st ack as a gr aphic ob jec t . Th e gra phic ob jec t placed in the stac k can be sav ed into a var iable name f or st orage or other ty pe of manipulation .
Pa g e 1 2 - 47 X,Y  T his command copies the coor dinates o f the cur r ent cur sor positi on, in us er coor dinates , in the stac k . Z ooming in and out in th e gr aphics display Whene v er y ou pr oduce a tw o -dimensi onal FUNCTION gr aphi c inter acti ve ly , the f irst s oft-menu k e y , labeled @) ZOOM , lets yo u access func tions that can be used to z oom in and o ut in the c urr ent gra phics dis play . T he Z OOM men u includes the f ollo w ing func tions (pr es s L to mo ve to the next menu) : W e pr esent eac h of thes e functi ons f ollo w ing . Y ou jus t need to produ ce a gr aph as indi cated in C hapter 12 , or w ith one of the pr ogr ams listed ear lier in this Cha pter . ZF A CT , ZIN, ZO UT , and ZL A ST Pr es sing @) ZFACT pr od u ces an input scr een that allow s you to c hange the c urr ent X- and Y -F acto rs. T he X- and Y -F actor s re late the hor i z ont al an d v er ti cal user - def ined unit r anges to their co rr esponding p i xe l r anges. Change the H-F act or to r ead 8., and pr ess @@@OK@@@ , then change the V -F acto r to r ead 2 ., and pr es s @@@OK@@ . Chec k off the option  Recenter on cursor , and pr es s @@@OK@@ . Bac k in the gr aphi cs displa y , pr ess @@ZIN @ . The gr aphic is r e -dr aw n w ith the ne w ve rtical and hori z ontal scale fact ors , center ed at the position w her e the c ursor w as located , w hile maintaining the o ri ginal PICT si z e (i .e ., the ori ginal number of p ix els in both d i rec tions). Using the arr ow k e y s, s cr oll hor i z ontally or ve rtically as f ar as y ou can of the z oomed-in gr aph. T o z o om out , sub jected to the H- and V-F actors set w i th ZF A CT , pr ess @) ZOOM @ZOUT . The r esulting gr aph w ill pr ov ide mo r e detail than the z oomed-in gr aph .
Pa g e 1 2 - 4 8 Y ou can alw a ys r etu r n to the v er y last z oom wi ndow b y u sing @ ZLAST . BO XZ Z ooming in and out of a gi v en gr aph can be pe rfor med by u sing the soft-menu k ey B O XZ . W ith BO XZ you s elect the re ctangular s ector (the “bo x”) that y ou want to z oom in into . Mo v e the curs or to one of the corners of the box (using the ar r ow k e ys), and pr es s @) ZOOM @BOXZ . Using the arr ow k ey s once mor e , mo ve the c ursor to the opposite corne r of the desir ed z oom bo x . The c urso r w ill tr ace the z oom box in the s cr een. W hen desir ed z o o m bo x is selected , pr ess @ZOOM . T he calculat or will z oom in the contents o f the z oom bo x that y ou selected t o fill the entir e sc r een . If y ou no w pre ss @ZOUT , the calculat or wi ll z oom out of the c urr ent bo x using the H- and V -F act ors, whi ch ma y not r eco v er the gra ph vi e w fr om w hic h yo u started the z oom box oper ation . ZDFL T , Z A UT O Pr es sing @ZDFLT r e -dr aw s the c urr ent plot using the de faul t x- and y-range s, i .e. , - 6.5 to 6 .5 i n x, a nd –3.1 to 3.1 in y . The co mma nd @ZAUTO , on the other hand , c reat es a z oom windo w using the cur r ent independent var i able (x) r ange , but adju sting the dependent v ar iable (y) r ange to f it the c urve (as w hen y ou us e the fu nct ion @AUT O in the PL O T WINDO W input f or m ( „ò , simultaneou sly in RPN mode). HZIN, HZ OUT , VZIN and VZ OUT The se func tions z oom in and out the gr aphics s cr e e n in the hori z ontal or vertical dir ecti on accor ding to the c urr ent H- and V -F act ors . CNTR Z ooms in with the cente r of the z oom w indo w in the c urr ent cur sor locati on. T he z ooming fac tors us ed ar e the cur r ent H- and V -F actor s. ZDECI Z ooms the gr aph so as to r ound off the limits of the x -interval to a dec imal val ue. ZINT G Z ooms the gr aph so that the pi x el units become user -def ine units. F or e xam ple , the minimum PI CT w indo w has 131 pi x els. When y ou use ZINT G , w ith the
Pa g e 1 2 - 4 9 c ursor at the cent er of the sc reen , the w indo w gets z oomed so that the x -ax is e xtends fr om –64. 5 to 6 5 . 5 . ZSQR Z ooms the gra ph so that the plotting scale is maintained at 1:1 b y adjus ting the x scale , keep ing the y scale f i xe d, if the w indow is w ider than tall er . This f or ces a pr oportional z ooming. ZTRIG Z ooms the gr aph so that the x scale incorpor ates a range f r om about –3 π to 3 π , the pr ef err ed r ange for tr igono metri c func tions . The S YMBOLIC m enu and gr aphs T he S YMBOLIC men u is acti v ated by pr essing the P k ey (f our th k ey f r om the left in fo ur th r ow fr om the top of the k ey boar d) . This men u pr ov ides a list of menus re lated to the Computer A lgebr aic S ys tem or CAS , these ar e: All but o ne of these me nus ar e av ailable dir ectl y in the k e yboar d by pr es sing the appr opr iate k ey str ok e combinati on as f ollo w s. T he Chapter of the user manual w here the men us ar e desc r ibed is also listed: AL GEBRA.. ‚× (the 4 key ) C h. 5 ARI THME TIC .. „Þ (the 1 key ) C h. 5 CAL CUL US .. „Ö (the 4 k e y) Ch . 13 Not e : None o f these functi ons ar e pr ogr ammable . T he y ar e only u sef ul in an inter acti ve w a y . Do not confus e the command @ZFACT in the Z OOM menu w ith the func tion ZF A CT OR, w hic h is us ed fo r gas dy namic and c hemistry appli cations (see C hapter 3).
Pa g e 1 2 - 5 0 S OL VER.. „Î (the 7 key) Ch. 6 TRIGONO ME TRIC. . ‚Ñ (the 8 key ) C h. 5 EXP &LN.. „Ð (the 8 key ) C h. 5 T he S YMB/GRAPH menu T he GR AP H su b-menu w ithin the S YMB menu inc ludes the f ollo w ing f unctions: DEFINE: same as the k ey stro k e sequence „à (the 2 key ) GR OB ADD: paste s two GROB s fir st o v er the seco nd (See Cha pter 2 2) PL O T(functi on) : plots a f unction , similar t o „ô PL O T ADD(functi on): adds this f uncti on to the lis t of func tions to plot , similar to „ô P lot se tup ..: same as „ô S IGNT AB(func tion): sign t able of gi v en func tio n sho w ing interv als of positi v e and negati ve v ar iation , z er o points and inf inite as ym ptotes T A B V A L: table of v alues f or a func tion T AB V AR: v ar iation table of a functi on Ex amples of so me of these f uncti ons ar e pr ov ided next . PL O T(X^2 -1) is similar to „ô w ith EQ: X^2 -1. Using @ERASE @DRA W pr oduces the plot: PL O T ADD(X^2 -X) is similar to „ô but adding this f uncti on to EQ : X^2 -1. Using @ERASE @DRAW pr oduces the plot:
Pa g e 1 2 - 5 1 T AB V AL(X^2 -1,{1, 3}) pr oduces a list of {min max} v alues o f the functi on in the interv al {1, 3}, w hile SIGNT AB(X^2 -1) show s the sign o f the func tion in the interv al (- ∞ , ) , w ith f(x) > 0 in (- ∞ ,-1) , f(x) <0, in (-1,1), and f(x) > 0 in (1, ∞ ). T AB V AR(LN(X)/X) pr oduces the f ollo w ing table of v ari ation: A deta iled interpretation of the table of v ari a ti on is easier to follo w in RPN mode: The ou tput is in a graphical f orm at, sho wing the or iginal f unction , F(X) , the der i vati v e F’(X) r ight after der iv atio n and after simplif icati on, and f inall y a table of v ar iation . T he table consis ts of tw o ro ws , labeled in the r i ght - hand side . T hus, the top r o w r epr esents v alues of X and the second r o w r epr esents v alues
Pa g e 1 2 - 52 of F . T he question m ar ks indicates u ncertai nty or non -definition. F or ex ample, fo r X<0, LN(X) is not defined , thu s the X lines sho ws a que stion mar k in that interv al. R ight at z er o (0 0) F is inf inite , for X = e , F = 1/e . F incr eas es bef or e r eaching this v alue , as indi cated by the u p war d ar r o w , and dec r eases aft er this value (X=e) becoming sli ghtly lar ger than z er o ( :0) as X goes to infinity . A plot of the gr aph is show n below t o illustr ate these obs ervati ons: Function DR A W3DMA TRIX T his func tion tak es as ar gument a n × m matri x, Z , = [ z ij ], and minimum and max imum values f or the plot . Y ou w ant to se lect the v alues of v min and v max so that the y contain the value s listed in Z . The gener al call to the functi on is, ther ef or e , D RA W3DMA TRI X( Z ,v min ,v max ) . T o illustr ate the use o f this functi on we fi rst g en e ra te a 6 × 5 matri x using R ANM({6 ,5}) , and then call functi on DR A W3DMA TRIX, as sho wn belo w : T he plot is in the style o f a F AS T3D P L O T . Differ ent v ie w s of the plot ar e sho w n belo w :
P age 13-1 Chapter 13 Calculus Applications In this Chapte r we dis cu ss appli cations of the calc ulator ’s functi ons to oper ations r elated to Calc ulus, e .g., limits , der i vati v es , integr als, po we r ser ies , etc. T he CAL C (Calc ulus) menu Man y of the func tions pr esented in this Chapte r ar e contained in the calc ulator ’s CAL C menu , av ailable thr ough the ke ystr ok e sequence „Ö (ass oc iated w ith the 4 k ey) . T he CAL C menu sho ws the fo llo w ing entr ies: T he fir st f our options in this menu ar e actually sub-men us that appl y to (1) der i vati v es and integrals , ( 2) limits and pow er se ri es, (3) diff er enti al equations, and ( 4) gr aphic s. The f unct ions in entr ies (1) and (2) w ill be pre sented in this Chapte r . Differ ential eq uations , the subj ect of item ( 3) , ar e pr esent ed in Chapter 16. Gr aphic f uncti ons, the sub ject of item (4), wer e pr esented at the end of Cha pter 12 . F inally , entr ies 5 . DERVX and 6 .INTVX are the f uncti ons to obtain a der i vati ve and a indef inite integr al f or a functi on of the def ault CA S var iable (typi call y , ‘X’) . F unctions DER VX and INT VX ar e disc ussed in detail later . Limits and der iv ati ves Diffe r ential calc ulus deals w ith der i vati ves , or r ates of c hange , of f unctions and their a pplicatio ns in mathematical anal y sis . The der i v ativ e of a func tion is def ined as a limit of the differ ence of a functi on as the inc r ement in the independent v ar iable t ends to z er o . L imits ar e used also t o chec k the continuity of funct i ons.
P age 13-2 Function lim T he calculat or pr ov ides f uncti on lim t o c a l cu l at e l i m i t s of fu n c t io n s. Th i s f un c t io n use s as input an e xpre ssi on re pr esenting a func tion and the v alue wher e the limit is to be calc ulated. F unction lim is av ailable thr ough the command catalog ( ‚N~„l ) or thr ough opti on 2 . LIMIT S & SERIE S… of the CAL C menu (see abo ve). Fu n c ti o n lim is ent er ed in AL G mode as lim(f(x),x=a) t o calc ulate the limit . In RPN mode , enter the func tion f irs t , then the expr ession ‘ x=a ’ , and f inall y functi on lim . Example s in AL G mode ar e show n ne xt , inc luding some limits to inf inity . T he k e y str ok es f or the f irs t ex ample are a s fo llo w s (using Algebr aic mode , and sy stem f lag 117 set to CHOO SE bo xe s) : „Ö2 @@OK@@ 2 @@OK@ @ x 1‚í x‚Å 1` T he infinity s ymbol is as soc iated w ith the 0 k e y , i.e .., „è . Not e : The f uncti ons av ailable in the LIMI T S & SERIE S menu ar e sho wn ne xt: F u nc tion DI VPC is u sed to di v ide tw o poly nomials pr oduc ing a ser ies e xpansion . F unctions D I VP C, SERIE S, T A YL OR0, and T A YL OR ar e us ed in ser ie s e xpansions o f functi ons and disc uss ed in more detail in this C hapter . ) ( lim x f a x →
P age 13-3 T o calc ulate one -sided limits, add 0 or -0 t o the value to the v ari able . A “ 0” means limit fr om the ri ght , w hile a “-0” means limit fr om the left . F or ex ampl e , the limit of as x appr oaches 1 fr om the left can be determined with the fo llo w ing k ey str ok es (AL G mode): ‚N~„l˜ $OK$ R!ÜX- 1™@íX@Å1 0` T he re sult is as fo llow s: De rivat ives T he deri vati v e of a f uncti on f(x) at x = a is defi ned as the limit Some e xamples o f der iv ativ es u sing this limit ar e show n in the f ollo w ing sc r een shots: Functions DERIV and DER VX T he functi on DERIV is us ed to tak e der i v ati ve s in ter ms of any independent var iable , w hile the functi on DERVX t ak es deri vati v es w ith re spect t o the CAS def ault v ari able VX (typi call y ‘X’) . While fu nctio n DERVX is av ailable dir ectly in the CAL C menu , both func tions ar e av ailable in the DERIV .&INTE G sub-menu w ithin the CAL CL menu ( „Ö ). F uncti on DERIV r equir es a f unction , say f(t), and an independe nt var iable , sa y , t, w hile functi on DERVX r equire s only a f uncti on of VX. Ex amples ar e sho wn ne xt 1 − x h x f h x f x f dx df h ) ( ) ( lim ) ( ' 0 − = = > −
P age 13-4 in AL G mode . Re call that in RPN mode the ar guments must be e nter ed bef ore the func tion is appli ed. T he DERIV&INTEG menu T he functi ons a vailable in this sub-me nu ar e listed be low : Out of the se func tions DERIV and DER VX ar e used f or deri vati v es. The other func tions inc lude functi ons r elated to anti-der i vati ves and integr als (IBP , INT VX, PREV AL, RIS CH, S IGMA, and SIG MA VX) , to F ouri er ser ie s (FOURIER) ,and t o v ector anal y sis (CURL , DIV , HE S S, LAPL ) . Ne xt we dis c uss f uncti ons DERIV and DERVX, the r emaining functi ons are pr esented e ither later in this Cha pter or in subsequent Chap ters . Calculating deriv ati ves w ith ∂ T he sy mbol is av ailable as ‚¿ (the T k e y) . T his s y mbol can be u sed to enter a der iv ati v e in the stac k or in the Eq uation W riter (s ee Chapter 2) . If y ou use the s ymbol to w r ite a deri vati v e into the s tack , f ollo w it immediatel y w ith the independent v ari able , then by a pair of par enthese s enclo sing the functi on to
P age 13-5 be differ entiated . T hus , to calc ulate the deri vati v e d(sin(r ) ,r ) , us e , in AL G mode: ‚¿~„r„ÜS~„r` In RPN mode , this expr essi on must be enc los ed in quot es befo r e enter ing it into t he sta ck. Th e r e su lt in AL G mo de i s: In the E quati on W r iter , when y ou pr ess ‚¿ , the calc ulat or pr ov ides the fo llo w ing expr essio n: The in sert cursor (  ) w ill be locat ed ri ght at the de nominator a waiting f or the user to enter an indepe ndent v ari able , say , s: ~„s . T hen , pr es s the r igh t - arr o w k e y ( ™ ) to mov e to the placeholder betw een par enthese s: Ne xt, ente r the functi on to be differ enti ated, sa y , s*ln(s) :
P age 13-6 T o e valuate the der iv ati v e in the E quation W r iter , pres s the up-arr ow k ey — , fo ur times, t o selec t the entir e e xpr essi on , then, pr ess @ EVAL . The der i vati ve w ill be e valuated in the E quation W riter as: T he c hain r ule T he chain rule f or der i vati ves appli es to der i vati ve s of composite f uncti ons. A gener al e xpr essi on f or the chain-rule is d{f[g(x)]}/dx = (df/dg) ⋅ (dg/dx). Using the calc ulator , this for mula r esults in: T he ter ms d1 in fr ont of g(x) and f(g(x)) in the e xpre ssion abo v e ar e abbr e v iatio ns the calculat or uses to indicate a f irs t deri vati v e when the independent v ar iable , in this case x , is clear ly de fined . T hus , the latter r esult is interpr eted as in the f ormula f or the chain rule sho w n abov e . Here is another e x ample of a c hain rule appli cation: Not e : The s ymbo l ∂ is used f ormall y in mathemati cs to indi cate a partial der i vati ve , i .e., the der iv ati ve of a functi on w ith mor e than one var iable . Ho w ev er , the calculator doe s not distinguish between or dinar y and partial der i vati ves , utili zing the same s ymbol f or both . The user m ust k eep this distinc tion in mind when tr anslating r esults fr om the calc ulator to pa per .
P age 13-7 Deri v ativ es of equations Y ou can use the calc ulator to calc ulate der i v ativ es o f equations , i .e ., e xpr essi ons in w hic h deri vati v es w ill ex ist in both sides o f the equal sign. S ome e xample s ar e sho wn belo w: Notice that in the e xpr es sions w her e the deri v ati ve si gn ( ∂ ) or function DERIV w as used , the equal sign is pr eserv ed in the equation, but not in the case s w here f uncti on D ER V X w as us ed. In these case s, the equatio n was r e -wr i tten w ith all its ter ms mo ved to the le ft -hand si de of the equal sign . Als o , the equal sign w as r emo v ed, bu t it is unders tood that the r esulting e xpre ssi on is equal to ze ro. Im pl ic it de rivative s Implic it der iv ati v es ar e possible in e xpr essi ons suc h as: Application of der iv ativ es Deri vati v es can be used f or anal yzing the gra phs of functi ons and for optimi zing functi ons of one v ar iable (i .e., f i nding max ima and minima) . Some appli cati ons of der i v ati v es ar e sho w n ne xt .
P age 13-8 Analyzing gr aphics of func tions In Chapter 11 w e pre sented some f unctions that ar e av ailable in the graphic s sc r een f or anal yzing gr aphi cs of func tions of the f orm y = f(x). The se fu nctio ns inc lude (X,Y) and TR A CE f or determining po ints on the gr aph , as w ell as func tions in the Z OOM and FCN menu . The f uncti ons in the Z OOM menu allo w the user to z oom in into a graph t o analyz e it in mo r e detail . The se func tions ar e desc ribed in detail in C hapter 12 . Within the f uncti ons of the FCN menu , we can use the f uncti ons SL OPE , EXTR , F’ , and T ANL to deter mine the slope of a tangent to the gr aph , the e xtr ema (minima and max ima) of the func tion , to plot the der i vati ve , and to find the equati on of the tangent line . T ry the follo w ing e x ample for the functi on y = tan(x). Θ Press „ô , simultaneou sly in RPN mode , to access to the PL O T SE TUP wi ndo w . Θ Chang e TYPE to FUNCTION , if needed , by u sing [ @CHOOS ]. Θ Press ˜ and type in the equati on ‘T AN(X)’ . Θ Mak e sur e the independent var iable is set t o ‘X’ . Θ Press L @@@OK@@@ to r eturn to no rmal calc ulator displa y . Θ Press „ò , simultaneo usly , to access the P L O T wi ndow Θ Change H- VIEW r ange to –2 to 2 , and V -V IEW range to –5 to 5 . Θ Press @ERASE @ DRAW to plot the functi on in polar coordinate s. T he re sulting plot looks as f ollo w s: Θ Noti ce that ther e are v er t i cal lines that r epresent as y mptotes. T hese ar e not par t o f the gr aph, but sho w points w her e T AN(X) goes to ±∞ at certain value s of X. Θ Press @TRACE @ ( X,Y) @ , and mov e the c urs or to the point X: 1. 08E0, Y : 1.8 6E0. Next , pres s L @) @FCN@ @SLOPE . T he re sult is Slope: 4 .4501 054 7 846. Θ Press LL @TANL . T his oper ation pr oduces the equatio n of the tangent line , and plots its gr aph in the same fi gur e . The r esult is sho w n in the f igur e below :
P age 13-9 Θ Press L @PICT @CANCL $ to r eturn t o normal calc ulator displa y . Notice that the slope and tangent line that y ou r eques ted ar e listed in the stac k . Function DOMAIN F uncti on DOMAIN , av ailable thr ough the command catalog ( ‚N ), pr o v ides the domain of def inition of a func tion as a list of numbers and spec if icati ons. F or e xam ple , indicat es that between – ∞ and 0, the func tion LN(X) is not def ined (?) , w hile fr om 0 to ∞ , the functi on is def ined ( ) . On the other hand , indicat es that the functi on is not def ined between – ∞ and -1, nor betw een 1 and ∞ . The domain of this functi on is, ther efor e , -1<X<1 . Function T AB V AL T his func tion is accesse d thr ough the command cat alog or thr ough the GR AP H sub-men u in the CAL C menu . F uncti on T A B V AL tak es as ar guments a functi on of the CA S var iable , f(X) , and a list of two n umbers r epr esenting a domain o f inter es t for the f uncti on f(X) . F unc tion T AB V AL r eturns the input v alues plus the r ange of the f unction cor r esponding to the domain us ed as input . F or e x ample ,
P age 13-10 T his re sult indicat es that the r ange of the f uncti on cor r esponding to the domain D = { -1,5 } is R = . Function SIGNT AB F uncti on SIGNT AB, a v ailable thr ough the command catalog ( ‚N ), pro v ides inf orma tion on th e sign of a function th r o ugh it s domai n . F or ex a mple , fo r the T AN(X) func tion , SIGNT AB indicate s that T AN(X) is negativ e betw een – π /2 and 0, and po siti ve between 0 and π /2 . F or this cas e , SIGNT AB does not pr o v ide infor mation (?) in the inte rvals betw een – ∞ and - π /2 , nor between π /2 and ∞ . Thu s, S IGNT AB , for this ca se , pr ov ides inf ormati on onl y on the main domain of T AN(X) , namel y - π /2 < X < π /2 . A second e x ample of func tion S IGNT AB is sho w n belo w: F or this ca se , the func tion is negati v e for X<-1 and positi ve f or X> -1. Function T AB V AR T his func tion is accesse d thr ough the command cat alog or thr ough the GR AP H sub-menu in the CAL C menu . It uses as in put the functi on f(VX) , wher e VX is the def ault CA S var iable . T he func tio n re turns the f ollo w ing , in RPN mode: 1 1 ) ( 2 = X X f ⎭ ⎬ ⎫ ⎩ ⎨ ⎧ 26 26 , 2 2
P age 13-11 Θ L ev el 3: the f uncti on f(VX) Θ T w o lists , the fir st one indicate s the var iation of the f uncti on (i .e ., wher e it inc reas es or dec reas es) in ter ms o f the independent var iable VX, the second one indicate s the var iati on of the f uncti on in term s of the dependent v a r iable . Θ A gr aphic ob jec t sho w ing ho w the var i atio n table w as compu ted . Ex ample: Anal yz e the functi on Y = X 3 -4 X 2 -11X 30, u sing the func tion T AB V AR. Use t he fo llow ing k e ys tr ok es , in RPN mode: 'X^3-4*X^2 -11*X 30' `‚N ~t (selec t T AB V AR) @@OK@@ T his is what the calc ulator sho ws in s tack le v el 1: This is a gr aphic object . T o be able to the r esult in its entir ety , pr ess ˜ . T he var iation table o f the function is sho w n as follo ws: Press $ to r eco ver n ormal calc ulator displa y . Pr ess ƒ to dr op this last r esult f r om the stac k . T w o lists, cor r esponding t o the top and bottom r ow s of the gr aphic s matri x sho w n earli er , no w occ up y lev el 1. T hes e lists ma y be usef ul f or pr ogr amming pu r poses. Pr ess ƒ t o dr op this last r esult f r om the stac k.
P age 13-12 The interpr etation of the v ariati on table show n abov e is as follo ws: the functi on F(X) incr eases f or X in the int erval (- ∞ , -1) , r eaching a max imum equal to 3 6 at X = -1. Then , F(X) decr eas es until X = 11/3, r eaching a minimum of –4 00/2 7 . After that F(X) incr eases until r eac hing ∞. Al so , at X = ±∞ , F(X) = ±∞ . Using deri vati ves to calculate e xtr eme points “Extr eme poin ts, ” or extr ema, is the gener al designati on f or maximum and minimum v alues of a f unctio n in a giv en in terval . Since the de ri vati v e of a func tion at a gi v en point r e pr esen ts the slope o f a line tangent to the c urve at that point , then values o f x for w hi ch f ’(x) =0 r epr esent points w her e the gra ph of the functi on r eac hes a max imum o r minimum . F urthermor e, the value of the second der i vati ve of the f uncti on, f ”(x) , at thos e points dete rmines w hether the point is a r elati v e or local max imum [f”(x)<0] or minimum [f”(x)>0]. T hese ideas ar e illustr ated in the f igur e belo w . In this f igur e w e limit ours elv es to determining e xtre me points of the f uncti on y = f(x) in the x -interv al [a,b]. W ithin this inte r v al we f ind tw o points , x = x m and x = x M , w here f ’(x)=0. The point x = x m , w here f ”(x)>0, r epre sents a local minimum , while the po int x = x M , w here f ”(x)<0, r e pr esents a local max imum . F r om the gr aph of y = f(x) it f ollo w s that the absolu te max imum in the interv al [a ,b] occur s at x = a, w hile the absolute minimum occ urs at x = b . F or ex ample , to de termine w her e the cr itical points o f functi on 'X^3- 4*X^2 - 11*X 30 ' occur , we can u se the f ollo w ing entr ie s in AL G mode:
P age 13-13 W e fi nd two c r itical po ints, one at x = 11/3 and one at x = -1. T o ev aluate the second der i vati ve at eac h point use: T he last s cr een show s that f”(11/3) = 14 , thus , x = 11/3 is a r elati v e minimum . F or x = -1, we ha ve the f ollow ing: T his r esult indi cate s that f ”(-1) = -14 , th us , x = -1 is a r elati v e max imum . Ev aluate the f unction at tho se points t o ve r ify that indeed f(-1) > f(11/3) . Hi gh er ord er de rivative s Higher or der deri vati v es can be calc ulated b y appl y ing a der iv ati v e fu nctio n se v er al times , e .g .,
P age 13-14 Anti-deri v ati ves and integr als An anti-der iv ati ve o f a func tion f(x) is a func tion F(x) su ch that f(x) = dF/dx . F or e x ample , since d(x 3 ) /dx = 3x 2 , an anti-de r i vati v e of f(x) = 3x 2 is F(x) = x 3 C, w here C is a constant . One w ay to r ep r esent a n anti-der i vati ve is as a indefinite inte gr al , i .e ., , if and onl y if , f(x) = dF/dx, and C = const ant . Functions INT , INT VX, RIS CH, SIGMA and SI GMA VX T he calculator pr ov ides f unctions INT , INTVX, RIS CH, S IGMA and S IGMA VX to calc ulate anti-de ri vati v es of f u nc tions . F unctions INT , RIS CH, and S IGMA w ork w ith func tions o f an y var ia ble , while f uncti ons INT VX, and S IGMA VX utili z e func tions of the CA S v ari able VX (t y pi call y , ‘ x ’) . F uncti ons INT and RIS CH r equir e , ther ef or e , not only the e xpr es sion f or the f unctio n being integr ated , but also the independe nt var iable name . F uncti on INT , r equir es als o a value of x w here the anti-der i vati v e w ill be e valuated . F unctions INTVX and SIG MA VX r equire onl y the expr ession of the functi on to integrate in terms of VX. Some e x amples ar e show n next in AL G mode: P lease no tice that f unctions S IGMA VX and SIG MA ar e designed f or inte grands that inv ol v e some sort of int eger funct ion lik e the fac tor ial (!) f uncti on sho wn C x F dx x f = ∫ ) ( ) (
P age 13-15 abo v e . The ir re sult is the so -called discr ete der i vati ve , i .e . , one de fined f or integer n umbers onl y . Definite integr als In a def inite integr al of a f uncti on, the r esulting anti-der i vati ve is e valuated at the upper and lo wer limit o f an int erval (a ,b) and the ev a l uated value s subtr acted . S y mbolicall y , wher e f(x) = dF/dx . T he PRE V AL(f(x) ,a ,b) f uncti on of the CA S can simplif y su ch calc ulati on by r eturn ing f(b) -f(a) w ith x being the CA S va ri able VX. T o calculat e def inite integr als the calc ulator also pr o vi des the integr al s ymbol a s the k e y str ok e combinat ion ‚Á (a ssoc i ated w ith the U key ) . Th e si m pl e st w ay to build an integr al is b y using the E quati on W r iter (see C hapter 2 f or an e x ample) . W ithin the E quatio n W r iter , the s ymbol ‚Á pr oduces the integr al sign and pro vi des placeholder s fo r the integr ation limits (a ,b) , for the func tion , f(x), and for the v ar iable of int egr ation (x). The f ollo w ing sc r een shots sho w ho w to build a par ti cu lar integr al . The insert c urso r is fir st located in the lo w er limit of int egr ation , ente r a value and pr es s the ri ght-arr o w k e y ( ™ ) to mo ve to the upper limit of int egr ation . Ente r a value in that locati on and pr ess ™ again to mo ve t o the integr and locati on. T ype the integr and e xpre ssio n, and pr ess once mor e to mov e t o the differ enti al place holder , type the v ar iable of int egr ation in that location and the int egr al is re ady to be calc ulated. At this point , you can pr ess ` to r eturn the integr al to the stac k, w hic h will sho w the f ollo w ing entry (AL G mode sho w n) : ), ( ) ( ) ( a F b F dx x f b a − = ∫
P age 13-16 T his is the gener al for mat for the de finit e integral w hen typed dir ectly into the stac k, i .e ., ∫ (low er limit , upper limit , inte gr and, v ar ia ble of int egrati on) Pr es sing ` at this point w ill e valuat e the integral in the stac k: T he integral can be e valuated also in the E quation W rite r by s electing the entir e e xpre ssi on an using the soft menu k e y @ EVAL . Step-b y-step e valuation o f d e ri vati ves and integr als W ith the Step/S tep opti on in the CAS MODE S windo ws s elected (s ee Chapter 1) , the e valuati on of der i vati ves and integr als w ill be sho wn st ep by st ep . F or e xam ple , her e is the ev aluation of a der iv ati ve in the E quation W r iter : ʳʳʳʳʳ Notice the a pplicati on of the c hain rule in the f irst s tep , lea ving the de ri vati v e of the func tion under the integr al expli c itly in the nu merat or . In the second step , the r esulting fr action is r ationali z ed (e liminating the squar e r oot fr om the denominato r), and simplif ied . T he final v er sion is sh o wn in the thir d st ep . E ach step is sh ow n by pr essing the @EVAL menu k ey , until re aching the po int whe r e further a pplicati on of f uncti on EV AL pr oduce no mor e change s in the ex p ress io n.
P age 13-17 T he follo w ing ex ample sh o ws the e v aluation of a defi nite integr al in the E quation W riter , s tep-by-step: ʳʳʳʳʳ Notice that the st ep-by-s tep pr ocess pr ov ide s infor mation on the inter mediate step s follo wed b y the CAS to solv e this integr al . F irst , CAS ide ntif ies a squar e r oot integr al, ne xt, a r ational f r actio n, and a second r a ti onal e xpr essi on, t o come up w ith the final r esult . Notice that thes e steps mak e a lot of sense to the calc ula t or , although not eno ugh inf ormati on is pro vi ded to the u ser on the indi v idual s teps . Integr ating an equation Integr ating an equati on is str aightf orwar d, the calc ulator simpl y integr ates both sides o f the equation sim ultaneousl y , e.g . ,
P age 13-18 T ec hniques o f integr ation Se v er al techni ques of int egr ation can be im plemented in the calc ulators , as sho w n in the f ollo w ing e x amples . Substitution or chang e o f var iables Suppose w e want to calc ulate the integr al . If w e us e step-by- step calc ulatio n in the Eq uation W rit er , this is the sequence of v ari able subs titutio ns: T his second step sho w s the pr oper subs tituti on to use , u = x 2 -1. The last four steps sho w t he progr ession of the solution: a square r o ot , follo wed b y a fr acti on , a second fr action , and the f inal r esult . This r esult can be simplif ied b y using f uncti on @SIMP , to r ead:
P age 13-19 Integration b y par ts and differentials A differ ential o f a functi on y = f(x) , is de fined a s dy = f’(x) dx , w her e f’(x) is the der i vati v e of f(x). Differ enti als ar e used to r epr esen t small incr ements in the var iables . The diff er ential o f a pr oduct of tw o functi ons , y = u(x)v(x) , is gi v en by dy = u(x)d v(x) du(x)v(x), or , simply , d(u v) = udv - vdu . Th us , the integr al of udv = d(uv) - vdu , is wr itten as . Since b y the def inition of a differ ential , ∫ dy = y , we wri te th e p re vio us ex pres sio n a s . T his for mulati on , kno w n as inte gr ation b y parts, can be us ed to f ind an integr al if dv is ea sily int egra ble. F or e xample , the integr al ∫ xe x dx can be s ol v ed by integr ation b y parts if we u se u = x , dv = e x dx , since , v = e x . W ith du = dx, the integr al becomes ∫ xe x dx = ∫ udv = u v - ∫ vdu = x e x - ∫ e x dx = x e x - e x . T he calculat or pr o vi des f uncti on IBP , unde r the CAL C/DERIV&INT G menu , that tak es as ar gumen ts the or iginal func tion t o integr ate , namel y , u(X)*v’(X) , and the f unction v(X), and r eturns u(X)*v(X) and -v(X)*u ’(X) . In other w or ds , func tion IBP r eturns the tw o terms of the right-hand side in the int egr ation b y parts equation . F or the ex ample used abo v e , we can w r ite in AL G mode: Th us, w e can use f uncti on I BP to pr ov ide the compo nents of an integrati on b y parts. T he ne xt step w ill hav e to be car ri ed out separ ately . It is important to menti on that the integr al can be calculat ed direc tly b y u sing, fo r ex ample, ∫∫ ∫ − = vdu uv d udv ) ( ∫ ∫ − = vdu uv udv
P age 13-20 Integration b y par tial fr actions F unction P A R TFR A C, presented in Chapte r 5, pr o vi des the decompositi on of a fr action int o par ti al fr acti ons. T his techni que is us eful t o r educe a complicated fr action into a sum of simple f r actio ns that can then be integrated t erm b y ter m. F or ex ample , to integrate w e can decompose the f r acti on into its par ti al component fr actions , as follo ws: T he direc t integr ation pr oduces the same re sult , w ith some s w itc hing of the ter ms (R igo r ous mode set in the CA S – see Cha pter 2): Impr oper integrals T hese ar e integr als w ith infinit e limits of integr ation . T y pi call y , an impr oper integr al is dealt with b y f ir st calc ulating the integr al as a limit to inf init y , e.g ., . ∫ dX X X X X 3 4 5 2 5 ∫ ∫ ∞ → ∞ = ε ε 1 2 1 2 lim x dx x dx
P age 13-21 Using the calc ulator , w e pr oceed as f ollo ws: Alternati ve ly , y ou can ev aluate the i n tegra l to inf inity fr om the start, e .g ., Integr ation with units An integr al can be calculated w ith units incorpor ated into the limits of integr ation , as in the e x ample sho w n belo w that uses AL G mode , w ith the CAS set to A ppro x mode. T he left -hand side f igur e sho ws the integr al t y ped in the line editor bef or e pr essing ` . T he ri ght-hand figur e sho w s the r esult afte r pr essing ` . If y ou enter the integr al with the CA S set to Ex ac t mode, y ou w ill be asked t o c hange to Appr o x mode , ho we ver , the limits of the integral w ill be show n in a diffe r ent for mat as show n her e: These l imit s r ep r esent 1 × 1_mm and 0 × 1_mm, w hic h is the same as 1_mm and 0_mm , as bef or e . Jus t be aw ar e of the diff erent f ormats in the output .
P age 13-2 2 Some n otes in the u se of units in the limits of int egrati ons: 1 – T he units of the low er limit of integr ation w i ll be the ones u sed in the f inal r esult , as illu str ated in the tw o e x amples belo w : 2 - Upper limit units mu st be consisten t w ith low er limit units. Otherw ise , the calc ulator sim ply r eturns the une valuated integr al . F or e x ample , 3 – T he integrand ma y hav e units too . F or ex ample: 4 – If both the limits o f integr ati on and the integr and hav e units, the r esulting units ar e combined accor ding to the rules o f integr ation . F or e x ample , Infinite ser ies An inf inite se ri es has the f orm . T he inf inite se ri es typ icall y starts w ith indi ces n = 0 or n = 1. E ach te rm in the s er ies has a coeff ic ient h(n) that depends on the inde x n. n n a x n h ) ( ) ( 1 , 0 − ∑ ∞ =
Pa g e 1 3 - 23 T a ylor and Mac laur in’s series A fu nction f( x) can be expanded in to an inf inite ser ie s ar ound a point x=x 0 by using a T a y lor’s ser ie s, namel y , , wher e f (n) (x) r epresen ts the n- th deri vati ve of f(x) w ith r espect to x, f (0) (x) = f(x). If the v alue x 0 is z ero , the ser ies is re fer r ed to as a Maclaur in ’s ser ies , i .e ., T a ylor pol ynomial and r eminder In pr actice , w e c annot e v alua te all ter ms in an infinite s er ies, instead , w e appr o x imate the se ri es b y a poly nomial of or der k, P k (x) , and es timate the or der of a r esidual , R k (x) , su ch that , i .e ., T he poly nomi al P k (x) is r ef err ed to as T a yl or’s pol yn omial . T he or der of the r esi dual is estimated in ter ms of a small quan tit y h = x -x 0 , i .e ., e v aluating the poly nomial at a v alue of x v er y c los e to x 0 . T he re sidual if gi ve n by , ∑ ∞ = − ⋅ = 0 ) ( ) ( ! ) ( ) ( n n o o n x x n x f x f ∑ ∞ = ⋅ = 0 ) ( ! ) 0 ( ) ( n n n x n f x f ∑ ∑ ∞ = = − ⋅ − ⋅ = 1 ) ( 0 ) ( ) ( ! ) ( ) ( ! ) ( ) ( k n n o o n k n n o o n x x n x f x x n x f x f ). ( ) ( ) ( x R x P x f k k = 1 ) 1 ( ! ) ( ) ( ⋅ = k k k h k f x R ξ
P age 13-2 4 wher e ξ is a n umber near x = x 0 . Since ξ is ty pi cally unkn o wn , inst ead of an estimat e of the r esidual , w e pr ov ide an es timate of the or der of the r esi dual in re fe ren c e t o h, i. e. , we s ay t h a t R k (x) has an err or o f orde r h n 1 , or R ≈ O(h k 1 ). If h is a small number , sa y , h<<1, then h k 1 w ill be typi call y very small , i .e ., h k 1 <<h k << …<< h << 1. T hu s, f or x clo se to x 0 , the larger the n umber of elements in the T ay lor pol ynomi al , the smaller the or der of the r esidual . Functions T A YLR, T A YLR0, and SERIES F uncti ons T A YLR, T A YLR0, and SERIE S ar e used to ge nerat e T ay lor poly nomials, as w ell as T a y lor ser ie s w ith r esiduals . T hese f uncti ons ar e av ailable in the CAL C/LIMIT S&SERIE S menu des cr ibed earli er in this Chapte r . F uncti on T A YL OR0 perfor ms a Macla urin s er ies e xpansion, i .e ., about X = 0, o f an e xpre ssi on in the defa ult independent var ia ble , VX (t y picall y ‘X’) . The e xpansion us es a 4 - th or der relati ve po w er , i .e ., the differ ence bet w een the highes t and lo w est po w er in the expansi on is 4. F or e x ample , F uncti on T A YLR pr oduces a T a ylor s eri es e xpansion o f a functi on of an y var iable x about a point x = a f or the or der k spec ifi ed by the user . Thu s, the f uncti on has the f ormat T A YLR(f(x -a) ,x ,k) . F or e xample , F uncti on SERIE S p r oduces a T a ylor pol y nomial u sing as ar guments the f unction f(x) to be e xpanded , a var iable name alo ne (for Mac laur in ’s ser ies) or an e xpre ssi on of the f or m ‘ var iable = value ’ indicating the point o f e xpansion of a T ay lor ser ies , and the order o f the ser ies to be pr oduced. F unction SERIE S r eturns tw o output items a list w ith four it ems, and an e xpr essi on f or h = x - a, if the second ar gument in the f uncti on call is ‘ x=a’ , i .e ., an expr ession f or the
P age 13-2 5 inc reme nt h. T he list r etur ned as the fir st output ob ject inc ludes the fo llo w ing items: 1 - Bi-dir ecti onal limit of the func tio n at point of e xpansion , i .e . , 2 - An eq uiv alent v alue of the f unctio n near x = a 3 - Expr essi on f or the T ay lor po ly nomi al 4 - Or der of the r esidual or r emainder Becau se of the r elati v ely lar ge amount of output , this functi on is easi er to handle in RPN mode . F or ex ample: Dr op the contents o f stac k lev el 1 b y pr essing ƒ , and then enter μ , to decompose the lis t . The r esults are as f ollo ws: In the r ight-hand side fi gur e abov e , w e are u sing the line editor to see the ser ies e xpansion in det ail . ) ( lim x f a x →
Pa g e 1 4 - 1 Chapter 14 M ulti-v ariate Calculus Applications Multi- v ar iate calculus r ef ers to functi ons of two or mor e v ar iables . In this Chapte r we dis c uss the basi c concepts of multi-v ari ate calc ulus including partial der i vati v es and multiple int egrals . Multi-var iate func tions A func tion of tw o or mor e var iables can be def i ned in the calc ulator b y using the DEFINE fu nctio n ( „à ). T o illustr ate the concept o f par ti al der i v ati ve , w e w ill def i ne a couple of m ulti-var iat e func tions , f(x ,y) = x cos(y), and g(x ,y ,z) = (x 2 y 2 ) 1/2 sin(z) , as follo ws: W e can ev aluate the f uncti ons as w e wo uld ev aluate an y other calc ulator fu nct ion, e.g., Gr aphi cs of tw o -dimensional f unctions ar e pos sible using F as t3D , W ire fr a m e, P s -C ontour , Y - Slice , Gr idmap , and Pr- Surface plots as desc ribed in Chapt er 12 . P ar tial der iv ati v es Consi der the func tion o f t w o var iable s z = f(x,y), the par ti al der iv ati v e of the func tion w ith re spect t o x is def ined b y the limit
Pa g e 1 4 - 2 . Similarl y , . W e w ill use the multi-var i ate functi ons def ined earli er to calc ulate partial der i vati v es using thes e def initions . Her e ar e the der i vati ves o f f(x ,y) w ith r espec t to x and y , re specti vel y: Notice that the def inition of partial der i vati ve w ith r espec t to x, f or e xample , r equir es that w e k eep y fi x ed w hile taking the limit as h  0. This sugges t a wa y to qui ckl y calc ulate partial der iv ati ve s of multi-v ar iate f uncti ons: use the rules o f or dinar y der i v ativ es w ith r espect to the v ar iable of int ere st , w hile consider ing all other var iables as constant . Thus , for e xample , , w hich ar e the same r esults as f ound w ith the limits calc ulated earlier . Consi der another e xam ple , In this calc ulation w e tr eat y as a constant and tak e deri v ati ve s of the e xpr essi on w ith r espec t to x . Similarl y , y ou can use the der i v ativ e f uncti ons in the calculat or , e.g ., DER VX, DERI V , ∂ (desc r ibed in detail in Chapter 13) to calc ulate partial der iv ati ve s. Re call that f unction DER VX use s the C A S default v ar iable VX (t y pi cally , ‘X’), h y x f y h x f x f h ) , ( ) , ( lim 0 − = ∂ ∂ → k y x f k y x f y f k ) , ( ) , ( lim 0 − = ∂ ∂ → () () ) sin( ) cos( ), cos( ) cos( y x y x y y y x x − = ∂ ∂ = ∂ ∂ () xy yx y yx x 2 0 2 2 2 = = ∂ ∂
Pa g e 1 4 - 3 ther ef or e , w ith DERVX y ou can onl y calculat e deri vati v es w ith r espect to X . Some e xamples o f fir st-order partial der iv ati ve s are sho wn ne xt: ʳʳʳʳʳ Hi gh er -o rde r d erivat ives T he fo llo wing s econd-or der der i vati ves can be def ined T he last tw o e xpr essi ons r epr esen t cr oss-der i v ati ve s, the partial de ri vati v es signs in the denominator sh o ws the or der of der i v ation . In the left-hand side , the der i vati on is taking fir st w ith r espect t o x and then w ith re spect to y , and in the r ight-hand side , the opposite is tr ue. It is important to indicate that , if a func tion is continu ous and diff er entiable , then . , , 2 2 2 2 ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ∂ ∂ ∂ ∂ = ∂ ∂ ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ ∂ ∂ ∂ ∂ = ∂ ∂ y f y y f x f x x f ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ∂ ∂ ∂ ∂ = ∂ ∂ ∂ ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ ∂ ∂ ∂ ∂ = ∂ ∂ ∂ y f x y x f x f y x y f 2 2 , y x f x y f ∂ ∂ ∂ = ∂ ∂ ∂ 2 2
Pa g e 1 4 - 4 T hir d-, fourth-, and higher or der der i vati ves ar e def ined in a similar manner . T o calc ulate higher o r der der i vati ves in the calculator , simply r epeat the der i vati v e functi on as man y times as needed . Some e xamples ar e show n belo w : T he c hain rule for partial deri vati ves Consi der the func tion z = f(x ,y) , suc h that x = x(t) , y = y(t) . T he func tion z actuall y r epr esents a compo site fu nctio n of t if w e wr ite it as z = f[x(t),y(t)]. T he c hain rule for the der iv ati ve dz/dt f or this case is w ritte n as T o see the expr essi on that the calc ulator pr oduce s for this v ersi on of the chain rul e use: T he r esult is gi v en by d1y(t) ⋅ d2z(x(t),y(t)) d1x(t) ⋅ d1z(x(y) ,y(t)). The ter m d1y(t) is to be inter pr eted as “the de ri vati v e of y(t) w ith re spect t o the 1 st independent v ari able , i .e ., t” , or d1y(t) = d y/dt . Similarl y , d1x(t) = dx/dt . On the other hand, d1z(x(t),y(t)) means “the fir st der i vati ve of z(x ,y) w ith r espec t to the fir st independent v ar iable , i .e ., x ” , or d1z(x(t) ,y(t)) = ∂ z/∂ x . Similarl y , d2z(x(t) ,y(t)) = ∂ z/ ∂ y . Th us, the e xpressi on abo ve is to be interpr eted as: dz/dt = (d y/dt) ⋅ ( ∂ z/ ∂ y) (dx/dt)⋅ ( ∂ z/∂ x) . v y y z v x x z v z ∂ ∂ ⋅ ∂ ∂ ∂ ∂ ⋅ ∂ ∂ = ∂ ∂
Pa g e 1 4 - 5 A diff er ent v ersi on of the c hain rule appli es to the cas e in whi ch z = f(x,y), x = x(u ,v), y = y(u, v) , so that z = f[x(u ,v) , y(u ,v)]. The f ollo wing f orm ulas r epre sent the c hain rule for this situati on: Determining e xtrema in functions of t w o v ariables In or der f or the functi on z = f(x ,y) to hav e an extr eme point (e xtr ema) at (x o ,y o ), its der i vati ves ∂ f/∂ x and ∂ f/∂ y mu st vanish at that po int . Thes e are neces sary conditi ons . The su fficien t co nd itio ns f or the func tion to ha ve an extr eme at point (x o ,y o ) ar e ∂ f/∂ x = 0, ∂ f/∂ y = 0, and Δ = ( ∂ 2 f/ ∂ x 2 ) ⋅ ( ∂ 2 f/ ∂ y 2 )- [ ∂ 2 f/ ∂ x∂ y] 2 > 0. T he point (x o ,y o ) is a r elativ e max imum if ∂ 2 f/ ∂ x 2 < 0, or a r elati v e minimum if ∂ 2 f/ ∂ x 2 > 0. The value Δ is r ef err ed to as the disc riminan t . If Δ = ( ∂ 2 f/ ∂ x 2 ) ⋅ ( ∂ 2 f/ ∂ y 2 )- [ ∂ 2 f/ ∂ x∂ y] 2 < 0, w e hav e a condition kno w n as a saddle point , w her e the func tion w ould attain a max imum in x if w e w er e to hold y const ant , while , at the same time, attain ing a minimum if w e wer e to hold x const ant , or v ice v er sa . Ex ample 1 – Deter mine the e xtr eme points (if an y) of the f uncti on f(X,Y) = X 3 -3X - Y 2 5 . F irst , we def ine the f unction f(X,Y ) , and its der iv ati v es fX(X,Y) = ∂ f/∂ X, fY(X,Y) = ∂ f/∂ Y . T hen , we s ol ve the eq uations fX(X,Y ) = 0 and fY(X,Y) = 0, simult aneousl y : T otal differential o f a func tion z = z(x ,y) F rom the las t equation , if we multipl y b y dt, w e get the tot al differ ential o f the fu ncti on z = z(x,y), i .e ., dz = ( ∂ z/∂ x) ⋅ dx (∂ z/∂ y) ⋅ dy . v y y z v x x z v z u y y z u x x z u z ∂ ∂ ⋅ ∂ ∂ ∂ ∂ ⋅ ∂ ∂ = ∂ ∂ ∂ ∂ ⋅ ∂ ∂ ∂ ∂ ⋅ ∂ ∂ = ∂ ∂ ,
Pa g e 1 4 - 6 W e find c r itical points at (X,Y ) = (1, 0) , and (X,Y) = (-1, 0 ). T o c alc ulate the disc r iminant , we pr oceed t o calculate the second der i v ati ves , fXX(X,Y) = ∂ 2 f/ ∂ X 2 , fXY(X,Y) = ∂ 2 f/ ∂ X/ ∂ Y , and fYY(X,Y ) = ∂ 2 f/ ∂ Y 2 . T he last r esult indi cates that the disc r iminant i s Δ = -12X, thus , for (X,Y ) = (1, 0), Δ <0 (saddle po int) , and f or (X,Y) = (-1, 0) , Δ >0 and ∂ 2 f/ ∂ X 2 <0 (r elati ve max imum) . T he f igur e below , pr oduced in the calc ulato r , and edited in the computer , illustr ates the e x istence of these two po ints: Using function HESS to anal yze e xtr ema F uncti on HE SS can be u sed to anal yz e e xtr ema of a f uncti on of tw o var i ables as sho w n next . F uncti on HE S S, in gener al, tak es as input a func tion o f n independent v ari ables φ (x 1 , x 2 , …,x n ) , and a v ector o f the f uncti ons [‘ x 1 ’ ‘x 2 ’…’x n ’]. F uncti on HE S S r eturns the Hes sian matr i x of the functi on φ , def ined as the matr i x H = [h ij ] = [ ∂ 2 φ /∂ x i ∂ x j ], the gr adien t of the fu nction w ith r espect t o the n -v ar ia bles , grad f = [ ∂φ /∂ x 1 , ∂φ/ ∂x 2 , … ∂φ /∂ x n ], and the list of va riab le s [ ‘ x 1 ’ ‘ x 2 ’…’x n ’].
Pa g e 1 4 - 7 Appli cations of f uncti on HE S S ar e easier to v i suali z e in the RPN mode . Consi der as an ex ample the f uncti on φ (X,Y ,Z) = X 2 XY XZ , we ’ll apply fu nct ion H E S S to fu nct ion φ i n t h e f o l l owi n g e xa m p l e. T h e s cr e e n s h o ts s h ow t h e RPN stac k bef or e and after appl y ing func tion HE S S. When appli ed to a functi on of tw o var iable s, the gr adient in lev el 2 , w hen made equal to z er o , repr esents the equati ons for c r itical points , i .e ., ∂φ /∂ x i = 0, w hile the matri x in lev el 3 r epr esent s econd der i vati ves . T hus , the re sults fr om the HE S S func tion can be u sed to anal yz e extr ema in func tions o f two v ar iables . F or ex ample, f or the f unctio n f(X,Y) = X 3 -3X - Y 2 5, pr oceed as f ollo w s in RPN mode: ‘X^3-3*X- Y^2 5’ ` [‘X’ , ’Y’] ` Enter func tion and v ar iables HE S S Appl y func tion HE S S S OL VE F ind c riti cal poin ts μ Decompose vect or ‘s 1 ’ K ‘s 2 ’ K St or e cr iti cal points T he var ia bles s1 and s2 , at this point , contain the v ector s [‘X=-1’ , ’Y=0] and [‘X=1’ , ’Y=0], re spect ‘H’ K Store H essia n mat r ix J @@@H@@@ @@s1@@ SU BS T ‚ï Subs titute s1 into H T he r esulting matr i x A has a 11 element s a 11 = ∂ 2 φ /∂ X 2 = -6 ., a 22 = ∂ 2 φ /∂ X 2 = -2. , a n d a 12 = a 21 = ∂ 2 φ /∂ X∂ Y = 0. The disc r iminant , fo r this cr itical po int s1(-1, 0) is Δ = ( ∂ 2 f/ ∂ x 2 ) ⋅ ( ∂ 2 f/ ∂ y 2 )- [ ∂ 2 f/ ∂ x∂ y] 2 = (-6 .)(- 2 .) = 12 . 0 > 0. Since ∂ 2 φ /∂ X 2 <0, point s1 r e pr esents a r elati ve ma x imum. Ne xt, w e subs titute the s econd point , s2 , into H: J @@@H@@@ @@s2@@ SU BS T ‚ï Subs titute s2 into H
Pa g e 1 4 - 8 T he re sulting matri x has elements a 11 = ∂ 2 φ /∂ X 2 = 6 ., a 22 = ∂ 2 φ /∂ X 2 = - 2 ., and a 12 = a 21 = ∂ 2 φ /∂ X∂ Y = 0. T he disc r iminant , f or this cr iti cal point s2(1, 0) is Δ = ( ∂ 2 f/ ∂ x 2 ) ⋅ ( ∂ 2 f/ ∂ y 2 )- [ ∂ 2 f/ ∂ x∂ y] 2 = (6 .)(- 2 .) = -12 . 0 < 0, indicating a saddle point . Multiple integrals A ph y sical inte rpr etati on of an or dinary integral , , is the ar ea under the c urve y = f(x) and absc issas x = a and x = b . T he generali z ation to thr ee dimensions o f an ordinary integr al is a double integr al of a func tion f(x ,y) o ver a r egion R on the x -y plane repr esenting the v olume of the s olid bod y cont ained under the surf ace f(x,y) abo ve the r egion R . T he r egion R can be des cr ibed as R = {a<x<b , f(x)<y<g(x)} or a s R = {c <y<d , r (y)<x<s(y)}. T hus , the dou ble integr al can be wr itten as Calc ulating a double inte gr al in the calculat or is str aightf orwar d. A double integr al can be built in the E quatio n W rit er (see e x ample in C hapter 2). An e x ample fo llo ws . T his double integr al is calc ulated dir ectl y in the E quation W r iter b y selecting the entir e expr es sion and us ing func tion @ EVAL . The r esult is 3/2 . St ep-by-s tep output is pos sible by s etting the Step/S tep option in the CA S MOD E S sc r e en . ∫ b a dx x f ) ( ∫∫ ∫∫ ∫∫ = = d c y s y r b a x g x f R dydx y x dydx y x dA y x ) ( ) ( ) ( ) ( ) , ( ) , ( ) , ( φ φ φ
Pa g e 1 4 - 9 Jacobian of coor dinate transf ormation Consi der the coordinat e tr ansfor mation x = x(u ,v) , y = y(u ,v) . T he Jacobi an of this tr ansf ormati on is def i ned as . When calc ulating an int egr al using suc h transf ormati on , the expr ession to u se is , w her e R’ is the r egi on R e xpre ssed in (u ,v ) coor dina te s. Double integral in polar coor dinates T o tr ansfor m fr om polar to Car tesi an coor dinates w e use x(r , θ ) = r cos θ , and y(r , θ ) = r sin θ . T hus , the Jacobian o f the transf or mation is W ith this re sult , integr als in polar coordinat es ar e wr itten a s ⎟ ⎟ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎜ ⎜ ⎝ ⎛ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ = = v y u y v x u x J J det ) det( | | ∫∫ ∫∫ = ' | | )] , ( ), , ( [ ) , ( R R dudv J v u y v u x dydx y x φ φ r r r y r y x r x J = ⋅ ⋅ − = ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ = ) cos( ) sin( ) sin( ) cos( | | θ θ θ θ θ θ
Pa g e 1 4 - 1 0 w here the r egion R’ in polar coor dinates is R’ = { α < θ < β , f( θ ) < r < g( θ )}. Double integr als in polar coor dinates can be enter ed in the ca lc ulator , making sur e that the Jacobi an |J| = r is includ ed in the integr and . The f ollo w ing is an e x ample of a double in tegr al calc ulated in polar coor dinates , sho w n step-b y- step : ∫∫ ∫∫ = β α θ θ θ θ φ θ φ ) ( ) ( ' ) , ( ) , ( g f R rdrd r dA r
P age 15-1 Chapter 15 V ec tor Anal y sis Applications In this Chapt er we pr esent a number of f unctio ns fr om the CAL C menu that appl y to the analy sis of scalar and ve ctor f iel ds. The CAL C menu w as pr esen ted in detail in Chapte r 13 . In partic ular , in the DERI V&INTE G menu w e identif ied a number of functi ons that hav e appli cations in v ecto r analy sis, namely , CURL, DIV , HE S S , L AP L . F or the ex erc ises in this C hapter , change y our angle measur e to r adians . Definitions A fu nction de fi ned in a regi on of s pace suc h as φ (x ,y ,z) is kno w n as a scalar f ield , e x amples ar e tem per atur e , density , and v oltage near a c har ge . If the func tion is def i ned b y a v ector , i.e ., F (x,y ,z) = f(x,y ,z) i g(x ,y ,z) j h(x ,y ,z) k , it is referred to as a vecto r fiel d. The f ollo w ing operator , r efer r ed to as the ‘ del’ or ‘ nab la ’ oper ator , is a vector - based oper ator that can be appli ed to a scalar or v ector f unction: When this oper ator is appli ed to a scalar func tion w e can obtain the gr adien t of the f unction , a nd w hen appli ed to a vec tor func tion w e can obtain the di ver gence and the c url o f that f unction . A comb ination o f gr adient and di ver gence pr oduces another oper ator , called the L aplac ian of a scalar func tion . T hese ope rati ons ar e pr es ented ne xt . Gradient and dir ec tional der iv ativ e T he gr adien t of a s calar f uncti on φ (x ,y ,z) is a v ector f uncti on def ined b y T he dot pr oduct of the gradi ent of a f uncti on with a gi ven unit v ector r epr esents the r ate of c hange of the functi on along that par ti c ular vec tor . This r ate of c hange is called the direc tio nal deri vati v e of the f unction , D u φ (x ,y , z) = u •∇φ . [] [] [] [] z k y j x i ∂ ∂ ⋅ ∂ ∂ ⋅ ∂ ∂ ⋅ = ∇ z k y j x i grad ∂ ∂ ⋅ ∂ ∂ ⋅ ∂ ∂ ⋅ = ∇ = φ φ φ φ φ
P age 15-2 At an y partic ular point , the maximum r a t e of change o f the functi on occ urs in the dir ecti on of the gr adien t , i .e ., along a unit vec tor u = ∇φ /| ∇φ |. The v alu e o f that dir ectional der iv ati ve is equal to the magnitude of the gr adient at an y point D max φ (x ,y ,z) = ∇φ •∇φ /|∇φ | = | ∇φ | T he equation φ (x ,y ,z) = 0 r epr esents a surf ace in space . It turns out that the gr adient o f the f uncti on at an y point on this surface is nor mal to the surface . T hus , the eq uation of a plane tangent to the c ur v e at that point can be f ound b y using a tec hniq ue pr esent ed in Chapter 9 . The si mpl est way to ob tai n t he g r a die nt i s by u sin g fu nct ion DE RIV , ava il abl e i n the CAL C menu , e .g., A pr ogram to calculate th e gr adient T he follo w ing progr am, w hic h y ou can stor e into v ari able GRAD IENT , use s func tion DERI V to calc ulate the gr adient o f a scalar func tion o f X,Y ,Z . Calc ulations f or other bas e var iables w ill not w ork . If y ou wo rk f req uently in the (X,Y ,Z) sy stem , ho w ev er , this func tion will f ac ilitate calc ulations: << X Y Z 3  ARR Y DERIV >> T ype the pr ogr am w hile in RPN mode . Afte r s w itc hing to AL G mode , you can call the func tion GRADIENT as in the follo wing e x ample: Using function HESS to obtain th e gr adient The f uncti on HE S S can be used to obtain the gr adient of a f uncti on as sho wn ne xt . As indicated in Cha pter 14 , fu nction HE S S tak es as input a f unctio n of n independent v ari ables φ (x 1 , x 2 , …,x n ) , and a v ector o f the f uncti ons [‘ x 1 ’ ‘x 2 ’…’x n ’]. F uncti on HE S S r eturns the Hes sian matr i x of the functi on φ , def ined
P age 15-3 as the matri x H = [h ij ] = [ ∂φ /∂ x i ∂ x j ], the gr adien t of the f unction with r espec t to the n -v ar ia bles , grad f = [ ∂φ /∂ x 1 , ∂φ/ ∂x 2 , … ∂φ /∂ x n ], and the list of va riab le s [ ‘ x 1 ’ ‘ x 2 ’…’x n ’]. Co nsider as an e x ample the functi on φ (X,Y ,Z) = X 2 XY XZ , we ’ll apply f uncti on HE S S to this scalar f ield in the f ollo w ing e xam ple in RPN mode: T hus , the gr adient is [2X Y Z , X, X]. Alte rnati v el y , one can us e func tion DERI V as fo llo ws: DERIV(X^2 X*Y X*Z ,[X,Y ,Z]) , to obta in the s ame re sult . P otential of a gr adient Give n th e vec to r fi el d, F (x ,y ,z) = f(x ,y ,z) i g(x ,y ,z) j h(x ,y ,z) k , if ther e e x ists a fu nct ion φ (x ,y ,z) , suc h that f = ∂φ /∂ x, g = ∂φ / ∂ y , and h = ∂φ /∂ z, t h e n φ (x ,y ,z) is referred to a s th e p ote ntia l fu nct ion fo r the vect or fi eld F . It follo ws that F = gr ad φ = ∇φ . T he calculat or pr o vi des f uncti on PO TENTIAL , a vail able thr ough the command catalog ( ‚N ) , to calc ulate the potential func tion of a vect or fi eld , if it exi st s. F o r exa m pl e, if F (x,y ,z) = xi y j z k , appl y ing func tion P O TENT IAL we fi nd : Since functi on S Q (x) r epr esents x 2 , this r esults indicat es that the potential fu nctio n for th e vect or fie ld F (x ,y ,z) = x i y j z k , is φ (x ,y ,z) = (x 2 y 2 z 2 )/2 . Notice that the co nditions f or the e xis tence o f φ (x ,y ,z) , namel y , f = ∂φ /∂ x, g = ∂φ / ∂ y , and h = ∂φ /∂ z , ar e eq uiv alen t to the conditi ons: ∂ f/ ∂ y = ∂ g/∂ x, ∂ f/∂ z = ∂ h/∂ x, and ∂ g/∂ z = ∂ h/∂ y . Thes e conditions pr ov ide a quic k w ay t o deter mine if the v ector f ield has an as soc iated po tential f unctio n. If one of the conditi ons ∂ f/∂ y = ∂ g/∂ x, ∂ f/∂ z = ∂ h/∂ x, ∂ g/∂ z = ∂ h/∂ y , fai ls, a po ten tia l fu nct ion φ (x ,y ,z) does not ex ist. In such case , func tion P O TENTIAL r eturns an er r or message . F or e xample , the vec tor f ield F (x ,y ,z) = (x y) i (x -y z) j xz k , does
P age 15-4 not hav e a potential func tion assoc iated w ith it , since, ∂ f/∂ z ≠∂ h/ ∂ x. The cal c ula tor r espon se in th is case is sho wn bel o w: Di ver gence T he div er gence of a v ector f uncti on, F (x,y ,z ) = f(x ,y ,z) i g(x,y ,z) j h(x ,y ,z) k , is def ined b y taking a “ dot -pr oduct” o f the del oper ator w ith the f uncti on , i .e ., F uncti on DIV can be us ed to calc ulate the di ve r gence o f a vec tor f ield . F or exa mp l e , fo r F (X,Y ,Z) = [XY ,X 2 Y 2 Z 2 ,YZ], the di ver gence is calc ulated, in AL G mode , as f ollo w s: Laplacian T he div er gence of the gr adient of a scalar f unctio n produce s an op e rat or called the L aplac ian oper ator . Thu s, the L aplac ian of a scalar f uncti on φ (x,y , z) is gi v en by T he par ti al differ enti al equation ∇ 2 φ = 0 is kno w n as La place ’s equation . F uncti on L AP L can be used to calc ulate the Laplac ian of a scalar f uncti on. F or e xam ple , to calc ulate the Laplac ian of the f unction φ (X,Y ,Z) = (X 2 Y 2 )cos(Z), use: z h y g x f F divF ∂ ∂ ∂ ∂ ∂ ∂ = • ∇ = 2 2 2 2 2 2 2 x x x ∂ ∂ ∂ ∂ ∂ ∂ = ∇ • ∇ = ∇ φ φ φ φ φ
P age 15-5 Cur l The c url of a v ector fi eld F (x ,y ,z) = f(x, y ,z) i g(x ,y ,z) j h(x ,y ,z) k , is def ined b y a “ cr oss-pr oduct” of the del oper ator w ith the vec tor f ield, i .e ., T he cur l of v ect or fi eld can be calculat ed with f uncti on CURL . F or ex ample , f or the fu nction F (X,Y ,Z) = [XY ,X 2 Y 2 Z 2 ,YZ], the c url is calc ulated as fo llo ws: Irr otational fields and potential func tion In an earlier s ectio n in this chapt er we intr oduced func tion P O TENTIAL to calc ulate the pot ential f uncti on φ (x,y ,z) f or a v ector f ield , F (x ,y ,z) = f(x,y ,z) i g(x ,y ,z) j h(x,y ,z) k , suc h that F = gr ad φ = ∇φ . W e also indicated that the conditi ons fo r the e x iste nce of φ , w er e: ∂ f/∂ y = ∂ g/∂ x, ∂ f/∂ z = ∂ h/∂ x , and ∂ g/ ∂ z = ∂ h/∂ y . T hese conditions ar e equi valent to the v ector e xpre ssion cu rl F = ∇× F = 0. A v ector f ield F (x ,y ,z) , w ith z er o cur l, is kno wn a s an irr otational fi e ld . T hu s, w e conc lude that a potential f uncti on φ (x,y ,z) alw ay s ex ists for an ir r otati onal fi eld F (x,y ,z) . [] [] [] ) , , ( ) , , ( ) , , ( z y x h z y x g z y x f z y x curl ∂ ∂ ∂ ∂ ∂ ∂ = × ∇ = k j i F F ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ∂ ∂ − ∂ ∂ ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ ∂ ∂ − ∂ ∂ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ∂ ∂ − ∂ ∂ = z g y h x h z f z g y h k j i
P age 15-6 As an e xample , in an earlie r ex ample w e attempted to f ind a potenti al func tion for th e ve ctor f ie ld F (x,y ,z) = (x y) i (x -y z) j xz k , and got an err or message back f r om func tion P O TENT IAL. T o ve rify that this is a r otati onal f ield (i .e., ∇× F ≠ 0) , w e use f unctio n CURL on this fi eld: On the other hand , the v ector f ield F (x ,y ,z) = xi y j zk , is indeed ir r otati onal as sho wn belo w : V ector potential Give n a ve cto r fiel d F (x,y ,z) = f(x ,y ,z) i g(x ,y ,z) j h(x,y ,z) k , if ther e ex ists a vector fun ction Φ (x,y ,z) = φ (x ,y ,z) i ψ (x,y ,z) j η (x ,y ,z) k , suc h that F = cu rl Φ = ∇ ×Φ , then f uncti on Φ (x ,y ,z) is re fe rr ed to as the v ect or potenti al of F (x,y ,z) . T he calculat or pr o vi des f uncti on VPO TENTIAL , a vaila ble thr ough the command catalog ( ‚N ) , to calc ulate the vector potenti al, Φ (x,y ,z) , giv en the ve ctor fie ld, F (x ,y ,z) = f(x,y ,z) i g(x,y ,z) j h(x,y ,z) k . F or e x ample , gi ven the vect or fie ld, F (x ,y ,z) = -(y i zj xk ) , f unc tion VP O TENT IAL pr oduces i. e. , Φ (x ,y ,z) = -x 2 /2 j (-y 2 /2 zx) k . It should be indicat ed that there is mor e than one possible v ector pot ential fu nct ions Φ fo r a given ve cto r fi el d F . F or e x ample , the follo w ing sc r een shot sho w s that the c url of the v ect or func tion Φ 1 = [X 2 Y 2 Z 2 ,XYZ ,X Y Z] is the vec tor F = ∇× Φ 2 = [1- XY , 2Z - 1, ZY - 2Y ]. App lic at ion of fu nct ion VPO TE NTI AL
P age 15-7 pr oduces the v e c tor potenti al func tion Φ 2 = [0, ZYX- 2YX, Y -( 2ZX-X)], w hic h is diffe r ent fr om Φ 1 . T he last command in the scr een shot sho ws that indeed F = ∇× Φ 2 . Thu s, a v ector potenti al functi on is not uniquel y determined . T he components of the gi ve n vect or fi eld, F (x ,y ,z) = f(x,y ,z) i g(x,y ,z) j h(x ,y ,z) k , and tho se of the v ector pote ntial f unction , Φ (x ,y ,z) = φ (x ,y ,z) i ψ (x ,y ,z) j η (x ,y ,z) k , ar e r elated b y f = ∂η /∂ y - ∂ψ /∂ x, g = ∂φ /∂ z - ∂η / ∂ x , and h = ∂ψ /∂ x - ∂φ /∂ y. A condition f or functi on Φ (x ,y ,z) to ex ists is that di v F = ∇• F = 0, i .e ., ∂ f/∂ x ∂ g/∂ y ∂ f/∂ z = 0. T hus , if this conditi on is not satisf ied , the vec tor potenti al fu nct ion Φ (x ,y ,z) does not e xis t . F or e xample , giv en F = [X Y ,X- Y ,Z^2], f unction VP O TENTIAL r eturns an e rr or mes sage , since func tion F does not satisfy the conditi on ∇• F = 0: T he condition ∇• F ≠ 0 i s ve ri fie d in t he fo ll owi ng sc ree n sh ot :
Pa g e 1 6 - 1 Chapter 16 Differ ential Equations In this Chapte r we pr esent e xample s of so lv ing or dinar y diff er ential equati ons (ODE) using calc ulator f uncti ons. A differ ential equatio n is an equati on in vol v ing der i vati ves of the independen t var iable . In mo st cases , w e seek the dependent f uncti on that satisf ies the differ en tial equati on. Basic operations w ith differ ential equations In this sec tion w e pr esent s ome use s of the calc ulator fo r enter ing , c hecking and v isuali zing the solution o f ODEs . Entering differ ential equations T he ke y to using differ ential equati ons in the calc ulator is typ ing in the der i vati v es in the equati on. T he easi est w a y to enter a diff er enti al equation is t o type it in the equation w riter . F or e xam ple , to t y pe the follo wing ODE: (x -1) ⋅ (d y(x)/dx) 2 2 ⋅ x⋅ y(x) = e x sin x , use: ‚O „ Ü~ „x -1 ™™™*‚¿ ~„x ™~„y„Ü~„x™™ Q2 ™™ 2* ~„ x * ~„ y „Ü~„x ™™™™ ‚ = „¸ ~„ x ™*S~„x ` T he deri vati v e dy/dx is r epr es ented by ∂ x(y(x)) or by d 1y(x) . F or soluti on or calc ulation purpo ses , y ou need to spec if y y(x) in the e xpre ssion , i .e., the dependent v ar iable mu st inc lude its independent var iable(s) in an y deri vati v e in the equati on . Y ou can also type an equati on dir ectl y into the stac k by u sing the sy mbol ∂ in the der i vati ves . F or ex ample, t o t y pe the f ollo w ing ODE inv ol ving s econd-or der der i vati v es: d 2 u(x)/dx 2 3u(x) ⋅( du(x)/dx) u(x) 2 = 1/x , direc tly into the scr een, use: ³‚ ∂ ~„x„Ü‚¿~„x„ Ü~ „u „Ü ~„x™™™ 3*~ „u„Ü ~„x™*‚¿~„x„ Ü~„u„ Ü ~„x ™™ ~„u„ Ü ~„x™ Q2 ‚ Å 1/ ~„x` T he r esult is ‘ ∂ x( ∂x(u(x))) 3*u(x)* ∂x(u(x)) u^2=1/x ’ . T his for mat sho w s up in the sc r een w hen the _T extbook optio n in the dis play se tting
Pa g e 1 6 - 2 ( H @) DISP ) is not selec ted . Pre ss ˜ to see the equati on in the E quatio n Wr i t e r. An alter nati v e notatio n for der iv ati v es typed dir ectl y in the st ack is to u se ‘ d1’ f or the der i vati v e w ith r espect to the f irs t independent var ia ble , ‘ d2’ for the der i vati v e w ith r espec t to the seco nd independent v ar iable , etc. A second- or der der iv ati v e , e.g . , d 2 x/dt 2 , w her e x = x(t) , w ould be wr itten as ‘ d1d1x(t)’ , w hile (dx/dt) 2 w ould be wr itten ‘ d1x(t)^2’ . Thu s, the P DE ∂ 2 y/ ∂ t 2 – g(x,y) ⋅ ( ∂ 2 y/ ∂ x 2 ) 2 = r(x ,y) , w ould be wr it t en , using this not ation , as ‘ d2d2y(x ,t) - g(x ,y)*d1d1y(x ,t)^2=r(x ,y)’ . T he notatio n using ‘ d’ and the or der of the independent v ar ia ble is the notation pr ef err e d b y the calc ulator w hen deri vati v es ar e in vol v ed in a calculati on . F or e x ample , using f uncti on DERIV , in AL G mode , as sho w n ne xt DERIV(‘ x*f(x,t) g(t ,y) = h(x ,y ,t)’ ,t), p r oduces the fo llo w ing expr ession: ‘ x*d2f(x,t) d1g(t,y)=d3h(x,y,t) ’ . T r anslated to paper , this e xpre ssi on r epre sents the partial diff er ential eq uation x ⋅ (∂ f/∂ t) ∂ g/∂ t = ∂ h/∂ t. Becau se the or der of the v ar iable t is diff er ent in f(x ,t) , g(t ,y) , and h(x ,y ,t) , der i vati ves w ith r es pect to t ha ve differ ent indi ces , i .e ., d2f(x ,t) , d1g(t ,y) , and d3h(x ,y ,t) . All of them , how ev er , r epr esent der i v ativ es wi th re spect to the same va riab le. Expr essi ons fo r der iv ati v es using the or der -of-var iable inde x notation do no t tr anslate into der i vati ve notati on in the equatio n wr iter , as y ou can c heck b y pr essing ˜ w hile the last r esult is in s tack le vel 1. Ho w e ver , the calculator under stands both not ations and oper ate s accordingl y r egar ding of the notati on used. Ch ecking solutions in the calc ulator T o chec k if a func tion satisfy a certain equati on using the calc ulator , u se func tion S UB S T (see Chapt er 5) to r eplace the solu tion in the f orm ‘ y = f(x)’ or ‘ y = f(x ,t)’ , et c., into the diff er ential eq uation . Y ou may need to simplify the r esult b y using functi on EV AL to ver ify the solution . F or e xample , to check that u = A sin ω o t is a so lutio n of the eq uation d 2 u/dt 2 ω o 2 ⋅ u = 0, use the follo w ing: In AL G mode: SU BS T (‘ ∂ t( ∂ t(u(t))) ω 0^2*u(t) = 0’ ,‘ u(t)=A*SIN ( ω 0*t)’) `
Pa g e 1 6 - 3 EV AL(AN S(1)) ` In RPN mode: ‘ ∂ t( ∂ t(u(t))) ω 0^2*u(t) = 0’ ` ‘ u(t)=A*SIN ( ω 0*t)’ ` SUBST EVAL The r esult is ‘0=0’ . F or this e xample , y ou could also us e: ‘ ∂ t(∂ t(u(t)))) ω 0^2*u (t) = 0’ to enter the diffe r ential equation . Slope field v isualiz ation of solutions Slope fi eld plots, intr oduced in Chapter 12 , are u sed to v isuali z e the s oluti ons to a differ enti al equati on of the for m dy/dx = f(x ,y) . A slope field plot sho w s a number of segments tangential to the solu tion c urve s, y = f(x). The slope of the segments at an y point (x ,y) is giv en by d y/dx = f(x ,y) , e valuated at an y point (x ,y) , r epr ese nts the slope of the tangent line at point (x ,y) . Ex ample 1 -- T r ace the solution to the diff er enti al equation y’ = f(x ,y) = sin x cos y , using a slope f ield plot . T o solv e this pr oblem, f ollo w the instr ucti ons in Chapter 12 for slopef ield plots . If y ou could r eprodu ce the slope f ield plot in paper , y ou can tr ace b y hand line s that ar e tangent t o the line segments sho wn in the plo t . This lines constitute lines of y(x ,y) = constant , for the soluti on of y ’ = f(x ,y) . Th us, slope f ie lds are u sef ul tools f or v isuali zing par ti c ularl y diffi cult equations t o sol v e . In summar y , slope fi elds ar e gr aphical ai ds to sk etc h the c ur v es y = g(x) that cor re spond to soluti ons of the diff er ential eq uation d y/dx = f(x ,y) . T he CAL C/DIFF m enu T he DI FFERENT IAL E QNS .. sub-menu w ithin the CAL C ( „Ö ) menu pr o v ides func tions f or the s olution o f differ enti al equati ons. T he menu is listed belo w w ith s ystem flag 11 7 set to CHO O SE b o xes:
Pa g e 1 6 - 4 T hese f unctions ar e brie fl y desc r ibed next . T he y w ill be desc r ibed in mor e detail in later parts of this Chapte r . DE S OL VE: Differ enti al E quati on S OL VEr , pro vi des a solu tion if pos sible IL AP: In ver se L AP lac e tr ansf orm , L -1 [F(s)] = f(t) L AP: LAPl ace transf orm , L[f(t)]=F(s) LDE C: solv es Linear Diff er ential E quations with C onstant coe ffi c ients , inc luding s ys tems of differ enti al equations w ith constant coeff ic ients Solution to linear and non-linear equations An eq uation in w hic h the dependent v ari able and all its pertinent deri v ati ve s ar e of the f irst degr ee is r efer r ed to as a linear differ en tial equatio n . Otherw ise , the equatio n is said t o be non -linear . Exam ples of linear differ ential eq uations ar e: d 2 x/dt 2 β⋅ (dx/dt) ω o ⋅ x = A sin ω f t , and ∂ C/∂ t u ⋅ ( ∂ C/∂ x) = D ⋅ ( ∂ 2 C/ ∂ x 2 ). An equati on who se r ight-hand side (not in v olv ing the f uncti on or its der iv ati v es) is equal to z er o is called a homogeneous equati on . Otherwis e , it is called non- homogeneous . The so lution t o the ho mogeneou s equation is kno wn as a gener al soluti on . A partic ular solution is one that satisf ie s the non - homogeneous equation . Function LDEC T he calculat or pr ov ides f uncti on LDEC (L inear Diff er ential E quation C ommand) to f ind the gener al solu tion to a linear ODE of an y or der w ith constant coeffi c ients , whether it is homogeneous or not . T his functi on req uires y ou to pr o v ide two pieces o f input: • the r ight- hand si de of the ODE • the char acter isti c equati on of the ODE
Pa g e 1 6 - 5 Both of thes e inputs must be gi ven in ter ms of the def ault independent v ar iable fo r the calculator ’s CAS (ty pi cally ‘X’) . T he output fr om the functi on is the gener a l soluti on of the ODE . The f unction LDE C is a v ailable thr ough in the CAL C/DI FF men u . The e x amples ar e sho wn in the RPN mode , ho w ev er , tr anslating them to the AL G mode is s tr aightf orwar d . Ex ample 1 – T o sol ve the homogeneou s ODE: d 3 y/dx 3 -4 ⋅ (d 2 y/dx 2 )- 1 1 ⋅ (dy/ dx) 30 ⋅ y = 0, en ter : 0 ` 'X^3-4*X^2- 11*X 30' ` LDEC μ . Th e so lu tio n i s: w here cC0, cC1, and cC2 ar e constants of integr ation . While this r esult seems ve r y compli cated, it can be simplif ied if w e take K1 = (10 *cC0-(7 cC1-cC2))/40, K2 = -(6*cC0-(cC1 cC2))/24, and K3 = (15*cC0 (2*cC 1-cC2))/ 15. Then , the solution is y = K 1 ⋅ e –3x K 2 ⋅ e 5x K 3 ⋅ e 2x . T he reas on wh y the re sult pr ov ided by LDE C sho ws su ch complicated comb ination o f constan ts is because , inter nally , to pr oduce the soluti on , LDE C utili z es Laplace tr ansfor ms (to be pres ented later in this c hapter ) , whi ch tr ansfor m the soluti on of an ODE int o an algebrai c soluti on . The combinati on of co nstants r esult fr om facto r ing out the e xponenti al ter ms after the La place tr ansfor m soluti on is obtained . Ex ample 2 – Using the func tion LDE C, s olv e the non-homogeneous ODE: d 3 y/dx 3 -4 ⋅ (d 2 y/dx 2 )- 1 1 ⋅ (dy/dx) 3 0 ⋅ y = x 2 . Enter : 'X^2' ` 'X^3-4*X^2-11* X 30' ` LDE C μ
Pa g e 1 6 - 6 T he soluti on, sho w n par ti ally he re in the E quation W r iter , is: R eplac ing the combinatio n of constants accompan y ing the e xponenti al terms w ith simpler values , the e xpr essi on can be simplifi ed to y = K 1 ⋅ e –3x K 2 ⋅ e 5x K 3 ⋅ e 2x ( 4 5 0 ⋅ x 2 3 30 ⋅ x 2 4 1)/13 5 00. W e r ecogni z e the f irst thr ee ter ms as the gener al soluti on of the homogeneou s equation (s ee Example 1, abo v e) . If y h r epr esen ts the solution t o the homogeneous equation , i .e ., y h = K 1 ⋅ e –3x K 2 ⋅ e 5x K 3 ⋅ e 2x . Y ou can pr ov e that the r emaining ter ms in the s olution sho wn abo ve , i . e ., y p = (450 ⋅ x 2 3 30 ⋅ x 2 41)/13 500, cons titute a partic ular soluti on of the ODE . T o v er if y that y p = ( 4 50 ⋅ x 2 3 30 ⋅ x 2 41)/13 5 00, is indeed a par ti c ular soluti on of the ODE , use the f ollo w ing: 'd1d1d1Y(X) -4*d1d1Y(X)- 11*d1Y(X) 30* Y(X) = X^2' ` 'Y(X)=(450 *X^2 330*X 24 1)/13500' ` SUBST EV L Allo w the calculator a bout ten seconds to pr oduce the r esult: ‘X^2 = X^2’ . Ex ample 3 - Solv ing a sy stem of linear diffe r ential equations w ith constant coeff ic ients . Consi der the s y stem of linear differ enti al equations: x 1 ’(t) 2x 2 ’(t) = 0, Not e : This r esult is gener al fo r all non- h omogeneous linear ODE s, i .e ., giv en the soluti on of the homogeneous equati on , y h (x) , the solu tion o f the corr esponding non- homogeneou s equati on, y(x), can be wr itten as y(x) = y h (x) y p (x) , wh ere y p (x) is a par ti c ular solution t o the OD E .
Pa g e 1 6 - 7 2x 1 ’(t) x 2 ’(t) = 0. In algebr aic f orm , this is wr itten as : A ⋅x ’(t) = 0, w her e . T he s y stem can be s olv ed b y using func tion LDE C w ith argume nts [0, 0] and matri x A, as sho w n in the f ollo wing sc r een using AL G mode: T he soluti on is gi ve n as a vec tor containing the func tio ns [x 1 (t) , x 2 (t)]. Pr essing ˜ w ill tri gger the Matr ix W rit er allow ing the u ser to s ee the t w o com ponents of the v ector . T o see all the details of eac h component , pr ess the @EDIT! soft menu k e y . V er if y that the compone nts ar e: Function DES OL VE The calc ulator pr ov ides f unction DE S OL VE (Differ enti al E quation S OL VEr ) to sol v e cer t ain t y pes of diff er ential eq uations . The f uncti on r equir es as input the diffe r ential equatio n and the unkno wn f unction , and r eturns the s olution to the equati on if av ailable . Y ou can als o pr ov ide a v ector containing the diff er ential equati on and the initial conditions , instead o f only a diff erenti al equati on, as input to DE SOL VE . T he functi on DE S OL VE is av ailable in the CAL C/DI FF menu . Example s of DE S OL VE applicati ons ar e sho w n belo w using RPN mode . Ex ample 1 – Solv e the fir st- or der OD E: d y/dx x 2 ⋅ y(x) = 5 . In the calc ulator u se: 'd1y(x) x^2*y(x)=5' ` 'y(x)' ` DES OLVE T he soluti on pr o v ided is {‘ y = (I NT(5*EXP(xt^3/ 3) ,xt ,x) cC0)*1/EXP(x^3/ 3)}’ }, i .e ., ⎥ ⎦ ⎤ ⎢ ⎣ ⎡ = 1 2 2 1 A
Pa g e 1 6 - 8 Ex ample 2 -- So lv e the second-o rde r ODE: d 2 y/dx 2 x (dy/dx) = e xp(x) . In the calc ulator use: ‘ d1d1y(x) x *d1y(x) = EXP( x) ’ ` ‘ y(x) ’ ` DESOLVE T he r esult is an e xpr essi on hav ing tw o impli c it integr ations , namel y , F or this parti cular eq uation , ho w ev er , w e r eali z e that the le ft -hand side of the equation r epr esents d/dx(x d y/dx) , th us, the ODE is no w w ritten: d/dx(x d y/dx ) = exp x, and x d y/dx = exp x C . Ne xt , we can w r ite d y/dx = (C e xp x)/x = C/x e x /x . In the calc ulator , y ou ma y try to integr ate: ‘ d1y(x) = (C EXP(x))/x ’ ` ‘ y(x)’ ` DESOLVE T he r esult is { ‘ y(x) = INT((EXP(xt) C)/xt ,xt,x) C0’ }, i .e ., The v ariable ODETYPE Y ou w ill noti ce in the soft-menu k e y labels a ne w v ar iab le called @OD ETY (ODETYPE). This v ari able is pr oduced w ith the call to the DE S OL func tion and holds a str ing sho w ing the t y pe of ODE us ed as input for DE S OL VE . Pr ess @ODET Y to obtain th e str ing “ 1st order linear ”.
Pa g e 1 6 - 9 P er f or ming the integr ation by hand, w e can only ge t it as far as: becaus e the integr al of exp(x)/x is no t av ailable in c losed f or m. Ex ample 3 – Sol v ing an equati on w ith initial co nditions . Sol ve d 2 y/dt 2 5y = 2 co s(t/2) , w ith initial conditi ons y(0) = 1.2 , y’(0) = -0. 5 . In the calculator , use: [‘ d1d1y(t) 5*y(t) = 2*C OS(t/2)’ ‘ y(0) = 6/5’ ‘ d1y(0) = -1/2’] ` ‘ y(t)’ ` DE S OL VE Notice that the initial conditi ons w er e changed to the ir Exact e xpre ssi ons, ‘ y(0) = 6/5’ , r ather than ‘ y(0)=1.2’ , and ‘ d1y(0) = -1/2’ , r ather than , ‘ d1y(0) = -0. 5’ . Chang ing to th ese Exac t e x pr essions fac ilita tes the solution. T he soluti on is: Press μμ to simplif y the r esult to ‘ y(t) = -((19* √ 5*SIN( √ 5*t) -(14 8*CO S( √ 5*t) 80*CO S(t/2)))/190)’ . Not e : T o obtain fr actio nal expr essions f or decimal v alues us e func tion  Q (See Chapter 5) . 0 ) ( C dx x C e x y x ⋅ = ∫ 0 ln ) ( C x C dx x e x y x ⋅ ⋅ = ∫
Pa g e 1 6 - 1 0 Press J @ODETY to get the str ing “ Linear w/ cst coeff ” fo r the ODE t y pe in this case . Laplace T r ansfor ms T he Laplace tr ansform o f a func tion f(t) pr oduces a f unction F(s) in the image domain that can be utili z ed to find the so lution o f a linear differ ential eq uation in vo lv ing f(t) thr ough algebr aic me thods. T he st eps in vo lv ed in this appli catio n ar e thr ee: 1. Use of the L aplace tr ansfor m conv er ts the linear ODE inv olv ing f(t) into an algebr aic equati on. 2 . T he unkno wn F(s) is sol v ed for in the image domain thr ough algebr aic manipulation . 3 . An in v ers e La place tr ansfor m is used t o conv ert the image func tion f ound in step 2 int o the soluti on to the differ enti al equation f(t). Definitions T he Laplace tr ansform f or f unction f(t) is the func tio n F(s) de fined a s T he image var i able s can be , and it gener ally is , a comple x number . Man y prac tical appli cations o f Laplace tr ansfor ms inv ol v e an ori ginal func tion f(t) w her e t re pres ents time , e.g ., contr ol s y stems in elec tri c or h y dr aulic c ir c uits . In m o st c ases one is inter ested in th e s y stem response af ter time t>0, thus, the def initio n of the Laplace tr ansf orm , gi v en abo v e , inv olv es an integr ation f or value s of t lar ger than z er o . T he inv erse L aplace tr ansfor m maps the f unction F(s) ont o the ori ginal functi on f(t) in the time domain, i .e ., L -1 {F(s)} = f(t) . Th e c onvo lu tio n i nt eg r a l or con v olution pr oduct of tw o fu nctions f(t) and g(t), w here g is shifted in time , is def ined as 0 {( ) } ( ) ( ) . L ∞ − == ⋅ ∫ st ft F s ft e d t . ) ( ) ( ) )( * ( 0 ∫ ⋅ − ⋅ = t du u t g u f t g f
Pa g e 1 6 - 1 1 Laplace tr ansfor m and inv erses in the calc ulator T he calculat or pr o vi des the f uncti ons L AP and ILAP to calc ulate the L aplace tr ansfor m and the in v erse L aplace tr ansfor m, r especti v ely , of a func tion f(VX) , w here VX is the CA S def ault independent v ar iable , whi ch y ou should set t o ‘X’ . T hus , the calculat or r eturns the tr ansfor m or inv er se tr ansfor m as a f unction o f X. T he functi ons L AP and ILAP are a vail able under the CAL C/DIFF menu . T he e x amples ar e w ork ed out in the RPN mode , but tr anslating them to AL G mode is str ai ghtforw ard . F or these e xamples , set the CA S mode to R eal and Exac t . Ex ample 1 – Y ou can get the def i niti on of the L aplace tr ansform u se the fo llo w ing: ‘ f(X) ’ ` LP in RPN mode, or L P(f(X))in AL G mode. T he calculator r eturns the r esult (RPN, le f t; AL G , ri ght): Compar e these e xp r essi ons w ith the one gi ve n earli er in the de finiti on of t he La place tr ansfor m , i. e., and y ou w ill notice that the CA S de fault v ar iable X in the equati on wr iter sc ree n r eplaces the var iable s in this definiti on . Ther ef or e , w hen using the func tion L AP y ou get back a func tion o f X, whi ch is the L aplace tr ansfor m of f(X). Ex ample 2 – Determine the L aplace tr ansf orm of f(t) = e 2t ⋅ sin(t) . Use: ‘EXP( 2*X)*S IN(X)’ ` LAP The calc ulator r eturns the r esul t: 1/(S Q(X- 2) 1). Press μ to obtain , 1/(X 2 -4 X 5 ). When y ou tr anslate this r esult in paper y ou w ould wr ite ∫ ∞ − ⋅ = = 0 , ) ( ) ( )} ( { dt e t f s F t f st L 5 4 1 } sin { ) ( 2 2 ⋅ − = ⋅ = s s t e s F t L
Pa g e 1 6 - 1 2 Ex ample 3 – Deter mine the in ve rse L aplace tr ansfor m of F(s) = sin(s) . Use: ‘SIN(X)’ ` ILAP . The calc ulator tak es a fe w seconds to r eturn the r esult: ‘IL AP( SIN(X))’ , meaning that ther e is no c los ed-fo rm e xpr es sion f(t), such that f(t ) = L -1 {sin(s)}. Ex ample 4 – Determine the in ve rse L aplace tr ansf orm of F(s) = 1/s 3 . Us e: ‘1/X^3’ ` IL AP μ . T he calculat or r etur ns the r esult: ‘X^2/ 2’ , w hi ch is interpr eted as L -1 {1/s 3 } = t 2 /2 . Ex ample 5 – Determ ine the Laplace tr ansfor m of the f uncti on f(t) = cos (a ⋅ t b). Use: ‘C OS(a*X b)’ ` L AP . The calc ulator r etur ns the r esult: Press μ to obtain –(a sin(b) – X co s(b))/(X 2 a 2 ) . T he tr ansfor m is inter pr eted as fo llo ws: L {cos(a ⋅ t b)} = (s ⋅ cos b – a ⋅ sin b)/(s 2 a 2 ). Laplace tr ansfor m t heor ems T o help y ou determine the L aplace tr ansf orm of f unctions y ou can u se a number of theor ems, so me of whi c h ar e listed belo w . A f e w ex amples of the theor em appli cations ar e also included . Θ Differ enti ation theor em for the f i r st der i v ati ve . Le t f o be the initi al conditi on f or f(t) , i .e ., f(0) = f o , then L{df/dt} = s ⋅ F(s) - f o . Θ Differ en tiation theor em for the s econd deri vati v e . Let f o = f(0) , and (df/dt) o = df/dt| t=0 , then L{d 2 f/dt 2 } = s 2 ⋅ F(s) - s⋅ f o – (df/dt) o . Ex ample 1 – The v eloc it y of a mo ving partic le v(t) is def ined as v(t) = dr/dt , w her e r = r(t) is the po siti on of the partic le . Le t r o = r(0) , and R(s) =L{r(t)}, then, the tr ansfor m of the v eloc ity can be wr itten as V(s) = L{v(t)}=L{dr/dt}= s ⋅ R(s) -r o .
Pa g e 1 6 - 1 3 Θ Differ en tiation theo r em f or the n -th der iv ati v e . Let f (k) o = d k f/dx k | t = 0 , and f o = f(0) , then L{d n f/dt n } = s n ⋅ F(s) – s n-1 ⋅ f o − …– s⋅ f (n- 2) o – f (n-1) o . Θ Li nearity theor em . L{af(t) bg(t)} = a ⋅ L{f(t)} b ⋅ L{g(t)}. Θ Differ enti ation t heore m fo r the image func tion . L et F(s) = L{f(t)}, then d n F/ ds n = L{(-t) n ⋅ f(t)}. Θ Integr ati on theor em . Let F(s) = L{f(t)}, then Θ Con v olutio n theor em . Let F(s) = L{f(t)} and G(s) = L{g(t)}, then Ex ample 2 – As a fo llow up t o Example 1, the acceler atio n a(t) is de fined as a(t) = d 2 r/dt 2 . If the initial v eloc ity is v o = v(0) = dr/dt| t=0 , then the L aplace tr ansf orm of the acceler ati on can be w r itten as: A(s) = L{a(t)} = L{d 2 r/dt 2 }= s 2 ⋅ R(s) - s⋅ r o – v o . Ex ample 3 – L et f(t) = e –at , using the calc ulator w ith ‘EXP(-a*X)’ ` LAP , y ou get ‘1/(X a)’ , o r F(s) = 1/(s a) . The thir d deri vati v e of this e xpr essi on can be calc ulated b y using: ‘X’ `‚ ¿ ‘X’ `‚¿ ‘X’ `‚ ¿μ Th e res ul t i s ‘-6/(X^4 4*a*X^3 6*a^2*X^2 4*a^3*X a^4)’ , or d 3 F/ds 3 = -6/(s 4 4 ⋅ a⋅ s 3 6 ⋅ a 2 ⋅ s 2 4 ⋅ a 3 ⋅ s a 4 ). No w , use ‘(-X)^3*E XP(-a*X)’ ` LAP μ . The r esult is e x actl y the same . {} ). ( 1 ) ( 0 s F s du u f t ⋅ = ∫ L
Pa g e 1 6 - 1 4 Θ Shift theore m for a shift to the r ight . Let F(s) = L{f(t)}, then L{f(t-a)}=e –as ⋅ L{f(t)} = e –as ⋅ F(s) . Θ Shift theore m for a shift to the left . L et F(s) = L{f(t)}, and a >0, then Θ Similar it y theo r em . L et F(s) = L{f(t)}, and a>0, then L{f(a ⋅ t)} = (1/a)⋅ F(s/a) . Θ Dampin g theor em . L et F(s) = L{f(t)}, then L{e –bt ⋅ f(t)} = F(s b) . Θ Div ision theor em . Let F(s) = L{f(t)}, the n Θ Laplace tr ansf orm of a peri odic func tion of per iod T : • L imit theor em fo r the initial value: L et F(s) = L{f(t)}, then • L imit theor em fo r the final v alue: Let F(s) = L{f(t)}, then Ex ample 4 – Using the con v olution theo r em, f ind the Laplace tr a n sfor m of (f*g)(t) , if f(t) = sin(t) , and g(t) = e xp(t) . T o f ind F(s) = L{f(t)}, and G(s) = L{g(t)}, us e: ‘SIN(X)’ ` LA P μ . R esult , ‘1/(X^2 1)’ , i .e., F(s) = 1/(s 2 1) . Als o , ‘EXP(X)’ ` LAP . Resul t, ‘1/(X-1)’ , i .e ., G(s) = 1/(s-1). Thu s, L{(f*g) (t)} = F(s) ⋅ G(s) = 1/(s 2 1) ⋅ 1/(s-1) = 1/((s-1)(s 2 1)) = 1/(s 3 -s 2 s-1 ). {} = = − ∫ )} )( * {( ) ( ) ( 0 t g f du u t g u f t L L ) ( ) ( )} ( { )} ( { s G s F t g t f ⋅ = ⋅ L L . ) ( ) ( )} ( { 0 ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ ⋅ ⋅ − ⋅ = ∫ − a st as dt e t f s F e a t f L ∫ ∞ = ⎭ ⎬ ⎫ ⎩ ⎨ ⎧ s du u F t t f . ) ( ) ( L ∫ ⋅ ⋅ ⋅ − = − − T st sT dt e t f e t f 0 . ) ( 1 1 )} ( { L )]. ( [ lim ) ( lim 0 0 s F s t f f s t ⋅ = = ∞ → →
Pa g e 1 6 - 1 5 Dir ac’s d elta function and Heav isid e’s step function In the analy sis of contr ol s y stems it is cu stomary to utili z e a t y pe of f uncti ons that r epr esent certain ph y sical occ urr ences suc h as the sudden acti vati on of a s w itc h (Heav iside’s s tep func tion , H(t)) or a sudden, ins tantaneous , peak in an input to the s y stem (Dir ac’s delta functi on , δ ( t)). T hese belong to a class of f unctions kno w n as gener ali z ed or s ymboli c func tions [e .g., s ee F r iedman , B ., 19 5 6 , Pr inc iples and T echni ques of Applied Mathemati cs, Do v er P ubli cations Inc ., Ne w Y ork (199 0 r epr int) ]. T he for mal def inition o f Dirac’s delta f uncti on , δ (x) , is δ (x) = 0, f or x ≠ 0, and Also , if f(x) is a continuous functi on , then An inte rpr etati on f or the integr al abo ve , par aphr ased f r om F r iedman (19 9 0) , is that the δ -func ti on “ pi cks ou t” the value o f the func tio n f(x) at x = x 0 . Dirac’s delta f unction is ty picall y repr esented b y an up war d ar r o w at the point x = x0, indicating that the f uncti on has a non - z er o value onl y at that par ti c ular value of x 0 . H eavis ide’ s st ep fun ctio n , H(x) , is de fined as Also , for a co ntinuou s functi on f(x), Dir ac’s delta func tion and Hea visi de ’s step func tion ar e r elated b y dH/dx = δ (x) . T he two functi ons ar e illus trat ed in the f igur e belo w . )]. ( [ lim ) ( lim 0 s F s t f f s t ⋅ = = → ∞ → ∞ ∫ ∞ −∞ = . 0 . 1 ) ( dx x δ ∫ ∞ −∞ = − ). ( ) ( ) ( 0 0 x f dx x x x f δ ⎩ ⎨ ⎧ < > = 0 , 0 0 , 1 ) ( x x x H ∫∫ ∞ −∞ ∞ = − 0 . ) ( ) ( ) ( 0 x dx x f dx x x H x f
Pa g e 1 6 - 1 6 Y ou can pr o v e that L{H(t)} = 1/s , from wh ich it fol lows th a t L {U o ⋅ H(t)} = U o /s , wher e U o is a constant . Also , L -1 {1/s}=H(t) , and L -1 { U o /s}= U o ⋅ H(t) . Also , using the shift theor em f or a shift to the ri ght , L{f(t -a)}=e –as ⋅ L{f(t)} = e –as ⋅ F (s ) , we c an wri t e L { H( t - k )} = e –ks ⋅ L{H(t)} = e –ks ⋅ (1/s) = (1/s)⋅ e –ks . Anothe r impor tan t r esult , kno wn as the se cond shif t theo r em fo r a shif t t o the rig ht , is tha t L -1 {e –as ⋅ F(s)}=f(t-a)⋅ H(t -a), w ith F(s) = L{f(t)}. In the calc ulator the Hea visi de step f uncti on H(t) is simply r efer red to as ‘1’ . T o c heck the tr ansfor m in the calc ulator u se: 1` L AP . The r esult is ‘1/X’ , i .e ., L{1} = 1/s . Similar ly , ‘U0’ ` LAP , pr oduces the r esult ‘U 0/X’ , i .e . , L{U 0 } = U 0 /s. Y ou can obtain Dir ac’s delta func tion in the calc ulator b y using: 1` ILAP The r esult is ‘ Delta(X)’ . This r esult is simpl y s ymboli c, i .e ., you cannot f ind a numer ical v alue for , s ay ‘ Delta(5) ’. T his re sult can be de fined the Laplace tr ansfor m fo r Dir ac’s delta f uncti on , becaus e fr om L -1 {1. 0}= δ (t) , it f ollo ws that L{ δ (t)} = 1.0 Also , using the shift theor em f or a shift to the ri ght , L{f(t -a)}=e –as ⋅ L{f(t)} = e –as ⋅ F (s ) , we c an wri t e L { δ (t-k)}=e –ks ⋅ L{δ (t)} = e –ks ⋅ 1. 0 = e –ks . y x x 0 (x _ x) 0 H(x _ x) 0 x 0 y x 1
Pa g e 1 6 - 1 7 Applications of L aplace transf orm in the solution of linear ODEs At the beginning of the s ectio n on Laplace tr ansfor ms we indi cated that y ou could us e these tr ansfor ms to con v ert a linear ODE in the time do main into an algebr aic eq uation in the image domain . T he r esulting equati on is then sol v ed fo r a functi on F(s) thr ough algebr aic methods , and the soluti on to the ODE is fo und b y using the in ver se L aplace tr ansfo rm on F(s). T he theorems o n deri vati v es of a f uncti on, i .e ., L{df/dt} = s ⋅ F(s) - f o , L{d 2 f/dt 2 } = s 2 ⋅ F(s) - s⋅ f o – (df/dt) o , and , in gener al , L{d n f/dt n } = s n ⋅ F(s) – s n-1 ⋅ f o − …– s⋅ f (n - 2) o – f (n-1) o , ar e partic ularl y use ful in tr ansf orming an ODE into an algebr aic equati on . Ex ample 1 – T o solv e the f irst or der equati on, dh/dt k ⋅ h(t) = a ⋅ e –t , b y using La place tr ansfor ms, w e can w r ite: L{dh/dt k ⋅ h(t)} = L{a ⋅ e –t }, L{dh/dt} k ⋅ L{h(t)} = a ⋅ L{e –t }. W ith H(s) = L{h(t)}, and L{dh/dt} = s ⋅ H(s) - h o , w her e h o = h(0) , the tr ansf ormed equation is s ⋅ H(s) -h o k ⋅ H(s) = a/(s 1) . Use the c alc ulator to solv e for H(s) , b y wr iting : ‘X*H-h0 k*H=a/(X 1)’ ` ‘H’ IS OL Not e : ‘EXP(- X)’ ` LAP , pr oduces ‘1/( X 1)’ , i .e ., L{e –t }=1/(s 1) .
Pa g e 1 6 - 1 8 T he r esult is ‘H=( (X 1)*h0 a)/(X^2 (k 1)*X k)’ . T o f ind the soluti on to the ODE , h(t) , w e need to us e the inv erse L aplace tr ansfor m, as f ollo w s: OB J  ƒ ƒ Iso lates r ight-hand side of las t e xpr essi on ILAP μ Obtains the in ve rse L aplace tr ansf orm T he r esult is . R eplac ing X w ith t in this e xpr essi on and simplify ing, r esults in h(t) = a/(k -1) ⋅ e -t ((k -1) ⋅ h o -a)/(k -1) ⋅ e -kt . Chec k what the s olution t o the OD E w ould be if y ou us e the functi on LDEC: ‘ a*E XP(-X)’ ` ‘X k ’ ` LDE C μ T he r esult is: , i .e ., h(t) = a/(k -1) ⋅ e -t ((k -1) ⋅ cC o -a)/(k -1) ⋅ e -kt . T hus , cC0 in the re sults fr om LDE C repr esents the initi al conditi on h(0) . Ex ample 2 – Use L aplace tr ansf orms to so lv e the second-or der linear equation , d 2 y/dt 2 2y = sin 3t . Using La place transf orms , w e can wr ite: L{d 2 y/dt 2 2y} = L{sin 3t}, L{d 2 y/dt 2 } 2 ⋅ L{y(t)} = L{sin 3t}. Not e : When u sing the func tion LDE C to so lv e a linear ODE of o r der n in f(X) , the r esult w ill be gi ven in ter ms of n constants cC0, cC1, cC2 , …, cC(n -1) , r epr esenting the initi al conditions f(0) , f ’(0) , f” (0) , …, f (n-1) (0) .
Pa g e 1 6 - 1 9 W ith Y(s) = L{y(t)}, and L{d 2 y/dt 2 } = s 2 ⋅ Y(s) - s⋅ y o – y 1 , wher e y o = h(0) and y 1 = h ’(0) , the tr ansfor med equati on is s 2 ⋅ Y(s) – s⋅ y o – y 1 2 ⋅ Y(s) = 3/(s 2 9) . Use the c alc ulator to solv e for Y(s) , b y wr iting : ‘X^2*Y -X*y0 -y1 2*Y=3/(X^2 9)’ ` ‘Y’ ISOL T he r esult is ‘Y=((X^2 9)*y1 (y0*X^3 9*y0*X 3))/(X ^4 11*X^2 18)’. T o f ind the soluti on to the ODE , y(t) , w e need to us e the inv erse L aplace tr ansfor m, as f ollo w s: OB J  ƒ ƒ Is olates ri ght -hand si de of last e xpre ssion ILAP μ Obtains the in ver se L aplace tr ansfo rm T he r esult is i. e. , y(t) = -(1/7) sin 3x y o co s √ 2x ( √ 2 ( 7 y 1 3)/14) sin √ 2x . Chec k what the s olution t o the OD E w ould be if y ou us e the functi on LDEC: ‘S IN(3*X)’ ` ‘X^2 2’ ` LD E C μ T he re sult is: i .e ., the same as befor e with cC0 = y0 a n d cC 1 = y1. Not e : ‘S IN(3*X)’ ` LAP μ produce s ‘3/(X^2 9)’ , i .e., L{sin 3t}=3/(s 2 9).
Pa g e 1 6 - 2 0 Ex ample 3 – Consider the equati on d 2 y/dt 2 y = δ (t-3) , wher e δ (t) is Dir ac’s d e lta func tion . Using La place transf orms , w e can wr ite: L{d 2 y/dt 2 y} = L{ δ (t- 3)}, L{d 2 y/dt 2 } L{y(t)} = L{ δ (t-3)}. Wi th ‘ Delta(X-3) ’ ` L AP , the calc ulator pr oduces EXP(-3*X) , i .e., L{ δ (t -3)} = e –3s . With Y(s) = L{y(t)}, and L{d 2 y/dt 2 } = s 2 ⋅ Y(s) - s⋅ y o – y 1 , wher e y o = h(0) and y 1 = h ’(0) , the tr ansfo rmed equation is s 2 ⋅ Y(s) – s⋅ y o – y 1 Y(s) = e –3s . Use the calc ulator to solv e f or Y(s), b y w riting: ‘X^2*Y -X*y 0 -y1 Y=EXP(-3*X) ’ ` ‘Y’ IS O L T he r esult is ‘Y=(X*y0 (y1 EXP(-( 3*X))))/(X^2 1)’ . T o f ind the soluti on to the ODE , y(t) , w e need to us e the inv erse L aplace tr ansfor m, as f ollo w s: OB J  ƒ ƒ Is olates ri ght -hand si de of last e xpre ssion ILAP μ Obtains the inv er se L aplace tr ansfor m T he re sult is ‘ y1*SIN(X) y0*C O S(X) SIN(X-3)*Heav iside(X-3)’ . Not e : Using the two e xamples sho wn he r e, we can conf irm w hat w e indicated earli er , i .e ., that func tion IL AP u ses L aplace tr ansfor ms and in ve rse tr a n sfor ms to so lv e linear ODEs gi ven the r igh t -hand side o f the equati on and the c harac ter isti c equation of the cor r esponding homogeneous ODE .
Pa g e 1 6 - 2 1 Chec k what the s olution t o the OD E w ould be if y ou us e the functi on LDEC: ‘Delta(X- 3)’ ` ‘X^2 1’ ` LD E C μ Note s : [1]. An alter nati ve w a y to obtain the in ver se L aplace tr ansfo rm of the e xpr es sion ‘(X*y0 (y1 E XP(-(3*X))))/(X^2 1)’ is b y separ ating the e xpr es sion in to partial f r actions , i .e., ‘ y0*X/(X^2 1) y1/(X^2 1) EXP(-3*X)/(X^2 1)’ , and use the linear it y theor em of the in ve rse L aplace tr ansf orm L -1 {a ⋅ F(s) b ⋅ G(s)} = a ⋅ L -1 {F(s)} b ⋅ L -1 {G(s)}, to wr i te , L -1 {y o ⋅ s/(s 2 1) y 1 /(s 2 1)) e –3s /(s 2 1)) } = y o ⋅ L -1 {s/(s 2 1)} y 1 ⋅ L -1 {1/(s 2 1)} L -1 {e –3s /(s 2 1))}, The n, w e use the calc ulator to obtain the f ollow ing: ‘X/(X^2 1)’ ` IL AP Re sult , ‘CO S(X)’ , i .e., L -1 {s/(s 2 1)}= cos t . ‘1/(X^2 1)’ ` ILAP R esult , ‘SIN(X)’ , i .e ., L -1 {1/(s 2 1)}= sin t . ‘EXP( -3*X)/(X^2 1)’ ` IL AP Re sult , SIN(X -3)*H ea v iside(X -3)’ . [2]. T he very last r esult , i .e ., the in v ers e Laplace tr ansfor m of the e xpr essi on ‘(EXP(-3*X)/(X^2 1))’ , can also be calc ulated b y using the second shifting theor em f or a shift to the ri ght L -1 {e –as ⋅ F(s)}=f(t -a)⋅ H(t-a), if w e can find an in v erse L aplace tr ansf orm f or 1/(s 2 1) . W ith the calculator , try ‘1/(X^2 1)’ ` IL AP . T he r esult is ‘SIN(X)’ . Thu s, L -1 {e –3s /(s 2 1)}} = sin(t-3 ) ⋅ H(t-3) ,
Pa g e 1 6 - 22 T he re sult is: ‘S IN(X-3)*Heav isi de(X-3) cC1*S IN(X) cC0*CO S(X)’ . P lease notice that the v ari able X in this expr essi on actuall y r e p r esen ts the v ari able t in the or iginal ODE . Thu s, the tr anslation of the so lution in pape r may be w ritt en as: When compar ing this r esult w ith the pr ev i ous r esult f or y(t), w e conclude that cC o = y o , cC 1 = y 1 . Defining and using Heaviside’s step function in th e calculator T he pre v ious e x ample pr ov ided some e xper ience w ith the u se of Dir a c’s delt a func tion as in put to a sy stem (i .e., in the r ight- hand si de of the ODE desc r ibing the s y stem). In this ex ample, w e w ant to use Heav iside’s s tep func tion , H(t) . In the calc ulator w e can defi ne this functi on as: ‘H(X) = IFTE(X>0, 1, 0)’ `„à T his defi nition w ill c r eate the var iable @@@H@@@ in th e calc ulator ’s so ft menu k e y . Ex ample 1 – T o see a plot of H(t- 2) , f or e x ample , use a FUNCTION ty pe of plot (see Chapt er 12) :  P r ess „ô , simultaneo usl y in RPN mode , to acces s to the P L O T SETUP wi nd ow .  Ch ange TYPE to FUNCTION , if needed  Change EQ to ‘H(X- 2)’ .  M ak e sur e that Indep is s et to ‘X’ .  P r ess L @@@OK@@@ to r eturn to normal cal cul ator displa y . Θ Press „ò , simultaneousl y , to acces s the PL O T w indo w .  Chang e the H- VI EW r ange to 0 to 20, and the V - VIEW range to - 2 to 2 .  Pres s @ERASE @DRAW to plot the f unction . ) 3 ( ) 3 sin( sin cos ) ( 1 − ⋅ − ⋅ ⋅ = t H t t C t Co t y
Pa g e 1 6 - 2 3 Use o f the f unction H(X) w ith LD E C, L AP , or IL AP , is not allo wed in the calc ulator . Y ou hav e to us e the main results pr ov ided earlier w hen dealing w ith the Heav iside step f uncti on , 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) . Ex ample 2 – T he funct ion H(t- t o ) w hen multipli ed to a f unctio n f(t) , i .e ., H(t -t o )f(t) , has the eff ect o f sw itching on the f uncti on f(t) at t = t o . F or e x ample, the s olution obtained in Ex ample 3, a bov e, wa s y(t) = y o cos t y 1 sin t sin(t -3) ⋅ H(t- 3). Suppo se w e use the initi al conditions y o = 0. 5, and y 1 = -0.2 5 . Let’s plot this func tion to see w hat it looks like: Θ Press „ô , sim ultaneousl y if in RPN mode , to access to the P L O T SETUP wi n dow .  Ch ange TYPE to FUNCTION , if needed  Change E Q to ‘0. 5*CO S(X) -0.2 5*S IN(X) S IN(X-3)*H(X-3)’ .  M ak e sur e that Indep is s et to ‘X’ .  H-VIEW : 0 20, V - VIEW : -3 2 .  P r ess @ERASE @DRAW to plot the function.  P r ess @EDIT L @LABEL to see the plot. T he r esulting gr aph w ill look lik e this: Notice that the si gnal starts w ith a r elati ve ly small amplitude , but suddenl y , at t=3, it s w itche s to an osc illatory signal w ith a lar ger amplitude . The diff er ence between the beha v ior o f the signal bef or e and after t = 3 is the “ sw itching on ” of the par tic u lar solut i on y p (t) = sin(t- 3) ⋅ H(t -3) . T he behav ior of the si gnal befor e t = 3 r epr esents the contr ibution of the homogeneo us solu tion , y h (t) = y o cos t y 1 sin t . T he soluti on of an equati on w ith a dri ving si gnal gi v en b y a H ea v iside st ep func tion is sho w n belo w . Ex ample 3 – Deter mine the soluti on to the equation , d 2 y/dt 2 y = H(t-3) ,
Pa g e 1 6 - 24 w here H(t) is Hea v iside ’s step f uncti on. Us ing Laplace tr ansfor ms, w e can wri te : L {d 2 y/dt 2 y} = L{H(t -3)}, L{d 2 y/dt 2 } L{y(t)} = L{H(t- 3)} . The la st ter m in this e xpr essi on is: L{H(t -3)} = (1/s) ⋅ e –3s . W ith Y(s) = L{y(t)}, and L{d 2 y/dt 2 } = s 2 ⋅ Y(s) - s⋅ y o – y 1 , wher e y o = h(0) and y 1 = h ’(0) , the tr ansf ormed equati on is s 2 ⋅ Y(s) – s⋅ y o – y 1 Y(s) = (1/s) ⋅ e –3s . Change CA S mode to Ex act , if ne cessar y . Use the ca lc ul ator to solve fo r Y(s) , by wr it ing: ‘X^2*Y -X*y0 -y1 Y=(1/X)*EXP(-3*X)’ ` ‘Y’ I S O L T he r esult is ‘ Y=(X^2*y0 X* y1 EXP (-3*X))/(X^3 X)’ . T o f ind the soluti on to the ODE , y(t) , w e need to us e the inv erse L aplace tr ansfor m, as f ollo w s: OB J  ƒ ƒ Isolates r igh t -hand side o f last expr ession IL AP Obtains the in v ers e La place tr ansfo rm T he r esult is ‘ y1*S IN(X-1) y0*C O S(X-1) -(CO S(X-3) -1)*Hea v iside(X -3)’ . T hus , we w rite as the s oluti on: y(t) = y o cos t y 1 sin t H(t -3) ⋅ (1 sin(t-3)) . Chec k what the s olution t o the OD E w ould be if y ou us e the functi on LDEC: ‘H(X-3)’ ` [ENTER] ‘X^2 1’ ` LDE C T he re sult is: P lease notice that the v ari able X in this expr essi on actuall y r e p r esen ts the var iable t in the ori ginal ODE , and that the v ar iable ttt in this e xpr essi on is a dumm y var iable . T hus , the translati on of the sol ution in paper ma y be wr itten as: . ) 3 ( sin sin cos ) ( 0 1 ∫ ∞ − ⋅ ⋅ − ⋅ ⋅ ⋅ = du e u H t t C t Co t y ut
Pa g e 1 6 - 2 5 Ex ample 4 – P lot the so lution to Ex ample 3 using the same v alues of y o and y 1 used in the plot of Ex ample 1, abov e . W e now plot the f unction y(t) = 0. 5 cos t –0.2 5 sin t ( 1 sin(t -3)) ⋅ H(t-3) . In the r ange 0 < t < 20, and c hanging the vertical r ange to (-1, 3) , the gr aph should look lik e this: Again , ther e is a ne w component to the moti on s w itc hed at t=3, namel y , the partic ular so luti on y p (t) = [1 sin(t-3)] ⋅ H(t -3) , w hic h changes the natur e of the soluti on f or t>3 . T he Heav iside st ep func tion can be co mbined w ith a constan t func tion and w ith linear f unctions t o gener ate sq uar e , tr iangular , and sa w tooth f inite pulse s, as fo llo w s: Θ Squar e pulse o f si z e U o in the interval a < t < b: f(t) = Uo[H(t-a) -H(t -b)]. Θ T ri angular pulse w ith a maximum v alue Uo , incr easing fr om a < t < b, decr easing fr om b < t < c: f(t) = U o ⋅ ((t-a)/(b-a)⋅ [H(t -a) -H(t-b)] (1-(t -b)/(b-c))[H(t-b) -H(t -c)]). Θ Sa w tooth pulse inc r easing to a max imum value Uo fo r a < t < b , dropp ing suddenl y do wn to z er o at t = b: f(t) = U o ⋅ (t -a)/(b-a)⋅ [H(t-a) -H(t -b)]. Θ Sa w tooth pulse inc r easing suddenly t o a maxi mum of Uo at t = a , then decr easing linearl y to z er o for a < t < b:
Pa g e 1 6 - 26 f(t) = U o ⋅ [1-(t-a)/(b-1)]⋅ [H(t-a) -H(t-b)]. Ex amples of the plots gener ated by the se func tions , fo r Uo = 1, a = 2 , b = 3, c = 4 , hori z ontal r ange = (0,5 ) , and v ertical r ange = (-1, 1.5 ) , ar e sho wn in the fig ure s b el ow: F ourier ser ies F ouri er ser ie s are s er ies in v olv ing sine and cosine func tions typ ical ly us ed to e xpand per iodi c func tions . A func tion f(x) is sai d to be peri odic , of per i od T , if f(x T) = f(t) . F or e x ample , becaus e sin(x 2 π ) = sin x , and cos(x 2 π ) = cos x , the func tions sin and cos ar e 2 π -pe r iodi c func tions . If tw o func tions f(x) and g(x) ar e per iodi c of per iod T , then their linear comb ination h(x) = a ⋅ f(x) b ⋅ g(x), is also per iodi c of per iod T . A T -per iodi c functi on f(t) can be expanded into a ser ies o f sine and cosine func tions kno wn a s a F our ier s eri es gi v en by wher e the coeffi c ients a n and b n ar e gi ve n b y ∑ ∞ = ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ ⋅ ⋅ = 1 0 2 sin 2 cos ) ( n n n t T n b t T n a a t f π π ∫ ∫ − − ⋅ ⋅ = ⋅ = 2 / 2 / 2 / 2 / 0 , 2 cos ) ( 2 , ) ( 1 T T T T n dt t T n t f T a dt t f T a π ∫ − ⋅ ⋅ = 2 / 2 / . 2 sin ) ( T T n dt t T n t f b π
Pa g e 1 6 - 2 7 T he follo w ing ex erc ises ar e in AL G mode , with CA S mode s et to Ex act . ( W hen y ou pr oduce a gr aph , the CAS mode w ill be re set to Appr o x. Mak e sur e to se t it back t o Exact afte r pr oduc ing the gra ph.) Suppo se , f or ex ample , that the func tion f(t) = t 2 t is peri odic w ith per i od T = 2 . T o determine the coeff ic ients a 0 , a 1 , and b 1 f or the corr esponding F ouri er se ri es , w e pr oceed as foll o ws: F irst , def ine f uncti on f(t) = t 2 t : Ne xt, w e’ll us e the E quation W riter to calculate the coeff ic ients: T hus , the firs t thr ee terms of the functi on ar e: f(t) ≈ 1/3 – ( 4/ π 2 ) ⋅ cos ( π⋅ t) ( 2/ π )⋅ sin ( π⋅ t) . A gr aphi cal compar ison o f the or iginal func tion w ith the F our ier e xpansion using thes e thr ee terms sho ws that the f itting is acceptable fo r t < 1, or ther eabouts . But , then, again, w e stipulated that T/2 = 1. Ther efor e, the fitting is val id onl y bet w een –1 < t < 1.
Pa g e 1 6 - 2 8 Function FOURIER An alter nati ve w a y to def ine a F our ier ser ies is by using comple x number s as fo llo w s: wh ere F uncti on FOURIER pr ov i des the coeff ic ient c n of the comple x -f orm o f the F our ier ser i es giv en the functi on f(t) and the v alue of n. T he functi on F OURIER r equir es y ou to st or e the value o f the peri od (T) of a T -per iodi c func tion int o the CA S varia bl e PE RIO D b efore c al li ng th e fu nc tion. The fun ctio n FO URI E R i s ava ila bl e in the DERIV su b-menu w ithin the CAL C menu ( „Ö ). F ourier series f or a quadr atic func tion Deter mine the coeff ic ients c 0 , c 1 , and c 2 f or the func tion f(t) = t 2 t , w ith per iod T = 2 . (Note: Because the integr al used b y functi on FOURIER is calculated in the inte r v al [0,T], while the one de fined ear li er was calc ulated in the interval [- T/2 ,T/2], w e need to shift the func tion in the t-ax is, b y subtrac ting T/2 fr om t , i .e ., w e w ill use g(t) = f(t-1) = (t-1) 2 (t-1) .) Using the calc ulator in AL G mode , f irst w e define f uncti ons f(t) and g(t): ∑ ∞ −∞ = ⋅ = n n T t in c t f ), 2 exp( ) ( π ∫ ∞ − − −∞ = ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ = T n n dt t T n i t f T c 0 . ,... 2 , 1 , 0 , 1 , 2 ,..., , ) 2 exp( ) ( 1 π
Pa g e 1 6 - 2 9 Ne xt, w e mo ve to the CA SDI R sub-dir ector y under HOME to c hange the value of var iable PERIOD , e.g ., „ (hol d) §`J @) CASDI `2 K @ PERIOD ` R eturn to the su b-dir ectory wher e y ou defined f uncti ons f and g, and calc ulate the coeff ic ients (A ccept change to C omple x mode w hen req uested): Th us, c 0 = 1/3, c 1 = ( π⋅ i 2)/ π 2 , c 2 = ( π⋅ i 1)/(2 π 2 ). The F ourier seri es with t hr ee el ements will be w ritten as g(t) ≈ R e[(1/3) ( π⋅ i 2)/ π 2 ⋅ exp (i ⋅π⋅ t) ( π⋅ i 1)/( 2 π 2 ) ⋅ ex p (2 ⋅i ⋅π⋅ t)]. A plot of the shifted func tion g(t) and the F our ier se ri es f itting f ollow s:
Pa g e 1 6 - 3 0 T he fitting is some what accepta ble for 0<t<2 , although not as good as in the pr ev ious e xample . A general e xpression for c n T he functi on F OURIER can pro v ide a gener al e xpr essi on f or the coeff ic ient c n of the comple x F our ier ser ies e xpansion . F or ex ample , using the same f unction g(t) as befor e, the gener al term c n is gi ven b y (f igur es sho w nor mal font and small font di sp lays) : T he gener al ex pre ssi on turns out to be , aft er simplifying the pr ev ious r esul t , W e can simplify this expr essio n ev en further by us ing Euler ’s f orm ula for comple x number s, namel y , e 2in π = cos(2n π ) i ⋅ sin( 2n π ) = 1 i ⋅ 0 = 1, since co s(2n π ) = 1, and sin( 2n π ) = 0, f or n integer . Using the calc ulator y ou can simplify the e xpre ssion in the equati on wr iter ( ‚O ) b y r eplac ing e 2in π = 1. The f igur e show s the expr essio n after simplif icati on: π π π π π π in in n e n i n n i e i n c 2 3 3 2 2 2 2 2 2 3 2 ) 2 ( ⋅ − ⋅ =
Pa g e 1 6 - 3 1 The r esult is c n = (i ⋅ n ⋅π 2)/(n 2 ⋅π 2 ). P utting t ogether the comple x F ouri er ser ies Hav ing deter mined the gener al expr ession for c n , w e can pu t together a f inite comple x F our ier se ri es b y using the summati on f unction ( Σ ) in the calculator as fo llo w s: Θ F irs t, def ine a func tion c(n) r epre senting the gener al term c n in the comple x F ouri er ser ie s. Θ Next , def ine the finit e complex F our ier ser ies , F(X,k) , w her e X is the independent v ari able and k deter mines the number o f ter ms to be us ed. Ideally w e w ould lik e to wr ite this f inite co mple x F our ier se ri es as Ho w ev er , because the f uncti on c(n) is not def ined f or n = 0, w e w ill be better ad v ised to r e -wr ite the e xpr essi on as ) 2 exp( ) ( ) , ( X T n i n c k X F k k n ⋅ ⋅ ⋅ ⋅ ⋅ = ∑ − = π = 0 ) 0 , , ( c c k X F )], 2 exp( ) ( ) 2 exp( ) ( [ 1 X T n i n c X T n i n c k n ⋅ ⋅ ⋅ ⋅ − ⋅ − ⋅ ⋅ ⋅ ⋅ ⋅ ∑ = π π
Pa g e 1 6 - 32 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))’) , w here T is the per iod , T = 2 . The fo llo w ing s cr een shots show the def i niti on of func tion F and the st orin g of T = 2 : Th e fu nct ion @@@F@@@ can be us ed to gener ate the e xpre ssion f or the complex F ourie r ser ies f or a f inite value of k . F or e x ample , for k = 2 , c 0 = 1/3,and using t as the independent v ari able , w e can e valuate F(t ,2 ,1/3) to get: T his result sho ws onl y the fir st ter m (c0) a nd part of the f irst e xponential t erm in the ser ies . The dec imal displa y for mat wa s changed to F i x w ith 2 dec imals to be able to sho w some o f the coeff ic i ents in the e xpa nsi on and in the exponent . As e xpected , the coeff ic ients ar e complex n umbers . T he functi on F , thus de fined , is f ine fo r obtaining values o f the finite F ouri er ser ies . F or ex ample, a single v alue of the ser ies , e.g ., F(0.5,2 , 1/3), can be obtained b y using (CA S modes set t o Exac t , step-b y-step , and Comple x) :
Pa g e 1 6 - 33 Accept c hange to Approx mode if r eques ted . The r esult is the v alue –0.40 46 7…. The ac tual value o f the functi on g(0. 5) is g(0. 5) = -0.2 5 . T he fo llo w ing calc ulations sh ow ho w w ell the F our ier ser ie s appr o x imate s this v alue as the number of componen ts in the ser ie s, gi v en b y k, inc r eases: F (0. 5, 1, 1/3) = (-0. 30 3 2 86 4 3 90 3 7 , 0.) F (0. 5, 2 , 1/3) = (-0.404 60 7 6 2 2 6 7 6 , 0.) F (0. 5, 3, 1/3) = (-0.19 2 4010 3188 6, 0.) F ( 0 . 5 , 4 , 1 / 3 ) = ( - 0 . 1 6707073 5979 , 0 . ) F (0. 5, 5, 1/3) = (-0.2 9 4 3 9 46 9 04 5 3, 0.) F (0. 5, 6, 1/3) = (-0. 30 5 6 5 2 5 9 9 7 43, 0.) T o compar e the re sults fr om the ser ie s w ith those of the or i ginal functi on , load these f unc tions int o the P L O T – FUNCT ION input fo rm ( „ñ , sim ultaneou sl y if using RPN mode): Change the limits of the Plot W indo w ( „ò ) as fo llo ws: Press the soft -m enu k e ys @ERASE @ DRAW to pr oduce the plot: Notice that the s eri es , w ith 5 terms , “hugs ” the graph o f the functi on v er y c los ely in the interval 0 to 2 (i .e., thr ough the peri od T = 2) . Y ou can also noti ce a
Pa g e 1 6 - 3 4 per iodi c ity in the gr aph o f the ser ies . This per i odic it y is eas y to v isuali z e by e xpa nding the hor i z ontal range of the plot to (-0.5, 4) : F ourier series f or a triangular w av e Consi der the functi on w hich w e assume to be per i odic w ith peri od T = 2 . This f uncti on can be def ined in the calc ulator , in AL G mode , b y the e xpr essi on DEFINE(‘ g(X) = IFTE(X<1,X,2 -X)’) If y ou started this e xample after f inishing ex ample 1 y ou alr eady ha v e a value of 2 stor ed in CAS v ar iable P ERIOD . If y ou ar e not sur e , check the v a lue of this var iable , and stor e a 2 in it if needed . The coe ffi c ient c 0 fo r the F our ier se ri es is calc ulated as f ollo w s: T he calculator w ill r equest a c hange to A ppr o x mode becaus e of the integr ation of the f uncti on I F TE() included in the in tegr and . Accepting , the change to Appr o x pr oduces c 0 = 0.5 . If we no w w ant to obtain a gener ic e xpr essi on for the coeff ic ient c n use: ⎩ ⎨ ⎧ < < − < < = 2 1 , 2 1 0 , ) ( x if x x if x x g
Pa g e 1 6 - 3 5 T he calculat or r eturns an int egr al that cannot be e valuat ed numer icall y becaus e it depends on the par ameter n . The coeff ic ient can s till be calc ulated by typing its de finiti on in the calc ulator , i .e ., w here T = 2 is the per i od. T he value of T can be st or ed using: T yp ing the firs t integr al abo ve in the E quation W rit er , selecting the entir e e xpr essi on , and using @ EVAL@ , w ill pr oduce the f ollo w ing: Rec a ll th e e in π = cos(n π ) i ⋅ sin(nπ ) = (-1) n . P erfor ming this substitu tion in the res u l t a b ove we h ave : ⋅ ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ ⋅ π ⋅ ⋅ ⋅ − ⋅ ⋅ ∫ dX T X n 2 i EXP X 2 1 1 0 ∫ ⋅ ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ ⋅ π ⋅ ⋅ ⋅ − ⋅ − ⋅ 2 1 dX T X n 2 i EXP ) X 2 ( 2 1
Pa g e 1 6 - 3 6 Press `` to cop y this re sult to the scr een. T hen , r eacti vat e the E quation W r iter to calc ulate the second integr al defi ning the coeffi c ie nt c n , namel y , Once again, r eplac ing e in π = (-1) n , and using e 2in π = 1, w e get: Press `` to cop y this second r esult to the sc r een . No w , add ANS(1) and ANS( 2) to get the full e xpre ssio n for c n : Pr es sing ˜ will place this r esult in the E quation W rit er , wher e we can simplify ( @SIMP@ ) it t o r ead: Once again, r eplac ing e in π = (-1) n , r esults in
Pa g e 1 6 - 37 T his re sult is used to de fine the f unction c(n) as f ollo ws: DEFINE(‘ c(n) = - (((-1)^n-1)/(n^2* π ^2*(-1)^n)’) i. e. , Ne xt, w e def ine function F(X,k ,c0) to calc ulate the F our ier seri es (if you completed e x ample 1, y ou alr eady ha v e this functi on stor ed) : 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))’) , T o compar e the ori ginal functi on and the F ouri er ser ie s we can pr oduce the simultaneou s plot of both f uncti ons . The de tails ar e similar to tho se of e x ample 1, e x cept that her e we u se a hor i z ont al range o f 0 to 2 and a v ertical r ange fr om 0 to 1, and adj ust the equations t o plot as sho w n her e: T he r esulting gr aph is sho wn belo w f or k = 5 (the number of elements in the ser ies is 2k 1, i . e ., 11, in this cas e) :
Pa g e 1 6 - 3 8 F r om the plot it is very diffi c ult to distinguish the or iginal functi on fr om the F ourier s eri es appr o ximati on. U sing k = 2 , or 5 ter ms in the ser ies, sho ws not so good a f itting: T he F our ier s eri es can be us ed to gener ate a per i odic tr iangular w a ve (or sa w tooth w av e ) by c hanging the hor iz ontal ax is r ange , f or e xample , fr om –2 to 4. T he gr aph sho w n belo w use s k = 5: F ourier series f or a squar e wa ve A squar e wa ve can be gener ated by using the f uncti on ⎪ ⎩ ⎪ ⎨ ⎧ < < < < < < = 4 3 , 0 3 1 , 1 1 0 , 0 ) ( x if x if x if x g
Pa g e 1 6 - 3 9 In th is case , th e per iod T , is 4. Mak e s ur e to chang e the value of v ari abl e @@@T@@@ to 4 (use: 4K @@@T@@ ` ) . F uncti on g(X) can be def ined in the calc ulator by us in g DEFINE(‘ g(X) = IFTE((X>1) AND (X<3) ,1, 0)’) The function plot ted as follo ws (hori z ontal r ange : 0 to 4 , v ert i cal r a nge: 0 to 1.2 ): Using a pr ocedur e similar to that of the tr iangular shape in e xample 2 , abov e, y ou can f ind that , and W e can simplify this e xpre ssi on b y using e in π /2 = i n and e 3in π /2 = (-i) n to ge t: 5 . 0 1 1 3 1 0 = ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ ⋅ ⋅ = ∫ dX T c
Pa g e 1 6 - 4 0 Th e si m pl i fic at io n of th e rig h t -h a nd s id e of c (n ) , a bove, i s ea si er d on e on p ap e r (i .e ., b y hand) . T hen , r et y pe the expr es sion f or c(n) as sho wn in the f igur e to the left abo v e , to def ine func tion c(n). T he F our ier s er ies is calc ulated w ith F(X,k ,c0) , as in e x amples 1 and 2 abo v e , w ith c0 = 0. 5 . F or e x ample , f or k = 5, i .e ., w ith 11 components , the appr o x imation is sho wn belo w: A better appr ox imation is obtained b y u sing k = 10, i .e ., F or k = 20, the f itting is ev en better , but it tak es longer to pr oduce the gr aph: F ourier series applications in differ ential equations Suppos e w e want to us e the peri odic sq uar e wa v e def ined in the pr ev ious e x ample as the e x c itation o f an undamped spring-mas s s y stem w hose homogeneous equation is: d 2 y/dX 2 0.2 5y = 0. W e can gener ate the ex citation f or ce by obtaining an appro ximati on w ith k =10 out of the F our ier s er ies b y using S W(X) = F(X,10, 0.5 ):
Pa g e 1 6 - 4 1 W e can use this r esult as the f irs t input to the f uncti on LD E C w hen us ed to obtain a soluti on to the s y ste m d 2 y/dX 2 0.2 5y = S W(X) , w here S W(X) stands f or Squar e W av e f uncti on of X. T he second inpu t item w ill be the char acter isti c equati on corr es ponding to the homogeneous ODE sho wn abo ve , i. e., ‘X^2 0.2 5 ’ . W ith these two inpu ts, f unctio n LD E C produces the f ollow ing result (dec imal fo rmat c hanged to F i x w ith 3 dec imals). Pr es sing ˜ allo ws y ou to see the entire e xpr essi on in the E quation w r iter . Explor ing the equation in the E quati on W r iter r ev eals the e xis tence of tw o const ants of int egrati on , cC0 and cC1. T hese v alues w ould be calc ulated using initial conditi ons. Suppo se that w e use the v alues cC0 = 0. 5 and cC1 = -0. 5, w e can r eplace thos e values in the s olution abo ve by u sing functi on S UBS T (see Chapter 5). F or this case , u se S UBS T(ANS(1),c C0=0. 5) ` , fo llow ed b y S UB S T(AN S(1) ,cC1=-0. 5) ` . Back into nor mal calculator displa y w e can use: T he latter r esult can be def ined as a func tion , FW(X) , as foll o ws (c utting and pasting the last r esult into the command): W e can no w plot the r eal par t of this f uncti on . Change the dec imal mode to St andar d, and u se the f ollo w ing:
Pa g e 1 6 - 42 T he soluti on is sho wn belo w: F ourier T r ansf orms Befor e pr esen ting the concept of F our ier tr ansf orms , we ’ll d i scus s the gener al def initio n of an integr al tr ansf orm . In gener al , an integr al tr ansf orm is a tr ansfor mation that r elate s a functi on f(t) to a new f uncti on F(s) by an integr ation of the f or m The f uncti on κ (s,t) is kno wn a s the k erne l of the tr ansfor mati on . T he use of an integr al tr ansf orm allo w s us to r eso lv e a func tion into a gi ven spectrum of components . T o understand the concept of a spectr um, consider the F ouri er ser i es r epr esenting a per i odic func tion w ith a p e ri od T . This F ouri er ser ies can be r e - w ritten as w here fo r n =1,2 , … ∫ ⋅ ⋅ = b a dt t f t s s F . ) ( ) , ( ) ( κ () , sin cos ) ( 1 0 ∑ ∞ = ⋅ ⋅ = n n n n n x b x a a t f ω ω ∑ ∞ = ⋅ = 1 0 ), cos( ) ( n n n n x A a x f φ ϖ , tan , 1 2 2 ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ = = − n n n n n n a b b a A φ
Pa g e 1 6 - 4 3 T he amplitudes A n w ill be r ef err ed to as the spectr um of the f uncti on and w ill be a measur e of the magnitude of the component of f(x) w ith fr equency f n = n/T . T he basic or f undamental fr equency in the F ouri er ser ies is f 0 = 1/T , thus , all other fr equenc ies ar e multiple s of this basi c f req uency , i .e ., f n = n ⋅ f 0 . Also , we can def ine an angular fr equenc y , ω n = 2n π /T = 2 π⋅ f n = 2 π⋅ n ⋅ f 0 = n ⋅ω 0 , w here ω 0 is the basi c or fundame ntal angular f req uency o f the F our ier ser ies . Using the angular fr equency notati on, the F ouri er ser ies expansi on is w ritten as A plot of the v alues A n vs . ω n is the t y pical r epresentation of a discr ete spectr um for a f unction . T he disc r ete spectr um w ill sho w that the func tion has componen ts at angular fr equenc ie s ω n w hic h ar e intege r multiples of the fundame ntal angular f r equenc y ω 0 . Suppo se that w e ar e faced w ith the need to e xpand a non -pe ri odic f unc tion into sine and cosine components . A no n -per i odic func ti on can be thought of as hav i ng an inf initel y large per iod. T hus , for a v ery large v alue of T , the fundame ntal angular fr equency , ω 0 = 2 π /T , become s a very small quantity , sa y Δω . A lso , the angular f r equenc ie s cor r esponding to ω n = n ⋅ω 0 = n ⋅Δω , (n = 1, 2, … , ∞ ) , no w tak e v alues c loser and c lose r to each othe r , suggesting the need fo r a contin uous s pectr um of v alues . The no n -p erio dic fu n ctio n c an be writ ten, th erefore , as wh ere ∑ ∞ = ⋅ = 1 0 ). cos( ) ( n n n n x A a x f φ ω () ∑ ∞ = ⋅ ⋅ = 1 0 sin cos n n n n n x b x a a ω ω ∫ ∞ ⋅ ⋅ ⋅ ⋅ = 0 , )] sin( ) ( ) cos( ) ( [ ) ( ω ω ω ω ω d x S x C x f ∫ ∞ −∞ ⋅ ⋅ ⋅ ⋅ = , ) cos( ) ( 2 1 ) ( dx x x f C ω π ω
Pa g e 1 6 - 4 4 and The continuous spectrum is giv en by Th e fu nct ion s C ( ω ), S ( ω ), and A( ω ) are continuou s functions of a var iable ω , w hich beco mes the tr ansfor m v ari able fo r the F our ier tr ansfor ms def ined belo w . Ex ample 1 – Determin e the coeffic ients C( ω ), S( ω ) , and the contin uous spec trum A( ω ) , f or the fu ncti on f(x) = exp(- x) , fo r x > 0, and f (x) = 0, x < 0. In the calc ulator , set up and e valuate the f ollo w ing integr als to calc ulate C( ω ) and S( ω ) , r espec ti v ely . CA S modes ar e set to Ex act and R eal. Th ei r res u lt s a re, re sp e ct ive ly: The continuous spect r um, A( ω ) is calc ulated as: . ) sin( ) ( 2 1 ) ( ∫ ∞ −∞ ⋅ ⋅ ⋅ ⋅ = dx x x f S ω π ω 2 2 )] ( [ )] ( [ ) ( ω ω ω S C A =
Pa g e 1 6 - 4 5 Def ine this e xpr essio n as a f unction by u sing func tion DEFINE ( „à ) . Then , plot the continuo us spectr um, in the r ange 0 < ω < 10 , as: Definition o f Four ier transf orms Diffe r ent t y p e s of F ourie r transf or ms can be defined . T he fo llo wing ar e the def initio ns of the sine , cosine , and full F our ier tr ansfor ms and their in v ers es us ed in this Chapt er . F ourie r sine tr ansfor m In ver se sine tr ansfo rm F ourie r cosine tr ansfo rm In ver se cosine tr ansform F ourie r tr ansfo rm (pr oper ) In ve rse F our ier tr ansfor m (pr oper) Ex ample 1 – Determine the F our ier tr ansfor m of the f uncti on f(t) = e xp(- t) , f or t >0, and f(t) = 0, fo r t<0. ∫ ∞ ⋅ ⋅ ⋅ ⋅ = = 0 ) sin( ) ( 2 ) ( )} ( { dt t t f F t f s ω π ω F ∫ ∞ − ⋅ ⋅ ⋅ = = 0 1 ) sin( ) ( ) ( )} ( { dt t F t f F s ω ω ω F ∫ ∞ ⋅ ⋅ ⋅ ⋅ = = 0 ) cos( ) ( 2 ) ( )} ( { dt t t f F t f c ω π ω F ∫ ∞ − ⋅ ⋅ ⋅ = = 0 1 ) cos( ) ( ) ( )} ( { dt t F t f F c ω ω ω F ∫ ∞ −∞ − ⋅ ⋅ ⋅ = = dt e t f F t f t i ω π ω ) ( 2 1 ) ( )} ( { F ∫ ∞ −∞ − − ⋅ ⋅ ⋅ = = dt e F t f F t i ω ω π ω ) ( 2 1 ) ( )} ( { 1 F
Pa g e 1 6 - 4 6 The continuous spect r um, F( ω ) , is calculated w ith the integral: T his re sult can be r ationali z ed b y multipl y ing numer ator and denominator b y the conjugat e of the denominator , namel y , 1-i ω . T he r esult is now : which is a co mp lex fu nct ion. T he absolute v alue of the r eal and imaginar y parts of the func tion can be plotted as sho wn be low Not es : T he magnitude , or ab solute value , of the F our ier tr ansfor m, |F( ω )|, is the fr equency s pectrum o f the ori ginal functi on f(t) . F or the e xample sho wn abo v e , |F( ω )| = 1/[2 π (1 ω 2 )] 1/2 . T he plot of |F( ω )| v s. ω wa s show n earlier . Some f uncti ons, su ch as const ant values , sin x , e xp(x) , x 2 , etc ., do not hav e F ouri er transf orm . F unctions that go to z er o suffi c ientl y fas t as x goes to infinity do hav e F ouri er tr ansf orms . ∫ ∫ − ∞ ∞ → − = ε ω ε ω π π 0 ) 1 ( 0 ) 1 ( 2 1 lim 2 1 dt e dt e t i t i . 1 1 2 1 1 ) ) 1 ( exp( 1 2 1 lim ω π ω ω π ε i i t i ⋅ = ⎥ ⎦ ⎤ ⎢ ⎣ ⎡ − − = ∞ → ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ − − ⋅ ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ ⋅ = ⋅ = ω ω ω π ω π ω i i i i F 1 1 1 1 2 1 1 1 2 1 ) ( ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ ⋅ − = 2 2 1 1 1 2 1 ω ω ω π i
Pa g e 1 6 - 4 7 Pr oper ties o f th e F ourier transfor m L inearity : If a and b are co nstants , and f and g functi ons, then F{a ⋅ f b ⋅ g} = a F{f } b F{g}. T r ansfor mati on of partial deri vati v es . Let u = u(x ,t) . If the F ouri er tr ansfor m tr ansfor ms the var i able x , then F{ ∂ u/∂ x} = i ω F{u}, F{ ∂ 2 u/ ∂x 2 } = - ω 2 F{u}, F{ ∂ u/∂ t} = ∂ F{u}/ ∂ t, F { ∂ 2 u/ ∂t 2 } = ∂ 2 F{u}/ ∂ t 2 Con voluti on: F or F our ier tr ansfor m applicati ons, the operati on of con voluti on is def ined as The f ollo wing pr opert y holds f or conv oluti on: F{f*g} = F{f} ⋅ F{g}. F ast F ourier T r ansfor m (FFT) T he F ast F our ier T ransf or m is a computer algor ithm by w hic h one can calc ulate v er y e ffi c ientl y a disc r ete F our ier tr ansfo rm (DFT) . T his algor ithm has appli cations in the analy sis of diff er ent types o f time -dependent signals, f r om turbulence measur ements to communi cation si gnals. T he discr ete F ouri er tr ansfor m of a seq uence of data v alues {x j }, j = 0, 1, 2 , …, n -1, is a new f inite sequence {X k }, def ined as T he dir ect calc ulation o f the sequence X k in v olv es n 2 pr oducts , wh ich w ould in vo lv e eno rmou s amounts of computer (o r calc ulator ) time partic ularl y fo r large v alues of n . The F ast F our ier T ransf or m r educes the n umber of oper ati ons to the or der of n ⋅ log 2 n . F or ex ample, f or n = 100, the FFT r equire s about 664 oper ations , w hile the direc t calc ulatio n wo uld requir e 10, 000 operati ons. T hu s, ∫ ⋅ ⋅ − ⋅ = . ) ( ) ( 2 1 ) )( * ( ξ ξ ξ π d g x f x g f ∑ − = − = ⋅ − ⋅ = 1 0 1 ,..., 2 , 1 , 0 ), / 2 exp( 1 n j j k n k n kj i x n X π
Pa g e 1 6 - 4 8 the number o f oper ations u sing the FFT is r e du ced by a f act or of 10000/6 64 ≈ 15 . The FFT op er ates on t he sequenc e {x j } b y partitioning it int o a number o f shorter seque nces . The DFT ’s of the shorter seq uences ar e calc ulated and later comb ined together in a highl y eff ic ient manner . F or details on the algo rithm r ef er , f or e xample , to Chapt er 12 in New land , D .E ., 19 9 3, “ An Intr oductio n to R andom Vibr ati ons, S pectr al & W av elet A naly sis – T hir d E dition , ” Longman Sc ientif i c and T echni cal , New Y ork . T he only r equir ement fo r the applicati on of the FFT is that the number n be a po w er of 2 , i .e ., select y our data so that it contains 2 , 4, 8 , 16 , 3 2 , 6 2 , etc ., points . Ex amples of FF T applications FFT applicati ons usually in v ol ve data dis cr eti z ed fr om a time -dependent signal . T he calculator can be f ed that data, sa y fr om a computer or a data logger , f or pr ocessing . Or , y ou can gener ate y our o wn dat a by pr ogr amming a func tion and adding a fe w r andom number s to it . Ex ample 1 – Def ine the functi on f(x) = 2 sin (3x) 5 cos(5x) 0. 5*R AND , w here RAND is the unifor m r andom number gener ator pr ov ided by the calc ulator . Gener ate 12 8 dat a points b y using v alues of x in the interval (0,12 .8). Stor e those value s in an arr ay , and per f or m a FFT on the arr a y . F irst , w e def ine the func tion f(x) as a RPN pr ogram: <<  x ‘2*S IN(3*x) 5*CO S(5*x)’ EV AL RAND 5 *  NUM >> and stor e this pr ogr am in var iabl e @@@@f@@@ . Ne xt, type the f ollo w ing pr ogram to gener a t e 2 m data v alues betw een a and b . The pr ogr am w ill tak e the values o f m, a , and b: <<  m a b << ‘2^m ’ EV AL  n << ‘(b-a)/(n 1)’ E V AL  Dx << 1 n F OR j ‘ a (j-1)*Dx ’ EV AL f NEXT n  ARR Y >> >> >> >> St or e this pr ogram unde r the name GD A T A (Gener ate D A T A). Then , run the pr ogr am for the v alues , m = 5, a = 0, b = 100. In RPN mode , use: 5#0#100 @GDATA!
Pa g e 1 6 - 49 T he fi gur e belo w is a box plot o f the data pr oduced. T o obtain the gra ph, f irs t cop y the ar r ay j ust c r eated, then tr ansfor m it into a column v ector b y using: OB J  1  ARR Y (F uncti ons OB J  and  ARR Y are a vaila ble in the command cat alog, ‚N ) . S tor e the arr ay into var ia ble Σ DA T by us i n g fu nct ion ST O Σ (also a vailable thr ough ‚N ) . Select Bar in the TYPE f or gr aphs, c hange the vi e w w ind o w to H- VIEW : 0 3 2 , V -VIEW : -10 10, and BarW idth to 1. Pr ess @CANCL $ to r eturn to nor mal calculat or displa y . T o perfor m the FFT on the arr ay in s tack le v el 1 use fu nction FFT a vailable in the MTH/FFT menu on ar r ay Σ DA T: @£DAT FFT . The FF T r eturns an arr ay o f comple x number s that ar e the arr a y s of coeff ic ie nts X k of th e DF T . Th e m a gn it ud e o f t he coeff i c ients X k r epr esents a f req uency spec trum of the or i ginal data. T o obtain the magnitude of the coeff ic ients y ou could tr ansfor m the arr ay into a list , and then appl y funct ion AB S to the list . This is accomplished b y using: OB J  μ ƒ  LIS T „Ê F i n ally , yo u can con v ert the list bac k to a col umn vec tor t o be sto red in Σ DA T , as fo llow s: OBJ  1 ` 2  LIS T  ARR Y S T O Σ T o plot the spectr um, f ollo w the instr ucti ons for pr oducing a bar plot gi ven earli er . The v ertical r ange needs to be changed to –1 to 8 0. The s pectr um of fr equenc ie s is the follo w ing: T he spectrum sho ws tw o large co mponents for tw o fr equenc i es (these ar e the sinus oidal com ponents, sin (3 x) and cos(5x)) , and a number of smaller components f or other fr equenc ie s.
Pa g e 1 6 - 50 Ex ample 2 – T o pr oduce the signal gi ven the s pectr um, w e modif y the pr ogr am GD A T A to inc lude an abso lute v alue , so that it r eads: <<  m a b << ‘2^m ’ EV AL  n << ‘(b-a)/(n 1)’ EV AL  Dx << 1 n FOR j ‘ a (j-1 )*Dx ’ EV AL f AB S NEXT n  ARR Y > > >> >> >> St or e this ver sion o f the pr ogr am under G SPE C (Gener ate SP E Ctr um) . R un the pr ogr am w ith m = 6, a = 0, b = 100. In RPN mode , use: 6#0#100 @GSPEC! Press ` when done , to k eep an additional cop y of the spectr um arr ay . Con vert this r o w v ector in to a column v ect or and stor e it into Σ D A T . F ollo w ing the pr ocedur e fo r generating a bar plot , the s pectrum gene rat ed for this e xample looks as sho w n below . The hori z ontal range in this case is 0 to 64, w hile the vertical r ange is –1 to 10: T o r epr oduce the signal w hose spec trum is sho wn , u se func tion IFFT . Since w e left a cop y of the s pectr um in the stac k (a r o w v ector ) , all y ou need to do if f ind func tion IFFT in the MTH/FF T menu or thr ough the command catalog, ‚N . As an alter nativ e, y ou could simply type the f unction name , i .e ., t y pe ~~ifft` . T he signal is sho wn as an ar r ay (r ow vect or ) w ith comple x numbers . W e are inte r ested onl y in the r eal par t o f the elements. T o e xtr act the r eal par t o f the comple x number s, us e functi on RE f r om the CMPLX menu (s ee Chapter 4), e.g ., type ~~re` . What r esults is anothe r r ow v ector . Conv ert it into a column vec tor , store it into Σ D A T , and plot a bar plot to sho w the si gnal. T he signal f or this e x ample is show n below , using a hor i z ont al range o f 0 to 64 , and a vertic al r ange of –1 to 1:
Pa g e 1 6 - 5 1 Ex cept for a lar ge peak at t = 0, the signal is mo stl y nois e . A smaller v er ti cal scale (-0. 5 to 0. 5) sho ws the si gnal as f ollo ws: Solution to specific second-or der differential equations In this secti on w e pr esent and so lv e spec ifi c t y pes of or dinar y differ ential equati ons who se solu tions ar e def ined in ter ms of s ome cla ssical f uncti ons, e .g ., Bess el’s f unctions , Hermite pol y nomials , etc. Examples ar e pres ented in RPN mode . T he Cauc h y or Euler equation An equati on of the f orm x 2 ⋅ (d 2 y/dx 2 ) a ⋅ x⋅ (d y/dx) b ⋅ y = 0, w her e a and b ar e r e al constants, is know n as th e C auch y or Euler equation. A solution to the Cau ch y eq uation can be f ound b y assuming that y(x) = x n . T ype the equation as: ‘ x^2*d1d1y(x) a*x*d1y(x) b*y(x)=0’ ` T hen, type and sub stitute the sugges ted soluti on: ‘ y(x) = x^n ’ ` @SUBST T he r esult is: ‘ x^2*(n*(x^(n-1-1)*(n -1))) a*x*(n*x^(n -1)) b*x^n =0, w hic h simplif i es to ‘ n*(n-1)*x^n a*n*x^n b*x^n = 0’ . Di v i ding b y x^n, r esults in an au x iliary algebr ai c equation: ‘ n*(n -1) a*n b = 0’ , or . . Θ If the equation has tw o differ ent r oots, sa y n 1 and n 2 , then the gener al soluti on of this equati on is y(x) = K 1 ⋅ x n 1 K 2 ⋅ x n 2 . Θ If b = (1-a) 2 /4 , then the equation ha s a double r oot n 1 = n 2 = n = (1-a)/2 , and the solu tion turns ou t to be y(x) = (K 1 K 2 ⋅ ln x)x n . Legendre’s equation An equati on of the f orm (1- x 2 ) ⋅ (d 2 y/dx 2 )- 2 ⋅ x⋅ (dy/dx ) n ⋅ (n 1) ⋅ y = 0, w her e n is a r eal number , is kno wn as the Legendr e ’s diff er enti al equation . A n y soluti on fo r this equatio n is kno w n as a L egendr e’s f uncti on . When n is a nonnegati ve integer , the s oluti ons ar e called Legendr e’s pol ynomials . Legendr e’s poly nomial of or der n is gi ven by 0 ) 1 ( 2 = ⋅ − b n a n
Pa g e 1 6 - 52 w here M = n/2 or (n-1)/2 , whi che v er is an integer . Legendr e’s pol y nomials ar e pr e -pr ogr ammed in the calculator and can be r ecalled by u sing the func tion LE GENDRE gi v en the or der of the pol ynomi al , n. T he functi on LE GENDR E can be obtained fr om the command catalog ( ‚N ) or thr ough the menu ARITHME T IC/POL YNOMIAL menu (see Chapter 5 ) . In RPN mode , the fir st si x Legendr e poly nomials ar e obtained as f ollo w s: 0 LE GENDRE , re sult: 1, i .e ., P 0 (x) = 1. 0. 1 LE GENDRE , re sult: ‘X’ , i .e ., P 1 (x) = x . 2 LE GENDRE , re sult: ‘( 3*X^2 -1)/2’ , i .e ., P 2 (x) = (3x 2 -1)/2 . 3 LE GENDRE , r esult: ‘(5*X^3-3*X)/2’ , i .e . , P 3 (x) =(5x 3 -3x)/2 . 4 LE GENDRE , r esult: ‘(3 5*X^4 -30*X^2 3)/8’ , i .e ., P 4 (x) =(3 5x 4 -3 0x 2 3)/8. 5 LE GENDRE , re sult: ‘(6 3*X^5- 7 0*X^3 15*X)/8’ , i .e ., P 5 (x) =(6 3x 5 -70 x 3 15x)/8. Th e O D E ( 1-x 2 ) ⋅ (d 2 y/dx 2 )- 2 ⋅ x⋅ (d y/dx) [n ⋅ (n 1) -m 2 /(1- x 2 )] ⋅ y = 0, has f or solu tion the f unction y(x) = P n m (x)= (1- x 2 ) m/2 ⋅ (d m Pn/dx m ) . T his functi on is r ef err ed t o as an assoc iated L egendr e func tion . Bessel’s equation T he ordinary differ ential eq uation x 2 ⋅ (d 2 y/dx 2 ) x ⋅ (d y/dx) (x 2 - ν 2 ) ⋅ y = 0, w here the paramet er ν is a nonnegativ e r eal number , is know n as Bessel’s diffe r ential equation . Soluti ons to Bessel’s equatio n are gi ven in ter ms of Bessel fu nc tions of the fi rst kind of or der ν : m n M m n m n x m n m n m m n x P 2 0 )! 2 ( )! ( ! 2 )! 2 2 ( ) 1 ( ) ( − = ∑ ⋅ − ⋅ − ⋅ ⋅ − ⋅ − = .. ... )! 2 ( )! 1 ( ! 1 2 )! 2 2 ( ) ! ( 2 )! 2 ( 2 2 − ⋅ − − ⋅ ⋅ − − ⋅ ⋅ = − n n n n x n n n x n n ∑ ∞ = Γ ⋅ ⋅ ⋅ − ⋅ = 0 2 2 , ) 1 ( ! 2 ) 1 ( ) ( m m m m m m x x x J ν ν ν ν
Pa g e 1 6 - 5 3 wher e ν is not an integer , and the func tion Gamma Γ (α ) is defined in Chapt er 3. If ν = n , an integer , the Bessel f uncti ons of the f ir st kind for n = intege r ar e def ined b y Regar dless of whether w e use ν (n on -int eger ) or n (integer ) in the calc ulato r , we can def ine the Bess el f unctions o f the fir st kind b y using the f ollo wing f inite ser ies: T hus , w e hav e contr ol o v er the f uncti on ’s or der , n , and of the number o f elements in the ser ie s, k . Once you ha v e typed this functi on , yo u can u se func tion DEFINE to de fi ne functi on J(x ,n ,k) . This w ill cr eate the v ar iable @@@ J@@@ in the so ft -menu ke ys . F or ex ample, t o ev aluate J 3 (0.1) using 5 te rms in the se ri es , calc ulate J( 0.1, 3,5) , i .e ., in RPN mode: .1#3#5 @@@J@@@ Th e r esult is 2 . 08 20 315 7E -5 . If y o u want to o bta in an exp r es sion for J 0 (x) w ith, sa y , 5 terms in the ser ies , use J(x, 0,5) . T he result is ‘1-0.2 5*x^2 0. 015 6 2 5*x^4 - 4. 3 4 0 3 77 7E - 4*x^6 6 .7 8 216 8E -6*x^8- 6 .7 816 8*x^10’ . F or non -integer values ν , the soluti on to the Bess el equation is gi ven b y y(x) = K 1 ⋅ J ν (x) K 2 ⋅ J - ν (x). F or integer v alues , the functi ons Jn(x) and J-n(x) ar e linearl y dependen t , since J n (x) = (-1) n ⋅ J -n (x) , ther ef or e , w e cannot use them to obtain a gener al functi on to the equation . Inste ad, w e in tr oduc e the Bessel functions of the second kind def ined as ∑ ∞ = ⋅ ⋅ ⋅ − ⋅ = 0 2 2 . )! ( ! 2 ) 1 ( ) ( m n m m m n n m n m x x x J
Pa g e 1 6 - 5 4 Y ν (x) = [J ν (x) cos νπ – J −ν (x)]/sin νπ , fo r non -int eger ν , and f or n integer , w ith n > 0, by wher e γ is the Euler cons tant , def ined by and h m r epr esents the har monic s er ies F or the case n = 0, the Bes sel f uncti on of the seco nd kind is def ined as With these def i niti ons, a gener al solution of B esse l’s equati on for all v a lues of ν is giv en by y(x) = K 1 ⋅ J ν (x) K 2 ⋅ Y ν (x). In som e insta nces, it i s necessa ry to pr ov ide c omple x solutions to Bessel’s equations b y def ining the Bessel functi ons of the thir d kind of or der ν as H n (1) (x) = J ν (x) i ⋅ Y ν (x) , and H n (2) (x) = J ν (x) − i⋅ Y ν (x) , T hese f uncti ons ar e also kno wn as the fir st and seco nd Hank el func tions of or der ν . In some applicati ons yo u may also ha ve to utili z e the so -called modif ied Bessel func tions of the f irs t kind of or der ν de fined a s I ν (x)= i - ν ⋅ J ν (i ⋅ x) , w her e i is the unit imaginar y n umber . The se func tions ar e soluti ons to the diff er ential equation x 2 ⋅ (d 2 y/dx 2 ) x ⋅ (dy/dx) - (x 2 ν 2 ) ⋅ y = 0. m m n m n m m m n n n x n m m h h x x x J x Y 2 0 2 1 )! ( ! 2 ) ( ) 1 ( ) 2 (ln ) ( 2 ) ( ⋅ ⋅ ⋅ ⋅ − ⋅ ⋅ ⋅ = ∑ ∞ = − π γ π m n m n m n x m m n x 2 1 0 2 ! 2 )! 1 ( ⋅ ⋅ − − ⋅ − ∑ − = − − π ..., 0 5772156649 . 0 ] ln 1 ... 3 1 2 1 1 [ lim ≈ − = ∞ → r r r γ m h m 1 ... 3 1 2 1 1 = . ) ! ( 2 ) 1 ( ) 2 (ln ) ( 2 ) ( 2 0 2 2 1 0 0 ⎥ ⎦ ⎤ ⎢ ⎣ ⎡ ⋅ ⋅ ⋅ − ⋅ ⋅ = ∑ ∞ = − m m m m m x m h x x J x Y γ π
Pa g e 1 6 - 5 5 T he modifi ed Bessel f unctions o f the second kind , K ν (x) = ( π /2)⋅ [I - ν (x) − I ν (x)]/sin νπ , ar e also so lutions o f this OD E . Y ou can implement f uncti ons r epr esenting Bes sel’s f unctions in the calc ulator in a similar ma nn er to that used to def ine Bess el’s func tions of the f irst kind, but k eeping in mind that the inf inite se ri es in the calc ulator need to be tr anslated into a f inite s er ies . Cheby she v or T c heb y cheff pol y nomials Th e fu nct ion s T n (x) = cos(n ⋅ cos -1 x) , and U n (x) = sin[(n 1) co s -1 x]/(1- x 2 ) 1/2 , n = 0, 1, … ar e called Cheb y shev or T cheb yc heff pol y nomials of the f irs t and second kind , r especti vel y . The pol y nomi als Tn(x) are s olutions o f the diffe r ential equati on (1- x 2 ) ⋅ (d 2 y/dx 2 ) − x ⋅ (dy/dx) n 2 ⋅ y = 0. In the calc ulator the f uncti on T C HEB Y CHEFF gener ates the C heby she v or T c heby c heff pol yno mial of the f irs t kind of or der n, giv en a v alue of n > 0. If the intege r n is negativ e (n < 0) , the f uncti on T CHEB Y CHEFF gener ates a T cheb yc heff pol yno mial of the second kind of or der n w ho se def inition is U n (x) = sin(n ⋅ ar ccos(x))/sin(ar ccos(x)) . Y ou can acces s the func tion T C HEB Y CHEFF thr ough the command catalog ( ‚N ). T he fir st f our Cheb yshe v or T c heb yc heff pol y nomials o f the f irs t and second kind ar e obtained as f ollo w s: 0 T CHEB Y CHEFF , r esult: 1, i .e ., T 0 (x) = 1. 0. -0 T CHEB Y C HEFF , r esult: 1, i. e., U 0 (x) = 1. 0. 1 T CHEB Y CHEFF , r esult: ‘X’ , i .e., T 1 (x) = x . -1 T CHEB Y C HEFF , r esult: 1, i .e., U 1 (x) =1. 0. 2 T CHEB Y CHEFF , re sult: ‘2*X^2 -1, i.e ., T 2 (x) =2x 2 -1. - 2 T C HEB Y CHEFF , r esult: ‘2*X’ , i. e., U 2 (x) =2x . 3 T CHEB Y CHEFF , re sult: ‘4*X^3-3*X’ , i .e., T 3 (x) = 4x 3 -3x . -3 T CHEB Y CHEFF , r esult: ‘4*X^2 -1’ , i .e., U 3 (x) = 4x 2 -1.
Pa g e 1 6 - 5 6 Laguerr e’s equation Lague rr e ’s equation is the s econd-orde r , linear OD E of the f orm x ⋅ (d 2 y/dx 2 ) (1 − x) ⋅ (d y/dx) n ⋅ y = 0. L aguerr e pol ynomi als, de fined as , ar e soluti ons to L aguerr e ’s equation . Laguer r e ’s pol ynomi als can also be calc ulated w ith: Th e te rm is the m-th coeff ic ient o f the b inomial e xpansio n (x y) n . It also r epr esen ts the number of combinati ons of n elements tak en m at a time . This fu nction is av ailable in the calc ulator as func tion C OMB in the MTH/P ROB menu (see als o Chapter 17) . Y ou can def ine the f ollo w ing f uncti on to calc ulate Lague rr e ’s pol yn omials: When done t yping it i n the e quation wr ite r pr ess use function DEF INE to cr e ate the func tion L(x ,n) into v ar iable @@ @L@@@ . T o gener ate the f irst f our L aguerr e poly nomi als us e , L(x, 0) , L(x ,1) , L(x ,2) , L(x , 3) . T he r esults ar e: L 0 (x) = . L 1 (x) = 1- x . ,... 2 , 1 , ) ( ! ) ( , 1 ) ( 0 = ⋅ ⋅ = = − n dx e x d n e x L x L n x n n x n . ! ) 1 ( ) ( 0 m n m m n x m n m x L ⋅ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ⋅ − = ∑ = n n x n x n n x n ⋅ − − ⋅ − ⋅ − = ! ) 1 ( .... ... 4 ) 1 ( 1 2 ) , ( )! ( ! ! m n C m n m n m n = − = ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛
Pa g e 1 6 - 57 L 2 (x) = 1- 2x 0.5x 2 L 3 (x) = 1-3x 1. 5x 2 - 0. 1 6666 … x 3 . W eber ’s equation and H er mite poly nomials W eber’s eq uation is def ined as d 2 y/dx 2 (n 1/2 - x 2 /4)y = 0, f or n = 0, 1, 2 , … A partic ular so lutio n of this eq uation is gi ven b y the functi on , y(x) = ex p (-x 2 /4)H * (x/ √ 2) , wher e the f uncti on H * (x) is the H er mite poly nomial: In the calc ulator , the func tion HERMI TE , av ailable thr ough the menu ARI THMET IC/P OL YNOMIAL . F uncti on HERMITE tak es as argument an integer number , n, and r etur ns the Hermite pol y nomi al of n -th degree . F or e xam ple , the f irst f our Her mite pol yno mials ar e obtained b y using: 0 HERMITE , re sult: 1, i .e., H 0 * = 1. 1 HERMITE , re sult: ’2*X’ , i. e., H 1 * = 2x . 2 HERMITE , re sult: ’4*X^2 - 2’ , i .e., H 2 * = 4x 2 -2. 3 HERMITE , re sult: ’8*X^3-12*X’ , i .e ., H 3 * = 8x 3 -12x . Numerical and graphical solutions t o O D Es Diffe r ential equati ons that cannot be s olv ed anal yticall y can be sol v ed numer icall y or gr aphicall y as illu str ated belo w . Numerical solution of first-or der O DE T hro ugh the use of the numer ical sol v er ( ‚Ï ), yo u can access an input fo rm that lets y ou sol v e fi rst-or der , linear or dinary differ ential equations . T he use o f this f eature is pr esented using the f ollo w ing e xample . T he method used in the solu tion is a f ourth-or der R unge -K utta algor ithm prepr ogr ammed in the calc ulat or . Ex ample 1 -- Suppos e we w ant to sol ve the diff er ential equation , dv/dt = -1. 5 v 1/2 , w ith v = 4 at t = 0. W e are as k ed to f ind v for t = 2 . ,.. 2 , 1 ), ( ) 1 ( ) ( * , 1 * 2 2 0 = − = = − n e dx d e x H H x n n x n n
Pa g e 1 6 - 5 8 F i r st , c r eate the e xpr es sion de fining the de ri vati v e and stor e it into var i able E Q. T he fi gur e to the left sho ws the AL G mode command, w hile the ri ght-hand side f igur e sho ws the RPN s tack be for e pre ssing K . T hen, enter the NUMERICAL S OL VER en vir onment and select the differ ential equation s olv er : ‚Ϙ @@@OK@@@ . Ent er the fo llow ing paramet ers: To s o l v e , p r e s s : @SOLVE (wai t) @EDIT@ . T he re sult is 0. 2 4 99 ≈ 0 . 25. P re ss @@@OK@@@ . Solution presented as a table of values Suppose w e w anted to pr oduce a table of v alues of v , fo r t = 0. 00, 0.2 5, …, 2 . 00, w e w ill pr oceed as f ollo w s: F irst , pr epar e a table t o wr ite do w n y our r esults. W rit e do wn in y our table the step- b y-step r esult s: Ne xt , w ithin the SO L VE en v ir onment , c hange the final v alue of the independe nt var iable to 0.2 5, use : — .2 5 @@OK@ @ ™™ @SOL VE (wa it ) @EDIT (So lv es f or v at t = 0.2 5, v = 3 .2 8 5 …. ) @@OK@ @ INIT — . 5 @@OK@@ ™™@SOLVE (wai t) @EDIT (Changes initial v alue of t to 0.2 5, and f inal value of t to 0.5, s ol ve f or v(0. 5 ) = 2 .640…) tv 0.00 0.00 0.25 …… 2.00
Pa g e 1 6 - 59 @@OK@ @ @INIT — .7 5 @@OK@@ ™™ @SOLVE (wai t) @EDIT (Changes initial v alue of t t o 0.5, and f inal v alue of t to 0.7 5, sol v e f or v(0.7 5) = 2 . 066…) @@OK@ @ @INIT — 1 @@OK@@ ™ ™ @SOLVE (wai t) @EDIT (Changes initi al value o f t to 0.7 5, and final v alue of t to 1, s olv e for v(1) = 1. 5 6 2…) R epeat for t = 1.2 5, 1.5 0, 1.7 5, 2 .0 0. Pre ss @@OK@@ after v ie w ing the last r esult in @EDIT . T o r eturn to nor mal calculator displa y , pr ess $ or L @@OK@@ . T he diffe r ent soluti ons w ill be sho w n in the st ack , w ith the late st r esult in le v el 1. T he final r esults look as f ollo ws (r ounded to the thir d dec imal) : Graph ical solution o f first-or der ODE When w e can not obtain a c losed-f orm s olution f or the int egral , w e can alw ay s plot the integr al by se lecting Diff Eq in the TYPE fie ld of th e PL OT en vi r onment as fo llo ws: su ppose that w e want t o plot the position x(t) fo r a v eloc ity functi on v(t) = e xp(- t 2 ) , w ith x = 0 at t = 0. W e kno w there is no c losed-fo rm e xpr essio n for the integr al , how ev er , w e know that the def initi on of v(t) is dx/dt = e xp(- t 2 ). T he calculat or allow s for the plotting of the solu tion of diff er ential equations o f the f orm Y'(T) = F(T ,Y) . F or our case , we let Y = x and T = t, ther efor e , F(T ,Y) = f(t , x) = e xp(-t 2 ). L et's pl ot the soluti on , x(t) , f or t = 0 to 5, b y using the fo llo w ing k ey str ok e sequence: tv 0. 00 4. 000 0 . 25 3. 285 0. 50 2 .640 0.7 5 2 .06 6 1. 00 1.5 6 2 1.2 5 1.12 9 1. 50 0.7 66 1.7 5 0.4 7 3 2. 0 0 0 . 2 5 0
Pa g e 1 6 - 6 0 Θ „ô (simultaneousl y , if in RPN mode) to enter PL O T e nv i r onment Θ Highl ight the f ield in f r ont of TYPE , using the —˜ k ey s. T hen , pres s @CHOOS , and highlight Diff Eq , u sing the —˜ k ey s. Pr ess @@OK@@ . Θ Change f ield F: t o ‘EXP(- t^2)’ Θ Make sur e that the f ollo w ing par ameters ar e set t o: H-VAR: 0, V-VAR: 1 Θ Change the independent v ar iable to t . Θ Accept c hanges to P L O T SETUP: L @@OK@@ Θ „ò (simultaneo usly , if in RPN mode) . T o enter P L O T WINDO W env ironment Θ Change the h ori z ontal and v ertical v ie w wi ndow t o the follo w ing settings: H-VIEW: -1 5; V-VIEW: -1 !!!!1.5 Θ Also , use the f ollo w ing values for the r emaining par ameter s: Init: 0, F inal: 5, Step: De fault , T ol: 0. 0001, Init - Soln: 0 Θ T o plot the gr aph use: @ ERASE @DRAW When y ou observ e the graph be ing plotted, y ou'll notice that the graph is not v er y smooth . T hat is becaus e the plotter is using a time s tep that may be a b it lar ge fo r a smooth gr aph . T o r efi ne the gra ph and mak e it smoother , use a st ep of 0 .1. P r es s @CANCL and change the Step : value t o 0.1, then use @ERASE @DR AW once mor e to r epeat the gra ph. The plot w ill tak e longer to be com pleted, but the shape is de finitel y smoother than bef or e. T r y the f ollo w ing: @EDIT L @LABEL @MENU t o see ax es la bels and r ange. Notice that the labels f or the ax es ar e sho w n as 0 (hori z ontal, for t) and 1 (v ertical , f or x) . T hese ar e the def initio ns for the ax es as gi ven in the P L O T SETUP w indo w ( „ô ) i .e ., H-V AR: 0, and V- V AR: 1. T o see the gr aphical solu tion in detail u se the f ollo w ing:
Pa g e 1 6 - 6 1 LL @) PICT T o re c over m e nu a n d re t u rn to PI C T envi ro n me n t. @ ( X,Y )@ T o determine coor dina t es of an y point on the gr aph . Use the š™ k e ys to mov e the cursor ar oun d the plot a r ea . At th e bottom of the sc r een y ou w ill see the coor dinates of the c urs or as (X,Y) , i .e., the calc ulator use s X and Y a s the default name s fo r the hori z ontal and vertic al axe s, res p ec t ively . P res s L @CA NCL to r eco ver the me nu and re turn to the P L O T WINDO W en v ir onment . F inall y , pre ss $ to r eturn to nor mal display . Numerical solution of second-or der ODE Integr ation o f second-or der ODE s can be accomplished b y def ining the s olutio n as a v ector . As a n ex ample , suppose that a spr ing-mass s ys tem is sub ject to a damping f orce pr oportional to its s peed, so that the r esulting diff er ential equation is: or , x" = - 18. 7 5 x - 1 .9 6 2 x', subj ect to the initial conditi ons, v = x' = 6 , x = 0, at t = 0. W e want to f ind x, x' at t = 2 . R e -wr ite the ODE as: w ' = Aw , wher e w = [ x x' ] T , and A is the 2 x 2 matri x sho w n belo w . T he initial conditions ar e no w wr itten as w = [0 6] T , fo r t = 0. (Note: T he sym bo l [ ] T means the tr anspose o f the v ector or matr i x) . T o so lv e this pr oblem, f irs t , cr eate and st or e the matr i x A , e .g ., in AL G mode: T hen, acti vate the n umeri cal diffe r ential equatio n sol ver b y u sing: ‚ Ï ˜ @@@OK@@@ . T o sol v e the differ ential equati on w ith starting time t = 0 and f inal dt dx x dt x d ⋅ − ⋅ − = 962 . 1 75 . 18 2 2 ⎥ ⎦ ⎤ ⎢ ⎣ ⎡ ⋅ ⎥ ⎦ ⎤ ⎢ ⎣ ⎡ − − = ⎥ ⎦ ⎤ ⎢ ⎣ ⎡ ' 962 . 1 75 . 18 1 0 ' ' x x x x
Pa g e 1 6 - 62 time t = 2 , the input for m fo r the differ ential equation s olv er should look a s fo llo w s (notice that the Init: v alue f or the Soln: is a v ect or [0, 6]) : Press @SOLVE (wai t) @EDIT to s ol ve f or w(t=2) . The so lution r eads [.16 716… - .6 2 71…], i .e ., x(2 ) = 0.16 716 , and x'( 2) = v(2) = -0.6 2 71. Pr ess @CANCL to re tu r n t o S O L V E envi ro n me n t. Solution presented as a table of values In the pr ev ious e x ample we w er e inter ested onl y in finding the v alues of the positi on and veloc it y at a gi ven time t . If w e wanted to pr oduce a t able of value s of x and x', for t = 0. 00, 0.2 5, …, 2 .00, w e w ill pr oceed as fo llo ws: F irst , pr epar e a table t o wr ite do w n y our r esults: Ne xt , w ithin the SO L VE en v ir onment , c hange the final v alue of the independe nt var iable to 0.2 5, use: — .2 5 @@OK@ @ ™™ @SOL VE (wa it ) @EDIT (Sol v es for w at t = 0.2 5, w = [0.9 68 1. 3 6 8]. ) @@OK@ @ INIT — . 5 @@OK@@ ™™@SOLVE (wai t) @EDIT (Changes initi al value o f t to 0.2 5, and final v alue of t to 0. 5, solv e again f or w(0.5 ) = [0. 7 48 - 2 .616]) @@OK@ @ @INIT — .7 5 @@OK@@ ™™ @SOLVE (wai t) @EDIT (Changes initi al value o f t to 0. 5, and final v alue of t to 0.7 5, sol v e again for w(0.7 5) = [0. 014 7 - 2 .8 5 9]) @@OK@ @ @INIT — 1 @@OK @@ ™ ™ @SOLVE (wai t) @EDIT tx x ' 0.00 0.00 6.00 0.25 ……… 2.00
Pa g e 1 6 - 6 3 (Changes initi al value of t to 0.7 5, and f inal v alue of t to 1, sol v e again f or w(1) = [-0.4 6 9 -0.6 0 7]) R epeat for t = 1.2 5, 1.5 0, 1.7 5, 2 .0 0. Pre ss @@OK@@ after v ie w ing the last r esult in @EDIT . T o r eturn to nor mal calculator displa y , pr ess $ or L @@OK@@ . T he diffe r ent soluti ons w ill be sho w n in the st ack , w ith the late st r esult in le v el 1. T he final r esults look a s follo ws: Graphical solution f or a second-order ODE Start b y acti v ating the differ ential equation numer ical sol v er , ‚ Ï ˜ @@@OK@@@ . The S OL VE scr een should look lik e this: Notice that the initi al condition f or the s oluti on (Soln: w Init:[0., …) inc ludes the v ector [0, 6] . Pr ess L @@OK@@ . Ne xt , pr ess „ô (simultaneousl y , if in RPN mode) to enter the P L O T en vi ro nment . Highli ght the f ield in f r ont of TYPE , using the —˜ k ey s. The n, pr ess @ CHOOS , and highli ght Diff Eq , using the —˜ keys. P res s @ @OK@@ . Modify the r es t of the PL O T SE TUP sc r een to look lik e this: t x x' t x x' 0. 00 0. 000 6 . 000 1.2 5 - 0. 3 5 4 1.2 81 0 . 25 0 . 9 68 1 .368 1 .50 0 . 1 4 1 1 .36 2 0. 5 0 0.7 4 8 - 2 .616 1.7 5 0.2 2 7 0.2 6 8 0.7 5 -0.015 - 2 .8 5 9 2 .00 0.16 7 -0.6 2 7 1. 00 -0.46 9 -0.60 7
Pa g e 1 6 - 6 4 Notice that the opti on V - V ar : is set to 1, indicating that the f irst ele ment in the v ector s oluti on, namel y , x ’ , is to be plotted against the independent v ar ia ble t . Accept c hanges to P L O T SETUP b y pr essing L @@OK@@ . Press „ò (simultaneousl y , if in RPN mode) to enter the P L O T WINDO W en vi r onment . Modify this inpu t for m to look lik e this: T o plot the x ’ vs . t graph us e: @ERASE @DRAW . The plot of x ’ vs . t looks like this: T o plot the second c urve w e need to use the P L O T SETUP inpu t for m once , mor e . T o r eac h this fo rm f r om the gr aph abo v e use: @CANCL L @@OK @@ „ô (simultaneousl y , if in RPN mode) . Change the v alue of the V - V ar : fi eld to 2 , and pre ss @DRAW (do not pr ess @ERASE or yo u w ould loos e the gr aph pr oduc ed abo ve) . Us e: @EDI T L @ LABEL @MENU to s ee a x es labels a nd r ange. Notice that the x ax is label is the n umb e r 0 (indicating the independent v ari able) , w hile the y-axis label is the numbe r 2 (indicating the second v ar iable , i .e ., the last v ar iable plott ed) . Th e combined gr aph looks lik e this:
Pa g e 1 6 - 65 Press LL @PICT @CANCL $ to r etur n to nor mal calc ulator displ ay . Numerical solution for stiff first-or d er ODE Consi der the ODE: d y/dt = -100y 100t 101, sub jec t to the initial conditi on y(0) = 1. Ex ac t solution T his equation can be w ri t t en as dy/dt 100 y = 100 t 101, and so lv ed using an integr ating fact or , IF(t) = e xp(100t), as follo ws (RPN mode , w ith CAS set to Ex act mode): ‘(100*t 101)* EXP(100*t)’ ` ‘t’ ` RIS CH The r esult is ‘(t 1)*EXP(100*t)’ . Ne xt , we add an int egr ation co nstant , by u sing: ‘C’ ` T hen, w e di vi de b y FI(x) , b y using: ‘EXP(100*t)’ `/ . The r esult is: ‘ ((t 1)*EXP(100*t) C)/EXP(100*t) ’ , i .e ., y(t) = 1 t C ⋅ e 100t . Use of the initial conditi on y(0) = 1, r esults in 1 = 1 0 C ⋅ e 0 , or C = 0, the partic ular so luti on be ing y(t) = 1 t . Numerical s olution If w e at t empt a dir ect numer i cal soluti on of the or iginal equation d y/dt = - 100y 100t 101, using the calc ulator ’s o w n numer ical so lv er , we fi nd that the calc ulator t ak es longer to pr oduce a soluti on that in the pr e v iou s fir st-orde r e xa m p l e . To c h e c k t h i s o u t, s e t y o u r d i f f e re n t i a l e q u a t i o n n u m e ri c a l s o l v e r ( ‚ Ϙ @@ @OK@@@ ) to:
Pa g e 1 6 - 6 6 Her e w e are try ing to obtain the v alue of y( 2) giv en y(0) = 1. W ith the Soln: Final f ield highli ghted, pr ess @SOLVE . Y ou can chec k that a soluti on tak es abo ut 6 sec on ds, wh il e i n t he previou s fi rst - orde r exa mp le th e s ol ut ion was alm os t instantaneou s. Pr ess $ to cancel the calc ulation . T his is an ex ample of a stiff or dinar y diff er ential equation . A s tiff ODE is one w hose ge ner al soluti on contains components that v ary at wi dely diff er ent r ates under the same inc r ement in the indepe ndent var ia ble . In this par ti c ular case , the gener al soluti on, y(t) = 1 t C ⋅ e 100t , contains the components ‘t ’ and ‘C ⋅ e 100t ’ , w hi ch v ar y at v ery differ ent rat es, e x cept fo r the cases C=0 or C ≈ 0 (e .g ., for C = 1, t =0.1, C ⋅ e 100t =2 20 2 6) . T he calc ulator’s ODE numer ical sol v er allo ws for the soluti on of s tiff ODEs by selecting the opti on _Stiff in the SOLVE Y’(T) = F(T,Y) s cr een. W ith this option s electe d y ou need to pr o v ide the values o f ∂ f/∂ y and ∂ f/∂ t . F or the cas e under consi der ation ∂ f/∂ y = -100 and ∂ f/∂ t = 100. Enter thos e values in the cor r esponding f ields of the SOLVE Y’(T) = F(T,Y ) scr een : When done , mo ve the c ursor to the Soln: Final f ield and pr ess @SOLVE . T his time , the solu tion in pr oduced in about 1 s econd. Pre ss @EDIT to see the so l ut io n : 2 . 9999999999 , i.e. , 3. 0 .
Pa g e 1 6 - 67 Note: T he opti on Stiff is also a vailable f or gr aphical s oluti ons of differ ential equati ons. Numerical solution to ODEs w it h th e S O L VE/DIFF menu T he S OL VE soft men u is acti va ted b y using 7 4 MENU in RPN mode . T his menu is pr esent ed in detail in Cha pter 6 . One of the sub-menu s, DIFF , contains func tions f or the numer ical s olution o f or dinar y differ ential eq uations f or use in pr ogr amming. T hese f uncti ons ar e desc r ibed ne xt using RPN mode and s y stem flag 117 set to S OFT menus. (See note in page 16 - 7 5) . T he functi ons pr o vi ded by the S OL VE/D IFF menu ar e the f ollo w ing: Function RKF T his functi on is used t o compute the solu tion to an initi al v alue proble m for a f irst-or der differ ential equati on using the R unge -K utta-F ehlber t 4 th -5 th or der solu tion sc heme . Suppos e that the diff er enti al equati on to be sol ved is gi ven b y dy/dx = f(x ,y) , w i th y = 0 at x = 0, and that y ou w ill allo w a con ve r gence cri te r ia ε f or the soluti on . Y ou can also spec ify an incr ement in the independent va riab le, Δ x, to be used b y the function . T o r un this functi on y ou w ill p r epare y our stac k as fo llo ws: 3: {‘ x ’ , ‘ y’ , ‘f(x ,y)’} 2 : { εΔ x } 1: x fi na l T he value in the f irst s tac k lev el is the v alue of the independen t var ia ble wher e yo u w a n t t o fi n d y ou r so l u t i o n, i. e . , yo u wa n t t o f i n d, y fin al = f s (x fi na l ) , w her e f s (x) r epr esents the so lution to the diff er ential eq uation . The s econd stack le v el ma y contain only the v alue of ε , and the step Δ x w ill be tak en as a small def ault v alue. A fter running f uncti on @@RKF@@ , the s tack w ill show the lines: 2 : {‘ x’ , ‘ y’ , ‘f(x ,y)’} 1: ε
Pa g e 1 6 - 6 8 T he value of the so lution , y fi na l , w ill be a v ailable in var i able @@@y@@@ . T his func tion is appr opr iate f or pr ogramming since it lea v es the diff er ential eq uation spec if icati ons and the toler ance in the st ack r eady f or a new s olution . Notice that the soluti on use s the initial conditions x = 0 at y = 0. If , y our actual initial solu tions ar e x = x init at y = y init , y ou can alw ay s add these v alues to the solu tion pr o v ided b y RKF , k eeping in mind the f ollo wing r elationship: The f ollo w ing sc r eens show the RPN s tack bef ore and after a pply i ng f uncti on RKF f or the diff er ential eq uation d y/dx = x y , ε = 0. 001, Δ x = 0.1. After a pply ing func tion RKF , var i able @@@y@@@ contains the value 4. 3 880... Function RRK T his func tion is simil ar to the RKF functi on , e x cept that RRK (R osen br oc k and R unge -K utta methods) r equir es as the list in stac k lev el 3 f or input not only the names of the independe nt and depend e nt var ia bles and the func tion def ining the differ ential equati on, bu t also the e xpr essi ons for the f irs t and second der i vati v es of the e xpr essi on . Thu s, the input st ack f or this func tion w ill look a s fo llo w s: ˆˍʳʳʳʳʳ {'x', 'y', 'f(x ,y)' ' ∂ f/∂ x' ' ∂ f/∂y' } 2 : { εΔ x } 1: x fi na l T he value in the f irst s tac k lev el is the v alue of the independen t var ia ble wher e yo u w a n t t o fi n d y ou r so l u t i o n, i. e . , yo u wa n t t o f i n d, y fin al = f s (x fi na l ) , w her e f s (x) r epr esents the so lution to the diff er ential eq uation . The s econd stack le v el ma y RKF so lution Actual solution xyxy 00 x init y init x final y final x init x final y init y final
Pa g e 1 6 - 69 contain only the v alue of ε , and the step Δ x w ill be tak en as a small def ault value . After running f unction @@RKF@ @ , the s tack w ill show the lines: 2 : {‘ x ’ , ‘ y’ , ‘f(x ,y)’ ‘ ∂ f/∂ x’ ‘ ∂ f/vy’ } 1: { εΔ x } T he value o f the soluti on , y fin al , w ill be a vail able in var iable @@@y@@@ . T his functi on can be u sed to s olv e so -called “ stiff ” differ ential equati ons. T he follo w ing scr een shots sho w the RPN st ack bef ore and af t er applicati on of fu nct ion R RK : T he value st or ed in var ia ble y is 3 . 00000000004. Function RKF STEP T his functi on use s an input list similar to that of f uncti on RKF , as w ell as the toler ance for the soluti on , and a possible st ep Δ x , and r eturns the same input list , f ollo w ed by the to ler ance, and an es timate of the next s tep in the independent v ar iable . The f uncti on r eturns the input lis t, the t oler ance , and the ne xt step in the independent v ari able that satisf i es that toler ance . Th us , the input st ack looks as f ollo w s: ˆˍʳʳʳʳʳʳ {‘ x ’ , ‘ y’ , ‘f(x,y)’} 2 : ε 1: Δ x After r unning this func tion , the stac k will sho w the lines: 3: {‘ x ’ , ‘ y’ , ‘f(x ,y)’} 2 : ε 1: ( Δ x) next T hus , this functi on is used t o deter mine the appr opri ate si z e of a time st ep to satisfy the requir ed toler ance. T he follo w ing scr een shots sho w the RPN st ack bef ore and af t er applicati on of func tion RKF S TEP:
Pa g e 1 6 - 70 T hese r esults indi cate that ( Δ x) ne xt = 0. 3 40 4 9… Function RRKS TEP T his f uncti on use s an input list similar to that of func tion RRK , as well as the toler ance for the so lution , a po ssible st ep Δ x, and a n umber (L A S T) specify ing the last me thod used in the solu tion (1, if RKF w as used , or 2 , if R RK w as used) . F uncti on RRK S TEP r eturns the same input lis t , fo llow ed by the toler ance , a n es timate of the nex t step in the independent v ar ia ble , and the c urr ent method (CURRENT) used to ar r iv e at the next s tep . Th us, the input s tack loo ks as fo llo w s: 4: {‘ x’ , ‘ y’ , ‘f(x,y )’} 3: ε 2 : Δ x 1: L A S T After r unning this func tion , the stac k will sho w the lines: 4: {‘ x’ , ‘ y’ , ‘f(x,y )’} 3: ε 2 : ( Δ x) ne xt 1: CURRENT T hus , this functi on is used t o deter mine the appr opri ate si z e of a time st ep (( Δ x) next ) to s atisfy the req uir ed toler ance , and the method u sed to ar ri ve at that r esult (CURRENT). T he follo w ing scr een shots sho w the RPN st ack bef ore and af t er applicati on of fu nct ion R RKS TE P:
Pa g e 1 6 - 7 1 T hese r esults indi cate that ( Δ x) ne xt = 0. 005 5 8… and that the RKF method (CURRENT = 1) should be used. Function RKFERR T his functi on r etur ns the abso lute er r or estimate f or a gi ven s tep whe n sol v ing a pr oblem as that des cr ibed f or func tion RKF . T he input st ack looks a s follo ws: 2: ʳʳʳ {‘ x ’ , ‘ y’ , ‘f(x ,y)’} 1: Δ x After r unning this func tion , the stac k will sho w the lines: 4: {‘ x’ , ‘ y’ , ‘f(x,y )’} 3: ε 2 : Δ y 1: err or T hus , this functi on is u sed to deter mine the inc remen t in the soluti on , Δ y , as we ll as the absolute er r or (err or). T he follo w ing scr een shots sho w the RPN st ack bef ore and af t er applicati on of func tion RKFERR: T hese r esult sho w that Δ y = 0.8 2 7… and err or = -1.8 9… × 10 -6 . Function RSBERR T his functi on perfor ms similarl y to RKERR but w ith the input e lements listed f or func tion RRK . T hus , the input stac k fo r this functi on w ill look as follo ws: 2 : {‘ x ’ , ‘ y’ , ‘f(x ,y)’ ‘ ∂ f/∂ x’ ‘ ∂ f/vy’ } 1: Δ x After running the fu nctio n, the s tack w ill sho w the lines: 4: {‘ x ’ , ‘ y’ , ‘f( x,y)’ ‘ ∂ f/∂ x’ ‘ ∂ f/v y ’ }: 3: ε 2 : Δ y 1: err or
Pa g e 1 6 - 72 T he follo w ing scr een shots sho w the RPN st ack bef ore and af t er applicati on of func tion R SBERR: T hese r esults indi cate that Δ y = 4.1514… and err or = 2 .7 6 2 ..., f or Dx = 0.1. Chec k that , if Dx is redu ced to 0. 01, Δ y = -0. 003 0 7… and err or = 0. 000 5 4 7 . Not e : As y ou e xec ute the commands in the D IFF men u value s of x and y w ill be pr oduced and s tor ed as v ar iables in yo ur calc ulator . The r esults pr o v ided b y the functi ons in this sec tion w ill depend on the c urr ent values of x and y . T her ef or e , some o f the r esults il lustr ated abo ve ma y differ fr om w hat y ou get in y our calc ulator .
Pa g e 1 7- 1 Chapter 17 Pr obability Applications In this Chapte r w e pr ov ide e xample s of applicati ons of calc ulator’s func tions to pr obab ility distr ibutions . T he MTH/PR OB ABILITY .. sub-m enu - part 1 T he MTH/PR OB ABILITY .. sub-men u is accessible thr ough the k ey str ok e sequence „´ . W ith sy stem flag 117 se t to CHOOSE bo x es , the follo w ing list of MTH options is pr o v ided (see le ft -hand side f igur e below). W e hav e selected the PR OB A BILI TY .. option (option 7) , to sho w the f ollo w ing func tions (see r ight- hand side f i gur e belo w) : In this sec tion w e discu ss f uncti ons COMB , P ERM, ! (f actor ial) , RAND , and RDZ . F ac tor ials, combinations, and permutations T he fact or ial of an int eger n is def ined as: n! = n ⋅ (n-1) ⋅ (n - 2)…3 ⋅ 2⋅ 1. B y def inition , 0! = 1. F actor ials ar e used in the calc ulati on of the number of permu tations and co mbinati ons of obj ects . F or e xample , the number of permu tations o f r objec ts fr om a set o f n distinct obj ects is Also , the number of combinatio ns of n obje cts tak en r at a time is )! /( ! ) 1 )...( 1 )( 1 ( r n n r n n n n r n P − = − − − = )! ( ! ! ! ) 1 )...( 2 )( 1 ( r n r n r r n n n n r n − = − − − = ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛
Pa g e 1 7- 2 T o simplify notation , use P(n ,r) f or per mutati ons, and C(n ,r) f or combinations . W e can calculat e combinations , perm utations , and factor i als with f uncti ons CO MB, P ERM, and ! fr om the MT H/P R OBA BILITY .. sub-men u . The oper ati on of those f uncti ons is desc r ibed next: Θ C OMB(n,r ) : Comb inatio ns of n items tak en r at a time Θ P ERM(n,r ): P erm utations o f n items tak en r at a time Θ n!: F actor ial of a po sitiv e integer . F or a non-integer , x! retur ns Γ (x 1) , wher e Γ (x) is the Gamma functi on (see Chapt er 3) . The f actor ial s y mbol (!) can be enter ed als o as the ke ys tr ok e combination ~‚2 . Ex ample of appli cations o f these f uncti ons ar e sho wn ne xt: Random numbers T he calculator pr ov ides a r andom number gener ator that r eturns a unif orml y distr ibuted , r andom real number betw een 0 and 1. T he gener ator is able to pr oduce seque nces of r andom number s. Ho w ev er , after a certain number of times (a v ery la r ge number indeed) , the seque nce tends to r epeat itself . F or that r eason, the r andom number generator is mor e pr operl y r efer r ed to as a pseudo - r andom number gener a t or . T o gener ate a r andom number w ith y our calc ulator use fun cti on R A ND from t he MT H/ PROBAB IL ITY su b- men u . Th e fo llowin g sc r een sho ws a n umber of r andom number s pr oduced using RAND . The number s in the left -hand si de f igur e ar e pr oduced w ith calling functi on RAND w ithout an ar gument . If y ou place an ar gument list in func tion RAND , y ou get back the lis t of numbers plu s an additional r andom number attached to it as illus tr ated in the ri ght -hand si de fi gur e .
Pa g e 1 7- 3 R andom number gener ators , in gener al, oper ate b y taking a v alue , called the “ seed” of the gener ator , and per f or ming some mathematical algor ithm on that “ seed” that gener ates a ne w (ps eudo)r andom number . If y ou w ant to gener ate a sequence o f number and be able to r epeat the s ame sequence lat er , yo u can change the "seed" of the gener ator b y using functi on RDZ(n) , w her e n is the “ seed , ” befor e generating the seq uence . Random n umber gener ators oper a t e b y starting wi th a "seed" number that is tr ansfor med into the f irst r andom number of the ser ies . The c urr ent number the n ser v es as the "seed" for the ne xt number and so on . B y "re-seeding" the seq uence w ith the same number y ou can r epr oduce the same seq uence mor e than once . F or e xam ple , tr y the fo llo w ing: RDZ(0.2 5) ` Us e 0.2 5 as the "seed ." RA ND () ` F irst r andom number = 0.7 5 2 8 5… RA ND () ` S econd r andom number = 0. 51109… RA ND () ` T hir d r andom number= 0. 0 8 54 2 9…. Re -start the sequence: RDZ(0.2 5) ` Us e 0.2 5 as the "seed ." RA ND () ` F irst r andom number = 0.7 5 2 8 5… RA ND () ` S econd r andom number = 0. 51109… RA ND () ` T hir d r andom number= 0. 0 8 54 2 9…. T o gener ate a sequence of r andom number s us e func tion SE Q. F or e x ample , to gener ate a list of 5 r andom numbers y ou can us e, in AL G mode: SEQ(RAND() ,j,1,5,1) . In RPN mode, u se the f ollo w ing pr ogr am: «  n « 1 n FOR j RND NEXT n  LIS T » » St or e it into v ari able RLS T (Rando m Li S T) , and us e J5 @RLST! to pr oduce a list of 5 r andom numbers . F uncti on RNDM(n ,m) can be used to gener ate a matr i x of n r o w s and m columns w hos e elements ar e random in tegers betw een -1 and 1(see Chap ter 10) . Discrete pr obability distributions A random v ar iable is said to b e discr ete w hen it can on l y take a finite num ber of v alues. F or ex ample , the number of rain y day s in a giv en location can be consi der ed a disc r ete r andom var ia ble becaus e we coun t them as integer numbers onl y . Let X r epre sent a disc r ete r andom v ari able , its probab ility mass
Pa g e 1 7- 4 fu nct ion (pmf) is r epr esented by f (x) = P[X=x], i .e ., the pr obability that the ra nd om va riab le X ta kes th e val ue x. T he mass distr ibuti on functi on mus t satisf y the conditi ons that f(x) >0, f or all x , and A c umulati ve dis tributi on func tio n (cdf) is def ined as Ne xt, w e w ill define a number o f functi ons to calc ula t e discr ete probab ility distr ibuti ons. W e suggest that yo u cr eate a sub-dir ect or y , say , HOME\S T A T S\DFUN (Discr ete FUNctions) w her e w e w ill def ine the pr obability mass f uncti on and cumulati ve distr ib u tion f unction f or the b inomial and P ois son distr ibuti ons . Binomial distribution T he pr obability mas s func tion of the binomi al distr ibuti on is gi ve n by wher e ( n x ) = C(n ,x) is the comb ination of n ele ments tak en x at a time . The v alues n and p are the par amet ers of the distr ibution . The v alue n r epr esents the number of re petitions of an e xperime nt or observati on that can ha v e one of two outcomes, e.g ., s uccess an d f ai lur e . If the random v ariable X represents the number of succ esses in the n r epetiti ons, then p r e presents the pr obabilit y of getting a success in an y gi ven r epetiti on. T he c umulativ e distributi on func tion fo r the binomi al distr ibution is gi v en b y 0 . 1 ) ( = ∑ x all x f ∑ ≤ = ≤ = x k k f x X P x F ) ( ] [ ) ( n x p p x n x p n f x n x ,..., 2 , 1 , 0 , ) 1 ( ) , , ( = − ⋅ ⋅ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ = −
Pa g e 1 7- 5 P oisson distribution The probabilit y mass f unction of the P oisson di str ibut ion is giv en by . In this e xpre ssi on, if the r andom var i able X r epre sents the n umber of occ urr ences o f an e ven t or observati on per unit time , length , area , volume , etc., then the par a meter l r epres ents the a v er age number of occ urr ences pe r unit time , length , ar ea, v olume , etc . The c umul ativ e distr ibution f uncti on fo r the P oisson distribution is g i v en by Ne xt , use f unction DEFINE ( „à ) to def ine the f ollo wing pr obability mas s func tions (pmf) and c umulati v e distr ibuti on func tions (cdf): DEFINE(pmf b(n,p,x) = COMB (n,x)*p^x*(1- p)^(n-x)) DEFINE(cdf b(n,p,x) = Σ (k=0,x,pm fb(n,p,k))) DEFINE(pmf p( λ , x) = EXP(- λ )* λ ^x/x!) DEFINE(cdf p( λ ,x) = Σ (k =0,x,pmfp( λ ,x))) T he functi on names st and for : Θ pmfb: pr obability mass f uncti on for the b inomial distr ibuti on Θ cdf b: cumulati v e distr ibution f uncti on for the b inomial distr ibuti on Θ pmfp: pr obability mass functi on for the P oi sson distr i buti on Θ cdfp: cumulati ve distr ibuti on functi on f or the P oiss on distribu tion Ex amples of calc ulati ons using these f uncti ons ar e show n ne xt: n x x p n f x p n F x k ,..., 2 , 1 , 0 , ) , , ( ) , , ( 0 = = ∑ = ∞ = ⋅ = − ,..., 2 , 1 , 0 , ! ) , ( x x e x f x λ λ λ ∞ = = ∑ = ,..., 2 , 1 , 0 , ) , ( ) , ( 0 x x f x F x k λ λ
Pa g e 1 7- 6 Continuous pr obabilit y distr ibutions T he proba bility distributi on f or a continuou s r andom var ia ble , X, is c harac ter i z e d b y a f uncti on f(x) know n as the pr obab ilit y density functi on (pdf) . T he pdf has the foll o wing pr operties: f(x) > 0, f or all x , and Pr obabiliti es ar e calc ulated using the c u m ulati ve dis tribu tion f unction (cdf), F(x), def ined by , w her e P[X<x] stands f or “the pr obab ility that the r andom var ia ble X is less than the v alue x ” . In this sec tion w e desc ribe se ver al continuous pr obability distr ibuti ons including the gamma , exponenti al, bet a, and W eibull distr ibuti ons. T hese dis tributi ons ar e desc r ibed in an y statis tic s te xtbook . Some o f these dis tribu tions mak e use of a the Gamma func tion def i ned ear lie r , whi ch is calculat ed in the calc ulator by us ing th e fact orial fun ction as Γ (x) = (x-1)!, fo r any r ea l n umber x. T he g amma distr ibution T he proba bility distributi on f unctio n (pdf) f or the gamma distr ibuti on is giv en b y T he corr es ponding (cumulati ve) dis tribu tion f unctio n (cdf) would be gi ven b y an integr al that has no c losed-f orm soluti on . T he exponential distr ibution T he exponenti al distr ibuti on is the gamma distr ibution w ith a = 1. Its pdf is gi v en b y PX x F x f d x [] ( ) ( ) . <= = −∞ ∫ ξξ . 1 ) ( = ∫ ∞ ∞ − dx x f ∫ ∞ − = = < x d f x F x X P ξ ξ ) ( ) ( ] [ ; 0 , 0 , 0 ), exp( ) ( 1 ) ( 1 > > > − ⋅ ⋅ Γ = − β α β α β α α x for x x x f
Pa g e 1 7- 7 , w hile its cdf is giv en b y F(x) = 1 - e xp(- x/ β ) , f or x>0, β >0. T he beta distribution T he pdf for the gamma dis tr ibution is gi v en b y As in the case of the gamma dis tribut ion , the corr esponding cdf for the bet a distr ibuti on is also gi v en b y an integr al w ith no c losed-f orm solu tion . T he W eibull distribution T he pdf for the W eibull distr ibution is gi ven b y While the corr esponding cdf is gi ven b y Functions for continuous distr ibutions T o def ine a collec tion o f func tions cor r esponding to the gamma , e xponential , beta , and W eibull dis tributi ons, f i r st c r eate a sub-dir ecto r y called CFUN (Con tinuous FUNc tions) and def ine the follo w ing functi ons (c hange to Appr o x mode): Gamma pdf: 'gpdf(x) = x^( α-1)*EXP(-x/ β)/( β ^ α*GAMMA( α)) ' Gamma cdf: 'gcdf(x) = ∫(0,x,gpdf(t),t)' Beta pdf: ' β pdf(x)= GAMMA(α β )*x^(α -1) *(1-x)^( β-1)/(GAMMA( α)*GAMMA( β))' Beta cdf: ' β c df(x) = ∫ (0,x, βpdf(t),t)' 0 , 0 ), exp( 1 ) ( > > − ⋅ = β β β x for x x f 0 , 0 , 1 0 , ) 1 ( ) ( ) ( ) ( ) ( 1 1 > > < < − ⋅ ⋅ Γ ⋅ Γ Γ = − − β α β α β α β α x for x x x f 0 , 0 , 0 ), exp( ) ( 1 > > > ⋅ − ⋅ ⋅ ⋅ = − β α α β α β β x for x x x f 0 , 0 , 0 ), exp( 1 ) ( > > > ⋅ − − = β α α β x for x x F
Pa g e 1 7- 8 Exponential pdf: 'epdf(x) = EXP(-x/ β)/ β ' Exponential cdf: 'ecdf(x) = 1 - EXP(-x/ β )' W eibull pdf: 'Wpdf(x) = α* β*x^( β-1)*EXP(- α*x^ β )' W eibull cdf: 'Wcdf(x) = 1 - EXP(- α*x^ β)' Use f uncti on DEFINE to def ine all these f unctions . Ne xt , enter the v alues of α and β , e .g ., 1K~‚a` 2K ~‚b` F inally , fo r the cdf for Gamma and Be ta cdf’s , y ou need to edit the pr ogr am def initions t o add  NUM to the pr ogr ams produce d b y f uncti on DEFINE . F or e xam ple , the Gamma cdf , i .e ., the functi on gcdf , should be modif ied to r ead: «  x '  NUM( ∫ (0,x,gpdf(t),t))' » and stor ed back into @gcdf . Repeat the pr ocedur e for β cdf . Use RPN mode to perf orm the se c hanges . Unlik e the discr ete func tio ns defined ear lier , the continuous f unctions de fined in this secti on do not inc lude their par ameter s ( α and/or β ) in their de finiti ons. T here for e , yo u don't need to enter them in the displa y to calculat e the functi ons . Ho w ev er , tho se par ameter s must be pr ev iousl y def ined by s tor ing the cor r esponding v alues in the var iable s α and β . Once all f uncti ons and the val ue s α and β ha v e been stor ed , y ou can order the menu labels b y using func tion ORDER . The call to the func tion w ill be the f ollo w ing: ORDER({‘ α ’, ’ β ’ , ’gpdf’ , ’gcdf’ , ’ β pdf ’ , ’ β cdf ’ , ’epdf’ , ’ecdf’ , ’Wpdf’ , ’Wcdf’}) F ollo wing this command the men u labels w ill sho w as foll ow s (Pr ess L to mov e to the se cond li st . Press L once mor e to mo ve to the f irs t list) : Some e xamples o f applicati on of thes e func tions , for v alues o f α = 2 , β = 3, ar e sho w n belo w . Noti ce the var iable IERR that sho ws up in the s econd sc r een shot . T his r esults f r om a numer ical int egr ation f or f uncti on gcdf .
Pa g e 1 7- 9 Continuous distributions f or statistical infer ence In this sec tion w e disc uss f our contin uous pr obability distr ibutions that ar e commonl y used f or pr oblems r elated to statis tical inf er ence . The se distr ibuti ons ar e the normal dis tributi on , the Student’s t distr ibution , the Chi-s quar e ( χ 2 ) distr ibuti on, and the F -distr ibution . The fu nctions pr ov ided b y the calc ulator to e valuate pr obabiliti es f or these dis tr ibutions ar e contained in the M T H/ PR OB ABILITY menu intr oduced earli er in this chapt er . The f uncti ons are NDI S T , UTPN , UTPT , UTPC, and UTPF . Their appli cation is de sc ribed in the f ollo w ing sec tions . T o see thes e func tions ac ti vat e the MTH menu: „´ and se lect the PR OBABILI TY option: Normal distr ibution pdf T he expr ession f or the normal dis tributi on pdf is: ], 2 ) ( exp[ 2 1 ) ( 2 2 σ μ π σ − − = x x f
Pa g e 1 7- 1 0 wher e μ is the mean , and σ 2 is the v ari ance of the dis tributi on . T o calc ulate the val ue of f( μ , σ 2 ,x) fo r the normal distr ibution , use func tion NDIS T w ith the fo llo w ing ar guments: the mean , μ , the var iance , σ 2 , and, the v alue x , i .e ., NDIS T( μ ,σ 2 ,x) . F or e xample , chec k that for a nor mal distr ibution , f(1. 0, 0. 5,2 . 0) = 0.20 7 5 5 3 7 4. Normal distr ibution cdf T he calculat or has a func tion UTPN that calc ulates the u pper - t ail normal distr ibution , i .e., UTPN(x) = P(X>x) = 1 - P(X<x). T o obtain the v alue of the upper - tail normal dis tributi on UTPN w e need to enter the fo llow ing values: the mean , μ ; the var iance , σ 2 ; and, the v alue x , e.g ., UTPN(( μ , σ 2 ,x) F or ex ample , c heck that f or a normal distr ibution , with μ = 1. 0, σ 2 = 0. 5, UTPN(0.7 5) = 0.6 3 816 3. U se UTPN(1. 0, 0.5, 0.7 5) = 0.6 3816 3 . Diffe r ent pr obability calculati ons fo r normal distr ibuti ons [X is N( μ , σ 2 )] can be def ined using the func tion UTPN , as fo llo ws: Θ P(X<a) = 1 - UTPN( μ, σ 2 ,a) Θ P(a<X<b) = P(X<b) - P(X<a) = 1 - UTPN( μ, σ 2 ,b) - (1 - UTPN( μ, σ 2 ,a)) = UTPN( μ, σ 2 ,a) - UTPN( μ, σ 2 ,b) Θ P(X>c) = UTPN( μ, σ 2 ,c) Ex amples: Using μ = 1. 5, and σ 2 = 0. 5, f ind: P(X<1. 0) = 1 - P(X>1. 0) = 1 - UTPN(1. 5, 0. 5, 1.0) = 0.2 3 9 7 50. P(X>2 .0) = UTPN(1. 5, 0. 5, 2 .0) = 0.2 3 9 7 50. P(1. 0<X<2 .0) = F(1. 0) - F(2 . 0) = UTPN(1. 5, 0. 5,1. 0) - UTPN(1.5, 0. 5,2 . 0) = 0.7 60 2 4 9 9 - 0.2 3 9 7 5 00 = 0. 5 2 4 99 8. T he Student-t distrib ution T he Studen t -t , or simply , the t -, distr ibutio n has one parame ter ν , know n as the degr ees of f r eedom of the distr ibuti on. T he pr obability distr ibuti on functi on (pdf) is gi ve n by
Pa g e 1 7- 1 1 wher e Γ ( α ) = ( α -1)! is the G AMMA func tion def ined in Chapte r 3 . T he calculator pr ov ides f or values o f the upper - t ail (cumulati v e) distr ibution func tion f or the t-distr ibution , f uncti on UTPT , gi ve n the paramet er ν and the value of t , i .e ., UTPT( ν ,t) . T he def inition of this f unction is , ther ef or e, F or ex a m ple , UTPT(5,2 .5 ) = 2 .7 2 4 5…E - 2 . Other pr obability calc ulations f or the t-distr ibutio n can be defined u sing the functi on UTPT , as follo ws: Θ P(T<a) = 1 - UTP T( ν ,a) Θ P(a<T<b) = P(T<b) - P(T<a) = 1 - UTPT( ν ,b) - (1 - UTPT( ν ,a)) = UTP T( ν ,a) - UTPT ( ν ,b) Θ P(T>c) = UTP T( ν ,c) Ex amples: Gi v en ν = 12 , determine: P(T<0. 5) = 1-UTPT(12 , 0. 5) = 0.6 8 6 9 4 .. P(-0. 5<T<0. 5) = UTPT(12 ,-0. 5) -UTPT(12 , 0. 5) = 0. 3 7 3 8… P(T> -1.2) = UTP T(12 ,-1.2) = 0.8 7 3 3… T he C hi-squar e distribution T he Chi-sq uar e ( χ 2 ) distr ibuti on has one par ameter ν , kno wn as the degr ees of fr eedom. The pr obability distr ibution f uncti on (pdf) is gi ven b y ∞ < < −∞ ⋅ ⋅ Γ Γ = − t t t f , ) 1 ( ) 2 ( ) 2 1 ( ) ( 2 1 2 ν ν πν ν ν ∫ ∫ ∞ − ∞ ≤ − = − = = t t t T P dt t f dt t f t UTPT ) ( 1 ) ( 1 ) ( ) , ( ν 0 , 0 , ) 2 ( 2 1 ) ( 2 1 2 2 > > ⋅ ⋅ Γ ⋅ = − − x e x x f x ν ν ν ν
Pa g e 1 7- 1 2 T he calculator pr ov ides f or values o f the upper - t ail (cumulati v e) distr ibution fu nct ion fo r th e χ 2 -distr ibution u sing [UTP C] gi ven the v alue o f x and the par ameter ν . The def inition of this func tion is , ther ef or e , T o use this f uncti on , we need the degr ees of f reedo m, ν , and the v alue of the chi-s quar e v ariable , x , i .e ., UTPC( ν ,x) . F or ex ample , UTP C(5, 2 . 5) = 0.7 7 64 9 5… Diffe r ent pr obability calcul ations f or the Chi-s quar ed distr ibution can be def ined using the f uncti on UTPC , as fo llo ws: Θ P(X<a) = 1 - UTP C( ν ,a) Θ P(a<X<b) = P(X<b) - P(X<a) = 1 - UTP C( ν ,b) - (1 - UTPC( ν ,a)) = UTP C( ν ,a) - UTPC( ν ,b) Θ P(X>c) = UTP C( ν ,c) Ex amples: Gi v en ν = 6 , determine: P(X<5 .3 2) = 1-UTP C(6,5 . 3 2) = 0.4 9 6 5 .. P(1.2<X<10. 5) = UTP C(6 ,1.2) -UTP C(6 ,10.5 ) = 0.8 717… P(X> 20) = UTP C(6,20) = 2 .7 6 9 ..E -3 T he F distribution T he F distr ibution ha s two par ameters ν N = n umer ator degr ees of f r eedom, and ν D = denominato r degree s of f reedom . The pr obability distr ibuti on func tion (pdf) is gi ven b y ∫ ∫ ∞ − ∞ ≤ − = − = = t t x X P dx x f dx x f x UTPC ) ( 1 ) ( 1 ) ( ) , ( ν ) 2 ( 1 2 2 ) 1 ( ) 2 ( ) 2 ( ) ( ) 2 ( ) ( D N N N D F N D N F D N D N x f ν ν ν ν ν ν ν ν ν ν ν ν − ⋅ − ⋅ Γ ⋅ Γ ⋅ ⋅ Γ =
Pa g e 1 7- 1 3 T he calculator pr ov ides f or values o f the upper - t ail (cumulati v e) distr ibution func tion f or the F distr ibuti on, f uncti on UTPF , giv en the par ameter s ν N and ν D, and the value of F . The definition of th is function is, theref ore , F or ex ample, to calc ulate UTPF(10,5, 2 .5 ) = 0.1618 3 4… Diffe r ent pr obability calc ulations f or the F distr ibution can be def ined using the func tion UTPF , as f ollow s: Θ P(F<a) = 1 - UTPF( ν N , ν D, a ) Θ P(a<F<b) = P(F<b) - P(F<a) = 1 -UTPF( ν N , ν D ,b) - (1 - UTPF( ν N , ν D, a ) ) = UTPF( ν N , ν D ,a) - UTPF( ν N , ν D, b ) Θ P(F>c) = UTPF( ν N , ν D, a ) Ex ample: Gi v en ν N = 10, ν D = 5, f ind: P(F<2) = 1-UTPF(10,5,2) = 0.7 7 00… P(5<F<10) = UTPF(10,5,5) – UTPF(10,5,10) = 3 .46 9 3 ..E - 2 P(F>5) = UTPF(10,5,5 ) = 4.4 808..E - 2 In verse cumulativ e distribution functions F or a co ntinuou s random v ar iable X w ith c umulati ve density func tion (cdf) F(x) = P(X<x) = p , to calculat e the inv ers e cum ulati ve distr ibution f unction w e need t o f ind the value o f x , suc h that x = F -1 ( p ) . Th i s va l u e i s re l a t iv e ly s i m p l e t o f i n d fo r the cases o f the e xponential and W eibull distr ibutions since their cdf’s ha v e a cl osed fo rm ex press ion : Θ Exponenti al, F(x) = 1 - e xp(- x/ β ) Θ W eibull , F(x) = 1-e xp(- α x β ) (Bef or e contin uing, mak e sur e to purge v ar iable s α and β ) . T o f ind the inv erse cdf’s for the se two dis tr ibutions we need jus t sol v e for x fr om thes e e xpre ssio ns, i. e. , ∫ ∫ ∞ − ∞ ≤ ℑ − = − = = t t F P dF F f dF F f F D N UTPF ) ( 1 ) ( 1 ) ( ) , , ( ν ν
Pa g e 1 7- 1 4 Exponential: W eibull: F or the Gamma and Beta distr ibuti ons the e xpr essi ons to s olv e w ill be mor e compli cated due to the pr esence o f integr als, i .e ., • Gamma, • Beta , A numer ical soluti on w ith the numer i cal sol ver w ill not be feasible beca use of the integr al sign in v olv ed in the e xpre ssi on. Ho w e ve r , a gra phical solu tion is possible . Details on ho w to find the r oot of a gr aph are pr esented in C hapter 12 . T o ensur e numer ical r esults , change the CA S setting to Appr o x. T he func tion to plot f or the Gamma distr ibuti on is Y(X) = ∫ (0,X,z^( α -1)*exp(- z/ β )/( β ^ α *G AMMA( α )) ,z) -p F or the Beta distr ibuti on, the f uncti on to plot is Y(X) = ∫ (0,X, z^( α -1)*(1- z)^( β -1)*G AMMA( α β )/(G AMMA( α )*G AMMA( β )) ,z) -p T o pr oduce the p lot , it is ne c essary to stor e values of α , β , and p , bef o r e attempting the plot . F or e xam ple , f or α = 2 , β = 3, and p = 0.3, the plo t of Y(X) f or the Gamma distr ibution is sho wn belo w . (Plea se notice that , becaus e of the complicated natur e of func tion Y(X) , it w ill tak e some time bef ore the gr aph is pr oduced. Be patien t .) ∫ − ⋅ ⋅ Γ = − x dz z z p 0 1 ) exp( ) ( 1 β α β α α ∫ − − − ⋅ ⋅ Γ ⋅ Γ Γ = x dz z z p 0 1 1 ) 1 ( ) ( ) ( ) ( β α β α β α
Pa g e 1 7- 1 5 Ther e are tw o r oots of this functi on f ound by using f unction @ROOT w i thin the plo t en vi r onment . Because o f the integr al in the equatio n, the r oot is appro ximat ed and w ill not be sho wn in the plot s cr een . Y ou w ill only get the me ssage Cons tant? Sho wn in the sc r een. Ho we v er , if you pr ess ` at this point , the appr o x imate r o ot w ill be listed in the displa y . T w o r oots ar e sho wn in the r i ght - hand f igur e belo w . Alter nativ ely , y ou can use func tion @ TRACE @ ( X,Y ) @ to estimate the r oots by tr ac ing the c urve near its inter cepts w ith the x -ax is . T w o es timates ar e sho wn belo w: These estim ates sugg est solutions x = -1 .9 and x = 3 . 3. Y o u can ver if y these “ soluti ons ” by e valuatin g func tion Y1(X) f or X = -1.9 and X = 3 . 3, i .e ., F or the normal , Student’s t , Chi-squar e ( χ 2 ) , and F dis tr ibutions , whi c h ar e r epr esented b y f unctio ns UTPN, UTP T , UPT C, and UTPF in the calc ulator , the in ve rse c uff can be f ound by s olv ing o ne of the f ollo w ing equati ons: Θ Nor mal , p = 1 – UTPN( μ , σ 2, x ) Θ Student’s t , p = 1 – UTPT( ν ,t) Θ Chi-s quar e , p = 1 – UTPC( ν ,x) Θ F dis tributi on: p = 1 – UTPF( ν N,ν D, F )
Pa g e 1 7- 1 6 Notice that the second par amet er in the UTPN functi on is σ 2, n o t σ 2 , r epr esenting the v ar iance of the distr ibuti on. A lso , the s ymbol ν (the lo w er -case Gr eek letter no) is not a v ailable in the calc ulator . Y ou can us e , for e xample , γ (gamma) instead o f ν . T he lette r γ is a v ailable thought the char acter set ( ‚± ). F or ex ample , to obtain the v alue of x f or a normal dis tr ibution , w ith μ = 10, σ 2 = 2 , w ith p = 0.2 5, st or e the equation ‘ p=1-UTPN ( μ ,σ 2,x) ’ into v ari able E Q (fi gure in the le ft -hand si de below). Then , launch the numer ical so lv er , to get the input f or m in the r ight-hand side f igur e: T he next s tep is to ent er the value s of μ , σ 2 , and p , and sol v e for x : T his input f orm can be used t o sol ve f or any o f the f our var iables inv olv ed in the equati on for the nor mal distr ibuti on. T o fac ilitate s olution o f equati ons inv olv ing functi ons UTPN , UTPT , UTP C, and UTPF , y ou may w ant to c r eate a sub-direc tory UT P E Q w er e y ou w ill stor e the equations lis ted abov e:
Pa g e 1 7- 1 7 Th us, at this point , you w ill hav e the four equati ons av ailable for so lution . Y ou needs ju st load one of the equati ons into the E Q f ie ld in the nume ri cal solv er and pr oceed w ith sol v ing for one o f the var ia bles . Example s of the UTPT , UTP C, and UPTF ar e show n belo w: Notice that in all the e xample s show n abov e , w e ar e wo rking w ith p = P(X<x) . In man y statist ical inf er ence pr oblems we w ill actuall y tr y to f ind the v alue of x fo r whi ch P(X>x) = α . F urthermor e , fo r the normal distr ibution , w e most lik el y w ill be wor king w ith the standar d normal distr ibution in w hic h μ =0, and σ 2 = 1. The st andar d normal v ar iable is ty pi cally r efer r ed to as Z , so that the pr oblem to s olv e will be P(Z>z) = α . F or these cases of s tatistical infer ence pr oblems , we could st or e the follo w ing equations:
Pa g e 1 7- 1 8 W ith these four equati ons, w henev er y ou launch the numer i cal s olv er y ou ha ve the f ollo w ing cho i ces: Ex amples of s olution o f equations E QNA, E QT A, E QCA, and E QF A ar e sho w n belo w : ʳʳʳʳʳ
P age 18-1 Chapter 18 Statistical Applications In this Chapte r we intr oduce statisti cal applicati ons of the calc ulator including statis tic s of a sample , f r equency dis tributi on of data , simple r egre ssi on, conf i dence int ervals , and h ypothe sis te sting . Pre-progr amm ed statistical f eatures T he calculat or pr o vi des pr e -pr ogrammed st atistical f eatur es that ar e acces sible thr ough the k e y str ok e combinati on ‚Ù (same k e y as the number 5 key ) . T he statis tic al appli catio ns av ailable in the calc ulator ar e: T hese appli cations ar e pre sented in detail in this Cha pter . F irs t , ho we v er , w e demonstr ate ho w t o enter data fo r statisti cal analy s is . Enterin g data F or the analy sis of a single se t of data (a sample) w e can use appli cati ons number 1, 2 , and 4 fr om the list abo v e . All of thes e applicati ons r equir e that the data be a v ailable as columns of the matr i x Σ D A T . T his can be accomplished b y enter ing the data in col umns using the matr i x w r iter , „² . T his operati on may become t edious f or lar ge number of data points. Inst ead, y ou ma y w ant to enter the dat a as a list (s ee Chapter 8) and con vert the list into a column v ector b y u sing pr ogr am CRMC (see C hapter 10) . Al ternati v el y , you can ente r the follo w ing pr ogram to con vert a list into a column vect or . T y pe the pr ogr am in RPN mode: « OB J  1 2 LI S T  ARR Y »
P age 18-2 St or e the pr ogram in a v ar iable called LX C. After st or ing this pr ogram in RPN mode y ou can also us e it in AL G mode. T o sto r e a column vec tor into v ar iable Σ D A T use functi on S T O Σ , av ailabl e thr ough the catalog ( ‚N ) , e .g., S T O Σ ( ANS(1)) i n AL G mode . Ex ample 1 – Using the pr ogram LX C, def ined abo v e , cr eate a column v ector using the f ollo win g 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 RP G mode, ty pe 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 .5 } ` @LXC Use f unction S T O Σ to store the data into Σ DA T . Note: Y ou can also enter statis tical data b y launching a s tatisti cs appli cation (suc h as Single-var , Frequencies or Summary stat s) and pr essing #EDIT # . This launc hes the Matr i x W r iter . Enter the data as y ou usually do . In this case , when y ou ex it the Matri x W r iter , the data you ha ve en tered is aut omaticall y sa v ed in Σ D AT. Calculating singl e-variable statistics Assuming that the single data se t was stor ed as a column v ector in v ari able Σ D A T . T o access the diff er ent S T A T pr ograms , pr ess ‚Ù . Pr ess @@@OK @@ to sele ct 1. Single-var .. Ther e will be a v ailable to y ou an input f orm labeled SIN GLE-V ARIABL E ST A TIST ICS , w ith the da t a cu rr entl y in your Σ D A T var ia ble listed in the for m as a vect or . Since y ou onl y hav e one column, the f ield Col: should ha ve the v alue 1 in f r ont of it . The Type f ield determine s whether y ou ar e w orking w ith a sample or a populatio n, the def ault s etting is Sample . Mov e the c ursor to the hor i z ontal line pr ec eding the fi eld s Mean , Std Dev , V ariance , To t a l , Maximum , Minimum , pr es sing the @  CHK@ soft menu k ey to s elect tho se measur es that y ou want as output o f this progr am . When r eady , pr ess @@@OK @@ . T he selected v alues w ill be listed , appr opr iatel y labeled , in the sc reen o f y our calc ulat or .
P age 18-3 Ex ample 1 -- F or the data st or ed in the pr ev ious e x ample , the single -var iable statis tic s r esults ar e the f ollo w ing: M e a n : 2. 1 3333333333 , S t d D e v: 0 . 9 6 42 0 7 9 49 4 0 6, Va r i a n c e : 0 . 9 2969696969 7 T otal: 2 5 .6, Max imum: 4. 5, Minimum: 1.1 Definition s Th e d efi ni ti on s us ed for thes e quantitie s are the f ollo wing: Suppos e that y ou ha ve a number dat a points x 1 , x 2 , x 3 , … , r ep r esent ing diffe r ent measur ements of the s ame disc r ete or continuou s var ia ble x . The se t of all possible v alues o f the quantit y x is r ef err ed to as the population of x . A f inite population w ill hav e onl y a f i x ed number of e lements x i . If the quantity x r epr esents the measur ement of a continuou s quantit y , and since , in theor y , such a quantity can tak e an infi nite number of v alues, the populati on of x in this case is inf inite . If yo u selec t a sub-set of a populati on, r epr ese nted b y the n data val ue s { x 1 , x 2 , …, x n }, w e sa y y ou hav e selec ted a sample of values of x. Samples ar e char acter i z ed b y a number o f measur es or st atistic s . Ther e ar e measur es o f centr al te ndency , suc h as the mean, median , and mode , and measur es o f spreading , suc h as the r ange , var iance , and standar d de vi ation . Me asur es of central tendency T he mean (or ar ithmetic mean) of the sample , ⎯ x , is de fine d as the av er age value o f the sample elements , T he value la beled Total obtained abo v e r epre sents the summation o f the values of x, or Σ x i = n ⋅⎯ x . This is the value pr o v ided by the calc ulator under the heading Mean . Other mean v alues used in ce r t ain applicati ons ar e the geometr ic mean , x g , or the harmoni c mean , x h , def ined as: ∑ = ⋅ = n i i x n x 1 . 1 . 1 1 , 1 2 1 ∑ = = ⋅ = n i i h n n g x x x x x x L
P age 18-4 Ex amples of calc ulation of these measur es, using lis ts, ar e a vailable in C hapter 8. T he median is the value that s plits the data set in the mi ddle when the e lements ar e placed in incr easing orde r . If y ou hav e an odd number , n, of or dered elements , the median of this sam ple is the value located in positi on (n 1)/2 . If y ou hav e an e v en number , n , o f elements, the medi an is the av er age of the elements located in positi ons n/2 and (n 1)/2 . Although the pr e -pr ogr ammed statis tical f eature s of the calc ulator do not include the calc ulation of the medi an, it is ve r y easil y to wr ite a p r ogram to calc ulate such quantity b y wor king w ith lists . F or ex ample , if y ou wan t to use the data in Σ D A T to f ind the medi an, type the f ollo w ing pr ogr am in RPN mode (see Cha pter 21 f or mor e infor matio n on pr ogr amming in User RP L language) .: «  nC « R CL Σ DUP S IZE 2 GE T IF 1 > THEN nC C OL − S W AP D ROP O B J  1  ARR Y END OB J  OB J  DROP DRO P DUP  n «  LIS T S OR T IF ‘ n MOD 2 == 0’ THEN DUP ‘ n/2’ EV AL GE T S W AP ‘(n 1)/2’ EV AL GET 2 / ELSE ‘(n 1)/2’ EV AL GE T END “Median ”  T A G » » » St or e this pr ogram unde r the name MED . An e xample o f applicati on of this pr ogr am is sho wn ne xt. Ex ample 2 – T o ru n the pr ogr am, f irst y ou need to pr epar e y our Σ DA T m a trix. Then , enter the nu mber of t he col umn in Σ D A T wh ose medi an y ou w ant to f ind , and pr es s @@MED@ @ . F or the data c urr entl y in Σ D A T (entered in an ear lier e xample), use pr ogram MED to show that Median: 2.15 . Th e m od e of a sample is bette r determined f r om histogr ams, ther ef or e , w e leav e its def inition f or a later secti on . Me asur es of spread Th e va rian ce (V ar ) of the sample is def ined as . T he standar d de v iation (St De v) of the sam ple is jus t the squar e r oot of the var iance , i .e ., s x . ∑ = − ⋅ − = n i i x x x n s 1 2 2 ) ( 1 1
P age 18-5 Th e ran g e of the sample is the differ ence betw een the maximum and minim um v alues of the sample . Since the calc ulator , thr ough the pr e -pr ogr ammed statis tical f uncti ons pr o v ides the max imum and minimum values o f the sample , y ou can easily calc ulate the range . Coefficient of variation T he coeffi c ient o f var iati on of a sample comb ines the mean , a measur e of centr al tendency , with the s tandar d dev iation , a measur e of spr eading, and is def ined, as a per centage, b y: V x = (s x / ⎯ x)100. Sample vs . pop ulati on T he pre -pr ogrammed f uncti ons for single -v ari able statisti cs us ed abo v e can b e appli ed to a finit e population b y selec ting the Type: Population in the SINGLE-VARIABLE STATISTICS s cr e e n. T he main diff er ence is in the value s of the v ar iance and s tandar d de v iati on whi ch ar e calc ulated using n in t he denominator o f the var iance , r ather than (n -1) . Ex ample 3 -- If yo u wer e to r epeat the ex er c ise in Ex ample 1 of this secti on , using Population r ather than Sample as the Type , yo u w ill get the same value s fo r the mean, to tal , maxim um, and minimum . The v ar iance and standar d dev iati on, ho we v er , w ill be gi v en by : V ar iance: 0.8 5 2 , St d D e v: 0.9 2 3. Obtaining frequency distr ibutions The ap pl ica tio n 2. Frequencies.. in the S T A T menu can be used to obtain fr equency distr ibuti ons for a se t of data . Again, the dat a must be pr esent in the fo rm of a column vector stor ed in var iable Σ D A T . T o get starte d , pr ess ‚Ù˜ @@@OK@@@ . The r esulting inpu t for m contains the follo wing f ields: Σ DAT : the matr i x containing the data of inter est . Col : the column of Σ D A T that is unde r scr utin y . X-Min : the minimum c las s boundary (def ault = -6 . 5) . Bin Count : the n umber of clas ses(def ault = 13) . Bin W idth : the unif orm w idth of eac h cla ss (def ault = 1) .
P age 18-6 Definition s T o unders tand the meaning of thes e par ameters w e pr esent the follo w ing def initions : Gi v en a set of n data v alues: {x 1 , x 2 , …, x n } listed in no parti cular or der , it is often r equir ed to gr ou p these data into a ser ies of c lass es by counting the f r eque ncy or number o f values cor r esponding to each c lass . (Note: the calculator s r efe rs to clas ses as bins). Suppose that the cla sses , or bins , w ill be selected b y di v iding the interval (x bot , x top ) , into k = Bin C ount c lass es b y selecting a n umber of cl ass boundar ies , i .e ., {xB 1 , xB 2 , …, xB k 1 }, so that c lass n umber 1 is limited by xB 1 -x B 2 , class number 2 by xB 2 - xB 3 , an d s o o n. Th e l as t cl ass, cl ass nu mb er k, wi ll b e li mi te d by xB k - xB k 1 . T he value of x corr espo nding to the middle of each c lass is kno w n as the cla ss mark , and is defined a s xM i = (xB i xB i 1 )/2 , for i = 1, 2 , …, k. If the clas ses ar e cho sen suc h that the class si z e is the same , then we can def ine the class si z e as the value Bin W idth = Δ x = (x max - x min ) / k , and the clas s boundar ies can be calc ulated as xB i = x bot (i - 1) * Δ x. An y data point , x j , j = 1, 2 , …, n, belong s to the i- th c lass , if xB i ≤ x j < xB i 1 T he applicati on 2. F requencies.. in the S T A T men u will perfor m this fr equenc y count , and w ill k eep tr ack of th ose v alues that ma y be belo w the minimum and abo ve the max imum clas s boundari es (i .e ., the ou tliers ). Ex ample 1 -- In or der to be t t er illus trate obtaining fr equency distr ibuti ons, w e w ant to gener ate a r elati v el y large dat a set , sa y 200 points , by u sing the fo llo w ing: Θ F irst , seed the random n umber generator u sing: RDZ(25 ) in AL G mode , or 25 ` RDZ in RPN mode (see Chapte r 17) . Θ T y pe in the fo llo w ing pr ogram in RPN mode: «  n « 1 n FOR j RAND 100 * 2 RND NEXT n  LIS T » » and sa ve it under the name RDLIS T (RanDom n umber LIS T gener ator ) .
P age 18-7 Θ Gener ate the list of 200 n umber b y using RDLIS T(200) in AL G mode , or 200 ` @RDLIST@ in RPN mode. Θ Use pr ogram LX C (see abo ve) to con v ert the list thu s gener ated into a column vec tor . Θ Stor e the column vector into Σ DA T , b y us i n g f u n c t io n ST O Σ . Θ Obtain single -var i able inf ormati on using: ‚Ù @@@OK@@@ . Us e Sample for the T ype of dat a set , and select all options as r esults. T he re sults for this e xample w er e: Mean: 51. 04 06 , S td Dev : 2 9 . 5 8 9 3…, V ari ance: 8 7 5 .5 2 9… T ot al: 10 208.12 , Max imum: 9 9 . 3 5, Minimum: 0.13 T his informati on indi cates that our data r anges fr om values c los e to z er o t o values c lose to 1 00. W ork ing with whole num bers, w e c an sele c t t he range of v ari ation o f the data as (0,100) . T o pr oduce a fr equenc y distr ibution w e w ill use the interv al (10, 90) di viding it int o 8 bins of w idth 10 eac h . Θ Select the pr ogr am 2. F requencies.. by u s in g ‚Ù˜ @@@OK @@@ . T he data is alr eady loaded in Σ D A T , and the optio n Col should h old the value 1 since w e hav e onl y one column in Σ DA T . Θ Change X -Min to 10, Bin C ount to 8 , and Bin W idth to 10, then pr es s @@@OK@@@ . Using the RPN mode , the r esults ar e sho wn in the stac k as a column v ect or in stac k lev el 2 , an d a r o w vec tor of tw o components in stack le v el 1. The v ect or in stac k le v el 1 is the number of outli ers ou tside of the int erval w her e the fr equency count wa s perfor med. F or this case , I get the values [ 2 5 . 2 2 .] indicating that the r e ar e , in my Σ D A T vect or , 2 5 values smaller than 10 and 2 2 lar ger than 90. Θ Press ƒ to dr op th e vector of out liers fr om th e stack . The r em ainin g r esul t is the fr equency count o f data. T his can be tr anslated into a table as sho wn belo w . This table was pr epared f r om the inf ormatio n we pr ov ided to gener ate the fr equency distr ibuti on, although the onl y column r etur ned by the calc ulator is the F r equenc y column (f i ) . T he clas s numbers , and clas s boundar ies ar e eas y
P age 18-8 to calc ulate for unif orm-si z e c lasses (or bins) , and the class mar k is just the a ver age of the clas s boundari es f or eac h cla ss. F inally , the c u m ulati ve fr equency is obtain ed by adding to eac h v alue in the last column , e x cept the f irst , the fr equenc y in the ne xt r o w , and r eplac ing the r esult in the la st column of the ne xt r o w . Th us, f or the second c lass, the c umulativ e f r equency is 18 15 = 3 3, w hile f or cla ss number 3, the cum ulati ve f r equency is 3 3 16 = 4 9 , and so on . The c umulati v e fr equency r epr es ents the fr equenc y of those n umbers that ar e smaller than or equal to the uppe r boundar y of any gi ven c las s. Gi ven the (column) v ect or of fr equenc ie s gener ated b y the calc ulat or , you can obtain a c umulati ve fr equency v ector b y using the fol low ing pr ogr am in RPN mode: Class No . Class Bound. Class mark . F r equency Cumulati v e iX B i XB i 1 Xm i f i fr equency < XB 1 outlier belo w ra ng e 25 11 0 2 0 1 5 1 8 1 8 22 0 3 0 2 5 1 4 3 2 33 0 4 0 3 5 1 7 4 9 44 0 5 0 4 5 1 7 6 6 55 0 6 0 5 5 2 2 8 8 66 0 7 0 6 5 2 2 1 1 0 77 0 8 0 7 5 2 4 1 3 4 k = 8 80 90 8 5 19 15 3 >XB k outlier s abov e ra ng e 22
P age 18-9 « DUP S I ZE 1 GET  fr eq k « {k 1} 0 CON  cfr eq « ‘fr eq(1,1)’ EV AL ‘ cfr eq(1,1)’ S T O 2 k FOR j ‘ cfr eq(j-1,1) fr eq(j,1)’ EV AL ‘ cfr eq (j,1)’ S T O NEXT cfr e q » » » Sa ve it un der the name CFRE Q. Use this pr ogram t o gener ate the list o f c umulati ve f r equenc ies (pr ess @CFRE Q w ith the column vec tor of f r equenc ies in the stac k) . T he r esult , for this e x ample , is a column v ect or r epre senting the last column o f the ta ble abo ve . Histograms A his togr am is a bar plot sho w ing the f r equenc y count as the hei ght of the bar s w hile the clas s boundarie s show n the base o f the bars. If y ou hav e y our r aw data (i .e., the or iginal data be fo re the fr equenc y count is made) in the v ari able Σ D A T , y ou can select Histogram as y our gr aph type and pr o v ide inf ormation r egarding the initi al value o f x, the n umber of b ins, and the bin w idth , to gener a t e the histogr am. Alter nati v ely , yo u can gener ate the column v ector containing the fr equency count , as perf ormed in the e xample a bov e, s tor e this vec tor in to Σ D A T , and s elect Barplot as y our gr aph t y pe. In the ne xt ex ample, w e sho w y ou how to us e the firs t method to gener ate a histogram . Ex ample 1 – Using the 200 data points gener ated in the e xample a bov e (sto re d as a column v ecto r in Σ D A T) , gener ate a histogr am plot of the data using X- Min = 10, Bin Coun t = 16, and Bin W idth = 5 . Θ Fi r s t, p r e ss „ô (sim ultaneou sly , if in RPN mode) to en ter the P L O T SETUP s cr een . Within this sc r een, c hange T ype: to Histogr am, and chec k that the opti on Col: 1 is selected . T hen, pr ess L @@@OK@@@ . Θ Next , pre ss „ò (simultaneou sly , if in RPN mode) to ent er the P L O T WINDO W – HIS T OGR AM sc r een . Within that s cr een modif y the infor mation to H- Vi e w: 10 9 0, V - V ie w: 0 15, Bar Wi dth: 5 . Θ Press @ERASE @DRAW@ to gener ate the f ollo w ing hist ogr am:
P age 18-10 Θ Press @CANCEL t o re turn to the pr ev io us sc r een . Change the V -v ie w and Bar W idth once mor e , now to r ead V- Vi e w: 0 3 0, Bar Wi dth: 10. The ne w histogr am, bas ed on the same data set , no w looks lik e this: A plot of f r equency count , f i , vs . c lass marks , xM i , is kno wn as a f r equenc y poly gon. A plot of the c umulati v e fr equency v s. the upper boundar ies is kno w n as a c umulativ e f r equency ogi ve . Y ou can produce s cat t erplots that simulate thes e t w o plots b y enter ing the p r oper data in columns 1 and 2 of a ne w Σ D A T matri x and changing the Type : to SCATTER in the PL O T SETUP wi nd ow . F itting data to a function y = f(x) Th e p rog ram 3. Fit data.. , a vaila ble as option number 3 in the S T A T menu , can be us ed to f it linear , logarithmic , exponenti al, and po wer f uncti ons to data set s (x ,y) , stor ed in c olumns o f the Σ D A T matri x. In or der f or this pr ogr am to be eff ecti v e , y ou need to ha ve at leas t t w o columns in y our Σ D A T v ariable . Ex ample 1 – F it a linear r elationship to the data sho wn in the table be low : x 012345 y 0. 5 2. 3 3. 6 6. 7 7.2 1 1
P age 18-11 Θ F irst , enter the tw o r o ws of data into column in the v ariable Σ DA T by u s i n g the matri x wr iter , and f uncti on S T O Σ . Θ T o access the pr ogram 3. Fit data.. , u se the f ollo w ing k e y str ok es: ‚Ù˜˜ @@@OK@@@ T he input fo rm w ill sho w the c urr ent Σ D A T , alread y loaded. If needed , change y our set u p scr een to the f ollo w i ng par ameters f or a linear fitting: Θ T o ob tain the data f itt ing pr ess @@OK@@ . T he output fr om this pr ogr am, sho wn belo w f or our partic ular data se t, consis ts of the f ollo w ing thr ee lines in RPN mode: 3: '0.19 5 2 3 80 9 5 2 38 2 . 008 5 714 2 8 5 7*X' 2 : Corr elation: 0.9 8 3 7 814 2 446 5 1: C ov ar iance: 7 . 03 Le v el 3 sho ws the f orm o f the equation . In this case , y = 0. 06 9 2 4 0. 003 8 3 x. Le v el 2 show s the sample cor r elation coeff ic ient , and lev el 1 sho w s the co v ari ance of x -y . Definition s F or a s ample of data points (x ,y) , w e def ine the sample co var iance a s Th e s am pl e co rr e la ti on co ef ficien t fo r x, y is de fin e d a s . ) )( ( 1 1 1 y y x x n s i n i i xy − − − = ∑ = y x xy xy s s s r ⋅ =
P age 18-12 Wher e s x , s y ar e the standar d dev iations of x and y , r es pecti v ely , i .e . Th e va lu es s xy and r xy ar e the "Co v ari ance" and "Corr elation ," r espec tiv ely , obtained b y using the "F it data" featur e of the calc ulator . Lineari zed relationships Man y curv ilinear r elatio nships "str aight en out" to a linear fo rm . F or e x ample , the diff er ent models f or dat a fitting pr ov i ded by the calc ulator can be linear i z ed as des cr ibed in the table belo w . T he sample co var iance o f ξ,η is giv en b y Also , we de f ine the sample v ari ances of ξ and η , r espectiv ely , as T he sample corr elati on coeff ic ient r ξη is Indep. D epend. T ype of Actual Linearized variable V ari able Covar . Fitting Model Model ξη s ξη Linear y = a bx [same] x y s xy Log. y = a b ln(x) [same] ln(x ) y s ln(x),y Exp. y = a e bx ln(y) = ln (a) bx x ln(y) s x,ln(y) Power y = a x b ln(y) = ln (a) b ln(x) ln(x) ln(y) s ln(x),ln(y) 2 1 2 ) ( 1 1 x x n s n i i x − − = ∑ = 2 1 2 ) ( 1 1 y y n s n i i y − − = ∑ = ) )( ( 1 1 η η ξ ξ ξη − − − = ∑ i i n s 2 1 2 ) ( 1 1 ξ ξ ξ − − = ∑ = n i i n s 2 1 2 ) ( 1 1 η η η − − = ∑ = n i i n s η ξ ξη ξη s s s r ⋅ =
P age 18-13 T he gener al fo rm of the r egr essi on equati on is η = A B ξ . Best data fitting T he calculat or can deter mine whi ch one of its linear or linear i z ed r elatio nship off ers the bes t fitting f or a set of (x ,y) data points . W e w ill illustr ate the u se of this featur e w ith an e x ample . Suppos e y ou w ant to f ind w hic h one of the dat a f itting functi ons pr o vi des the best f it f or the follo wing dat a: F i r st , ent er the data as a matri x, e ither by u sing the Matri x W riter and ente ring the data , or b y enter ing two lists o f data cor re sponding to x and y and using the pr ogr am CRMC dev eloped in Chapt er 10. Next , sav e this matr i x into the statis tical matr i x Σ D A T , by u sing func tion S T O Σ . F inally , launc h the data fi t applicati on by u sing: ‚Ù˜˜ @@@OK@@@ . The displa y sho w s the c urr ent Σ D A T , alr eady loaded . Change y our set u p sc r een to the f ollo w ing par ameters if needed: Press @@@OK@@@ , to get: 3: '3 .9 9 50 4 8 3 3 3 2 4*EXP(-. 5 7 9 206 8 3120 3*X)' 2 : Cor relati on: -0.99 66 2 4 99 9 5 2 6 1: Co vari ance: -6.2 3 3 506 6 612 4 T he best f it fo r the data is, ther efo r e , y = 3 .9 9 5 e -0.5 8 ⋅ x . Obtaining additional summar y statistics The ap pl ica tio n 4. S ummar y stats.. in the S T A T menu can be us eful in s ome calc ulati ons f or sample statis tic s. T o get started , pr ess ‚Ù once mor e , mo ve to the fo ur th opti on using the do wn -ar r o w k e y ˜ , and pr ess @@@OK@@@ . The r esulting input f orm contains the f ollo w ing fi elds: Σ DAT: the matri x containing the data of inter est . x 0.2 0. 5 1 1.5 2 4 5 10 y 3 . 1 62 . 7 32 . 1 21 . 6 51 . 2 90 . 4 70 . 2 90 . 0 1
P age 18-14 X-Col, Y -Col: these opti ons appl y only w hen y ou ha ve mor e than tw o columns in the matr ix Σ D A T . B y defa ult , the x column is column 1, and the y col umn is column 2 . _ Σ X _ Σ Y… : s ummary st atistic s that y ou can c hoose as re sults of this pr ogr am b y chec king the appr opri ate f ield u sing [  CHK] w hen that fi eld is selected . Man y of these summary s tatisti cs ar e used to calc ulate statisti cs of tw o var iable s (x ,y) that may be re lated b y a func tio n y = f(x) . T her ef or e , this pr ogr am can be thought off as a compani on to pr ogr am 3. Fit data.. Ex ample 1 – F or the x -y data c urr entl y in Σ D A T , obtain all the summary statisti cs . Θ T o acc ess the summar y stats… opti on , use: ‚Ù˜˜˜ @@@OK@@@ Θ Select the column n umbers cor re sponding to the x - and y-data , i . e ., X-Col: 1, and Y - C ol: 2 . Θ Using the @  CHK@ k ey s elect all the options f or outputs , i . e ., _ Σ X, _ Σ Y, e t c . Θ Press @@@O K@@@ to obtain the follo wing r esults: Σ X: 2 4.2 , Σ Y: 1 1 . 72, Σ X2: 14 8. 54 , Σ Y2 : 2 6.6 2 4 6, Σ XY : 12 .6 0 2 , N Σ :8 Calculation of percentiles P er centiles ar e measur es that di vi de a data set in to 100 par ts . T he basi c pr ocedure to calc ulate the 100 ⋅ p-th P er centile (0 < p < 1) in a s ample of si z e n is as f ollo ws: 1. Or der the n obs ervati ons fr om smallest to lar gest . 2 . Determine the pr oduc t n ⋅ p A. If n ⋅ p is not an integer , ro und it up to the ne xt integer and f ind the cor re sponding or der ed value . Note : T her e ar e two other a pplicati ons under the S T A T menu , namely , 5. Hypth. tests.. and 6. Conf . Inter val.. The se two a pplication s w ill be disc uss ed later in the c hapter .
P age 18-15 B. I f n ⋅ p is an integer , sa y k, calc ulate the mean of the k -th and (k -1) th or der ed observ ations . T his algorithm can be implemented in the f ollo w ing pr ogr am typed in RPN mode (See C hapter 21 for pr ogr amming inf ormati on): « S ORT DUP S I ZE  p X n « n p *  k « IF k CEIL k FL OOR - NO T THEN X k GE T X k 1 GET 2 / ELSE k 0 RND X S W AP GET END » » » w hic h we ’ll stor e in v ari able %T ILE (per cent- tile) . T his pr ogr am r equir es as input a v alue p w ithin 0 and 1, r epr esen ting the 100p per centile , and a list o f v alues. T he pr ogr am r eturns the 100p per centile of the lis t . Ex ample 1 - Det ermin e the 2 7% perc entile of the lis t { 2 1 0 1 3 5 1 2 3 6 7 9}. In RPN mode , ent er 0.2 7 ` { 2 1 0 1 3 5 1 2 3 6 7 9} ` @ % TILE . In AL G mode , enter %TILE(0.2 7 ,{2 ,1, 0,1, 3,5,1 ,2 , 3, 6, 7 , 9 }. T he r esult is 1. T he ST A T soft menu All the pr e -pr ogr ammed statisti cal f unctions desc r ibed abo v e are acces sible thr ough a S T A T soft menu . The S T A T soft menu can be acc essed b y using, in RPN mode , the command: 9 6 MENU Y ou can cr eate yo ur ow n p r ogram , sa y @STATm , to acti vate the S T A T soft menu dir ectl y . The contents o f this progr am a r e simply : « 9 6 MENU ». T he S T A T soft menu contains the f ollo wing f uncti ons: Pressing t he k ey corresponding to any of these menus pro v ides access to diffe r ent functi ons as desc r ibed belo w . Not e : Integer r ounding rule , for a no n -int eger x .yz…, if y ≥ 5, r ound up to x 1; if y < 5, r ound up to x .
P age 18-16 T he D A T A sub-menu T he D A T A sub-menu cont ains functi ons us ed to manipulate the statis tic s matri x Σ DA T A : The ope rati on of thes e func tions is as f ollo w s: Σ : add r o w in lev el 1 t o bottom of Σ DA T A ma t rix. Σ - : r emo v es last r ow in Σ D A T A matri x and places it in le v el of 1 o f the stac k. The modif ied Σ D A T A ma tr ix r emains in memor y . CL Σ : er ases curr ent Σ DA T A ma t rix. Σ D A T : places conte nts of cu rr ent Σ D A T A matr i x in lev el 1 of the st ack . „ Σ D A T : stor es matri x in le vel 1 of s tack into Σ DA T A m a t ri x. Th e Σ P AR sub-menu Th e Σ P AR sub-menu contains f uncti ons used to modify statisti cal par ameter s. T he parame ters sho wn cor r espond to the last e xam ple of data f itting. T he parame ters sho wn in the displa y ar e: Xcol: indicates column o f Σ D A T A r epr esenting x (De fau lt: 1) Ycol: indicates column of Σ D A T A r e pr esenting y (D ef aul t: 2) Inter cept: show s inter cept of most r ecent data fitting (Defa ult: 0) Slope: sho ws slope of mo st r ecent data fi tting (Def ault: 0) Model: sho w s c urr en t data fit model (Def ault: LINFI T) T he functi ons list ed in the soft men u k e ys oper ate as f ollo w s: X COL: enter ed as n @XCOL , c hanges Xcol to n . Y COL : ente r ed as n @YCOL , c hanges Y col to n .
P age 18-17 Σ P AR: show s statis tical par ameters . RE SET : r eset par ameter s to default v alues INFO: sh o ws s tatist ical par ameter s The MODL sub-menu w ithin Σ PA R T his sub-menu con tains fu nctio ns that let y ou change the dat a -f itting model to LINFIT , L OGFIT , EXPFI T , P WRFIT o r BE S TFIT b y pr essing the appr opri ate butt on. T he 1V AR sub menu T he 1V AR sub men u contains f uncti ons that ar e used to calc ulate st atistic s of columns in the Σ D A T A matri x . T he functi ons av ailable ar e the f ollo w ing: T O T : sho w sum of each column in Σ DA T A m at rix. MEAN: sho ws a ver age of each column in Σ D ATA m a t r i x . SDEV : show s st andard dev i ation of each column in Σ DA T A m at rix. MAX Σ : sho ws max imum v alue of eac h column in Σ DA T A m a t rix. MIN Σ : sho w s av er age of each column in Σ DA TA m a t rix. BINS: u sed as x s , Δ x , n [BINS], pr o v ides f r equency dis tr ibution f or data in Xcol c o lumn in Σ D A T A matri x with t he fr equency b ins def ined as [x s ,x s Δ x], [x s ,x s 2 Δ x],…, [x s ,x s n Δ x]. V AR: show s v ar iance of eac h column in Σ DA T A m a t ri x. P SDEV : sho ws populati on standar d de vi ati on (based on n rather than on (n-1)) o f ea c h column in Σ DA T A m a t rix . PV AR: show s population v ar iance o f each column in Σ DA T A m a t ri x. MIN Σ : sho w s av er age of each column in Σ DA TA m a t rix. T he PL O T sub-menu T he PL O T sub-menu cont ains functi ons that ar e used to pr oduce plots w ith the data in the Σ D A T A matri x.
P age 18-18 T he functi ons inc luded ar e: B ARP L: produce s a bar plot with data in Xcol column of the Σ D ATA m a t r i x . HIS TP: pr oduces his togr am of the data in Xcol co lumn in the Σ DA T A m a t rix, using the de fault w idth corr esponding to 13 bi ns unless the bin si z e is modifi ed using func tion BIN S in the 1V AR sub-menu (see abo ve) . S CA TR: pr oduces a s catter plot of the data in Yco l column of the Σ DA T A m a t rix vs . the data in Xcol column of the Σ D A T A matr i x . E quati on fitt ed w ill be stor ed in the v aria ble EQ . T he FIT sub-menu T he FIT sub-menu contains f unctions u sed t o fit eq uations t o the data in columns Xcol and Ycol of the Σ DA T A m a t rix . T he functi ons a vailable in this sub-me nu ar e: Σ LINE: pr o v ides the equati on corr esponding to the mo st r ecent f itting . LR: pr ov ides inter cept and slope of mo st r ecent fitting . PR EDX: u sed as y @PREDX , gi ven y f ind x f or the fitting y = f(x). PRED Y : used as x @PRE DY , giv en x f ind y for the f itting y = f(x) . CORR: pr ov i des the corr elation coeff i c ient f or the mos t r ecent f itting. CO V : pr o vi des sample co -var iance f or the most r ecent f itting P CO V : show s population co -var i ance for the most r ecent f it ting . T he SUMS sub-menu T he SUM S sub-men u contains functi ons us ed to obtain summar y s tatistic s of the data in columns Xcol and Ycol of the Σ DA T A ma t rix. Σ X : pr o vi des the sum of v alues in Xcol column . Σ Y : pr ov ides the sum of values in Ycol column.
P age 18-19 Σ X^2 : pr o vi des the sum of s quar es of v alues in Xcol column . Σ Y^2 : pr ov ides the sum of squar es of value s in Ycol column . Σ X*Y : pr ov ides the sum o f x ⋅ y , i .e ., the pr oducts of data in columns Xcol and Ycol. N Σ : pr o vi des the n umber of column s in the Σ DA T A ma t rix. Ex ample of S T A T menu oper ations Let Σ D A T A be the matr ix sho wn in ne xt page . Θ T y pe the matr i x in lev el 1 of the st ack b y using the Matr i x W r iter . Θ T o stor e the matri x into Σ D A T A, us e: @) DATA „ @ £DAT Θ Calc ulate st atisti cs of eac h column: @) STAT @) 1VAR : @TOT pr oduces [3 8. 5 8 7 . 5 8 2 7 9 9 .8] @MEAN p ro du c es [ 5.5 . 12.5 1 1 8 2 8 .54 … ] @SDEV produce s [3 . 3 9… 6 .7 8… 210 9 7 . 01…] @MAX£ pr oduces [10 21. 5 5 5 06 6] @MIN£ pr oduces [1.1 3 .7 7 .8] L @VAR pr oduces [11. 5 2 4 6 . 08 44 50 8414 6 . 3 3] @PSDEV pr oduces [3 .14 2… 6. 2 84… 19 5 3 2 . 04…] @PVAR produce s [9 .8 7… 3 9 .4 9… 3815 006 9 6. 8 5…] Θ Dat a: Θ Generat e a scatterplot o f the data in columns 1 and 2 and f it a str aight line to it: ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ 55066 5 . 21 0 . 10 24743 9 . 19 2 . 9 2245 1 . 15 8 . 6 612 5 . 12 5 . 5 25 9 . 5 2 . 2 101 9 . 8 7 . 3 8 . 7 7 . 3 1 . 1
P age 18-20 @) STAT @) £PAR @RESET r esets s tatisti cal par ameters L @ ) STAT @PLOT @ SCATR pr oduces s catter plot @STATL dr aw s data f it as a str aight line @CANCL r etur ns to main displa y Θ Deter mine the fitting equati on and some o f its statisti cs: @) STAT @) FIT@ @£LINE pr oduces '1.5 2*X' @@@LR@@@ pr oduces Intercept: 1. 5, Slope: 2 3 @PREDX pr oduces 0.7 5 1 @PREDY pr oduces 3 . 5 0 @CORR pr oduces 1. 0 @@COV@@ pr oduces 2 3 . 0 4 L @PCOV pr oduces 19 .7 4… Θ Obtain summar y statis tic s fo r data in columns 1 and 2: @) STAT @) SUMS : @@@£X@@ pr oduces 3 8. 5 @@@£Y@@ pr oduces 8 7 .5 @@£X2@ pr oduces 2 80.8 7 @@£Y2@ pr oduces 13 7 0.2 3 @@£XY@ produce s 619 .4 9 @@@N£@@ pr oduces 7
P age 18-21 Θ F it data using columns 1 (x) and 3 (y) us ing a logarithmi c fitting: L @ ) STAT @) £PAR 3 @YCOL sel ect Yco l = 3, and @) MODL @LOGFI sele ct Mo del = L og f it L @ ) STAT @PLOT @ SCATR pr oduce scatter gram of y v s. x @STATL sho w line f or log fitting Ob v iou sly , the log-f it is not a good ch oi ce . @CANCL r eturns t o normal displa y . • Selec t the best f itting by u sing: @) STAT @£PAR @) MODL @BESTF sho ws E XPFIT as the bes t fit f or these dat a L @) STAT @) FIT @£LINE pr oduces '2 .6 54 5*EXP(0.9 9 2 7*X)' @CORR pr oduces 0.9 99 9 5… (good cor r elation) 2 3 00 @PREDX pr oduces 6 .813 9 5. 2 @P REDY produces 4 6 3 . 3 3
P age 18-2 2 L @ ) STAT @PLOT @ SCATR pr oduce scatter gram of y v s. x @STATL sho w line f or log fitting Θ T o retur n to S T A T menu use: L @) STAT Θ T o get your v ar iable menu back u se: J . Confidence inter v als St atistical inf er ence is the proce ss of making conc lusi ons about a populati on based on info rmati on fr om sample data. In order f or the sample data to be meaningful , the sample mus t be r andom , i .e ., the s electio n of a partic ular sample mus t hav e the same pr obability as that of an y other possible s ample out of a gi ven populati on. T he f ollo w ing ar e some ter ms r elev ant to the concept of r andom sampling: Θ P opulation: collectio n of all concei vable observati ons of a pr ocess or attr ibute of a co mponent . Θ Sample: sub-se t of a populati on . Θ Random s ample: a sample repr esent ativ e o f the population . Θ Random v ar iable: r eal-valued func tion de fined on a sam ple space . Could be disc re te or continuous . If the population f ollo ws a certain pr oba b ility distr ibutio n that depends on a par ameter θ , a r andom sample of observati ons (X 1 ,X 2 ,X 3 ,... , X n ), o f s i z e n , can be used to estimate θ . Θ Sampling distr ibuti on: the jo int pr obab ilit y dis tr ibutio n of X 1 ,X 2 ,X 3 ,... , X n . Θ A statisti c: an y fu ncti on of the obse r v ations that is q uantifi able and doe s not contain an y unkno wn par ameter s. A st atistic is a r andom var ia ble that pr o v ides a means of estimatio n.
P age 18-2 3 Θ P oint e stimati on: when a single v alue of the par ameter θ is pr ov ided. Θ Conf idence inte rval: a nu meri cal interval that cont ains the par ameter θ at a gi ven le v el of pr obability . Θ Es timator : rule or method of es timation o f the par ameter θ . Θ Es timate: value that the estimator y ields in a par ti c ular applicati on . Ex ample 1 -- Let X r e pr esent the time (hours) r e q uir ed by a s pec if ic manufac turing pr ocess to be completed . Gi ven the f ollow ing sample of values of X: 2 .2 2 . 5 2 .1 2 .3 2 .2 . The population f r om wher e this sample is tak en is the collecti on of all possible v alues of the pr ocess time , ther ef or e , it is an infinit e population . Suppose that the population par ameter w e ar e trying to estimat e is its mean v alue , μ . W e will us e as an estimator the mean v alue of the sample , ⎯ X, def ined b y (a r ule) : F or the sample under consider ation , the estimat e of μ is the sample statis tic ⎯ x = ( 2 .2 2 . 5 2 .1 2 . 3 2 .2)/5 = 2 .2 6. T his single v alue of ⎯ X, namely ⎯ x = 2. 26, cons titutes a po int es timation o f the populati on par ameter μ . Estimation of Confidence Intervals T he next le v el of inf er ence fr om point e stimatio n is inter v a l es timation , i .e ., instead o f obtaining a single value of an es timator w e pr o vi de two s tatisti cs , a and b , whi c h define an int er v al containing the par ameter θ w ith a certain le v el of pr obability . The end poin ts of the inte r v al ar e kno wn as conf idence limits, and the inter v al (a,b) is kno w n as the confide nc e interval . Definitions Let (C l ,C u ) be a confi dence interval containing an unkno w n par ameter θ . Θ Conf idence le v el or conf idence coeff ic ie nt is the quantit y (1- α ), w h e r e 0 < α < 1, suc h that P[C l < θ < C u ] = 1 - α, wher e P [ ] r e pr esents a pr obabil ity (see C hapter 17). The pr e v iou s expr ession de fi nes the so -called two -si ded conf idence limits . Θ A low er one -si ded confi dence interval is def ined by Pr[C l < θ ] = 1 - α . Θ An upper one -si ded confi dence interv al is def ined b y Pr[ θ < C u ] = 1 - α . ∑ = ⋅ = n i i X n X 1 . 1
P age 18-2 4 Θ The par ameter α is kno w n as the signif icance le vel . T yp ical v alues o f α are 0. 01, 0. 05, 0.1, cor re sponding to conf idence le v els of 0.9 9 , 0.9 5 , and 0.90, r especti vely . Confidence inter v als f or th e population mean w hen t he population v ariance is kno wn Let ⎯ X be the mean o f a random s ample of si z e n, dr aw n fr om an infinite populatio n wi th kno wn s tandar d de vi atio n σ . T he 100(1- α ) % [i.e ., 99%, 9 5%, 90%, etc .], centr al, tw o -sided confi dence interval f or the population mean μ is ( ⎯X − z α /2 ⋅σ / √ n , ⎯ X z α /2 ⋅σ / √ n ) , w her e z α /2 is a standar d normal v ari ate that is e xceeded w ith a pr obability of α /2 . T he standar d err or of the sample mean , ⎯ X, is ⋅σ / √ n. T he one -sided uppe r and lo w er 100(1- α ) % conf idence limits f or the populati on mean μ ar e , r especti v ely , X z α ⋅σ / √ n , and ⎯X − z α ⋅σ / √ n . Thu s, a lo wer , one - sided , conf idence inte r v al is def ined as (- ∞ , X z α ⋅σ / √ n) , and an upper , one - sided , confi dence inter v al as (X − z α ⋅σ / √ n, ∞ ). Notice that in thes e last tw o intervals w e use the value z α , r ather than z α/2 . In gener al , the value z k in the standar d normal dis tributi on is def ined as that value o f z who se pr obability of e x ceedence is k, i . e ., Pr[Z>z k ] = k , or Pr[Z<z k ] = 1 – k. T he nor mal distr ibution w as desc r ibed in Chapt er 17 . Confidence inter v als f or th e population mean w hen t he population v ariance is unkno wn Let ⎯ X and S , r espec ti ve ly , be the mean and standar d de v iati on of a rando m sample of si z e n, dr aw n fr om an inf inite population that f ollo w s the normal distr ibuti on w ith unknow n st andard de v iati on σ . T he 10 0 ⋅ (1 −α ) % [i .e ., 99 %, 9 5%, 90%, etc .] centr al tw o -sided conf ide nce interval f or the population mean μ, is ( ⎯ X− t n- 1, α /2 ⋅ S /√ n , ⎯ X t n-1 , α /2 ⋅ S/√ n ), w her e t n- 1, α /2 is Student's t va riat e wi th ν = n-1 degr ees of f r eedom and pr obability α /2 of e x ceedence. T he one -sided upper and lo w er 100 ⋅ (1- α ) % conf idence limits f or the populatio n mean μ ar e , r especti v el y , X t n-1 , α /2 ⋅ S/√ n , and ⎯ X− t n- 1, α /2 ⋅ S /√ n.
P age 18-2 5 Small samples and large sampl es T he behav i or of the Student’s t distr ibution is suc h that for n>3 0, the distr ibution is indistinguishable fr om the standar d nor mal distribu tion . Th us, f or samples lar ger than 30 elements w hen the populati on var iance is unkno w n, y ou can use the same conf idence interval as w hen the p opulatio n var iance is kno wn , but r eplac ing σ w ith S . Samples for w hic h n>3 0 are ty picall y r efe rr ed to as lar ge samples , otherw ise the y ar e small sample s. Confidence inter v al f or a proportion A disc r ete r andom var iable X f ollo w s a Bernoulli distr ibuti on if X can tak e only two v alues , X = 0 (f ailur e) , and X = 1 (success). Let X ~ Bernoulli(p), wher e p is the pr obab ilit y o f success , then the mean v alue , or e xpectati on , of X is E[X] = p , and its v ar iance is V ar[X] = p(1-p) . If an e xperimen t inv olv ing X is r epeated n times , and k succes sful ou tcomes ar e r ecor ded, then an e stimate of p is gi ven b y p’= k/n , w hile the standar d er r or of p’ is σ p’ = √ (p ⋅ (1-p)/n) . In pr actice , the sample estimate f or p, i .e ., p ’ r eplaces p in the standar d err or for mula . F or a large sam ple si z e , n>30, and n ⋅ p > 5 and n ⋅ (1-p)>5, the sampling distr ibuti on is ve r y near ly nor mal. T her efor e, the 100(1- α ) % centr al t w o -sided conf idence int er v al f or the population mean p is (p ’ z α /2 ⋅σ p’ , p ’ z α /2 ⋅σ p’ ). F or a small sample (n<30), the interv al can be estimated as (p ’- t n- 1, α /2 ⋅σ p’ ,p ’ t n- 1, α /2 ⋅σ p’ ). Sampling distribution of differences and sums of statistics Let S 1 and S 2 be independent st atisti cs fr om t w o populati ons based on samples of si z es n 1 and n 2 , r espect iv el y . Also , let the r espec ti ve means and st andard err ors of the s ampling distribu tions of tho se st atistic s be μ S1 and μ S2 , and σ S1 and σ S2 , r especti vel y . T he diffe rence s betw een the statis tics fr om the tw o populatio ns, S 1 -S 2 , hav e a sampling dis tribu tion w ith mean μ S1 −S2 = μ S1 - μ S2 , and standar d e rr or σ S1 − S2 = ( σ S1 2 σ S2 2 ) 1/2 . A lso , the sum of the statis tics T 1 T 2 has a mean μ S1 S2 = μ S1 μ S2 , and s tandar d er r or σ S1 S2 = ( σ S1 2 σ S2 2 ) 1/2 .
P age 18-2 6 E stimator s for the mean and s tandar d dev iation o f the diff er ence and sum of the statis tics S 1 and S 2 ar e gi v en b y: In t hese expressions, ⎯ X 1 and ⎯ X 2 ar e the value s of the statisti cs S 1 and S 2 fr om samples tak en fr om the t w o populati ons, and σ S1 2 and σ S2 2 ar e the var i ances of the populati ons of the statis tics S 1 and S 2 fr om whic h the samples w er e taken . Confidence inter v als f or sums and differ ences of mean v alues If the population v ar iances σ 1 2 and σ 2 2 ar e kno wn , the confidence inte r v als for the differ ence and sum of the mean v alues of the populations , i .e ., μ 1 ±μ 2 , ar e gi v en b y: F or large s amples, i .e ., n 1 > 30 and n 2 > 30, and unkno wn , but equal, populatio n var i ances σ 1 2 = σ 2 2 , the conf idence int ervals f or the diffe r ence and sum of the mean v alues of the populati ons , i. e ., μ 1 ±μ 2 , ar e gi v en b y: If one of the sample s is small, i .e., n 1 < 30 or n 2 < 30, and w ith unknow n, but equal , population v ar iance s σ 1 2 = σ 2 2 , w e can obtain a “ pooled” estimat e of the v ar iance o f μ 1 ±μ 2 , as s p 2 = [(n 1 -1) ⋅ s 1 2 (n 2 -1) ⋅ s 2 2 ]/( n 1 n 2 -2 ) . 2 2 2 1 2 1 2 1 2 1 2 1 ˆ , ˆ n n X X S S S S S S σ σ σ μ = ± = ± ± ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ⋅ ± ⋅ − ± 2 2 2 1 2 1 2 / 2 1 2 2 2 1 2 1 2 / 2 1 ) ( , ) ( n n z X X n n z X X σ σ σ σ α α . ) ( , ) ( 2 2 2 1 2 1 2 / 2 1 2 2 2 1 2 1 2 / 2 1 ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ⋅ ± ⋅ − ± n S n S z X X n S n S z X X α α
P age 18-2 7 In this case , the cente red conf idence intervals f or the sum and diff er ence of the mean v alues of the populations , i .e ., μ 1 ±μ 2 , ar e gi ven by : wher e ν = n 1 n 2 - 2 is the number of degr ees of fr eedom in the Student’s t distr ibuti on. In the last tw o options w e spec ify that the population v ari ances, although unkno w n , mus t be equal . T his w ill be the case in w hic h the tw o samples ar e tak en fr om the same population , or fr om tw o populations about w hic h we suspec t that they ha v e the same population v ar iance . Ho w ev er , if w e hav e r eason to belie v e that the t w o unknow n population v ar iances ar e differ ent , w e can use the f ollo wing conf i dence interval w here the e stimated standar d dev iati on fo r the sum or differ ence is and n, the d egr ees of fr eedom of the t var iate , are calc u l ated using the integer value c losest to Determining conf idence inter v als The ap pl ica tio n 6. Co nf Inter v al can b e acc essed b y using ‚Ù— @@@OK@@@ . The appli cation off er s the f ollo w ing options: () 2 2 / , 2 1 2 2 / , 2 1 ) ( , ) ( p p s t X X s t X X ⋅ ± ⋅ − ± α ν α ν () 2 2 / , 2 1 2 2 / , 2 1 2 1 2 1 ) ( , ) ( X X X X s t X X s t X X ± ± ⋅ ± ⋅ − ± α ν α ν 2 2 2 1 2 1 2 1 n s n s s X X = ± )] 1 /( ) / [( )] 1 /( ) / [( )] / ( ) / [( 2 2 2 2 1 1 2 1 2 2 2 2 1 2 1 − − = n n S n n S n S n S ν
P age 18-2 8 These options ar e to be i nterpr eted as follow s : 1. Z -INT : 1 μ .: Single sample confi dence in te r v al fo r the population mean , μ , w ith kno wn populati on var iance , or for lar ge s amples w ith unkno wn populatio n v ari ance . 2. Z - I N T: μ1−μ2 .: Conf ide nce interval f or the differ ence o f the population means, μ 1 - μ 2 , w ith either kno wn population v ar iances , or f or large samples w ith unkno wn populati on v ari ances. 3 . Z -INT : 1 p.: Single sample conf idence interval f or the pr oportion, p , for lar ge samples w ith unkno wn populati on var iance . 4. Z -INT : p 1− p 2 .: Conf i dence interval fo r the d i ffer ence of t w o pr opor ti ons , p 1 -p 2 , f or lar ge samples w ith unkno wn populati on var iances . 5. T- I N T : 1 μ .: Single sample conf idence int er v al f or the population mean , μ , fo r small samples w ith unkno wn populati on v ari ance . 6. T- IN T : μ1−μ2 .: Conf ide nce interval f or the differ ence of the population means, μ 1 - μ 2 , fo r small samples w ith unkno wn populatio n var iance s. Ex ample 1 – Deter mine the center ed confi dence int er v al f or the mean of a populatio n if a s ample of 60 eleme nts indicate that the mean v alue of the sample is ⎯ x = 2 3. 3, and its s tandar d dev iation is s = 5 .2 . Us e α = 0. 05 . The conf idence le vel is C = 1- α = 0.9 5 . Select case 1 f r om the menu sho wn abo v e by pr essing @@@OK@@@ . Enter the v alues r equir ed in the input f or m as sho w n:
P age 18-29 Press @HELP to obtain a s cr een explaining the meaning of the conf idence inter v al in terms o f r andom numbers gener ated by a calc ulator . T o scr oll do wn the r esulting sc r een use the do w n -ar r o w k ey ˜ . Pr ess @@@OK@@@ when done w ith the help sc r een. T his w ill r eturn y ou to the sc r een sho wn abo v e. T o calculate the conf idence interval , pres s @@@OK@@@ . The r esult sho wn in the calc ulat or is: T he r esult indicat es that a 9 5% conf idence interv al has been calc ulated . The Criti cal z value sho wn in the sc reen abo ve corr esponds to the v alues ± z α/2 in the conf idence interv al for mula ( ⎯ X− z α /2 ⋅σ / √ n , ⎯ X z α /2 ⋅σ / √ n ) . The v a l ues μ Min and μ Max ar e the lo wer and uppe r limits of this interv al, i .e., μ Min = ⎯ X− z α /2 ⋅σ / √ n, a nd μ Max = ⎯ X z α /2 ⋅σ / √ n. Press @GRAPH to s ee a gr aphical displa y o f the conf idence interv al infor mati on: T he gr aph sho w s the standar d nor mal distr ibution pdf (pr obability density func tion), the loca ti on of the c r itical po ints ± z α/2 , the mean v alue (2 3 . 3) and the cor re sponding int er v al limits (21.9 84 2 4 and 2 4.615 7 6) . Pr es s @ TEXT to r eturn to the pr ev ious r esults sc r een, and/or pr ess @@@OK@@@ to ex it the confidence interval en vi r onment . The r esults w ill be listed in the calc ulator ’s displa y .
P age 18-30 Ex ample 2 -- Data f r om two s amples (s amples 1 and 2) indicat e that ⎯ x 1 = 5 7 .8 and ⎯ x 2 = 60. 0. The sample si z es ar e n 1 = 4 5 and n 2 = 7 5 . If it is kno w n that the populations ’ standar d dev iati ons ar e σ 1 = 3 .2 , and σ 2 = 4. 5, deter mine the 90% co nfi dence interval f or the diff er ence of the populati on means, i .e ., μ 1 - μ 2 . Press ‚Ù— @@@OK@@@ to acce ss the confi dence inter v al f eatur e in the calc ulator . Pr ess ˜ @@@OK@@@ to select option 2 . Z -INT : μ 1 – μ 2 .. Enter the fo llo w ing value s: When done , pre ss @@@OK@@@ . The r esults, as te xt and gr aph, ar e sho wn be lo w: Th e va riab le Δμ r epresents μ 1 – μ 2. Ex ample 3 – A surve y of publi c opini on indi cates that in a sample of 15 0 people 6 0 fa vo r incr easing pr operty taxe s to finance s ome public pr ojects . Deter mine the 99% conf ide nce interval f or the populati on pr oportion that w ould favor in cr e asi ng ta x es. Press ‚Ù— @@@OK@@@ to acce ss the confi dence inter v al f eatur e in the calc ulat or . Pr ess ˜˜ @@@OK @ @@ to sel ect o ption 3 . Z - IN T : μ 1 – μ 2 .. En ter the fo llo w ing value s:
P age 18-31 When done , pre ss @@@OK@@@ . The r esults, as te xt and gr aph, ar e sho wn be lo w: Ex ample 4 -- Determine a 90% conf idence inter v al f or the differ ence between two pr oportions if sample 1 sho ws 20 su ccess es out of 120 tr ials , and sample 2 s ho ws 15 s uccesses out of 1 00 trial s . Press ‚Ù— @@@OK@@@ to access the confi dence inter v al f eatur e in the calc ulator . Pr ess ˜˜˜ @@@OK @@ @ to select option 4. Z -INT : p1 – p2 .. Enter the f ollo w ing v alues: When done , pre ss @@@OK@@@ . The r esults, as te xt and gr aph, ar e sho wn be lo w:
P age 18-3 2 Ex ample 5 – Determine a 9 5% conf idence in terval f or the mean of the populatio n if a s ample of 50 elements has a mean of 15 . 5 and a st andard de vi atio n of 5 . The popul ation ’s standar d dev iation is unkno wn . Press ‚Ù— @@@OK@@@ to access the confi dence inter v al f eatur e in the calc ulator . Pr ess —— @@@OK@@@ to s elect opti on 5 . T -INT : μ . Ent er the fo llo w ing value s: When done , pre ss @@@OK@@@ . The r esults, as te xt and gr aph, ar e sho wn be lo w: T he fi gur e sho w s the Studen t’s t pdf fo r ν = 5 0 – 1 = 4 9 degr ees of fr eedom. Ex ample 6 -- Deter mine the 9 9% confi dence interval f or the diff er ence in means of tw o populations gi v en the sample data: ⎯ x 1 = 15 7 .8 , ⎯ x 2 = 16 0. 0, n 1 = 5 0, n 2 = 5 5 . The populations s tandard de vi ations ar e s 1 = 13 .2 , s 2 = 2 4. 5 . Press ‚Ù— @@@OK@@@ to access the confi dence inter v al featur e in the calc ulator . Pr ess — @@@OK@@@ to sel ect optio n 6 . T -INT : μ1−μ2. . Ent er the fo llo w ing value s: hen done , pr ess @@@OK@@@ . The r esults, as te xt and gra ph, ar e sho w n belo w:
P age 18-3 3 T hese r esults assume that the v alues s 1 and s 2 ar e the population st andar d de vi ations . If these v alues actuall y r epr esent the s amples ’ standar d de v iatio ns, y ou should enter the s ame values as be for e, bu t wi th the option _pooled selected . T he r esults no w become: Confidence inter v als f or th e v ariance T o de ve lop a for mula f or the conf idence in terval f or the v ari ance , f irst w e intr oduce the sampling distr ibution o f the var iance : Consi der a r andom sample X 1 , X 2 ..., X n of independent nor mally-dis tribu ted var iables w ith mean μ , va rian c e σ 2 , and sample mean ⎯ X. T he statistic is an unbi ased estimator o f the v ari ance σ 2 . T he quantity has a χ n-1 2 (chi-sq uare) distr ibuti on w ith ν = n -1 degr ees of fr eedom . The (1- α )⋅ 10 0 % two -s ided conf idence inte r v al is f ound fr om Pr[ χ 2 n -1,1- α /2 < (n -1) ⋅ S 2 / σ 2 < χ 2 n- 1, α /2 ] = 1- α . ∑ = − ⋅ − = n i i X X n S 1 2 2 , ) ( 1 1 ˆ ∑ = − = ⋅ − n i i X X S n 1 2 2 2 , ) ( ˆ ) 1 ( σ
P age 18-34 T he confi dence interv al fo r the population v ari ance σ 2 is theref ore , [(n -1) ⋅S 2 / χ 2 n-1 , α /2 ; (n-1) ⋅ S 2 / χ 2 n -1,1- α /2 ]. wher e χ 2 n-1 , α /2 , and χ 2 n-1,1- α /2 ar e the value s that a χ 2 va riabl e, wit h ν = n-1 degr ees of fr eedom , e x ceeds with pr obabiliti es α /2 and 1- α /2 , r es pecti vel y . T he one -sided upper conf idence limit f or σ 2 is def ined as (n -1) ⋅ S 2 / χ 2 n-1,1- α . Ex ample 1 – Determine the 9 5% conf idence interval f or the popula ti on v ari ance σ 2 based on the r esults f r om a sample of si z e n = 2 5 that indicates that the sample var iance is s 2 = 12 .5 . In Chapter 17 w e use the numer ical sol v er to so lv e the equati on α = UTPC( γ ,x). In this pr ogr am, γ r epresents the degr ees of fr eedom (n-1) , and α represents th e pr obability of e x ceeding a cer t ain value of x ( χ 2 ) , i .e ., Pr[ χ 2 > χ α 2 ] = α . F or the pre sent e x ample , α = 0.0 5 , γ = 2 4 and α = 0 .025. S o l vi n g t h e equati on pr esented abo ve r esults in χ 2 n-1 , α /2 = χ 2 24 , 0.025 = 3 9 . 3 6 4 07 70 26 6 . On the other hand , the value χ 2 n- 1, α /2 = χ 2 24 , 0.975 is calc ulated by u sing the val ue s γ = 2 4 and α = 0.9 7 5 . The r esult is χ 2 n -1,1- α /2 = χ 2 24 , 0.975 = 12 .4 0115 0 217 5 . T he lo w er and upper limits o f the int erval w ill be (Use AL G mode f or thes e calc ulati ons): (n -1) ⋅ S 2 / χ 2 n-1 , α /2 = (2 5-1) ⋅ 12 .5/3 9 . 3 640 7 7 0 2 6 6 = 7 .6 211617 9 6 7 6 (n-1) ⋅ S 2 / χ 2 n-1,1- α /2 = (2 5-1) ⋅ 12 .5/12 .401150 217 5 = 2 4.191 3 044144 T hus , the 9 5% conf idence in terval f or this e x ample is: 7 .6 211617 9 6 7 6 < σ 2 < 2 4.19130 44144.
P age 18-35 Hy pot hesis testing A h ypo thesis is a declar ation made about a populati on (for ins tance , w ith r espect to its mean) . A cceptance of the h y pothesis is based o n a statisti cal test on a sample tak en fr om the population . The consequent acti on and dec isi on - making ar e called h y pothesis te sting . T he proce ss of h ypothesis tes ting consists on taking a r andom sample fr om the populatio n and making a statisti cal hy pothesis about the populati on. If the obse r v atio ns do not support the model or theory postulat ed, the h y pothesis is r ej ected . How ev er , if the observati ons ar e in agr eement , then h y pothesis is not r ej ected, but it is not nec essar ily accepted. A ssoc iated w i th the decisi on is a le vel o f signif icance α . Pr ocedure f or testing hy potheses T he procedur e f or h ypothe sis testing in v olv es the f ollo wing si x steps: 1. Declar e a null h ypothesis , H 0 . T his is the h ypothe sis to be test ed . F or exa mp l e , H 0 : μ 1 - μ 2 = 0, i .e ., we h ypothesi z e that the mean v alue of populatio n 1 and the mean v alue of populati on 2 ar e the same . If H 0 is true , any ob served diff er ence in means is at tr ibuted to er r ors in r andom sampling . 2 . De c lar e an alte rnate h ypothesis , H 1 . F or the ex a m ple under consider ation , it coul d be H 1 : μ 1 - μ 2 ≠ 0 [Note: this is w hat we r eally w ant to test .] 3 . Determine o r spec ify a test s tatisti c, T . In the e x ample under consider ation , T w ill be bas ed on the diff er ence of obs erved means , ⎯ X 1 - ⎯X 2 . 4. Use the kno wn (or as sumed) distribu tion of the t est st atisti c, T . 5 . Def ine a re jec tio n regi on (the c riti cal r egio n, R) f or the te st statis tic bas ed on a pr e -assi gned signif icance le v el α . 6 . Use observed data to deter mine w hether the computed value o f the test statis tic is w ithin or outside t he cr itical r egion . If the t est s tatisti c is w ithin the c riti cal r egion , then w e sa y that the quantit y w e ar e tes ting is signif icant at the 100 α per cent lev el .
Pa g e 1 8 - 3 6 Err ors in h ypothesis testing In h ypothe sis testing w e use the ter ms err ors of T y pe I and T y pe II to def ine the case s in w hich a tr ue h ypothe sis is re jec ted or a fals e h ypothe sis is accepted (not r ejected) , respect i vel y . Let T = val ue of test sta tistic, R = re ject i on region, A = acceptance r egion , thus , R ∩ A = ∅ , and R ∪ A = Ω , wher e Ω = the parame ter space for T , and ∅ = the empty set . T he pr obabiliti es of making an er r or of T ype I or of T ype II ar e as follo ws: R ejec ting a true h y pothesis , Pr[ T ype I err or] = Pr[T ∈ R|H 0 ] = α Not r ej ecting a f alse h y pothesis , Pr[T ype II e rr or] = Pr[ T ∈ A|H 1 ] = β No w , let's consider the cases in w hi ch w e mak e the cor r ect dec ision: Not r ej ecting a true h ypothesis , Pr[Not(T ype I er r or )] = Pr[T ∈ A|H 0 ] = 1 - α R ej ecting a f als e h ypo thesis , Pr[Not( T y pe II er r or )] = Pr [T ∈ R|H 1 ] = 1 - β The complem ent of β is called the pow er of the tes t of the null h y pothesis H 0 vs. the alter nati ve H 1 . The po w er of a tes t is used , fo r ex ample , to deter mine a minimum sample si z e to r es tri ct err ors . Selecting values of α and β A typ ical v alue of the le vel o f signif icance (or pr obability of T ype I err or ) is α = 0. 0 5, (i .e ., incorr ect r ej ecti on once in 20 times o n the av er age) . If the conseq uences of a T ype I er r or ar e mor e ser i ous, choos e smaller value s of α , sa y 0.01 or e ven 0. 00 1. Notes: 1. F or the e xample under consi der ation , the alt ernate h ypothesis H 1 : μ 1 - μ 2 ≠ 0 pr oduces w hat is called a two -tailed test . If the alternate h ypothe sis is H 1 : μ 1 - μ 2 > 0 or H 1 : μ 1 - μ 2 < 0, then w e hav e a one - tailed tes t . 2 . T he pr obability of r ej ecting the n ull h ypo thesis is equal to the le v el of signif i cance , i .e ., Pr[T ∈ R|H 0 ]= α . The notati on Pr[ A|B] r epr esents the conditio nal proba bility of e vent A gi ven that e v ent B occ urs .
P age 18-3 7 Th e va lu e of β , i .e ., the pr obability of making an er r or of T ype II , depends on α , the sample si z e n, and on the tr ue value o f the paramet er tes ted . Th us, the val ue of β is determined after the h y pothesis te sting is perfor med . It is c ust omary to dr a w gra phs sho w ing β , or the pow er of the test (1- β ), a s a func tion of the tr ue value of the par ameter tested . T hese gr aphs ar e called oper ating char act er istic c urve s or pow er f uncti on c ur v es , re specti v ely . Inferences concer ning one mean T w o -sided h ypothesis T he pr oblem consists in te sting the null h y pothesis H o : μ = μ o , against the alter nati ve h y pothesis, H 1 : μ≠ μ ο at a lev el of conf idence (1- α )100%, or signif icance le v el α , using a sample of si z e n with a mean ⎯ x and a standar d de vi atio n s. T his te st is r efer r ed to as a t w o -sided or tw o - tailed t est . The pr ocedure f or the test is as f ollo w s: F irst , w e calc ulate the appr opri ate s tatisti c f or the tes t (t o or z o ) as f ollo w s: Θ If n < 30 and the standar d dev iation o f the population , σ , is kno w n, use the z -statistic: Θ If n > 30, and σ is kno wn , use z o as abov e. If σ is not kno wn , re place s for σ in z o , i .e. , us e Θ If n < 30, and σ is unkno w n, u se the t-statis tic , w ith ν = n - 1 degr ees of fr eedom. Then , calc ulate the P - v alue (a pr obability) assoc i ated with e ither z ο or t ο , and compar e it to α to dec ide whethe r or not to re jec t the null hy pothesis . The P - v alue for a tw o -sided t est is def ined as e ither P -value = P(|z|>|z o |) , or , P -value = P(|t|>|t o |). n x z o o / σ μ − = n s x z o o / μ − = n s x t o o / μ − =
P age 18-38 T he cr ite ri a to use f or h y pothesis te sting is: Θ Re je ct H o if P -value < α Θ Do not r ejec t H o if P -value > α . T he P -v alue fo r a two -si ded tes t can be calc ulated using the pr obability f unctio ns in the calc ulator as f ollo w s: Θ If using z , P - v alue = 2 ⋅ UTPN(0,1,|z o |) Θ If using t , P -value = 2 ⋅ UTP T( ν ,|t o |) Ex ample 1 -- T est the nul l hy pothesis H o : μ = 2 2 .5 ( = μ o ) , agains t the alter nati ve h y pothesis, H 1 : μ ≠ 2 2 .5, at a le v el of confi dence of 9 5% i.e ., α = 0. 0 5, using a sample of si z e n = 2 5 w ith a mean ⎯ x = 2 2 . 0 and a standar d de vi atio n s = 3. 5 . W e assume that w e don't know the v alue of the populati on standar d dev iati on, ther efor e , we calc ulate a t statisti c as fo llow s: T he corr esponding P -value , for n = 2 5 - 1 = 2 4 degrees o f fr eedom is P- v a l u e = 2 ⋅ UTPT(2 4 ,-0.714 2) = 2 ⋅ 0.7 5 90 = 1. 518, since 1. 518 > 0. 05, i .e ., P -value > α , w e cannot r ej ect the n ull h ypothesis H o : μ = 2 2 . 0. One -sided h ypothe sis T he pr oblem consists in te sting the null h y pothesis H o : μ = μ o , against the alter nati ve h y pothesis, H 1 : μ > μ ο or H 1 : μ < μ ο at a le vel o f conf idence (1- α )100% , or si gnifi cance lev el α , using a sample of si z e n w ith a mean ⎯ x and a standar d dev iati on s. T his tes t is re fer r ed to as a one -sided or one - tailed t est . T he pr ocedur e for perf orming a o ne -side te st starts as in the tw o - tailed t est b y calc ulating the appr opr iate st atistic f or the test (t o or z o ) as indi cated abo ve . 7142 . 0 25 / 5 . 3 5 . 22 0 . 22 / − = − = − = n s x t o o μ
P age 18-3 9 Ne xt, w e u se the P - v alue assoc iated w ith either z ο or t ο , and compare it to α to dec ide w hether or no t to r ej ect the n ull hy pothesis. T he P - v alue f or a tw o -sided tes t is defined as e ither P -value = P(z > |z o |) , or , P -value = P(t > |t o |) . T he cr ite ri a to use f or h y pothesis te sting is: Θ Re je ct H o if P -value < α Θ Do not r ejec t H o if P -value > α . Notice that the c r iter ia ar e ex actl y the same as in the two -si ded test . T he main diffe r ence is the w ay that the P -va lue is calc ulated . T he P -value f or a one -si ded tes t can be calc ulated using the pr obability func tions in the calc ulator as fo llo w s: Θ If using z , P -value = UTPN(0,1,z o ) Θ If using t , P -value = UTP T( ν ,t o ) Ex ample 2 -- T est the nul l hy pothesis H o : μ = 2 2 .0 ( = μ o ) , against the alter nati ve h y pothesis, H 1 : μ >2 2 . 5 at a lev el of conf idence of 9 5% i .e ., α = 0. 0 5, using a sample of si z e n = 2 5 w ith a mean ⎯ x = 2 2 . 0 and a standar d de vi ation s = 3 .5 . Again , we as sume that we don't kno w the value of the populatio n standar d dev iation , ther ef or e , the value of the t st atisti c is the same as in the tw o -sided tes t case sho w n abo ve , i .e ., t o = -0.714 2 , and P - v alue , for ν = 2 5 - 1 = 2 4 degrees o f fr eedom is P -value = UTP T(2 4 , |-0.714 2|) = UTPT( 2 4 , 0.714 2) = 0.2 409 , since 0.2 409 > 0.0 5, i .e ., P - v alue > α , we cannot r ej ect the null h ypothesis H o : μ = 2 2 .0. Inferences concer ning t w o means T he null h ypothe sis to be tes ted is H o : μ 1 - μ 2 = δ , at a le v el of confi dence (1- α )100%, or signif icance le v el α , u sing two sam ples of si z es , n 1 and n 2 , mean
P age 18-40 val ue s ⎯ x 1 and ⎯ x 2 , and st andard de vi ations s 1 and s 2 . If the populations standar d dev iati ons cor r esponding to the samples , σ 1 and σ 2 , ar e kno w n , or if n 1 > 30 and n 2 > 30 (l ar ge sa mples) , th e test stat istic to be used is If n 1 < 30 or n 2 < 30 (at leas t one small sample), use the f ollo w ing tes t statisti c: T w o -sided h ypothesis If the alt ernati v e h ypothe sis is a tw o -si ded h y pothesis, i .e ., H 1 : μ 1 - μ 2 ≠δ , The P - v alue for this te st is calc ulated as Θ If using z , P -value = 2 ⋅ UTPN(0,1, |z o |) Θ If using t , P -value = 2 ⋅ UTPT( ν ,|t o |) w ith the degree s of fr eedom for the t-distr ibution gi v en b y ν = n 1 n 2 - 2 . The test cr iteri a a r e Θ Re je ct H o if P -value < α Θ Do not r ejec t H o if P -value > α . One -sided h ypothe sis If the alter nati ve h ypothe sis is a t w o -sided h y pothesis, i .e ., H 1 : μ 1 - μ 2 < δ , or , H 1 : μ 1 - μ 2 < δ ,, the P - v alue fo r this test is calc ulated as: Θ If using z , P - v alue = UTPN(0,1, |z o |) Θ If using t , P -value = UTP T( ν ,|t o |) 2 2 2 1 2 1 2 1 ) ( n n x x z o σ σ δ − − = 2 1 2 1 2 1 2 2 2 2 1 1 2 1 ) 2 ( ) 1 ( ) 1 ( ) ( n n n n n n s n s n x x t − − − − − = δ
P age 18-41 T he cr ite ri a to use f or h y pothesis te sting is: Θ Re je ct H o if P -value < α Θ Do not r ejec t H o if P -value > α . P aired sample tests When w e deal w ith tw o samples o f si z e n w ith pair ed data point s, ins tead of tes ting the null h y pothesis , H o : μ 1 - μ 2 = δ , using the mean v a l ues and st andard de vi atio ns of the tw o samples , w e need to tr eat the pr oblem as a single sam ple of the differ ences of the pair ed value s. In other w or d s , gener ate a ne w random va riab le X = X 1 -X 2 , and tes t H o : μ = δ , w her e μ re pr esents the mean of the populatio n for X. T here fo r e , y ou w ill need to obtain ⎯ x and s for the s ample of value s of x . The tes t should then pr oceed as a one -sample tes t using the methods des cr ibed ear lie r . Inferences concer ning one pr oportion Suppos e that we w ant to tes t the null h ypothesis , H 0 :p = p 0 , w here p r epres ents the pr obab ilit y o f obtaining a succe ssful outcome in an y gi v en r epetition o f a Bernoulli tr ial. T o test the h y pothesis, w e perfor m n r epetitions of the e xper iment , and find that k succe ssful outcomes ar e recor ded. T hus , an estimat e of p is gi ven b y p ’ = k/n. The v ari ance f or the sample w ill b e es timated as s p 2 = p ’(1-p ’)/n = k ⋅ (n -k)/n 3 . Assume that the Z scor e, Z = (p-p 0 )/s p , f ollo ws the st andard normal distr ibuti on, i .e ., Z ~ N(0,1) . T he par ti c ular value of the s tatisti c to te st is z 0 = (p ’-p 0 )/s p . Instead o f using the P -value as a cr iter i on to accept or not accept the h y pothesis , w e will u se the compar ison between the c r itical value of z0 and the v alue of z cor r esponding to α or α /2 . T wo - tail ed test If using a two -tailed test w e w ill find the v alue of z α /2 , f r om Pr[Z> z α /2 ] = 1- Φ (z α /2 ) = α /2 , or Φ (z α /2 ) = 1- α /2 ,
P age 18-4 2 wher e Φ (z) is the c umulativ e dis tributi on f unctio n (CDF) of the st andar d normal distr ibuti on (see Cha pter 17). R ejec t the null h ypothe sis, H 0 , if z 0 >z α /2 , or if z 0 < - z α /2 . In other w ords , the r ej ecti on r egi on is R = { |z 0 | > z α /2 }, w hile the acceptance r egion is A = {|z 0 | < z α /2 }. One -ta iled test If using a one -tailed test we w ill find the v alue of S , fr om Pr[Z> z α ] = 1- Φ (z α ) = α , or Φ (z α ) = 1- α , R ejec t the null h ypothesis , H 0 , if z 0 >z α , and H 1 : p>p 0 , or if z 0 < - z α , and H 1 : p<p 0 . T esting th e differ ence between t w o pr oportions Suppo se that w e w ant t o test the null h ypothe sis, H 0 : p 1 -p 2 = p 0 , w her e the p's r epr esen ts the pr obability of obtaining a su ccessf ul outcome in an y giv en r epetition o f a Bernoulli tr ial f or two populations 1 and 2 . T o t est the h ypothes is, w e perfor m n 1 r epetitions o f the expe rime nt fr om populati on 1, and f ind that k 1 successf ul outcomes ar e recor de d . Also , we f ind k 2 successf ul outcomes out of n 2 tr ials in sample 2 . Thu s, estimates o f p 1 and p 2 ar e gi v en, res p ec t i ve ly , by p 1 ’ = k 1 /n 1 , and p 2 ’ = k 2 /n 2 . T he var i ances f or the sample s w ill be estimat ed, r espec ti vel y , as s 1 2 = p 1 ’(1-p 1 ’)/n 1 = k 1 ⋅ (n 1 -k 1 )/n 1 3 , and s 2 2 = p 2 ’(1-p 2 ’)/n 2 = k 2 ⋅ (n 2 -k 2 )/n 2 3 . And the v ar iance of the diff er ence of pr oportions is e stimated f r om: s p 2 = s 1 2 s 2 2 . Assume that the Z sc ore , Z = (p 1 -p 2 -p 0 )/s p , f ollo ws the st andar d normal distr ibuti on , i. e ., Z ~ N(0,1) . T he partic ular value o f the statisti c to tes t is z 0 = (p 1 ’-p 2 ’-p 0 )/s p .
P age 18-4 3 T wo - tail ed test If using a two -tailed test w e w ill find the v alue of z α /2 , f r om Pr[Z> z α /2 ] = 1- Φ (z α /2 ) = α /2 , or Φ (z α /2 ) = 1- α /2 , wher e Φ (z) is the c umulativ e dis tributi on f unctio n (CDF) of the st andar d normal distr ibuti on. R ejec t the null h ypothe sis, H 0 , if z 0 >z α /2 , or if z 0 < - z α /2 . In other w ords , the r ej ecti on r egi on is R = { |z 0 | > z α /2 }, w hile the acceptance r egion is A = {|z 0 | < z α /2 }. One -ta iled test If using a one -tailed test w e w ill f ind the value of z a , fr om Pr[Z> z α ] = 1- Φ (z α ) = α , or Φ (z α ) = 1- α , Re jec t the null h y pothesis, H 0 , if z 0 >z α , and H 1 : p 1 -p 2 > p 0 , or if z 0 < - z α , and H 1 : p 1 -p 2 <p 0 . Hy pothesis testing using pre-progr ammed features T he calc ulator pr ov ides w i th hy pothesis test ing procedur es under appli cation 5. Hypoth. test s.. can be acc essed by using ‚Ù—— @@@OK@@@ . As w ith the calculati on of conf idence int er v als, dis c uss ed earlier , this pr ogram off ers the f ollo wi ng 6 options: T hese opti ons are int erpr eted as in the confi dence interval a pplications:
P age 18-44 1. Z - T es t: 1 μ .: Single s ample hy pothesis testing f or the populati on mean, μ , w ith kno w n population v ar iance , or f or lar ge samples w ith unknow n populatio n v ari ance . 2. Z - Te s t : μ1−μ2 .: Hy pothesis te sting fo r the differ ence of the population means, μ 1 - μ 2 , w ith either kno w n population v ar iances , or for lar ge samples w ith unkno wn populati on v ari ances. 3 . Z -T est: 1 p .: Single sampl e h ypo thesis te sting f or the pr oportion , p , fo r lar ge samples w ith unkno wn populati on var iance . 4. Z - T es t: p 1− p 2 .: Hy pothesis tes ting fo r the differ ence of two pr opor ti ons, p 1 - p 2 , f or lar ge samples w ith unkno wn populati on v ari ances . 5. T-Tes t : 1 μ .: Single sample h ypothe sis tes ting fo r the population mean , μ , fo r small samples w ith unkno wn populati on v ari ance . 6. T-T es t: μ1−μ2 .: Hy pothesis tes ting for the differ ence of the population means, μ 1 - μ 2 , fo r small samples w ith unkno wn populatio n var iance s. T ry the f ollo w ing e xer c ises: Ex ample 1 – F or μ 0 = 15 0, σ = 10, ⎯ x = 15 8 , n = 50 , for α = 0. 0 5, test the h ypothe sis H 0 : μ = μ 0 , against the alter nativ e hy pothesis , H 1 : μ≠μ 0 . Press ‚Ù—— @@@OK@@@ to acces s the h ypothe sis tes ting featur e in the calc ulator . Pr ess @@@OK@@@ to select opti on 1. Z - T est: 1 μ . Enter the f ollo w ing data and pr ess @@@OK@@@ : Y ou ar e then ask ed to s elect the alt ernati v e h ypothesis . Select μ≠ 15 0, and pr ess @@OK@@ . T he r esult is:
P age 18-45 Then , w e r ej ect H 0 : μ = 150 , against H 1 : μ ≠ 150 . The test z value is z 0 = 5. 656854 . T he P- va l u e i s 1. 54 × 10 -8 . The crit ic al val ue s of ± z α /2 = ± 1.9 5 9 9 64, cor r es ponding to c r itical ⎯ x r ange of {14 7 .2 15 2 .8}. T his infor mation can be obse r v ed gra phicall y b y pre ssing the soft-menu k e y @GRAPH : Ex ample 2 -- F or μ 0 = 15 0, ⎯ x = 15 8 , s = 10, n = 50, f or α = 0. 05, te st the h ypothe sis H 0 : μ = μ 0 , against the alter nativ e hy pothesis , H 1 : μ > μ 0 . T he populatio n standar d de v iati on, σ , is not kno w n. Press ‚Ù—— @@@OK@@@ to acces s the h ypothe sis tes ting featur e in the calc ulator . Pr ess —— @@@OK@@@ to select option 5 . T -T est: 1 μ .: Enter the f ollo w ing data and pr ess @@@OK@@@ : Select the alter nati ve h ypothesis , H 1 : μ > 15 0, and pr ess @@@OK@@@ . T he r esult is:
P age 18-46 W e r ej ect the null h ypothe sis, H 0 : μ 0 = 15 0, against the alter nati v e h ypo thesis , H 1 : μ > 15 0. The te st t v alue is t 0 = 5 .6 5 6 8 54 , w ith a P - v alue = 0. 000000 3 9 3 5 2 5 . The c r itical v alue of t is t α = 1. 6 7 6 5 51, corr esponding to a cri tic al ⎯ x = 15 2 . 3 71. Press @GRAPH to see the re sults gr aphi cally as follo w s: Ex ample 3 – Data fr om two sample s sho w that ⎯ x 1 = 15 8 , ⎯ x 1 = 16 0, s 1 = 10, s 2 = 4. 5, n1 = 5 0, and n 2 = 5 5. For α = 0. 0 5, and a “ pooled” v ar iance , test the h y pothesis H 0 : μ 1 −μ 2 = 0 , against the alter nativ e hy pothesis, H 1 : μ 1 −μ 2 < 0 . Press ‚Ù—— @@@OK @@ @ to access the h ypothe sis tes ting featur e in the calc ulator . Pr ess — @@@OK@@@ to s elect option 6. T - T est: μ1−μ2 .: Ent er the fo llo w ing data and pre ss @@@OK@@@ : Select the alternati v e h ypothe sis μ1< μ2 , and pr ess @@@OK@@@ . T he r esult is
P age 18-4 7 T hus , w e accept (mor e acc urat ely , we do n ot r ej ect) the h y pothesis: H 0 : μ 1 −μ 2 = 0 , or H 0 : μ 1 =μ 2 , against the alter nati ve h ypothesis H 1 : μ 1 −μ 2 < 0 , or H 1 : μ 1 =μ 2 . The test t value is t 0 = -1. 3 4177 6 , w ith a P -value = 0. 09130 9 61, and cr itical t is –t α = -1.6 5 9 7 8 2 . T he gr aphical r esults are: T hese thr ee e x amples sho uld be enough to under stand the oper ation of the h ypothe sis testing pr e -pr ogrammed f eatur e in the calculator . Inferences concer ning one v ariance T he null h y pothesis to be t ested i s , H o : σ 2 = σ o 2 , at a le vel o f conf idence (1- α )100%, or signif icance le v el α , using a s ample of si z e n , and v ari ance s 2 . Th e tes t statisti c to be u sed is a chi-s quar ed tes t statisti c def ined as Depending on the alternati ve h y pothesis c hosen , the P -value is calc ulated as fo llo w s: Θ H 1 : σ 2 < σ o 2 , P -value = P( χ 2 < χ o 2 ) = 1-UTP C( ν ,χ o 2 ) Θ H 1 : σ 2 > σ o 2 , P -value = P( χ 2 > χ o 2 ) = UTP C( ν ,χ o 2 ) Θ H 1 : σ 2 ≠σ o 2 , P -v alue =2 ⋅ min[P(χ 2 < χ o 2 ), P( χ 2 > χ o 2 )] = 2 ⋅ min[1-UTPC( ν ,χ o 2 ), U T P C ( ν ,χ o 2 )] w her e the functi on min[x ,y] produce s the minimum v alue of x or y (similar ly , max[x ,y] pr oduces the maxi mum value of x or y). UTPC( ν ,x) r epr esents the calc ulator ’s upper - tail pr obabilitie s for ν = n - 1 degrees o f fr eedom . 2 0 2 2 ) 1 ( σ χ s n o − =
P age 18-48 T he test c r iter ia ar e the same as in h y pothesis te sting of means , namely , Θ Re je ct H o if P -value < α Θ Do not r ejec t H o if P -value > α . P lease noti ce that this pr ocedur e is valid onl y if the populati on fr om w hic h the sample w as tak en is a Normal populati on . Ex ample 1 -- Co nsider the case in w hic h σ o 2 = 2 5 , α =0. 05, n = 2 5, and s 2 = 20, and the sample wa s dra w n fr om a nor mal population . T o tes t the h ypothe sis, H o : σ 2 = σ o 2 , against H 1 : σ 2 < σ o 2 , w e firs t calc ulate Wi th ν = n - 1 = 2 5 - 1 = 2 4 degr ees of f r eedom, we calc ulate the P - v alue as , P- v a l u e = P ( χ 2 < 19.2 ) = 1-UTP C(2 4, 19.2 ) = 0.2 5 8 7 … Since , 0.2 5 8 7… > 0. 05, i .e., P -value > α , w e cannot re ject the null h y pothesis, H o : σ 2 =2 5(= σ o 2 ). Inferences concer ning t w o v ariances T he null h y pothesis to be t ested i s , H o : σ 1 2 = σ 2 2 , at a lev el of confi dence (1- α )100%, or signif icance le v el α , u sing two sam ples of si z es , n 1 and n 2 , and va rian c es s 1 2 and s 2 2 . The te st statis tic to be us ed is an F test statis tic def ined as wher e s N 2 and s D 2 r epr esent the numer ator and denominat or of the F statis tic , r especti vel y . Selec tion o f the numer ator and denominator depends on the alter nati ve h y pothesis being t ested , a s sho wn belo w . The co rr es ponding F distr ibuti on has degr ees of f r eedom, ν N = n N -1, and ν D = n D -1, wher e n N and n D , ar e the sample si z es cor r esponding to the var iances s N 2 and s D 2 , res p ec t ively . 2 2 D N o s s F =
P age 18-4 9 T he follo w ing table sho ws h ow to select the nu merat or and denominator f or F o depending on the alter nati ve h ypothe sis cho sen: ___________ _____________________ _____________________ _______________ Alterna ti ve T est Degrees h ypothe sis statis tic o f fr eedom ___________ _____________________ _____________________ _______________ H 1 : σ 1 2 < σ 2 2 (one -sided) F o = s 2 2 /s 1 2 ν N = n 2 -1, ν D = n 1 -1 H 1 : σ 1 2 > σ 2 2 (one -sided) F o = s 1 2 /s 2 2 ν N = n 1 -1, ν D = n 2 -1 H 1 : σ 1 2 ≠σ 2 2 (two -sided) F o = s M 2 /s m 2 ν N = n M -1, ν D = n m -1 s M 2 =max(s 1 2 ,s 2 2 ), s m 2 =min(s 1 2 ,s 2 2 ) ___________ _____________________ _____________________ ______________ (*) n M is the v alue of n corr esponding to the s M , and n m is the v alue of n cor re sponding to s m . ___________ _____________________ _____________________ _______________ The P -value is calc ulated, in all cases, as: P -value = P(F>F o ) = UTPF( ν N , ν D ,F o ) The test c riter ia a r e: Θ Re je ct H o if P -value < α Θ Do not r ejec t H o if P -value > α . Ex ample1 -- Consi der tw o samples dr aw n fr om normal populati ons such that n 1 = 21, n 2 = 31, s 1 2 = 0. 3 6, and s 2 2 = 0.2 5 . W e test the null h ypothe sis, H o : σ 1 2 = σ 2 2 , at a signif icance le v el α = 0. 0 5, against the alternati ve h ypothesis , H 1 : σ 1 2 ≠σ 2 2 . F or a two -sided h ypothesis , w e need to identify s M and s m , as fo llo w s: s M 2 =max(s 1 2 ,s 2 2 ) = max(0. 3 6 , 0.2 5) = 0. 3 6 = s 1 2 s m 2 =min(s 1 2 ,s 2 2 ) = min (0. 3 6, 0.2 5 ) = 0.2 5 = s 2 2 Also, n M = n 1 = 21, n m = n 2 = 31, ν N = n M - 1= 21-1=20, ν D = n m -1 = 31-1 =3 0.
P age 18-50 Ther efor e , the F test stati stics is F o = s M 2 /s m 2 =0.3 6/0. 2 5=1.44 T he P -v alue is P -value = P(F>F o ) = P(F>1.44) = UTPF( ν N , ν D ,F o ) = UTPF( 20, 30,1.44) = 0.17 88 … Since 0.17 88… > 0 . 05, i .e ., P - v a l ue > α , ther ef or e , w e cannot re ject the null h ypothe sis that H o : σ 1 2 = σ 2 2 . Additional notes on linear re gression In t his sect i on w e elab or ate t he ideas of line ar regr ession pr esented earlier in the c hapter and present a pr ocedur e f or h ypothesis t esting of r e gr ession par ameters . T he m ethod of least squar es Let x = independent , non -r andom var iable , and Y = dependent , r andom vari abl e. Th e reg ress ion c u rve of Y on x is def ined as the re lationship betw een x and the mean of the corr esponding distr ibuti on of the Y’s . Assume that the r e gr essio n c ur v e of Y on x is linear , i .e ., mean dis tribu tion o f Y’ s is gi v en b y Α Β x. Y differ s fr om the mean ( Α Β⋅ x) b y a value ε , thu s Y = Α Β⋅ x ε , w her e ε is a random v ari able . T o v isually c hec k whether the data f ollo ws a linear tr end, dr a w a scatter gr am or scatter plot . Suppos e that w e ha ve n pair ed observati ons (x i , y i ); we pr edict y b y means of ∧ y = a b ⋅ x , wher e a and b ar e constant . Def ine the predi cti on err or as, e i = y i - ∧ y i = y i - (a b ⋅ x i ). The method of least squar es requir es us to choose a , b so as to min imi z e t he sum of squared e r rors (S SE ) the conditions 2 1 1 2 )] ( [ i n i i n i i bx a y e SSE − = = ∑ ∑ = = 0 ) ( = SSE a ∂ ∂ 0 ) ( = SSE b ∂ ∂
P age 18-51 W e get the , so -called, nor mal equations: T his is a s y stem o f linear equati ons w ith a and b a s the unkno w ns, whi c h can be sol v ed using the linear equation f eature s of the calculator . T her e is, ho w ev er , no need to bother wi th these calc ulations becau se y ou can use the 3. Fit Data … option in the ‚Ù men u as pr es ented ear lier . Additional equations f or linear regr ession T he summar y s tatisti cs suc h as Σ x, Σ x 2 , etc., can be u sed to def ine the follo wing quantiti es: Not es : Θ a,b ar e unbias ed estimat ors of Α, Β . Θ The Gau ss-Mar k o v theor em of pr obability indi cates that among all unbiased est imators for Α and Β , the leas t-squar e estimat ors (a ,b) ar e the most ef f ic ient. ∑ ∑ = = ⋅ ⋅ = n i i n i i x b n a y 1 1 ∑ ∑ ∑ = = = ⋅ ⋅ = ⋅ n i i n i i n i i i x b x a y x 1 2 1 1 ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ − = ⋅ − = − = ∑ ∑ ∑ = = = n i i n i i x n i i xx x n x s n x x S 1 1 2 2 1 2 1 ) 1 ( ) ( 2 1 1 2 2 1 2 1 ) 1 ( ) ( ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ − = ⋅ − = − = ∑ ∑ ∑ = = = n i i n i i y n i i y y n y s n y y S ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ − = ⋅ − = − − = ∑ ∑ ∑ ∑ = = = = n i i n i i n i i i xy n i i i xy y x n y x s n y y x x S 1 1 1 1 2 1 ) 1 ( ) )( (
Pa g e 1 8 - 52 F r om w hic h it fo llow s that the standar d dev iations o f x and y , and the co var iance of x ,y ar e giv en , r espec tiv el y , by , , and Also , the sample corr elation coeff ic ient is In ter ms of ⎯ x, ⎯ y, S xx , S yy , and S xy , the sol ution to the normal equations is: , Prediction error T he r egr essi on c urve o f Y on x is def ined as Y = Α Β⋅ x ε . If w e hav e a set of n data po ints (x i , y i ) , then w e can wr ite Y i = Α Β⋅ x i ε I , (i = 1,2 ,…,n) , wher e Y i = independent , normall y distr ibuted r andom var i ables w ith mean ( Α Β⋅ x i ) and the common var iance σ 2 ; ε i = independent , normall y distr ibuted r andom var i ables w ith mean z er o and the common var iance σ 2 . Let y i = actual data v alue , ^ y i = a b ⋅ x i = least-squar e pr edicti on of the data . T hen, the pr edicti on err or is: e i = y i - ^ y i = y i - (a b ⋅ x i ). An es timate of σ 2 is the , so -called , standar d e rr or of the estimate , Confidence inter v als and hy pothesis testing in linear r egr ession Her e are s ome concepts and equations r elated to statisti cal infer ence f or linear r egressi on: 1 − = n S s xx x 1 − = n S s yy y 1 − = n S s yx xy . yy xx xy xy S S S r ⋅ = x b y a − = 2 x xy xx xy s s S S b = = ) 1 ( 2 1 2 / ) ( )] ( [ 2 1 2 2 2 2 1 2 xy y xx xy yy i n i i e r s n n n S S S bx a y n s − ⋅ ⋅ − − = − − = − − = ∑ =
Pa g e 1 8 - 5 3 Θ Conf idence limits f or r egr essi on coeff ic i ents: F or the slope ( Β ): b − (t n- 2 , α /2 ) ⋅s e / √S xx < Β < b (t n- 2 , α /2 ) ⋅s e / √S xx , F or the inter cept ( Α ): a − (t n- 2 , α /2 ) ⋅s e ⋅ [(1/n) ⎯ x 2 /S xx ] 1/2 < Α < a (t n- 2 , α /2 ) ⋅s e ⋅ [(1/n) ⎯ x 2 / S xx ] 1/2 , w her e t f ollo w s the Student’s t distr ibuti on w ith ν = n – 2 , degree s of fr eedom, and n r epr ese nts the number of po ints in the sample . Θ Hy pothesis tes ting on the slope , Β: Null h y pothesis , H 0 : Β = Β 0 , tes ted against the alter nativ e h ypothesis , H 1 : Β≠Β 0 . The test stat istic is t 0 = (b - Β 0 )/(s e / √S xx ) , w her e t fo llo ws the Student’s t distr ibution w ith ν = n – 2 , degree s of fr eedom, and n r epr esen ts the number of points in the sample . The te st is car ri ed out as that o f a mean v alue h ypothe sis testing , i .e ., giv en the le v el of si gnif icance , α , deter mine the cr iti cal value o f t , t α /2 , then , r e ject H 0 if t 0 > t α /2 o r i f t 0 < - t α /2 . If y ou test f or the v alu e Β 0 = 0, and it turns out that the te st suggests that y ou do not r ej ect the null h y pothesis, H 0 : Β = 0, then , the v alidity of a linear r egr essi on is in doubt . In other w or ds, the s ample data does not support the ass ertion that Β≠ 0. Therefor e , th is is a test of the significanc e of the r egres sion model . Θ Hy pothesis tes ting on the inter cept , Α: Null h y pothesis , H 0 : Α = Α 0 , tes ted against the alte rnati v e h ypothe sis, H 1 : Α≠Α 0 . The te st statistic is t 0 = (a- Α 0 )/[(1/n) ⎯ x 2 /S xx ] 1/2 , w here t f ollo w s the S tudent’s t distr ibution w ith ν = n – 2 , degree s of f reedom , and n r epr esents the number of po ints in the sample . The test is car r ied out as that of a mean v alue hy pothesis tes ting, i .e ., gi ve n the lev el o f signif ic ance, α , det ermine the c riti cal value o f t , t α /2 , then , r ejec t H 0 if t 0 > t α /2 or if t 0 < - t α /2 . Θ Conf idence interv al for the mean v alue of Y at x = x 0 , i .e ., α β x 0 : a b ⋅ x− (t n- 2 , α /2 ) ⋅s e ⋅ [(1/n) (x 0 - ⎯ x) 2 /S xx ] 1/2 < α β x 0 < a b ⋅ x (t n- 2 , α /2 ) ⋅s e ⋅ [(1/n) (x 0 - ⎯ x) 2 /S xx ] 1/2 . Θ Li mits of pr edicti on: conf idence interv al for the pr edi cted v alue Y 0 =Y(x 0 ): a b ⋅ x− (t n- 2 , α /2 ) ⋅s e ⋅ [1 (1/n) (x 0 - ⎯ x) 2 /S xx ] 1/2 < Y 0 <
P age 18-54 a b ⋅ x (t n- 2 , α /2 ) ⋅s e ⋅ [1 (1/n) (x 0 - ⎯ x) 2 /S xx ] 1/2 . Pr ocedure f or inference statistics f or linear regression using the calculator 1) Ent er (x,y) a s columns of data in the statis tical matr i x Σ D AT. 2) Pr oduce a scatter plot f or the appr opr iat e columns o f Σ D A T , and use appr opri ate H- and V - VIEW S to chec k linear tr end . 3) Us e ‚Ù˜˜ @@@OK@@@ , to f it str aight line , and get a , b , s xy (Co var iance) , and r xy (Cor r elatio n) . 4) Us e ‚Ù˜ @@@OK@@@ , to obtain ⎯ x, ⎯ y, s x , s y . C olumn 1 w ill sho w the statis tic s for x w hile column 2 w ill sho w the statis tics f or y . 5) Calc ulate , 6) F or eit her confidence i ntervals or tw o - tai led tests, obta in t α /2 , w ith (1- α )100% conf idence , fr om t -dis tr ibution w ith ν = n - 2 . 7) F or one - or two -ta iled tes ts, f ind the value o f t using the appr opri ate equati on for e ither Α or Β . R ej ect the null h ypothe sis if P-value < α . 8) F or conf idence inte r v als us e the appr opr iate f ormulas as sho w n abo v e. Ex ample 1 -- F or the follo w ing (x ,y) dat a , determine the 9 5% conf idence interval f or the slope B and the inter cept A Enter the (x ,y) data in columns 1 and 2 of Σ D A T , r espe c t i v ely . A sc atterpl ot of the data sho ws a good linear tr end: Use the Fit Data.. opti on in the ‚Ù menu , to get: 3: '-.86 3.24*X' 2: Correlation: 0.989720 229749 x 2.0 2 .5 3.0 3.5 4 .0 y 5. 5 7 . 2 9 . 4 1 0 .0 1 2. 2 2 ) 1 ( x xx s n S ⋅ − = ) 1 ( 2 1 2 2 2 xy y e r s n n s − ⋅ ⋅ − − =
Pa g e 1 8 - 5 5 1: Covariance: 2.025 T hese r esults ar e interpr eted as a = -0.8 6 , b = 3 .2 4, r xy = 0.9 8 9 7 20 2 2 9 7 4 9 , and s xy = 2 . 0 2 5 . T he corr elati on coeff ic ient is c los e enough to 1. 0 to co nfir m the linear tr end obs erved in the gr aph . Fro m t he Single-var… opti on of the ‚Ù menu we fi nd: ⎯ x = 3, s x = 0.7 9 05 6 9 415 04 2 , ⎯ y = 8.8 6, s y = 2.588 0 49 45857 . Ne xt , wi th n = 5, calc ulate Co nfi dence int ervals f or the slope ( Β ) and in ter cept ( A): Θ F i r s t , w e o b t a i n t n- 2 , α /2 = t 3 , 0 .025 = 3 . 18 2 446 30 5 2 8 (See c hapter 17 f or a pr ogr am to sol ve f or t ν ,a ): Θ Next , we calc ulate the ter ms (t n- 2 , α /2 ) ⋅s e / √S xx = 3 .18 2… ⋅ (0.18 2 6…/2 . 5) 1/2 = 0.8 6 0 2… (t n- 2 , α /2 ) ⋅s e ⋅ [(1/n) ⎯ x 2 /S xx ] 1/2 = 3. 1 8 2 4 … ⋅√0 .18 2 6 … ⋅ [(1/5 ) 3 2 /2 . 5] 1/2 = 2 .6 5 Θ F inally , for the slope B , the 9 5% conf idence int er v al is (-0.8 6 -0.8 60 2 4 2 , -0.8 6 0.8 60 2 4 2) = (-1.7 2 , -0.000 2 4 217) F or the inter cept A, the 9 5 % conf idence interval is (3 .2 4 - 2 .6 514 , 3 .2 4 2 .6 514) = (0. 5 8 8 5 5,5 .89 14) . 5 . 2 42 7905694150 . 0 ) 1 5 ( ) 1 ( 2 2 = ⋅ − = ⋅ − = x xx s n S = − ⋅ ⋅ − − = ) 1 ( 2 1 2 2 2 xy y e r s n n s ... 1826 . 0 ) ... 9897 . 0 1 ( ... 5880 . 2 2 5 1 5 2 2 = − ⋅ ⋅ − −
P age 18-5 6 Ex ample 2 -- Suppos e that the y-data used in Ex ample 1 r e pr esent the elongation (in h undr edths of an inc h) of a me tal w ir e w hen sub jec ted to a f or ce x (in tens o f pounds) . The ph y sical phe nomenon is suc h that w e e xpect t he inter cept , A, to be z er o . T o chec k if that should be the ca se , w e test the nu ll h ypothe sis, H 0 : Α = 0 , against the alter nati ve h ypothe sis, H 1 : Α≠ 0, at the le v el of si gnif icance α = 0. 05 . The test stat istic is t 0 = (a- 0 )/[(1/n) ⎯ x 2 /S xx ] 1/2 = (-0.8 6)/ [(1/5) 3 2 /2 .5] ½ = -0.44117 . The c r itical value of t , for ν = n – 2 = 3, and α /2 = 0. 0 2 5, can be calc ulated using the numer ical s olv er f or the equation α = UTPT( γ ,t) de v eloped i n Ch ap te r 1 7 . I n t h is prog ram, γ r epre sents the degr ees of fr eedom (n - 2) , and α repr esents the pr obability of e x ceeding a cer t ain value o f t, i .e. , Pr[ t>t α ] = 1 – α . F or the pr esent e x ample , the v alue of the lev el of si gnifi cance is α = 0. 05, g = 3, and t n- 2 , α /2 = t 3, 0. 0 2 5 . A lso , f or γ = 3 and α = 0. 0 2 5, t n- 2 , α /2 = t 3, 0. 0 2 5 = 3 .18 2 446 30 5 2 8. Becau se t 0 > - t n- 2 , α /2 , w e cannot r ej ect the null h ypothe sis, H 0 : Α = 0 , against the alter nativ e h y pothesis , H 1 : Α≠ 0, at the le vel of si gnif icance α = 0. 05 . T his result sugges ts that taking A = 0 f or this linear r egr es sion should be acceptable . After all, the v alue we f ound f or a, w as –0.8 6, w hic h is r elati vel y cl ose to zero . Ex ample 3 – T est of si gnifi cance for the linear r egre ssion . T est the n ull h ypothe sis for the slope H 0 : Β = 0 , against the alte rnati v e h y pothesis, H 1 : Β≠ 0, at the lev el of signif icance α = 0. 0 5, for the linear f itting of Example 1. The test stat istic is t 0 = (b - Β 0 )/(s e / √S xx ) = (3 .2 4 -0)/( √0 . 1 8 26666666 7 /2.5) = 18.9 5 . The c riti cal value of t , f or ν = n – 2 = 3, and α /2 = 0. 0 2 5, wa s obtained in Ex ample 2 , as t n- 2 , α /2 = t 3, 0. 0 2 5 = 3 .18 2 44 6 3 05 2 8. Beca us e , t 0 > t α /2 , w e mus t r ej ect the null h ypothe sis H 1 : Β≠ 0, at the lev el of si gnifi cance α = 0. 05, f or the linear f itting of Ex ample 1.
P age 18-5 7 Multiple lin ear fitting Consi der a data set of the fo rm Suppo se that w e sear c h for a data f itting of the for m y = b 0 b 1 ⋅ x 1 b 2 ⋅ x 2 b 3 ⋅ x 3 … b n ⋅ x n . Y ou can obtain the least -sq uar e appro ximati on to the values of the coeffi cients b = [b 0 b 1 b 2 b 3 … b n ], b y putting together the matr i x X: __ __ Then , the v ector of coeffi c ients is obtained f r om b = ( X T ⋅ X ) -1 ⋅ X T ⋅ y , wher e y is the v ector y = [y 1 y 2 … y m ] T . Fo r e xample , us e the fo llo w ing data to obtain the multiple linear f itting y = b 0 b 1 ⋅ x 1 b 2 ⋅ x 2 b 3 ⋅ x 3, x 1 x 2 x 3 …x n y x 11 x 21 x 31 …x n1 y 1 x 12 x 22 x 32 …x n2 y 2 x 13 x 32 x 33 …x n3 y 3 ... .. ...... x 1,m-1 x 2, m - 1 x 3,m-1 …x n, m- 1 y m-1 x 1,m x 2, m x 3,m …x n, m y m 1x 11 x 21 x 31 …x n1 1x 12 x 22 x 32 …x n2 1x 13 x 32 x 33 …x n3 .... . ...... 1x 1,m x 2, m x 3,m …x n, m
P age 18-5 8 W ith the calculat or , in RPN mode , yo u can pr oceed as fo llo ws: F irst , w ithin y our HOME dir ect ory , cr eate a sub-dir ect or y to be called MPFI T (Multiple linear and P oly nomial data FI Tting) , and ent er the M P FIT su b- dir ectory . Within the sub-dir ectory , t y pe this pr ogr am: «  X y « X TRAN X * INV X TRAN * y * » » and stor e it in a v ar iable called MTRE G (MulT iple REGr essi on) . Ne xt , enter the matr ices X and b into the stac k: [[1,1.2 , 3 .1,2][1,2 .5, 3 .1,2 . 5 ][1, 3 . 5, 4. 5,2 .5] [1, 4, 4. 5, 3][1, 6 ,5, 3 . 5]] `` (k eep an e xtr a copy) [5 .7 , 8.2 ,5 .0, 8.2 , 9 .5] ` Press J @MTREG . T he r esult is: [- 2 .164 9…,–0.7144…,-1.7 85 0…, 7 . 09 41…], i. e. , y = - 2 .164 9–0.7144 ⋅ x 1 -1.7 8 50 × 10 -2 ⋅ x 2 7 . 09 41 ⋅ x 3 . Y ou should ha v e in y our calc ulator ’s stac k the value o f the matri x X and th e v ector b , the fitted v alues o f y ar e obtained fr om y = X ⋅b , thus , ju st pr ess * to obtain: [5 .63 .., 8. 2 5 .., 5 . 0 3 .., 8.2 2 .., 9 .4 5 ..]. x 1 x 2 x 3 y 1.20 3 .10 2 . 00 5 .7 0 2 .50 3. 10 2.50 8 .2 0 3.50 4 .50 2 .50 5.00 4. 00 4.5 0 3. 00 8.2 0 6.0 0 5.0 0 3.50 9 .5 0
P age 18-5 9 Compar e these f itted value s with the or iginal data as sho w n in the table belo w: P oly nomial fitting Consi der the x -y data set {(x 1 ,y 1 ), ( x 2 ,y 2 ), … , ( x n ,y n )}. Suppose that w e w ant to f it a poly nomial or or der p to this data set . In other w or ds, w e seek a f it ting of the f or m y = b 0 b 1 ⋅ x b 2 ⋅ x 2 b 3 ⋅ x 3 … b p ⋅ x p . Y ou can obta in the least-squar e appr o x imation t o the values of the coeff i c ients b = [b 0 b 1 b 2 b 3 … b p ], b y putting together the matr ix X __ __ Then , the v ector of coeffi c ients is obtained f r om b = ( X T ⋅ X ) -1 ⋅ X T ⋅ y , wher e y is the v ector y = [y 1 y 2 … y n ] T . In Chapter 10, w e def ined the V andermonde matr ix co rr esponding t o a v ector x = [x 1 x 2 … x m ] . T he V andermonde matr i x is similar to the matr i x X of inte r est t o the poly nomial f itting , but ha v ing only n , r ather than ( p 1 ) columns . W e can tak e adv ant age of the V ANDERMONDE functi on to c r eate the matr i x X if w e observ e the f ollo w ing rule s: If p = n- 1 , X = V n . If p < n- 1 , then r emo v e columns p 2 , …, n -1, n fr om V n to for m X . x 1 x 2 x 3 yy - f i t t e d 1.20 3 .10 2 . 00 5 .7 0 5 .6 3 2 . 5 0 3 .10 2 .5 0 8. 20 8.2 5 3.50 4 .50 2 .50 5.00 5.03 4. 00 4. 50 3 . 00 8.20 8.2 2 6.0 0 5.00 3.50 9 .50 9 . 4 5 1x 1 x 1 2 x 1 3 … x 1 p-1 y 1 p 1x 2 x 2 2 x 2 3 … x 2 p-1 y 2 p 1x 3 x 3 2 x 3 3 … x 3 p-1 y 3 p .... .. ....... 1x n x n 2 x n 3 … x n p-1 y n p
P age 18-60 If p > n- 1 , then add columns n 1, …, p-1, p 1 , to V n to for m matr ix X . In st ep 3 fr om this lis t , we hav e to be a war e that column i (i = n 1, n 2 , …, p 1 ) is the v ector [x 1 i x 2 i … x n i ]. If we w er e to use a list of data v alues f or x r ather than a v ector , i .e ., x = { x 1 x 2 … x n }, w e can easily calc ulate the sequenc e { x 1 i x 2 i … x n i }. Then , w e can transf or m this list into a v ector and us e the COL men u to add those columns t o the matri x V n until X is completed. Af ter X is r ead y , and ha v ing the vect or y av ailable , the calc ulation o f the coeff ic ient v ect or b is the same as in multiple linear f itting (the pr ev i ous matr i x appli cation) . T hu s, w e can w rit e a progr am to calculate the pol y nomial f itting that can tak e adv antage o f the pr ogram alr eady de v eloped f or multiple linear f itting . W e need to add to this pr ogr am the step s 1 thr ough 3 listed a bov e . Th e algo rithm f or the pr ogr am, ther ef or e , can be w r it t en as fo llow s: Enter v ectors x and y, of the same dimensio n, as lists . (Note: since the func tion V ANDERMONDE uses a lis t as input , it is mor e con veni ent to ent er the (x ,y) data as a list .) Also , enter the value o f p. Θ Det erm ine n = si z e of vec tor x . Θ Us e the functi on V ANDERMONDE t o gener ate the V ander monde matr i x V n fo r t he li st x enter ed. Θ If p = n-1 , then X = V n , Else If p < n-1 R emov e columns p 2 , …, n from V n to form X (Us e a FOR loop and COL -) Else Add columns n 1, …, p 1 to V n to for m X (FOR loop , calc ulate x i , con v er t t o vec tor , use COL ) Θ Conver t y to vector Θ Calc ul ate b using pr ogr am MTRE G (see ex ample on multip le linear fi tt i ng ab ove ) Her e is th e tr anslati on of the algor ithm to a pr ogr am in User RP L language. (See Cha pter 21 f or additional inf ormatio n on pr ogr amming) :
P age 18-61 « Open pr ogr am  x y p Enter l ists x and y , and p (le v els 3,2 ,1) « Open subpr ogram 1 x SI ZE  n Deter mine siz e of x list « Open subpr ogram 2 x V ANDERMOND E P lace x in stac k , obtain V n I F ‘ p<n -1’ THEN This IF implements st ep 3 in algorithm n P lace n in stac k p 2 Calculate p 1 FOR j Start loop j = n -1, n - 2 , …, p 1, st ep = -1 j C OL − D R OP Re mo ve column and dr op it fr om stac k -1 STEP C lose F OR -S T EP loop ELSE I F ‘ p>n -1’ THEN n 1 Calc ulate n 1 p 1 Calc ulate p 1 FOR j S tar t a loop w ith j = n , n 1, …, p 1. x j ^ C alculate x j , as a list OB J  ARR Y Con vert list to arr ay j C OL Add column to matr ix NEXT Clos e FOR -NEXT loop END Ends second IF cla use . END Ends fir st IF claus e. Its r esult is X y OB J  ARR Y Con ve r t lis t y to an ar r ay MTRE G X and y used b y pr ogr am MTRE G  NUM Con vert to dec imal fo rmat » Clos e sub-pr ogr am 2 » Clos e sub-pr ogr am 1 » Close main pr ogram Sa ve it in to a v ari able called P O L Y (P OL Ynomial f itting). As an ex ample , us e the fo llo w ing data to obtain a pol y nomial f itting w ith p = 2 , 3, 4 , 5, 6 .
P age 18-6 2 Becau se w e w ill be using the same x -y data for f itting poly nomi als of diff er ent or ders , it is adv isable to s av e the lists of data v alues x and y into v ari ables xx and yy , re specti vel y . This w a y , we w ill not ha ve to t y pe them all o v er again in eac h applicati on of the pr ogr am P OL Y . T hus , pr oceed as follo ws: { 2 . 3 3 .2 4. 5 1. 6 5 9 . 3 2 1.18 6 .2 4 3.4 5 9 .89 1. 2 2 } ` ‘x x ’ K {17 9 .7 2 5 6 2 .3 0 19 6 9 .11 6 5 .8 7 312 20.8 9 3 2 .81 6 7 31.48 7 3 7 .41 3 9 2 48.4 6 33. 45 } ` ‘y y ’ K T o f it the data to poly no mials use the f ollo w ing: @@xx@ @ @@yy@ @ 2 @POLY , R esult: [4 5 2 7 .7 3 -3 9 5 8.5 2 7 4 2 .2 3] i .e ., y = 4 5 2 7 .7 3-3 9 5 8.5 2x 7 4 2 .2 3x 2 @@xx@ @ @@yy@ @ 3 @POLY , R esult: [ –99 8. 05 13 0 3 .21 -5 05 .2 7 7 9 .2 3] i .e ., y = -99 8. 05 13 0 3 .21x -5 0 5 .2 7x 2 7 9 .2 3x 3 @@xx@ @ @@yy@ @ 4 @POLY , R esult: [20.9 2 –2 .61 –1.5 2 6 . 05 3 . 51 ] i .e ., y = 20 .9 2 - 2 .61x-1. 5 2x 2 6. 05x 3 3 .51 x 4 . @@xx@ @ @@ yy@@ 5 @POLY , R esult: [19 .0 8 0.18 –2 .9 4 6 . 3 6 3 .4 8 0. 00 ] i .e ., y = 19 . 08 0 .18x - 2 .9 4x 2 6 . 3 6x 3 3 .48 x 4 0. 001 1x 5 @@xx@ @ @@yy@ @ 6 @POLY , R esult: [-16.7 3 6 7 .17 –4 8.6 9 21.11 1. 0 7 0.19 0. 00] i. e. , y = -16 .7 2 6 7 .17x - 4 8.6 9x 2 21.11x 3 1. 0 7x 4 0.19x 5 -0. 00 5 8x 6 Selec ting the best fitting As y ou can s ee f r om the r esults a bov e, y ou can f it an y pol y nomial to a set o f data. T he question ar ises , whic h is the best fitting for the data? T o help one dec ide on the be st fi tting we can u se se v er al cr iter ia: xy 2. 3 0 1 79 . 72 3. 2 0 562 .3 0 4. 5 0 19 6 9 .11 1 . 65 65. 8 7 9 . 3 2 312 2 0.8 9 1.18 3 2 .81 6. 2 4 6 7 3 1 .48 3. 45 7 37 . 4 1 9 . 89 392 4 8 . 46 1.2 2 3 3 .4 5
P age 18-63 Θ T he corr elation coeff ic ient , r . Th is v alue is constrained to the r ange –1 < r < 1. Th e cl ose r r is to 1 or –1, the better the data fitting . Θ T he sum of squar ed err ors , S SE . This is the quantity tha t is to be minimi z ed by lea st-squar e appr oac h. Θ A plot o f r esi duals. T his is a plot o f the err or corr esponding to eac h of the or iginal data points . If these er r ors ar e completely r andom, the r esiduals plo t should sho w no par ti c ular tr end . Bef or e attempting to pr ogr am these cr iteri a , w e pre sent some de finiti ons : Give n th e vec to rs x and y of data to be f it to the pol ynomi al equation , w e f orm the matr i x X and use it to calc ulate a v ector o f poly nomi al coeff ic i ents b . W e can calc ulate a vec tor of fi t te d d at a , y ’, b y u s i n g y ’ = X ⋅ b . An err or vector is calculated b y e = y – y ’. Th e sum of s quar e err ors is equal t o the squar e of the magni tude of the err or vec tor , i .e ., S S E = | e | 2 = e •e = Σ e i 2 = Σ (y i -y’ i ) 2 . T o calc ulate the corr elation coeff ic ient w e need to calc ulate f irst what is kno wn as the su m of squar ed totals , S S T , def ined as S ST = Σ (y i - ⎯ y) 2 , wher e ⎯ y is the mean v alue of the ori ginal y values , i. e., ⎯ y = ( Σ y i )/n . In ter ms of S SE and S S T , the corr ela ti on coeff ic ient is de fined b y r = [1-(S SE/S S T)] 1/2 . Her e is the new pr ogr am inc luding calc ulation of S SE and r (Once mor e , consult the las t page of this c hapter to s ee ho w to pr oduce the v ar iable and command name s in the pr ogram): « Open pr ogr am  x y p Enter lists x and y , and number p « Open su bpr ogr am1 x SI ZE  n Determine si z e o f x list « Open su bpr ogr am 2
P age 18-64 x V ANDERMOND E P lace x in stac k, obtain V n I F ‘ p<n -1’ THEN This IF is step 3 in algor ithm n P lace n in stac k p 2 Calc ulate p 1 FOR j S tar t loop , j = n-1 to p 1, step = -1 j C OL − D R OP R emo ve column , drop f r om stac k -1 S TEP Clos e FOR -S TEP loop ELSE I F ‘ p>n -1’ THEN n 1 C alc ulate n 1 p 1 Calc ulate p 1 FOR j S tart loop w ith j = n , n 1, …, p 1. x j ^ Calc ulate x j , as a list OB J  ARR Y Co nv ert list to ar ra y j CO L A dd colu mn to matr i x NEXT Clos e FOR -NEXT loo p END Ends second IF claus e . END Ends fi rst IF c laus e. Pr oduces X y OB J   ARR Y Con v ert list y to an arr ay  X yv Enter matr i x and arr a y as X and y « Op e n subpr ogram 3 X yv MTRE G X and y us ed b y pr ogr am MTRE G  NUM If needed, con verts to floating po int  b R esulting ve ctor pass ed as b « Open subpr ogram 4 b yv P lace b and yv in s tac k X b * Calc ulate X ⋅b - Calcul ate e = y - X ⋅b A B S S Q DUP Calc ulate S SE , mak e copy y Σ LI S T n / C alculat e ⎯ y n 1  L IST SW A P C O N C re a t e ve c t o r of n va lu es o f ⎯ y yv − AB S S Q Calc ulate S S T / Calc ulate S SE/S S T NEG 1 √ C alc ulate r = [1–S SE/S S T ] 1/2 “ r ”  T A G T ag r esult as “ r ” SW AP Ex c hange stac k lev els 1 and 2
P age 18-6 5 “SSE”  T A G T ag r esult as S SE » Close sub-progr am 4 » C lose sub-pr ogr am 3 » C lose su b-pr ogr am 2 » Clo se sub-pr ogr am 1 » Clo se main pr ogram Sa ve this pr ogr am under the name P OL YR, to em phasi z e calc ulation of the correlation coeffic ient r . Using the POL YR pr ogram f or v alues of p between 2 and 6 pr oduce the fo llo w ing table of v alues o f the corr elation coeff i c ient , r , and the sum of sq uar e err ors , S SE: While the corr elati on coeffi c ient is v ery close to 1. 0 for all values of p in the table , the values o f S SE v ar y w idel y . T he smallest v alue of S SE corr esponds t o p = 4. Th us , y ou could selec t the pre fe rr ed pol y nomi al data fitting f or the or iginal x -y data as: y = 20.9 2 - 2 .61x -1. 5 2x 2 6 . 0 5x 3 3 . 51x 4 . pr S S E 2 0.9 9 71908 10 7 3114 0. 01 3 0 . 9999 7 68 886 1 9 . 3 6 4 0 . 9999999 7 . 48 5 0 . 9999999 8 .92 6 0 . 9999998 432 . 60
P age 19-1 Chapter 19 Numbers in Differ ent Bases In this Chapt er w e pre sent e x amples of calculati ons of number in bases other than the dec imal basis . Definitions T h e nu m b e r sys t e m u s e d fo r e ve r yd a y a ri t h m e t ic i s k n own a s t h e decimal syst em fo r it uses 10 (L atin , deca) digits , namely 0 -9 , to w r ite out an y real n umber . Compu ters , on the other hand , use a s y stem that is based on two po ssible states, or bi nar y sy stem . The se two s tates ar e r epre sented b y 0 and 1, ON and OFF , o r high -vo ltage an d lo w-v olt age . Co mput er s also u se n umber s ystems base d on eight digits ( 0 - 7) or oct al s y stem , and sixteen di gits (0 -9 , A -F) or he x adec imal . As in the d ec imal s ys tem , the relati ve positi on of di gits deter mines its v alue . In gener al, a number n in ba se b can be wr it ten as a ser i es of digits n = (a 1 a 2 …a n .c 1 c 2 …c m ) b . T he “ point” separ ate s n “integer” digits f r om m “ dec imal” digits . The v alue of the number , conv erted to o ur c usto ma ry dec imal s y stem , is calc ulated by using n = a 1 ⋅ bn -1 a 2 ⋅ b n- 2 … a n b 0 c 1 ⋅ b -1 c 2 ⋅ b -2 … c m ⋅ b -m . F or e x ample , (15 .2 34) 10 = 1 ⋅ 10 1 5 ⋅ 10 0 2 ⋅ 10 -1 3 ⋅ 10 -2 4 ⋅ 10 -3 , and (101.111) 2 = 1 ⋅ 2 2 0 ⋅ 2 1 1 ⋅ 2 0 1 ⋅2 -1 1 ⋅ 2 -2 1 ⋅ 2 -3 T he BA SE menu While the calc ulator w ould t y pi call y be oper ated using the dec imal sy stem , y ou can pr oduce calc ulati ons using the binary , octa l, or he x adec imal sy ste m . Man y of the func tions f or manipulating number s y stems other than the dec imal s y stem ar e av ailable in the B A SE menu , accessible thr ough ‚ã (the 3 k ey). With s y stem f lag 117 set to CHOOSE bo xes , the B ASE men u show s the fo llo w ing entr ies:
P age 19-2 W ith sy st em flag 117 set to S OFT menus, the B A SE menu sho ws the f ollo w ing: W ith this for mat , it is ev ident that the L OGIC, BIT , and B YTE entri es w ithin the B ASE menu ar e th emselv es sub-menus. These menus are discussed later in this Chapter . Functions HEX, DEC, OCT , and B IN Number s in non-dec imal s ys tems ar e wr itten pr eceded by the # s y mbol in the calc ulato r . The s ymbol # is r eadily a v ailable as „â (the 3 k ey). T o select w hich number s ys tem (c urr ent base) w ill be us ed for number s preceded b y #, select one o f the follo w ing functi ons in the fir st B ASE menu , i. e., HE X(adec imal) , DEC(imal), OCT(al) , or BIN(ary) . F or ex ample , if @HEX  ! is select ed, an y number w ritt en in the calculat or that starts w ith # w ill be a he xadec imal number . Th us , y ou can wr ite numbers su ch as #5 3, #A5B , etc. in this s y stem . As d iff er ent s y stems ar e s elected , the numbe rs w ill be automati cally con v er ted to the ne w c urr ent ba se . T he foll ow ing ex amples sho w the same thr ee numbers w r itten w ith the # s y mbol for dif f erent c urrent bases: HEX DE C OCT BIN
P age 19-3 As the dec imal (D E C) sy stem has 10 digits (0,1,2 , 3, 4,5, 6, 7 , 8 , 9) , the he xadec imal (HEX) sy stem has 16 digits (0, 1,2 , 3, 4 ,5,6 , 7 , 8 , 9 ,A,B ,C,D ,E ,F) , the octal (OCT) sy stem has 8 digits (0,1,2 , 3, 4,5, 6, 7) , and the binar y (BIN) s ys tem has only 2 di gits (0,1) . Conv ersion between number s ystems Whate ver the n umber s y stem selected , it is r ef err ed to as the binar y s yst em for the purpo se of using the f uncti ons R  B and B  R . F or ex ample, if @HEX  ! is select ed, the f uncti on B  R w ill conv ert any he xadec imal number (pr eceded by #) into a dec imal number , while the f uncti on R  B w or ks in the oppo site dir ecti on. T r y the f ollo w ing ex erc ises, HEX is the c urr ent base: T he follo wing e x amples sho w con ve rsi ons when the base is the octal s yst em: W e also pr es ent transf ormations u sing the binary s ys tem as the c urr ent bas e: Notice that e v ery time you en ter a number starting w ith #, you get a s the entr y the number y ou enter ed pr eceded b y # and f ollo wed b y the letter h, o , or b (he xadec imal, oc tal , or binary) . The ty pe of letter used as suff i x depends on w hich non-dec imal number s ys tem has been selected , i .e ., HEX, OCT , or BIN . T o see w hat happens if y ou se lect the @ DEC@ setting , tr y the f ollow ing conv ersions:
P age 19-4 T he only e ffec t of selecting the DE C imal s y stem is that dec imal numbers , whe n started w ith the s ymbol #, ar e wr itten with the suff ix d . W ordsi ze T he wor dsi z e is the number of b its in a b inar y obj ect . B y defa ult , the w ordsi z e is 64 bites . F uncti on RCW S (R eCall W ordSi z e) show s the c urr ent wor d si z e . F unction S T W S (Se T the W ordSi z e) allo w s the user to r eset the wo rdsi z e to any number betwee n 0 an d 6 4. Changing the w or dsi z e w ill affec t the wa y that binary intege r oper ations ar e perfor med . F or e x ample , if a b inary integer e x ceeds the cur r ent w or dsi z e, the leading bits w ill be dropped bef or e an y oper ation can be perfor med on suc h number . Operations w it h binary integers T he operati ons of additi on, subtr action , ch ange of sign , multiplicati on , and di v ision ar e def ined for b inar y integers . Some e x amples, o f addition and subtr acti on, ar e show n belo w , for diff er ent cur r ent base s: #A02h #12 Ah = #B2Ch #2562d # 298d = #2860d #5002o # 452o = #5454o #10100000 0010b #10010 1010b = #10110 0101100b #A02h - #12 Ah = #8D8h #2562d - # 298d = #2264d #5002o - # 452o = #4330o #10100000 0010b - #10010 1010b = #10001 1011000b
P age 19-5 The L OGIC m enu T he L OGIC menu , av ailable thr ough the B A SE ( ‚ã ) pr ov ides the f ollo wing fu nct ions : T he functi ons AND , OR, X OR (e x c lusi v e OR) , and NO T ar e logical f uncti ons. T he input to these f uncti ons ar e t w o v alu e s or e xpre ssi ons (one in the cas e of NO T) that can be e xpr esse d as binar y logi cal re sults, i .e ., 0 or 1. Compar isons o f numbers thr ough the comparison oper ators =, ≠ , >, <, ≤ , and ≥ , are logi cal stat ements that can be either tr ue (1) or false (0). Some e x amples of logi cal stateme nts ar e show n belo w : F uncti ons AND , OR, X OR , and NO T can be appli ed to compar ison stat ements under the f ollo wing r ules: T hese f uncti ons can be used to build logi cal stat ements fo r pr ogr amming purposes. In the conte xt of this Chapter , the y w ill b y used to pr ov ide the re sult of bit-b y-bit oper ati ons along the lines of the r ules pr o v ided abo v e . In the follo wing ex amp les , t he base number sy stem i s indica ted in pa r entheses: 1 AND 1 = 1 1 AND 0 = 0 0 AND 1 = 0 0 AND 0 = 0 1 OR 1 = 1 1 OR 0 = 1 0 O R 1 = 1 0 OR 0 = 0 1 X OR 1 = 0 1 X OR 0 = 1 0 X OR 1 = 1 0 XOR 0 = 0 NO T(1) = 0 NO T(0) = 1
P age 19-6 AND (BIN) OR (BIN) X OR (BIN) NO T (HEX) T he B I T menu T he BIT men u , av ailable thr ough the B ASE ( ‚ã ) pr ov ide s the follo w ing fu nct ions : F uncti ons RL, SL , A SR, SR, RR , contained in the BIT menu , ar e used to manipulate b its in a binary integer . T he def initi on of thes e func tions are sho wn belo w : RL: R otate L eft one bi t , e .g., #1100b  #11000b SL: Shift L eft one bit , e .g ., #1101b  #1101 0b A SR: Ar ithmetic Shift R ight one bit , e .g. , #1100010b  #110001b SR: Shift R igh t one bit , e .g., #11011b  #1101b RR: Rot ate R ight o ne bit , e .g ., #1101b  #10000000 0000000000000 0000000000000 0000000000000 000 000000000 001b
P age 19-7 T he B Y TE menu T he B YTE menu , av ailable thr ough the B A SE ( ‚ã ) pr o v ides the f ollo w ing fu nct ions : F uncti ons RLB, SLB , SRB , RRB, cont ained in the BIT menu , ar e used to manipulate b its in a binary integer . T he def initi on of thes e func tions are sho wn belo w : RLB: R otate Left one byte , e.g ., #110 0b  #110000000 000b SLB: Shift Left one b y te , e .g., #1101b  #11 0100000000b SRB: Shift R ight one b yte , e .g., #11011b  #0 b RRB: Rotate R ight one byte , e.g ., #1101b  #1101000000 000000000000 0000000000000 0000000000000 0 00000000000 b Hex adec imal numbers f or pi x el r efer ences M any pl ot opt ion spe c ific atio ns use pixel referen ces as inpu t , e .g., { # 3 3 2h #A2 3h } #Ah 0. 3 60. AR C, to dr aw an ar c of a c ir c le . W e use f uncti ons C  P X and P X  C t o conv ert quic kl y between u ser -unit coor dinates and p ix el r ef er ences . T hese f uncti ons can be found thr ough the command ca t alog ( ‚N ). Some e xamples ar e show n belo w :
Pa g e 2 0 - 1 Chapter 20 Customi zing menus and k e yboar d T hro ugh the use of the man y calc ulator menus y ou hav e become famili ar w ith the oper ati on of men us f or a v ar iety of appli catio ns. A lso , y ou ar e f amiliar w ith the man y func tions a vaila ble by u sing the k ey s in the ke yboar d , whether thr ough the ir main functi on , or b y combining the m wi th the left-shift ( „ ), r i g h t- shift ( ‚ ) or ALPHA ( ~ ) k ey s. In this Chapter w e pro vi de ex amples of cus to m i ze d m e nus a n d keyb o ard keys t ha t you m ay fin d us efu l in yo ur own applicati ons. Customizing menus A c ust om menu is a menu c r eated b y the user . T he spec if icati ons for the me nu ar e st or ed into the r eserved v ar iable s CS T . T hu s, to c r eate a men u y ou mus t put together this v ar iable w ith the f eature s that yo u want to dis play in y our menu and the actions r equir ed b y the soft menu k e y s. T o sho w ex a m ples of c usto mi zing menus w e need to set s y stem f lag 117 to S OFT menu . Mak e sure y ou do this bef or e con tinuing (See Cha pter 2 f or instr ucti ons on setting s y st em fla gs) . T he PR G/MODES/MENU menu Commands u sef ul in c us tomi zing menus ar e pr o vi ded b y the MENU menu , access ible thro ugh the PR G menu ( „° ) . S etting s y stem f lag 117 to S OFT menu , the s equence „°L @ ) MODES @) MENU pr oduces the f ollo wing MENU soft menu : T he functi ons av ailable ar e: MENU: A cti v ates a menu gi v en its number CS T : Ref er ence to the C S T v ari able , e .g., ‚ @@CST@@ show s CS T contents. TME NU: Use instead of MENU to c r eate a tempor ar y menu w ithout o verw riting the contents of CS T R CLMENU: R etur ns menu numbe r of c urr ent men u
Pa g e 2 0 - 2 M enu numbers (R CLMENU and MENU func tions) E ac h pre-defined men u has a number attac hed to it . F or ex ample, su ppose that y ou acti vate the MTH menu ( „´ ). Then , using the f uncti on catalog ( ‚N ) f ind functi on RCLMENU and acti vate it . In AL G mod e simple pr ess ` after RCLMENU() sho w s up i n the sc r een . T he r esu lt is the number 3 . 01. T hus , you can ac tiv ate the MTH me nu by u sing MENU(3.01) , in AL G , or 3.01 MENU , in RPN. Most me nus can be acti v ated w ithout kno w ing their numbers b y using the k e yboar d. T her e are , ho we v er , some men us not accessible thr ough the k e yboar d. F or ex ample , the soft menu S T A T S is only accessible b y using func tion MENU . Its number is 9 6. 01. Us e MENU(96.01 ) in AL G mode , or 96.01 MENU in RPN mode to obtain the S T A T so ft menu . Custom menus (MENU and TMENU functions) Suppos e that y ou need to acti vate f our func tions f or a partic ular appli cation . Sa y , that y ou need to be able t o quic kl y access the fu nctio ns EXP , LN, G AMMA and ! ( ~‚2 ) and yo u want to place them in a so ft me nu that yo u w ill k eep acti v e fo r a while . Y ou could do this by c r eating a tempor ar y menu w ith func tion TMENU , or a mor e permanent men u w ith functi on MENU . T he main diffe r ence is that func tion MENU c r eates v ar iable C S T , while TMENU doe s not . W ith var iable C S T c r eated permanentl y in y our sub-dir ect or y y ou can alw a ys r eacti v ate the menu using the s pecif i cations in C S T b y pr essing „£ . W ith TMENU the menu s pec ifi cati ons ar e lost after y ou replace the t empor ary menu w ith another one . F or ex ample , in RPN mode , a menu is cr eated by u sing: {EXP LN G AMMA !} ` TMENU ` or {EXP LN G AMMA !} ` MENU ` to pr oduce the f ollo wing men u: Not e : The n umber 9 6. 01 in this ex ample means the f irst (01) sub-menu o f menu 9 6.
Pa g e 2 0 - 3 T o acti vate an y of those functi ons y ou simply need to enter the f unction ar gument (a number ) , and then pr es s the corr es ponding soft menu k ey . In AL G mode , the list to be ent er ed as ar gument o f functi on TMENU or MENU is mor e complicated: {{“ exp ” , ”EXP( “},{“ln ” , ”LN( “},{“Gamma ” , ”G AM MA(“},{“!” , ”!( “}} T he r eason f or this is that , in RPN mode , the command names ar e both soft menu la bels and commands. In AL G mode, the co mmand names w ill pr oduce no acti on since AL G functi ons mus t be fo llo w ed by par enthes es and ar guments. In the list sho wn abo ve (f or the AL G mode) , w ithin each sub-lis t yo u hav e a label fo r the k e y , e.g ., “ exp ” , follo wed b y the w ay that the f uncti on w ill be enter ed in the stac k so that the ar gument to the f unction can be typed at the pr ompt, e .g., “EXP( “ . W e need not w orry about the closing par enthesis, because the calc ula tor will complete the par entheses befor e e xec uting the function . The implementati on of f uncti on TMENU in AL G mode w ith the ar gument list sho w n abo ve is as follo ws . F irs t, w e enter the list , then w e pr oduce the temporary menu (s ee menu k e y labels) b y us ing func tion TMENU(ANS(1) ) . W e also sho w , in the le ft -hand side , the r esult of pr essing the @@exp ! so ft menu k e y , i .e ., the pr ompt EXP( . A fter typ ing 8` the r esult of the oper ation is sho wn in the r ight- hand si de: A simpler v ersi on of the men u can be de fi ned by u sing MENU({{”EXP( “ , “LN(“ , “G AMMA( “ , ”!( “}) . Enhanced RPN menu T he list pr esen ted abo ve f or the AL G mode , can be modifi ed sli ghtly to u se in the RPN mode . T he modifi ed list w ill look lik e this: {{“ exp ” ,EXP},{“ln ” ,LN},{“G amma ” ,G A MMA },{“!” ,!}}
Pa g e 2 0 - 4 Y ou can try using this list w ith TMENU or MENU in RPN mode to ve rify that y ou get the same menu a s obtained ear lier in AL G mode . M enu specification and CST v a r iable F r om the tw o e xer c ises sho wn abo v e w e notice that the most general men u spec if icati on list include a n umber of sub-lists equal to the number of items to be displa y ed in y our c ustom me nu . Eac h sub-lis t contains a labe l for the men u k e y fo llo we d by a f unction , e xpr essi on , label , or other objec t that constitutes the eff ect of the menu k ey w hen pr ess ed. C are m ust be e x er c ised in spec ifying the menu list in AL G mode ver sus RPN mode . In RPN mode , the menu k e y acti on can be simply a calc ulator command (e .g., EXP , LN, etc ., as sho w n abov e ), w hile in AL G mode it has to be a str ing w ith the command pr ompt wh ose ar gument needs to be pr o v ided b y the user bef or e pr essing ` and completi ng the command. T he e x amples abo ve illu str ate the diff er ence . T he gener al fo rm of the ar gument list f or commands TMENU or MENU in AL G mode is {“label1” , ”functi on1(“ , ”ls1(“ , ”rs1(“}, {“label2” , “func tion2(“ , ”ls2(“ , ”r s2( “},…} While , in RPN mode , the ar gument lis t has this for mat {“label1” , functi on1, ls1, rs1}, {“label 2” , func tion2 , ls2 , rs2},…} In these spec ifi cations , func tion1, f uncti on 2 , etc., r epre sent the main oper ati on of the k ey , w hile ls1, ls2 , …, et c., r epres ent the le ft -shift oper ation o f the k e y . Similarl y , rs1, r s2 , …, etc ., r e pr esent the r ight-shift oper ation o f the k e y . This lis t w ill be stor ed in v ari able CS T if command MENU is used . Y ou can hav e a diffe r ent CS T var iable in each su b-dir ectory , and y ou can al w ay s r eplace the c urr ent conte nts of CS T with tho se of other var i ables stor ing the pr operl y fo rmatted list to pr oduce anothe r cu stom menu . Not e : Y o u can use a 2 1x8 GROB ( See Chapter 2 2) to pr oduc e an icon i n the so ft menu k e ys . As an e xam ple , try , in RPN mode: {{GR OB 21 8 0 0000EF9 08FFF9 00FFF9B 3FFF9A2FFF9A3F FF9A0FFF3 8 8FF “hp ” }} ` MENU T his w ill place the hp logo on ke y A . Pr es sing A places the t ext ‘hp ’ in the command line .
Pa g e 2 0 - 5 Customizing the k e y board E ach k ey in the k e yboar d can be i dentif ied by tw o numbers r e pr esenting their r o w and column. F or e xam ple , the V AR ke y ( J ) is located in r o w 3 of column 1, and w ill be r ef er red t o as k ey 31. No w , since each k e y has up t o ten func tions as soc iated w ith it , eac h func tion is spec if ied b y dec imal di gits between 0 and 1, acco rding t o the follo w ing spec if icati ons: . 0 or 1, unshifted k e y 0. 01 or 0.11, not applicable .2 , k e y combined w ith „ .21, k ey si multaneous w ith „ . 3, ke y combined w ith ‚ .31, k ey sim ultaneou s w ith ‚ .4 , ke y combined w ith ~ .41, k e y comb ined w ith ~ . 5, ke y combined w ith ~„ . 51, ~ key si m ul t an e ou s wit h „ .6 , k e y combined w ith ~‚ .61, ~ k ey sim ultaneou s w ith ‚ T hus , the V AR functi on w ill be r ef err ed to as k e y 31. 0 or 31.1, w hile the UPDIR func tion w ill be k ey 31.2 , the COP Y func tion w ill be k ey 31. 3, the upper -case J is k e y 31.4, and lo wer case j is k ey 31. 5 . (K e y 31.6 is not defi ned) . In gener a l , a k e y w ill be desc r ibed b y the arr angement XY .Z , wher e X = r ow number , Y = column number , Z = shifting. W e can combine a gi ven k ey w ith the U SER k e y (left -shift ass oc iated w ith the ~ key , o r „Ì ) to cr eate a c ustomi z ed ke y action . In pr inc iple , the entir e k ey board can be r e -def ined to perfor m a number of c ustomi z ed oper ations . T he PR G/MODES/KE Y S sub-menu Commands u sef ul in c ust omi zing the k e y board ar e pr ov ided by the KE Y S menu access ible thro ugh the PR G menu ( „° ) . S etting s y stem f lag 117 to S OFT menu , the sequence „ °L @ ) MODES @ ) KEYS pr oduces the f ollo w ing KEY S soft menu:
Pa g e 2 0 - 6 T he functi ons av ailable ar e: A SN: Assigns an ob ject to a k ey spec ifi ed by XY .Z S T O KE Y S : Stor es user -d ef ined k e y l ist RC LK EY S : Ret ur ns cu rr en t use r-de fin ed key l ist DELKEY S: Un -assi gns one or mor e ke ys in the c urr ent user -d e f ined ke y list , the ar guments ar e either 0, to un -assi gn all use r -def ined k e ys , or XY .Z , to un -assi gn k e y XY .Z . Recall curr ent user-def ined k e y list Use command RCLKE Y S to see the cur r ent user -defined k ey list . Be for e any user -def ined ke y assignments , the r esult should be a list containing the letter S , i. e. , { S } . Assign an object to a user-defined k ey Suppo se that y ou w ant to ha v e access t o the old-fashi oned PL O T command f irst intr oduced w ith the HP 4 8G ser ies calc ulator , but c urr entl y not direc tly a v ailable fr om the k ey b oar d. T he menu nu mber for this menu is 81. 01. Y ou can see this menu ac ti ve b y using AL G mode: MENU(81. 01) RPN mode: 81.01 ` MENU ` If y ou wan t to ha v e a quick w a y to acti vate this menu f r om the ke yboar d , y ou could as sign this menu to the GRAPH k ey ( C ) wh os e ref ere n ce n u mb e r i s 13 . 0, i .e ., fi rst r o w , thir d column , main func tion . T o assi gn an obj ect to a k e y use function A SN , as follo ws: AL G mode: ASN(<<MENU (81.01)>>,13. 0) RPN mode: < < 18.01 MENU >> ` 13.0 ` ASN Another usef ul menu is the ori ginal S OL VE menu (descr ibed a t the end of Chapte r 6 in this Guide) , w hi ch can be ac ti vat ed by u sing ‚ (hold) 7 .
Pa g e 2 0 - 7 Operating user-defined ke ys T o oper a t e this user -def ined k e y , enter „Ì be fo re pre ssing the C key . Notice that afte r pre ssing „Ì the sc r een sho w s the spec ifi cation 1US R in the second displa y line . Pr essing f or „Ì C for this e xample , you should r eco v er the P L O T menu as follo ws: If y ou hav e more than o ne user -def ined k e y and wan t to oper ate mor e than one of them at a time , y ou can lock the k e yboar d in USER mode by enter ing „Ì„Ì befor e pres si ng the user-defined ke ys. W it h the ke y boa r d loc k ed in USER mode , the spec ifi cation USR w ill be sho wn in the second displa y line . T o unlock the k e yboar d pr ess „Ì once mor e. Un-assigning a user-defined k ey T o r emo v e the assignme nt perfor med abo v e , use f uncti on DELKEY S, as f ollo ws: AL G mode: DELKEYS(13.0) RPN mode: 13.0 ` DELKEY S ` Assigning multiple user-defined k e ys T he simples t w ay to assign se v er al use r -def ined is t o pro vi de a lis t of comman ds and k e y spec ifi cations . F or e x ample , suppose that w e assi gn the three tr igonometr ic f uncti ons (SIN, C OS , T AN) and the thr ee hy perboli c func tions (SINH , CO SH, T ANH) to k ey s A thr ough F , r especti v ely , as u ser -def ined k e y s. In RPN mode use: {SIN ʳ11.0 ʳ COS ʳ12.0 ʳ TN ʳ 13.0ʳ SINHʳ 14.0ʳ COSHʳ 15.0ʳ TN H ʳ 16.0} ` STOKEYS ` In AL G mode us e: STOKEYS({" SIN(" , 11.0, "C OS(", 12.0, "T N(", 13.0 , "SINH(", 14 .0, "COSH(", 15 .0, "T NH(", 16.0}) ` Oper ate thes e k ey s by using , f or e xample , in RPN mode: 5„ÌA 4„ÌB 6„ÌC 2 „ÌD 1„ÌE 2„ÌF
Pa g e 2 0 - 8 T o un -assign all user -defined k ey s use: AL G mode: DELKE YS(0) RPN mode: 0 DELKEYS Chec k that the use r -k e y def initions w er e r emov ed b y using f unction R C LKE Y S.
P age 21-1 Chapter 21 Pr ogr amming in User RP L language Use r RP L language is the pr ogramming language mo st commonl y used to pr ogr am the calculator . The pr ogram com ponents can be put together in the line editor by inc luding them betw een pr ogram container s « » in the appr opr iat e orde r . Because ther e is more e xperi ence among calc ulator us ers in pr ogr amming in the RPN mode , most of the e xamples in this Chapter w ill be pr esen ted in the RPN mod e . Also , to fac i lit ate enter ing progr amming commands , w e suggest y ou s et s y ste m flag 117 to S OFT men us. The pr ograms w ork eq uall y we ll in AL G mode once they ha v e been debugged and tes ted in RPN mode . If y ou pr ef er to w ork in the AL G mod e , simply lear n ho w to do the pr ogr amming in RPN and then reset the oper ating mode to AL G to run the pr ogr ams. F or a simple e xample o f User RPL pr ogr amming in AL G mode , r ef er to the las t page in this c hapter . An e x ample of progr amming T hroughou t the pr e vi ous C hapters in this guide w e hav e pr esent ed a number of pr ogr ams that can be used f or a var iety of applicati ons (e .g ., pr ogr ams CRMC and CRMT , us ed to cr eate a matr ix out o f a number of lists , w er e pr esen ted in Chapt er 10) . In this secti on w e pre sent a simple pr ogram t o intr oduce concepts r elated to pr ogramming the calc ulator . The pr ogr am we wi ll wr ite w ill be used to define the f unction f(x) = sinh(x)/(1 x 2 ) , w hic h accepts lists as a r gument (i .e ., x can be a list of numbers , as descr i bed in Chapter 8). In C hapter 8 we indicat ed that the plus sign , , ac ts as a co ncatenati on oper ator f or lists and n ot to produce a term-by- ter m su m . Inste ad , y ou nee d to use the A DD operator to achi ev e a term-b y- te rm summation o f lists. T hus , to def ine the func tion sho wn abo v e we will u se the f ollo wing pr ogram: « 'x' STO x SINH 1 x SQ A DD / 'x' PURGE » T o k e y in the pr ogr am fol lo w these ins truc tions: K ey str ok e sequence : Pr oduce s: Interpr eted as: ‚å « S tart an RP L progr am ['] ~„x™K 'x' STO St ore le vel 1 i nt o vari ab le x ~„x x P lace x in lev el 1 „´ @) HYP @SINH SINH Calc ulate sinh of lev el 1 1 #~„x „º 1 x SQ Ent er 1 and calc ulate x 2
P age 21-2 „´ @LIST @ADD@ AD D Calc ulate (1 x 2 ), / / then div ide ['] ~„x™ 'x' „° @) @MEM@@ @) @DIR@@ @ PURGE PURGE Purg e variab l e x ` Pr ogr am in lev el 1 ___________ ____________ __________ _______ ______________ T o sa v e the pr ogra m use: ['] ~„gK Press J to reco ver y our v ar iable menu , and ev aluate g(3 .5 ) by entering the v alue of the ar gument in le ve l 1 ( 3.5` ) and then pre ssing @@@g@@@ . Th e re s u lt i s 1 . 2 4 85… , i. e. , g (3.5 ) = 1 . 2 485. T r y a l so o b ta i n i n g g ({ 1 2 3 } ) , by enter ing the list in le vel 1 of the dis play : „ä1#2#3` and pr essing @@@g@@@ . T he r esult no w is {SINH(1)/2 S INH( 2)/5 SINH(3)/10}, if yo u r C AS i s se t t o EXACT mode . If y our CA S is set to AP PR OX IMA TE mode , the r esult w ill be {0. 5 8 7 6.. 0.7 2 5 3… 1. 0017…}. Global and local var iables and subprogr ams Th e p r o gra m @@@g@@@ , def ined abo v e , can be display ed as « 'x' STO x SINH 1 x S Q ADD / 'x' PURGE » by us in g ‚ @@@g@@@ . Notice that the pr ogram us es the v ari able name x to st or e the value placed in le vel 1 of stac k thr ough the pr ogr amming steps 'x' STO . The v ari able x, w hile the pr ogram is ex ecuting, is stor e d in y our variable menu as a n y other variable y ou had pr e vi ou sly st or ed . After calc ulating the func tion , the pr ogr am pur ges (er ase s) the var iable x s o it will not sho w in your v ar iable men u after f inishing e valuating the pr ogr am. If w e w er e not to pur ge the v ar iable x w ithin the pr ogr am its value w ould be av ailable to us after pr ogram e xec ution . F or that r eason, the v ari able x, as used in this pr ogr am, is r ef err ed to as a global va riab le . One impli cation o f the use o f x as a global v ar ia ble is that , if w e had a pr ev ious ly def ined a v ari able w ith the name x, its v alue w ould be r eplaced b y the v alue that the pr ogr am uses and then co mpletel y r emo v ed fr om y our va riab l e m en u a f te r p rog ra m exe cut ion. F r om the po int of v ie w of pr ogr amming , ther efor e , a global var i able is a v ari able that is accessible to the u ser after pr ogr am e xec ution . It is possible to
P age 21-3 use a local v ar iable w ithin the pr ogram that is only de fi ned for that pr ogr am and w ill not be a v ailable fo r use afte r pr ogr am e xec ution . The pr e v iou s pr ogr am could be modifi ed to r ead: « → x « x SINH 1 x SQ ADD / »» T he arr ow s ymbol ( → ) is obtain ed by comb ining the r ight-shift k e y ‚ w ith the 0 key , i. e. , ‚é . Als o , notice that ther e is an additional set o f pr ogr amming sy mbols (« ») indi cating the ex iste nce of a sub-pr ogr am , namely « x SINH 1 x SQ ADD / », w ithin the main progr am. T he main pr ogr am st ar ts w ith the combination → x , whi c h r epr ese nts assi gning the v alue in lev el 1 of stac k to a local var ia ble x. T hen, pr ogramming f lo w continues w ithin the sub- pr ogr am by pl ac ing x in the stack , e valuating SINH(x), plac ing 1 in the s tack , plac ing x in th e stac k, squaring x , adding 1 to x , and di vi ding stac k le vel 2 ( SINH(x) ) by s tack le vel 1 ( 1 x 2 ) . T he pr ogr am contr ol is then passed bac k to the main pr ogr am, but ther e are no mor e commands be t w een the fir st se t of c losing pr ogr amming s ymbo ls (») and the second one , ther ef or e , the pr ogr am ter minates . The las t value in the st ack , i . e ., SINH(x) / ( 1 x 2 ) , is r etur ned as the pr ogr am output . T he var i able x in the last v er sion o f the pr ogr am nev er occu pie s a place among the var iable s in y our var iable men u . It is operated upon w i thin the calc ulator memory with out affec ting an y similarl y named var iable in y our v ari able menu . F or that r eason, the v ariable x in this case is r ef err e d to as a v ar iable local to the pr ogr am, i .e ., a local var iable . Not e : T o modify pr ogr am @@@g@@@ , place the progr am name in the stack ( ³ @@@g@@@ ` ), t he n u s e „˜ . Us e the arr o w ke ys ( š™—˜ ) to mo v e about the pr ogr am. U se the backs pace/delete k e y , ƒ , to delete any un wanted c harac ters. T o add pr ogram containers (i .e ., « ») , use ‚å , since these s ymbols come in pairs y ou w ill ha ve t o enter them at the st ar t and end of the sub-pr ogram and delete o ne of its components w ith the delete k e y ƒ to pr oduce the r equir ed pr ogr am , namely :
P age 21-4 Global V ariable Scope An y var iable that y ou def i ne in the HO ME dir ectory or an y other dir ecto r y or sub-dir ectory w ill be consider ed a global var iable fr om the point o f vi ew of pr ogr am dev elopment . Ho we v er , the sco pe of suc h v ari able , i .e ., the locati on in the dir ecto r y tr ee w her e the var iable is acces sible , w ill depend on the location o f the var i able w ithin the tr ee (see Cha pter 2) . The r ule to deter mine a var iable ’s scope is the follo wing : a global v ari able is access ible to the dir ectory wher e it is defi ned and to any sub-dir ectory at tac hed to that dir ectory , unless a v ari able w ith the same name e xists in the sub- dir ectory under consi der ation . Cons equences of this rule ar e the follo wing: Θ A global var iable def i ned in the HOME dir ectory will be accessible f r om an y dir ecto r y w ithin HOME , unless r edefined w ithin a direc tory or sub- dir ectory . Θ If yo u r e -define the v ar iable w ithin a dir ecto r y or su b-dir ectory this def initi on tak es pr ecedence o ve r an y other def inition in direc tor ies a bo ve the c urr ent one . Θ When running a pr ogr am that r efe re nces a gi v en global var iable , the pr ogr am w ill us e the value of the global v ar iable in the dir ectory fr om w hic h the pr ogr am is in v ok ed . If no v ar iable with that name ex ist in the in vo king direc tory , the pr ogram w ill sear ch the dir ector ies abo v e the c urr ent one , up to the HOME directory , and use the value corr espond ing to the v ari able name under consider ation in the c los est dir ect or y a bov e the cu rren t on e. A pr ogr am def ined in a giv en dir ector y can be acc esse d f rom that dir ector y or an y of its sub-dir ector i es. « → x « x SINH 1 x SQ ADD / »» . When done editing the pr ogram pr ess ` . The modif i ed pr ogram is s tor ed back into var iable @@g@@ .
P age 21-5 Local V ariable Scope L ocal var iable s are ac tiv e only w ithin a pr ogr am or sub-pr ogram . The r ef or e , their scope is limited t o the pr ogr am or sub-pr ogram w her e the y’r e def ined . An e x ample of a local v ari able is the inde x in a F OR loop (des cr ibed late r in this chapter ) , f or e x ample « → n x « 1 n FOR j x NEXT n  LIST »» Th e PRG m en u In this secti on w e pr esent the cont ents of the P RG (pr ogr amming) menu w ith the calc ulator’s s ys tem flag 117 s et to S O F T menus. W ith this flag setting sub- menu s and commands in the PR G menu w ill be sho w n as so ft menu labe ls. T his fac ilitates e nter ing the pr ogramming commands in th e line editor w hen y ou ar e putting together a pr ogram . T o access the P RG men u use the k e y str ok e combinati on „° . Wi thin the PRG m enu w e iden ti fy the fol low in g s ub- men us ( press L to m o ve to the next collec tion o f sub-men us in the PR G menu): Her e is a br ief de sc ripti on of the contents of these sub-me nus , and their sub- menus: S T A CK: F uncti ons for manipulating elements of the RPN stac k MEM: F u nc tions r elated to memory manipulation DIR: F unctions r elated to manipulating dir ector i es ARI TH: F unctions to manipulate indices st or ed in var ia bles BR CH: C ollecti on of sub-me nus w ith pr ogram br anching and loop f uncti ons IF: IF - THEN -ELSE -END constr uct f or br anc hing CA SE: CA SE - THEN -END constr uct f or br anching All the se rule ma y sound conf using f or a ne w calculat or user . The y all can be simplif ied to the f ollo w ing suggestio n: Cr eate dir ector ie s and sub-dir ector ie s w ith meaningful name s to or gani z e yo ur data, and mak e sure y ou hav e all the global v ari ables y ou need within the pr oper sub-dir ectory .
P age 21-6 S T ART : S T AR T -NEXT -S TEP constru ct f or br anching FOR: F O R - NE XT- S TEP constr uct f or loops DO: DO-UNT IL -END construc t for loop s WHILE: WHILE-REP EA T-END c onstru ct f or loops TE S T : Compar iso n operator s, logi cal oper ators , flag t esting f unctio ns TYPE: F uncti ons for conv erting objec t types , splitting objec ts, etc . LIS T : F unc tions r elated t o list manipulation ELEM: F unc tions f or manipulating elements of a list PR OC: F uncti ons for a pply ing procedur es to lists GR OB: F uncti ons for the manipulatio n of gr aphi c obj ects PIC T : Fun ction s for drawing pictu r es in th e g r ap hics screen CHAR S: F uncti ons for char a c ter str ing manipulation MODE S: F uncti ons fo r modif y ing calc ulator modes FMT : T o change number f ormats , comma for mat ANGLE: T o change angle measur e and coordinat e s ys tems FL A G: T o set and un-set f lags and chec k their s tatus KE Y S: T o def ine and acti vate u ser -de fined k ey s (Cha pter 20) MENU: T o def ine and acti vate c us tom menus (Cha pter 20) M ISC: Mi sc el la ne ous mo d e ch an ge s ( be ep, clo ck, e tc. ) IN: F uncti ons fo r pr ogr am input OUT : F u nc tions f or pr ogr am output T IME: T ime -r elated func tions ALRM: Alarm manipulati on ERR OR: F uncti ons fo r err or handling IFERR: IFERR- THEN -ELSE -END constru ct f or err or handling RUN: F uncti ons for r unning and debugging progr ams Nav igating t hr ough RPN sub-menus St ar t w ith the k ey str ok e combinati on „° , then pre ss the appropr iate soft- menu k ey (e .g., @)@MEM@@ ) . If y ou want to access a sub- menu withi n thi s sub- menu (e .g ., @) @DIR@ @ w ithin the @)@MEM@@ sub-menu), pre ss the cor r esponding k ey . T o mov e up i n a sub- menu , pr ess the L k ey until y ou f ind either the r ef er ence to the upper sub-men u (e .g., @)@MEM@@ w ithin the @)@DIR@@ sub-me nu) or to the P RG menu (i .e ., @) @PRG@@ ).
P age 21-7 Functions listed b y sub-menu T he follo wing is a lis ting of the func tions w ithin the P RG sub-menus lis ted b y sub- menu . ST A CK MEM/DIR BRCH/IF BRCH/WHILE TYPE DUP PUR GE IF WHILE OB J  SW A P RC L T H E N R E P E A T  ARR Y DR OP S T O ELS E END  LIS T O VER P A TH END  ST R RO T CRDIR TES T  TA G UNRO T P GDIR BRCH/CA SE ==  UNIT RO LL V A RS C A S E ≠ C R RO LL D T V ARS T HE N < R  C PIC K O RD ER E ND > N UM UNPICK ≤ CHR PICK3 MEM/ARI TH BRCH/S T ART ≥ DT AG DEP TH S T O S T AR T AND E Q  DUP2 S T O- NEXT OR TYP E DUPN S T O x S TE P X OR VTYP E DR OP2 S T O/ NO T DR OPN INCR BRCH/F OR SA M E LIST DUPDU D E CR FOR TYPE OB J  NIP S INV NEXT SF  LIS T NDUPN SNE G S TEP CF S UB SC O N J F S ? R E P L MEM BR CH/DO FC? PU RG E BRCH DO F S?C MEM IFT UNT IL FC?C B Y TE S IFTE END LININ NEW OB AR CHI RE S T O
P age 21-8 LIS T/ELEM GROB CHARS MODES/FLAG MO DE S/M ISC GE T  GR OB SUB SF BEEP GE TI BL ANK REPL CF CLK PU T GO R POS FS? S Y M PU TI G X O R SIZ E F C? STK S IZE S UB NUM F S?C ARG P O S REP L CHR F S?C CMD HEAD  LC D O B J  FC?C INF O TA I L LC D  ST R STO F SIZE H EA D RC LF IN LIS T/PR OC ANIMA TE T AI L RE SE T INF ORM DOLIS T SREP L NO V AL DO SUB PIC T MOD ES/ KEY S CHOO SE NSUB PI CT MODES/FMT ASN I N PUT ENDS UB PDIM S TD S T OKEY S K E Y S TREAM LINE FI X RE CLKE Y S W AIT REVLI S T TLINE S CI DELKE Y S P R OMP T SO RT BO X E N G SE Q AR C FM, MODES/MENU OUT PIXON ML ME NU PV IE W PIXOF CS T TEX T PIX? MODES/ANGLE TMENU CLL CD PVIEW DE G RCLMENU DISP PX  C RAD FREE ZE C  P X GRAD M S GBO X RE CT BEEP CY LI N SPHERE
P age 21-9 Shortc uts in the PR G menu Man y of the func tions lis ted abo ve f or the P RG menu ar e r eadily a v ailable thr ough other means: Θ C omparison oper ators ( ≠ , ≤ , <, ≥ , >) ar e av ailable in the k ey boar d. Θ Man y fu ncti ons and settings in the MODE S sub-menu can be acti vated b y using the input f uncti ons pr ov ided by the H key . Θ F unctions f ro m the TIME sub-menu can be acce ssed thr ough the keys tro ke c o m bi n at io n ‚Ó . Θ F unctions S T O and RCL (in MEM/DIR sub-menu) ar e av ailable in the k e yboar d thr ough the k e ys K and „© . Θ F unctions R CL and P URGE (in MEM/DIR sub-menu) ar e a vaila ble thr ough the T OOL menu ( I ). Θ W ithin the BRCH sub-men u , pr essing the left-shift ke y ( „ ) or the right- shift k e y ( ‚ ) bef or e pr essing an y of the sub-men u k e y s, w ill c r eate constr ucts r elat ed to the sub-men u ke y c ho sen . This onl y wor ks w ith the calc ulato r in RPN mode . Examples ar e sho wn belo w : TI ME E RROR R UN DA T E D O ER R D B U G  D A TE ERRN S S T TI M E E R R M SST ↓  TIME ERR0 NEXT TI CK S L AST A RG H AL T KI LL TIME/ALRM ERROR/IFERR OFF AC K I F E R R AC K A L A R M T H E N STOA L A R M E LS E R C LALA R M E ND DELALARM FIND AL ARM
P age 21-10 „ @ ) @IF@@ „@CASE@ „ @ ) @IF@@ „@CASE@ „ @ ) START „ @) @FOR@ „ @ ) START „ @) @FOR@ „ @ ) @@DO@@ „ @WHILE Notice that the ins ert pr ompt (  ) is av ailable aft er the k ey w or d fo r each constr uct s o yo u can start t y ping at the r ight locatio n. K e y strok e sequence for commonl y used commands T he follo wing ar e k e y str ok e sequences to acces s commonly us ed commands f or numer ical pr ogr amming w ithin the PR G menu . The commands ar e fir st list ed by menu:
P age 21-11 @) STACK DUP „° @) STACK @@ DUP@@ SW A P „° @) STACK @ SWAP@ DR OP „° @) STACK @DROP@ @) @MEM@@ @) @DIR@@ PU RG E „° @) @ME M@@ @ ) @DIR@@ @ PURGE ORDER „° @) @MEM@@ @) @DIR@ @ @ORDER @) @BRCH@ @ )@IF@@ IF „° @) @BRCH@ @ ) @IF@@ @@@IF@@@ THEN „° @) @B RCH@ @ )@ IF@@ @THEN @ ELSE „° @) @BRCH@ @ )@IF@ @ @ELSE@ END „° @) @BRCH@ @ ) @IF@@ @@@END@@ @) @BRCH@ @ ) CASE@ CA SE „° @) @BRCH@ @ ) CASE@ @CASE@ THEN „° @) @B RCH@ @ )CASE@ @THEN@ END „° @) @BRCH@ @ ) CASE@ @ @END@ @) @BRCH@ @ ) START ST A RT „° @) @ BRCH@ @ ) START @START NEXT „° @) @BRCH@ @ ) START @NEX T ST E P „° @) @BRCH@ @ ) START @STE P @) @BRCH@ @ ) @FOR@ FO R „° @) @ BRCH@ @ ) @FOR@ @@ FOR@@ NEXT „° @) @BRCH@ @ ) @FOR@ @ @NEXT@ ST E P „° @) @BRCH@ @ ) @FOR@ @@STEP@ @) @BRCH@ @ ) @@DO@ @ DO „° @) @ BRCH@ @ ) @@DO @ @ @@@DO@@ UNT IL „° @) @BRCH@ @ ) @@DO@ @ @UNTIL END „° @) @BRCH@ @ ) @@DO@@ @@END@@
P age 21-12 @) @BRCH@ @ ) WHILE@ WHILE „° @) @BRCH@ @ ) WHILE@ @ WHILE REP EA T „° ) @BRCH@ @) W HILE@ @REPEA END „° ) @BRCH@ @ ) WHILE@ @ @END@ @ ) TEST@ == „° @ ) TE ST@ @@@ ≠ @@@ AND „° @ ) TEST@ L @@AND@ OR „° @ ) TEST@ L @@@OR@@ XO R „° @ ) TEST@ L @@XOR@ NO T „° @ ) TEST@ L @@NOT@ SA M E „° @ ) TEST@ L @SAME SF „° @ ) TEST@ L L @@@SF@@ CF „° @) TEST@ L L @@@CF@@ FS ? „° @ ) TEST@ L L @@FS? @ FC? „° @ ) TEST@ L L @@FC? @ FS ? C „° @ ) TEST@ L L @FS?C FC?C „° @ ) TEST@ L L @ FC?C @) TYPE@ OB J  „° @) TYPE@ @ OBJ  @  ARR Y „° @) TYPE@ @  ARRY  LIS T „° @) TYPE@ @  LIST  ST R „° @) TY PE@ @  STR  TA G „° @) TYPE@ @  TAG NUM „° @) TYPE@ L @NUM@ CHR „° @) TYPE@ L @CHR@ TYP E „° @) TYPE@ L @T YPE@ @) LIST@ @ ) ELEM@ GE T „° @) LIST@ @) E LEM@ @@GET@ @ GE TI „° @) LIST@ @ ) ELEM@ @GETI @ PU T „° @) LIST@ @ )ELEM@ @@PUT@ PU TI „° @) LIST@ @) E LEM@ @PUTI@ SIZE „° @) LIST@ @) E LEM@ @SIZE@ HEAD „° @) LIST@ @ ) ELEM@ L @HEAD@ TA I L „° @) LIST@ @ ) ELEM@ L @TAIL@
P age 21-13 @) LIST@ @ ) PROC@ REVLI S T „° @) LIST@ @) PROC@ @REVLI@ SO RT „° @) LIST@ @) PROC@ L @SORT@ SE Q „° @) LIST@ @ ) PROC@ L @@ SEQ@@ @) MODES @) ANG LE@ DE G „°L @) MODES @) A NGLE@ @@DE G@@ RAD „°L @) MO DES @ )ANGLE@ @@RAD@@ @) MODES @) MEN U@ CS T „°L @) MODES @) M ENU@ @@CST @@ MENU „°L @) MODES @) MENU@ @@MENU@ BEEP „°L @) MODES @) M ISC@ @@BEE P@ @) @@IN@@ INFORM „°L @) @@ IN@@ @INFOR @ INP UT „°L @) @@ IN@@ @INPUT @ MSGB O X „°L @) @OUT@ @MSGBO@ PVIEW „°L @) @OUT@ @P VIEW@ @) @RUN@ DBUG „°LL @) @RUN@ @@DB G@ SST „°LL @) @RUN@ @@SST @ SST ↓ „°LL @) @RUN@ @S ST ↓ @ HAL T „°LL @) @RUN @ @HALT@ KIL L „°LL @) @RUN@ @KILL Pr ograms f or generating lists of numbers P lease noti ce that the functi ons in the P RG menu ar e not the only f unctions that can be us ed in pr ogramming . As a matter of f act , almos t all func tions in the calc ulato r can be included in a pr ogram . Th us , y ou can use , for e xample ,
P age 21-14 fu nctio ns from th e M TH m enu . Spe c ifica lly , you ca n use fun ction s for li st oper ations suc h as S ORT , Σ LIS T , etc ., a vail able thr ough the MTH/LI S T menu . As additional pr ogramming e xer cis es, and to try the ke ystr ok e seque nces listed abo v e , we pr esent her ein thr ee pr og r ams for c r eating or manipulating lists . The pr ogr am names and listings ar e as follo ws: LIS C : « → n x « 1 n FOR j x NEXT n LIST »» CRL S T : « → st en df « st en FOR j j df STEP en st - df / FLOOR 1 → LIST »» CLI S T : « REVLIST DUP DUP SIZE 'n' STO ΣLIST SWAP TAIL DUP SIZE 1 - 1 SWAP FOR j DUP ΣLIST SWAP TAIL NEXT 1 GET n LIST REVLIST 'n' PURGE » T he oper ation of thes e pr ogr ams is as follo ws: (1) LIS C : cr eates a list of n elements all eq uals to a constant c . Oper ation : enter n, enter c, pr ess @LISC Ex ample : 5 ` 6.5 ` @LISC crea te s t he l is t: {6.5 6. 5 6.5 6.5 6.5 } (2 ) CRLS T : cr eates a lis t of number s fr om n 1 to n 2 w ith inc r ement Δ n , i .e ., {n 1 , n 1 Δ n, n 1 2 ⋅Δ n, … n 1 N ⋅Δ n }, wher e N=f loor((n 2 -n 1 )/ Δ n) 1. Oper ation : en ter n 1 , enter n 2 , enter Δ n, press @CRLST Ex ample : .5 ` 3.5 ` .5 ` @CRLST pr oduces: {0. 5 1 1. 5 2 2 . 5 3 3 . 5} (3) CLI S T : c reat es a list w ith c umulati ve sums of the elements , i .e ., if the or iginal list is {x 1 x 2 x 3 … x N }, then CLIS T cr eates the list: Oper ation : place the or iginal list in le v el 1, pr ess @CLI ST . Ex ample : {1 2 3 4 5} ` @CLIST pr oduces {1 3 6 10 15}. } ,..., , , { 1 3 2 1 2 1 1 ∑ = N i i x x x x x x x
P age 21-15 Ex amples of sequential pr ogramming In gener al , a pr ogr am is an y sequence o f calc ulato r instruc tions enc lo sed between the pr ogram container s and ». Su bpr ograms can be inc luded as part o f a pr ogr am. The e xamples pr esented pr e v iou sly in this guide (e .g., in Chapt ers 3 and 8) 6 can be cla ssif ied ba sicall y into tw o types: (a) pr ograms gener ated b y def ining a functi on; and, (b) pr ograms that simulat e a sequence of st ack ope rati ons . Thes e two type s of pr ogr ams ar e des cr ibed ne xt . The gener a l for m of the se pr ogr ams is inpu t  pr ocess  output , ther ef or e , w e re fer to them as sequential progr a ms . Pr ograms gener ated b y defining a function T hese ar e progr ams gener ated b y using fu nction DEFINE ( „à ) w i th an ar gument o f the for m: 'func tio n_name(x 1 , x 2 , …) = e xpre ssion containing v a r iables x 1 , x 2 , …' T he progr am is stor ed in a var ia ble called function_name . When the pr ogr am is r ecalled t o the stack , by using ‚ function _name . The pr ogram sho w s up as f ollo w s: «  x 1 , x 2 , … 'e xpres sion containing v ar iables x 1 , x 2 , …'». T o e valuate the f uncti on for a s et of input v ar ia bles x 1 , x 2 , … , in RPN mode , enter the v ar iables into the s tac k in the appr opri ate or der (i .e., x 1 fi rst, fo ll owed by x 2 , then x 3 , etc .) , and pr ess the soft me nu k e y labeled function_name . T he calc ulator w ill re turn the v alue of the func tion func tion_name ( x 1 , x 2 , … ). Ex ample : Manning’s eq uation f or w ide r ectangular c hannel . As an e x ample , consider the follo wing eq uation that calc ulates the unit disc har ge (disc har ge per unit w idth) , q, in a w ide r ectangular open c hannel using Manning ’s equation: 0 3 / 5 0 S y n C q u =
P age 21-16 wher e C u is a constant that depends on the sy stem of units us ed [C u = 1. 0 f or units of the Internati onal S ys tem (S.I .) , and C u = 1.4 8 6 f or units of the English S y ste m (E . S .)], n is the Manning’s r esist ance coeff ic ient , whi ch depends on the type of c hannel lining and other f actor s, y 0 is the flo w depth , and S 0 is the c hannel bed slope gi v en as a dimensi onless f r action . Suppos e that w e want to c r eate a func tion q(C u , n , y0, S0) to calc ulate the unit disc har ge q for this cas e . Use the e xpr essi on ‘ q(Cu ,n,y0,S0) =Cu/ n*y0^(5 ./3 .)* √ S0’ , as the ar gument of f unction DEFINE . Notice that the e xponent 5 ./3 ., in the equati on, r epr esents a r a ti o of r eal numbe rs due to the dec imal points . Pr ess J , if needed , to r eco ver the v ariable lis t. At this po int ther e w ill be a var iable called @@@q@@@ in your s oft menu k e y labels. T o see the contents of q, use ‚ @@@q@@@ . The pr ogr am gener ated b y def ining the func tion q(Cu,n,y0,S0) is s hown a s: « → Cu n y0 S0 ‘C u/n*y0^(5 ./3 .)* √ S0’ ». T his is to be interpr eted as “ ente r Cu , n , y0, S0, in that or der , then calculat e the e xpr essi on betw een quote s. ” F or e x ample , to calc ulate q for C u = 1. 0, n = 0. 012 , y0 = 2 m , and S0 = 0.0001, u se , i n RPN mode: 1 ` 0. 012 ` 2 ` 0. 0001 ` @@@q@@@ T he r esult is 2 .64 5 66 84 (or , q = 2 .64 5 6 6 8 4 m 2 /s) . Not e : V alues of the Manning ’s coe ff ic ient , n, ar e a vail able in tables a s dimensio nless number s, typ icall y between 0. 001 to 0. 5 . The v alue of C u is also u sed w ithout dimensi ons. Ho w ev er , car e should be tak en to ensur e that the v alue of y0 has the pr oper units, i .e. , m in S.I . and ft in E .S . T he re sult for q is r eturned in the pr oper units of the corr esponding sy stem in use , i.e ., m 2 /s in S .I. and ft 2 /s in E . S . Manning’s eq uation is , ther ef or e , not dimensionally co nsistent .
P age 21-17 Y ou can also separ ate the in put data w ith spaces in a single stac k line r ather than using ` . Pr ograms that simulate a sequence of stack operations In this case , the terms to be in v olv ed in the sequence o f oper ations ar e as sumed to be pr es ent in the stac k . The pr ogram is ty ped in by f ir st opening the pr ogr am cont ainers w ith ‚å . Ne xt, the seq uence of oper ati ons to be perfor med is enter ed . When all the oper ations ha v e been t y ped in , pr ess ` to complete the pr ogr am. If this is to be a once -onl y pr ogr am, y ou can at this p o int , pr ess μ to e xec ute the pr ogr am using the input data a vaila ble . If it is to be a permanen t pr ogram , it needs to be stor ed in a v ar iable name . T he best w ay t o desc ribe this type o f progr ams is with an e x ample: Ex ample : V eloc it y head f or a r ectangular c hannel . Suppo se that w e wa nt to calc ulate the v eloc it y head , h v , in a r ectangular c han nel o f w idth b , w ith a flo w depth y , that carr ies a dis char ge Q. The specif ic energ y is calculated as h v = Q 2 /(2g(b y) 2 ) , w her e g is the acceler ation of gr av ity (g = 9 .8 06 m/s 2 in S.I . units or g = 3 2 .2 f t/s 2 in E .S . units) . If w e w er e to calc ulate h v f or Q = 2 3 cfs (c ubic f eet per second = ft 3 /s) , b = 3 ft , and y = 2 f t , w e w ould use: h v = 2 3 2 /(2 ⋅ 32. 2 ⋅ (3⋅ 2) 2 ) . U sing the RPN modethe calc ula t or , interacti vel y , we can calc ulate this quantit y as: 2`3*„º32.2* 2*23„º™/ R esulting in 0.2 2 817 4 , or h v = 0.2 2 817 4. T o put this calc ulation together as a pr ogr am we need t o hav e the input data (Q, g , b , y) in the stac k in the or der in whi ch the y will be u sed in the calc ulati on . In te rms o f the var iable s Q, g , b , and y , the calc ulatio n ju st perfor med is wr it t en as (do not type the f ollo w ing): y ` b *„º g *2* Q „º™/
P age 21-18 As y ou can see , y is used f i r st , then w e us e b, g , a n d Q, in that order . Ther efor e, for the pur pose of this calculatio n we need to enter the v ar iables in the in ve rse or der , i .e. , (do not t y pe the f ollo w ing) : Q ` g `b ` y ` F or the spec if ic v alues under consider ation w e use: 23 ` 32. 2 ` 3 ` 2 ` T he pr ogr am itself will con tain onl y those k e ys tr ok es (or co mmands) that r esult fr om re mov ing the input value s fr om the int er acti v e calc ulation sho w n earli er , i .e ., r emo v ing Q, g, b, and y fr om (do not type the fo llow ing) : y ` b *„º g *2* Q „º™/ and k eeping onl y the oper ati ons sho wn bel o w (do not type the f ollo wing): ` *„ *2* „º™/ Unlik e the i nter acti ve u se of the calc ulator perfor med earli er , w e need to do some s w apping o f stac k lev els 1 and 2 w ithin the pr ogr am. T o wr ite the program, w e use, th er ef ore: ‚å Opens pr ogram s ymbols * Multiply y w ith b „º Squa r e (b ⋅ y) * Multiply (b ⋅ y) 2 times g 2* Enter a 2 and m ultiply it w ith g ⋅ (b ⋅ y) 2 „° @) STACK @SWAP@ Sw ap Q wi t h 2 ⋅ g⋅ (b⋅ y) 2 „º Sq uar e Q „° @) STACK @SWAP@ Sw ap 2 ⋅ g⋅ (b⋅ y) 2 wi th Q 2 / Di v ide Q 2 by 2 ⋅ g⋅ (b ⋅ y) 2 ` Enter the progr am T he r esulting pr ogr am looks lik e this: « * SQ * 2 * SWAP SQ SWA P / » Not e : When ente r ing the pr ogr am do not us e the k e y str ok e ™ , instead u se the k ey str ok e sequence: „° @) STACK @SWAP@ .
P age 21-19 Sa ve the pr ogram int o a var iable called hv: ³~„h~„v K A ne w var iable @@@hv @@@ should be av ailable in y our soft k e y menu . (Pr ess J to see y our v ar iable lis t .) The pr ogram le ft in the stac k can be e valuat ed by u sing func tion EV AL. T he r esult should be 0.2 2 8 17 4…, as befor e. Als o , the progr am is av ailable f or f utur e use in v ar iable @@@hv@@@ . F or e x ampl e , f or Q = 0. 5 m 3 /s , g = 9 .806 m /s 2 , b = 1.5 m , and y = 0.5 m , use: 0. 5 # 9. 8 0 6 #1. 5 # 0. 5 @@@hv @@@ The r esult now is 2 .2 6 618 6 2 3 518E- 2 , i.e ., hv = 2 .2 6618 6 2 3 518 × 10 -2 m. As mentioned earli er , the two ty pes of pr ogr ams pr esent ed in this sectio n are seque ntial pr ogr ams , in the se nse that the pr ogr am flo w follo ws a single path, i. e. , I N PU T  OP ER A TION  OUTP UT . Br anching o f the pr ogr am flo w is possible b y using the commands in the menu „° @ ) @BRCH@ . Mor e detail on pr ogr am br anching is pr esente d belo w . Inter ac ti ve input in pr ograms In the seque ntial pr ogr am e xample s show n in the pr e vi ous s ectio n it is not alw ay s clear t o the user the or der in w hic h the var iable s must be placed in the stac k bef or e pr ogr am ex ec uti on. F or the case o f the progr am @@@q@@@ , wri tt en a s « → Cu n y0 S0 ‘Cu/n*y0^(5/3)* √S0’ » , Not e : SQ is the func tio n that r esults fr om the k e y str ok e s equence „º . Not e : # is used her e as an alternati ve to ` f or input data entry . Not e: Since the equation pr ogrammed in @@@hv@@@ is dimensi onall y consiste nt , w e can use units in the in put .
P age 21-20 it is al wa y s pos sible to r ecall the pr ogr am def inition int o the stac k ( ‚ @@@q@@@ ) to see the or der in w hic h the v ari ables mu st be ent er ed , namely , → Cu n y0 S0 . Ho w ev er , f or the ca se of the pr ogr am @@hv@@ , its def inition « * SQ * 2 * S W AP SQ S W AP / » does not pr o v ide a c lue of the or der in whi ch the data mu st be enter ed , unless , of cour se , y ou ar e e xtr emel y e xperi enced w ith RPN and the Us er RP L language. One w ay to c heck the r esult of the pr ogr am as a for mula is to enter s ymboli c v ari ables , instead of n umeri c r esults , in the stac k, and let the pr ogram oper ate on those v ar ia bles. F or this appr oach to be eff ecti v e the calc ulator’s CA S (Calc ulator A lgebr aic S y ste m) must be s et to symbolic and exact m o de s . T h is is accomplished by u sing H @) CAS@ , and ensur ing that the c hec k marks in the options _Numeric and _Approx ar e r emo v ed. Pr ess @@OK@@ @@OK@ to r etu rn to nor mal calculat or displa y . Pr ess J to dis play y our var ia bles menu . W e wi ll use this latter approac h to chec k what f orm ula results f r om using the pr ogr am @@hv@@ as follo w s: W e kno w that there ar e fo ur inputs to the pr ogram , thu s, w e us e the s y mbolic v ar ia bles S4 , S3, S2 , and S1 t o indicat e the st ack le vels at input: ~s4` ~s3` ~s2` ~s1` Ne xt , pr ess @@hv@@ . T he r esulting f or mula may look l ik e this ‘SQ(S4)/(S3*SQ(S2*S1)*2) ’ , if y our displa y is not set to te xtbook style , or like this , if te xtb ook s t y le is selec ted . Since w e kno w that the f unction S Q( ) stands f or x 2 , w e interpr et the latter r esult as 2 ) 1 2 ( 3 ) 4 ( ⋅ ⋅ ⋅ S S SQ S S SQ
P age 21-21 w hich indi cates the positi on of the diff er ent stac k input le vels in the fo rmula . B y compar ing this r esult w ith the or iginal f ormula that w e pr ogr ammed , i .e ., w e find that w e mu st enter y in s tack le vel 1 (S1), b in stac k lev el 2 (S2), g in stac k le v el 3 (S3) , and Q in st ack le vel 4 (S4). Pr ompt with an input string T hese two appr oaches f or identify ing the or der of the input data ar e not very eff ic ient . Y ou can, ho we v er , help the user identify the v ari ables to be us ed by pr ompting him or her w ith the name of the var iable s. F r om the v ari ous methods pr o v ided b y the Use r RPL language , the simples t is to use an inpu t str ing and the func tion INP UT ( „°L @) @@IN@ @ @INPUT@ ) to load y our in put data . T he follo wing pr ogram pr ompts the user f or the value o f a var iable a and places the input in s tack le vel 1: « “ Enter a: “ {“  :a: “ {2 0} V } INPUT OBJ → » T his pr ogr am includes the s ymbo l :: ( tag) and  (r eturn), av ailable through the keys tro ke c o m bi n at io n s „ê and ‚ë , both ass oc iated w ith the . k e y . The tag s y mbol (::) is used to labe l str ings fo r input and output . T he r eturn sym bo l (  ) is similar t o a carr iage r eturn in a comput er . The str ings betw een quot es ( “ “) ar e typed dir ectl y fr om the alphanumer i c ke yboar d . Sa ve the pr ogr am in a v ar iable called INP T a (f or INP u T a). T ry r unning the pr ogr am b y pre ssing the soft menu k e y labeled @INPTa . , ) 1 2 ( 3 2 4 2 2 S S S S ⋅ ⋅ ⋅ , ) ( 2 2 2 by g Q h v =
P age 21-2 2 T he re sult is a stac k pr ompting the user f or the value o f a and plac ing the cu rsor r ight in fr on t of the prompt :a: Ent er a value f or a , sa y 3 5, then pre ss ` . T he r esult is the input s tring :a:35 in stac k lev el 1. A function with an input string If y ou w er e to use this p iece o f code to calculate the functi on , f(a) = 2*a^2 3, y ou could modify the pr ogr am to r ead as fo llo ws: « “ Enter a: “ {“  :a: “ {2 0} V } INPUT OBJ →→ a « ‘ 2 *a^2 3 ‘ » » Sa ve this ne w pr ogr am under the name ‘FUNCa ’ (FUNCti on of a): R un the pr ogram b y pr es sing @FUNCa . When pr ompted to enter the value of a enter , f or e xample , 2 , and pr ess ` . T he r esult is simpl y the algebr ai c 2a 2 3 , w hich is an incorr ect r esult . T he calculat or pro vi des f unctions f or debugging p r o g ram s t o id en ti f y l o gi ca l erro rs du ri ng p r o gra m execu ti on as s hown be l o w . Debugging th e pr ogram T o fi gur e out w h y it did not w ork w e use the DBUG f unction in the calc ulator as fo llo w s: ³ @FUNCa ` Cop ies pr ogram name to s tack le v el 1 „°LL @) @RUN@ @@DBG@ Starts debugger @SST ↓ @ St ep-by-s tep debugging , r esult: “Enter a:” @SST ↓ @ Res ul t: {“  a:” {2 0} V} @SST ↓ @ Re sult: user is pr ompted to en ter v alue of a 2` Ente r a value o f 2 f or a . R esult: “  :a:2” @SST ↓ @ Res ul t: a :2
P age 21-2 3 @SST ↓ @ R esult: empty stac k , e x ecu ting → a @SST ↓ @ Re sult: empty s tack , enter ing subpr ogr am « @SST ↓ @ R esult: ‘2*a^2 3’ @SST ↓ @ Re sult: ‘2*a^2 3’ , lea v ing subpr ogr am » @SST ↓ @ Re sult: ‘2*a^2 3’ , lea vi ng main pr ogram» F urther pr essing the @SST ↓ @ so f t men u k e y produ ces no mor e output since w e hav e gone thr ough the en tir e progr am, st ep by s tep . This r un thr ough the debugger di d not pr o v ide an y inf ormati on on w h y the pr ogr am is not calc ulating the v alue of 2a 2 3 for a = 2 . T o see what is the v alue of a in the sub-pr ogram , we need to r un the debugger again and e valuate a w ithin the sub-pr ogr am. T r y the f ollo w ing: J Rec overs varia bl es m en u ³ @FUNCa ` Cop ies pr ogram name to s tack le v el 1 „°LL @) @RUN@ @@DBG@ Starts debugger @SST ↓ @ S tep-b y-step debugging , r esult: “Ente r a:” @SST ↓ @ Res ul t: {“  a:” {2 0} V } @SST ↓ @ R esult: us er is pr ompted to en ter v alue of a 2` Ente r a value o f 2 f or a . R esult: “  :a:2” @SST ↓ @ Res ul t: a: 2 @SST ↓ @ R esult: empty stac k , e xec uting → a @SST ↓ @ Re sult: empty s tack , enter i ng subpr ogram « At this point w e ar e w ithin the subpr ogram « ‘ 2*a^2 3’ » w hic h uses the local v ari able a . T o see the v alue of a use: ~„aμ T his indeed sho w s that the local v ari able a = 2 Let ’s kill the debugger at this po int since w e alr eady kno w the r esult w e w ill get . T o kill the debugge r pr es s @KILL . Y ou r ecei v e an <!> Interrupted mes sage ackno wledging killing the debugger . Pr es s $ to r eco ver nor mal calculator displa y . Not e : In debugging mode , e v er y time w e pre ss @SST ↓ @ the top left cor ner of the displa y sho w s the pr ogr am step be ing e xec uted. A s oft k e y func tion called @@SST@ is also a vaila ble under the @) RUN sub-me nu w ithin the P RG menu . This can be used t o ex ec ute at once an y sub-pr ogr am called fr om w ithin a main pr ogr am . Ex amples of the a pplicati on of @@ SST@ w i ll be sho w n later .
P age 21-2 4 F ixi ng th e pr ogram T he only pos sible explanati on f or the failur e of the pr ogr am to pr oduce a numer ical r esult seems to be the lac k of the command  NUM after the algebr aic e xpr essi on ‘2*a^2 3’ . Let ’s edit the progr am by adding the mis sing EV AL functi on . T he progr am, after editing , should read as f ollo w s: « “ Enter a: “ {“  :a: “ {2 0} V } INPUT OBJ →→ a « ‘ 2*a^2 3‘  NUM »» St ore it again in v ar iable FUNCa , and run the pr ogr am again w ith a = 2 . This time , the r esult is 11, i .e ., 2*2 2 3 = 11. Input string f or t w o or three input v alues In this sec tion w e will c r eate a su b-dir ectory , w ithin the dir ect or y HO ME , to hold e xam ples of inpu t str ings fo r one , two , and three input data v alues . T hese w ill be gener ic input str ings that can be incor por ated in an y futur e progr am, taking car e of c hanging the var iable names accor ding to the needs of eac h pr ogr am. Let ’s get started b y cr eating a su b-dir ectory called PTRICK S (Pr ogr amming TRICK S) to hold pr ogr amming tidbits that w e can later borr o w fr om to us e in mor e complex pr ogr amming ex er cis es. T o cr eate the sub-dir ectory , f irst mak e sur e that y ou mo ve to the HOME dir ect or y . Within the HOME dir ectory , use the fo llow ing k ey str okes to c reate the sub-dir ectory P TRICK S: ³~~ptricks` Enter dir ectory name ‘PTRICK S’ „° @) @MEM@@ @) @DIR@@ @ CRDIR Create dir ectory J Re cover va riab l e l is ti ng A pr ogr am ma y hav e mor e than 3 input dat a value s. W hen using inpu t str ings w e want to limit the number of input data v alues to 5 at a time f or the simple r eason that , in gener al , we hav e v isible onl y 7 stac k le vels . If w e use st ack le v el 7 to gi v e a title to the in put string , and lea v e stack le vel 6 empty to fac ilitate r eading the displa y , we ha v e only s tack le v els 1 thr ough 5 to def ine inpu t va riab le s.
P age 21-2 5 Input string progr am for two input v alues T he input str ing pr ogr am fo r t w o input values , say a and b , looks as f ollo ws: « “ Enter a and b: “ {“  :a: :b: “ {2 0} V } INPUT OBJ → » T his progr am can be ea sily c r eated b y modif y ing the contents o f INPT a. St or e this pr ogr am into v ar iable INP T2 . Appli cation : e valuating a f uncti on of two v ar iab les Consi der the ideal gas la w , pV = nRT , w here p = gas pr es sur e (P a) , V = gas v olume(m 3 ) , n = n umber of moles (gmol), R = uni ver sal gas cons tant = 8. 314 51_J/(gmol*K) , and T = absolute temper atur e (K). W e can def ine the pre ssur e p as a func tio n of two v ar iable s, V and T , as p(V ,T) = nR T/V f or a gi ven ma ss of gas since n w ill also r emain cons tant . Assume that n = 0.2 gmol, then the f uncti on to pr ogr am is W e can def ine the functi on b y t y ping the follo wing pr ogr am « → V T ‘ (1.662902_J/K)*(T/V)’ » and stor ing it into var ia ble @@@p@@@ . T he next s tep is to add the in put str ing that w ill pr ompt the us er fo r the values o f V and T . T o c r eate this input str eam, modify the p r ogram in @@@p@@@ to read: « “ Enter V and T: “ {“  :V: :T: “ {2 0} V } INPUT OBJ →→ V T ‘(1.662902_J/K)*(T/V) ’ » St ore the ne w progr am back into v ar iable @@@p@@@ . Pr es s @@@p@@@ to run the p r ogram . Ente r value s of V = 0. 01_m^3 and T = 300_K in the in put str ing , then pr es s V T K J V T T V p ⋅ = ⋅ ⋅ = ) _ 662902 . 1 ( 2 . 0 31451 . 8 ) , (
P age 21-2 6 ` . The r esult is 4 9 8 8 7 . 06_J/m^3 . The units of J/m^3 ar e equiv alent to P ascals (P a) , the pr ef err ed pres sur e unit in the S .I. s y stem . In pu t st ring prog ram for th ree i npu t val ues T he input str ing pr ogr am f or thr ee input value s, sa y a ,b , and c, loo ks as fo llo w s: « “ Enter a, b and c: “ { “  :a: :b: :c: “ {2 0} V } INPUT OBJ → » T his progr am can be easily c r eated b y modify ing the contents o f INPT2 to mak e it look lik e sh o wn immedi atel y abo ve . The r esulting pr ogram can the n be stor ed in a v ar iable called INP T3 . W ith this pr ogr am we complet e the collecti on of input str i ng pr ograms that w ill allow u s to enter one , two , or thr ee data value s. K eep these pr ograms as a r e fer ence and copy and modify them to fulf ill the r equirements o f new pr ogr ams yo u wr ite. Application : ev aluating a f uncti on of thr ee v ari ables Suppo se that w e w ant to pr ogram the i deal gas la w inc luding the number o f moles , n, a s an additi onal var iable , i .e ., w e want to de fine the f uncti on and modify it to inc lude the thr ee -var iable inpu t str ing . The pr ocedure t o put together this func tion is v ery similar to that used ear lie r in def ining the functi on p(V ,T) . T he r esulting pr ogr am w ill look like this: « “ Enter V, T, and n: “ { “  :V:  :T:  :n: “ {2 0} V } INPUT OBJ →→ V T n ‘(8.31451_J/(K*mol))*(n*T/V) ‘ » Stor e this r esult back into the v ar iable @@ @p@@@ .T o run the pr ogr am , pr ess @@@ p@@@ . Not e : because w e deliber ately inc luded units in the functi on def inition , the input v alues mu st ha ve units attac h to them in input t o produc e the proper r esult . , ) _ 31451 . 8 ( ) , , ( V T n K J n T V p ⋅ =
P age 21-2 7 Enter v alues o f V = 0. 01_m^3, T = 300_K , and n = 0.8_mol . Bef or e pr es sing ` , the stac k will look lik e this: Press ` to get the result 19 9 5 48.2 4_J/m^3, or 199 54 8. 2 4_P a = 199 . 5 5 kP a. Input through input f orms F uncti on INFORM ( „°L @) @@IN@ @ @INFOR@ .) can be used to c r eate detailed input f orms f or a pr ogr am. F u nc tion INF ORM r equir es fi ve ar guments , in this or der: 1. A title: a char acter str ing desc r ibing the input f or m 2 . F ield def i niti ons: a list w ith one or mor e fie ld defi nitions {s 1 s 2 … s n }, w here eac h f ield definiti on , s i , can hav e one o f two f or mats: a. A simple f i eld label: a char acter str i ng b . A list of spec if icati ons of the f orm {“la bel” “helpInfo ” type 0 ty pe 1 … type n }. The “label” is a f ield label . T he “helpInf o ” is a char acter str ing desc r ibing the f ie ld label in detail, and the type spec ifi cations is a list o f types of v ari ables allo wed f or the f ield (see Chapter 2 4 f or obj ect types) . 3 . F ield f ormat inf ormation: a single number col or a list { col tabs }. In this spec if icati on, col is the number o f columns in the in put bo x , and tabs (optional) s pec if ies the number of tab stop s between the la bels and the f ields in the f orm . The list could be an empty list . Def ault value s ar e col = 1 and tabs = 3 . 4. L ist o f reset values: a list contai ning the valu es to r eset the di ffer ent f ields if the option @RESET is s elected w hile using the inpu t for m . 5. L ist of initi al values: a lis t containing the initial v alues of the f ields .
Pa g e 2 1 - 2 8 T he lists in items 4 and 5 can be em pty lists. Also , if no v alue is to be select ed for these opti ons y ou can use the NO V AL command ( „°L @) @@IN@ @ @NOVAL@ ). After f unction INFORM is acti vated y ou will get as a r esult either a z er o , in case the @CANCEL opti on is ente r ed, o r a list w ith the v alues enter ed in the fi elds in the or der spec if ied and the number 1, i .e ., in the RPN stack: Th us, if the v alue in stac k le vel 1 is z er o , no input wa s per f ormed , while it this v alue is 1, the in put values ar e av ailable in stac k lev el 2 . Ex ample 1 - As an ex ample , consider the follo wing pr ogram , INFP1 (INput F orm Pr ogr am 1) to calculat e the disc har ge Q in an open c hannel thr ough Chezy’s f ormula: Q = C ⋅ (R ⋅ S) 1/2 , w her e C is the Chez y coeff ic ient , a func tion of the channel surf ace ’s r oughnes s (typ ical v alues 8 0 -15 0) , R is the h ydr aulic r adius of the c hannel (a length), and S is the c hannel bed’s slope (a dimensio nless nu mbers , t y picall y 0. 01 to 0. 000001) . T he follo w ing pr ogram def ines an input f or m thr ough functi on INFORM: « “ CHEZY’S EQN” { { “C:” “Chezy’s coefficient” 0 } { “R:” “Hydraulic radius” 0 } { “S:” “Channel bed slope” 0} } { } { 120 1 .0001} { 110 1.5 .0000 1 } INFORM » In the pr ogr am we can identify the 5 components of the input as f ollo ws: 1. T itle: “ CHEZY’S EQN” 2 . F ield de fi nitions: ther e are thr ee of them , w ith labels “C:” , “R:” , “S:” , inf o str ings “Chez y coeff ic ient ” , “Hy dr aulic r adius ” , “C hannel bed slope ” , and accepting onl y data type 0 (r eal numbers) f or all of the thr ee fi elds: { { “C:” “Chezy’s coefficient” 0} { “R:” “Hydraulic radius” 0 } { “S:” “Channel bed slope” 0} } 2: {v 1 v 2 … v n } 1: 1
P age 21-29 3 . F ield f or mat infor mation: { } (an empty list , thus , default v alues us ed) 4. L ist of r eset v al ues: { 120 1 .0001} 5 . Lis t of initial v alues: { 110 1.5 .00001} Save th e prog ram i nto va riab le IN F P1 . P ress @INFP 1 to run the pr ogram . T he input f orm , w ith initial v alues loaded , is as follo ws: T o see the eff ect of r esetting these v alues us e L @RESET (select R ese t all to r eset fie ld val u es) : No w , enter diff er ent values for the thr ee fi elds, say , C = 9 5, R = 2 .5, and S = 0. 00 3, pr essin g @@@OK@@@ af ter entering each of th ese ne w valu es . After t hese subs titutions the input f or m will look lik e this: Now , to enter th ese v alues into the p r o gr am pres s @@@OK@@@ once mor e . This acti v ates the f uncti on INFORM pr oduc ing the fol low ing r esults in the stac k:
P age 21-30 T hus , we demonstr ated the u se of f uncti on INFORM. T o see h o w to use the se input v alues in a calc ulation modify the pr ogr am as follo ws: « “ CHEZY’S EQN” { { “C:” “Che zy’s coefficient” 0} { “R:” “Hydraulic radius” 0 } { “S:” “Channel bed slope” 0} } { } { 120 1 .0001} { 110 1.5 .000 01 } INFORM IF THEN OBJ  DROP  C R S ‘C*(R*S)’ NUM “Q”  TAG ELSE “Operation cancelled” MSGBOX END » T he pr ogr am steps sho w n abo ve aft er the INFORM command inc lude a dec ision br anching using the IF -T HEN -ELSE -END cons truct (de sc ribed in det ail else w her e in this Cha pter ) . T he pr ogr am contr ol can be se nt to one of tw o possib ilities depe nding on the value in s tac k lev el 1. If this v alue is 1 the contr ol is passed t o the commands: OBJ  DROP  C R S ‘C* √(R*S)’ NUM “Q” TAG T hese commands w ill calc ulate the v alue of Q and pu t a tag (or label) t o it . On the other hand , if the v alue in stac k le ve l 1 is 0 (w hi ch ha ppens w hen a @CANCEL is ente re d while using the in put bo x) , the pr ogr am contr ol is pass ed to the commands: “Operation cancelled” MSGBOX T hese commands w ill pr oduce a mess age box indi cating that the oper ation w as cancelled . Ex ample 2 – T o illustr ate the use of item 3 (F ie ld for mat inf ormatio n) in the ar guments of f uncti on INFORM, c hange the empt y lis t used in pr ogr am INFP1 to { 2 1 }, meaning 2 , rather than the defa ult 3, columns, and onl y one tab s top between la bels and values . Stor e this ne w pr ogr am in var ia ble INFP2: Note : F uncti on MS GBO X belongs to the collec tion o f output functi ons under the PR G/OUT sub-menu . Co mmands IF , THEN , ELSE , END ar e av ailable under the P RG/BR CH/IF sub-menu . Func tions OB J  ,  T A G are a vaila ble under the PR G/TYPE sub-menu . F uncti on DROP is a vailable under the P RG/ S T A CK menu . F unctions  and  NUM ar e av ailabl e in the ke yboar d.
P age 21-31 « “ 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 » R unning pr ogr am @INFP2 pr oduces the f ollo w ing input f orm: Ex ample 3 – Change the fi eld f ormat inf ormation lis t to { 3 0 } and sa ve the modif ied pr ogram int o var ia ble INFP3 . R un this pr ogr am to see the ne w input form : Creating a choose bo x F uncti on CHOO SE ( „°L @) @@IN@@ @ CHOOS@ ) allo ws the u ser to c r eate a c hoose bo x in a pr ogram . T his func tion r equire s three ar guments: 1. A pr ompt (a c harac ter str ing desc r ibing the choos e bo x) 2 . A list of choice d efinit ions { c 1 c 2 … c n }. A c hoi ce def inition c i can hav e an y of two f ormats: a. An objec t , e .g. , a number , algebrai c, et c., that w ill be displa y ed in the choo se bo x and wi ll also be the r esult of the choic e . b . A list {obj ect_displa y ed objec t_re sult} so that obj ect_displa y ed is listed in the choose bo x, and object_result i s sele cted as th e r esult if this c hoi ce is selected . 3 . A number indi cating the position in t he list of c hoi ce def initi ons of the def ault ch oi ce . If this number is 0, no defa ult ch oi ce is highli ghted .
P age 21-3 2 Ac tiv ati on of the CHOO SE func tion w ill re turn e ither a z er o, if a @CANCEL ac ti on is used , or , if a c hoi ce is made , the ch oi ce s elect ed (e .g., v) and the numbe r 1, i .e ., in the RPN stac k: Ex ample 1 – Manning ’s equation f or calc ulating the v eloc ity in an open ch an nel fl o w in clu de s a co ef fic ien t, C u , w hic h depends on the s ys tem of units used . If using the S .I. (S yste me International), C u = 1. 0, while if using the E .S . (English S yst em) , C u = 1.4 8 6 . The f ollo w ing pr ogr am uses a c hoos e box to let the use r select the v alue of C u b y selecting the s ystem o f units. Sa ve it into v ari able CHP1 (CHoos e Pr ogram 1): « “Units coefficient” { { “S.I. units” 1} { “E.S. units” 1.486} } 1 CHOOSE » R unning this pr ogr am (pr ess @CHP1 ) sho w s the follo wing c hoose bo x : Depending on w hether y ou selec t S.I. units or E.S. units, fun ctio n CHOO SE places either a value of 1 or a v alue of 1.4 8 6 in st ack le vel 2 and a 1 in le vel 1. If y ou cancel the choo se bo x, CHOICE r eturns a z er o (0) . T he values r eturned b y func tion CHOO SE can be oper ated upon b y other pr ogr am commands as sho w n in the modifi ed pr ogr am CHP2 : « “Units coefficient” { { “S.I. units” 1} { “E.S. units” 1.486} } 1 CHOOSE IF THEN “Cu” TAG ELSE “Operation cancelled” MSGBOX END » T he commands af t er the CHOOSE f uncti on in this new pr ogram indi cate a dec ision ba sed on the v alue of stac k le vel 1 thr ough the IF- THEN -EL SE -END cons truc t . If the value in s tac k lev el 1 is 1, the co mmands “Cu” TAG w ill pr oduced a tagged re sult in the scr een . If the value in stack le vel 1 is z er o , the 2: v 1: 1
P age 21-3 3 commands “Operation canc elled” MSGBOX w ill sho w a message bo x indicating that the oper ation w as cancelled. Identif y ing output in pr ograms T he simplest w ay to identify numer ical pr ogr am output is to “tag ” the pr ogr am r esults . A tag is simply a str ing attached to a numbe r , o r to a n y objec t . The str ing w ill be the name assoc iated w ith the obj ect . F or e xample , earli er on , w hen debugging progr ams INPT a (or INP T1) and INPT2 , w e obtained as r esults tagged n umeri cal outpu t suc h as :a:35. T agging a numerical r esult T o tag a numer ical r esult y ou need t o place the number in st ack le v el 2 and the tagging str ing in stack le v el 2 , then us e the → T A G func tio n ( „ ° @) TYPE@ @  TAG ) F or ex ample , to pr oduce the tagged r esult B:5. , us e: 5`‚Õ~b„ ° @) TYPE@ @  TAG Decomposing a tagged numerical r esult into a number and a tag T o decompos e a tagged r esult into its numer ical v alue and its tag , simply us e fu nct ion O B J  ( „° @) TYPE@ @OBJ  @ ) . T he r esult of dec omposing a tagg ed number w ith → OB J is to place the numer i cal value in st ack le vel 2 and the tag in stac k le v el 1. If yo u are int er est ed in u sing the numer i cal value onl y , then y ou w ill dr op the tag by us ing the backspace k e y ƒ . F or e xample , decomposing the t agged quantity B:5 (s ee abo ve) , w ill produce: “De -tagging” a tagged quantit y “De - tagging ” means to extr act the obj ect out o f a tagged quantit y . T his func tion is acc essed thr ough the k e y str ok e combinati on: „ ° @) TYPE@ L @DTAG . F or e x ample , giv en the tagged quan tity a:2 , D T A G r eturns the numer ical v alue 2 .
P age 21-34 Ex amples of tagged output Ex ample 1 – tagging output fr om function FUNC a Let ’s modif y the f uncti on FUNCa, de f ined earlier , to pr oduce a tagged output . Use ‚ @FUNCa to r ecall the contents of FUNCa to the st ack . The or iginal func tion pr ogram r eads « “ Enter a: “ {“  :a: “ {2 0} V } INPUT OBJ →→ a « ‘2*a^2 3 ‘  NUM »» Modify it to r ead: « “ Enter a: “ {“  :a: “ {2 0} V } INPUT OBJ →→ a « ‘2*a^2 3 ‘  NUM ” F” → TAG »» Stor e the pr ogram bac k into FUNCa b y using „ @FUNCa . Next , run the pr ogr am by pr essing @FUNCa . Enter a value o f 2 whe n pr ompted , and pr ess ` . The r esult is no w the tagged r esult F:11. Ex ample 2 – tagging input and o utput fr om functi on FUNCa In this e xam ple we modify the pr ogr am FUNCa so that the output inc ludes not only the e v aluated func tion , but also a cop y of the input w ith a tag . Use ‚ @FUNCa to r ecall the contents of FUNCa to the st ack: « “ Enter a: “ {“  :a: “ {2 0} V } INPUT OBJ →→ a « ‘ 2*a^2 3 ‘  NUM ” F” → TAG »» Modify it to r ead: Not e : F or mathemati cal oper ations w ith tagged quantiti es , the calculat or w ill "detag" the quantity aut omaticall y bef or e the oper ati on. F or e x ample , the left- hand side f igur e belo w sho w s two tagged q uantitie s bef or e and after pr essing the * k ey in RPN mode:
Pa g e 2 1 - 3 5 « “ Enter a: “ { “  :a: “ {2 0} V } INPUT OBJ →→ a « ‘ 2*a^2 3 ‘ EVAL ” F” →TAG a SWAP »» (R ecall that the functi on S W AP is av ailable b y using „° @) STACK @SW AP@ ). Stor e the pr ogram bac k into FUNCa b y using „ @FUNCa . Ne xt , run the pr ogr am by pr essing @FUNCa . En ter a v alue of 2 w hen pr ompted , and pr ess ` . The r esult is no w t w o tagged numbers a:2. in s tac k lev el 2 , and F:11. in stac k le v el 1. T o see the oper atio n of the func tion FUNC a, s tep by s tep , you could us e the DBUG func tion as f ollo w s: ³ @FUNCa ` Co pie s progr am name to stack le v el 1 „°LL @) @RUN@ @@DBG@ Starts debugger @SST ↓ @ S tep-b y-step debugging , r esult: “Ente r a:” @SST ↓ @ Res ul t: {“  a:” {2 0} V } @SST ↓ @ R esult: us er is pr ompted to en ter v alue of a 2` Ente r a value o f 2 f or a . R esult: “  :a:2” @SST ↓ @ Res ul t: a: 2 @SST ↓ @ R esult: empty stac k , e xec uting → a @SST ↓ @ Re sult: empty s tack , enter i ng subpr ogram « @SST ↓ @ R esult: ‘2*a^2 3’ @SST ↓ @ R esult: empty stac k , calc ulating @SST ↓ @ Re sult: 11., @SST ↓ @ Res ul t: “F ” @SST ↓ @ Re sult: F: 11. @SST ↓ @ Res ul t: a: 2 . @SST ↓ @ R esult: s w ap le ve ls 1 and 2 @SST ↓ @ leav ing subpr ogr am » @SST ↓ @ lea ving main pr ogram » Not e : Because w e us e an input str ing to get the input data v alue , the local va ria b le a actuall y stor es a tagged value ( :a:2 , in the ex ample abo ve ) . T her ef or e , we do not need to tag it in the output . All w hat we need to do is place an a bef or e the S W AP functi on in the subpr ogr am abov e , and the tagged input is placed in the s tack . It should be pointed out that , in perf orming the calc ulati on of the func tion , the tag o f the tagged input a is dr opped aut omaticall y , and only its n umer ical v alue is used in the calc ulati on.
Pa g e 2 1 - 3 6 Ex ample 3 – tagging input and outpu t fr om f uncti on p(V ,T) In this e xample w e modify the pr ogr am @@@p@@@ so that the o utput tagged input v alues and t agged r esult . Use ‚ @@@p@@@ to r ecall the cont ents of the pr ogram to the st ack: « “ 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 r ead: « “ Enter V, T and n: “ { “  :V:  :T:  :n: “ {2 0} V } INPUT OBJ →→ V T n « V T n ‘ (8.31451_J/(K*mol))*(n*T/V) ‘ EVAL “ p” → TAG »» Not e : Notice that w e hav e placed the calculati on and tagging of the func tion p(V ,T ,n) , pr eced ed b y a r ecall of the input v ari ables V T n, into a sub-pr ogr am [the sequ ence of instr ucti ons contained w ithin the inner set of pr ogr am sy mbols « » ]. Th is is necessa ry becaus e wi thout the pr ogram s ymbol separ ating the tw o listings of in put v ar ia bles ( V T N « V T n) , the pr ogr am w ill assume that the input co mmand → V T N V T n r equir es si x input value s, w hile onl y thr ee are a v ailable . T he r esult w ould hav e been the gener ation of an er r o r message and the in terr uption of the pr ogr am exe cut io n. T o inc lude the subpr ogr am mentio ned abo ve in the modif ied de finiti on of pr ogr am @@@p@@@ , w ill r equire y ou to use ‚å at the beginning and end of the sub-pr ogr am . Because the pr ogram s ymbols occ ur in pairs , w henev er ‚å is in vo k ed, y ou w ill need to er ase the c losing pr ogr am s y mbol (») at the beginning , and the opening pr ogram s ymbol ( « ) at the end, o f the sub-pr ogr am. T o er ase an y char acter w hile editing the pr ogr am , place the cur sor to the r ight of the c harac ter to be e ras ed and use the backs pace ke y ƒ .
P age 21-3 7 Stor e the progr am back into var ia ble p by using „ @@@p@@@ . Ne xt , run the pr ogr am by pr essing @@@p@@@ . Ent er value s of V = 0. 01_m^3, T = 30 0_K, and n = 0.8_mol , when pr ompted . Bef or e pre ssing ` for input , the s tack w ill look lik e this: After e xec uti on of the pr ogr am , the stac k w ill look lik e this: Using a message bo x A mess age box is a f anc ie r wa y to pr es ent output f r om a pr ogr am. T he mes sage bo x command in th e calc ulator is obtained b y using „°L @) @OUT@ @ MSGBO@ . The me ssage bo x command re quir es that the ou tput str ing to be placed in the box be a vaila ble in stac k lev el 1. T o see the oper ation o f the MS GBO X command tr y the f ollo w ing e xer c ise: ‚Õ~‚t~„ê1.2 ‚Ý ~„r~„a~„d „°L @) @OUT@ @ MSGBO@ In summar y : T he common thr ead in the thr ee e xample s sho wn her e is the us e of tag s to id entify inpu t and ou tput va ri able s. If w e u se an inpu t str ing to get our input v alues , those v alues ar e a l r eady pr e - t agged and can be ea sily r ecall into the stack f or output . U se of the → T A G command allo w s us to identify the output f r om a pr ogram .
P age 21-38 T he r esult is the f ollo w ing message bo x: Press @@@OK@@@ to c ancel the mes sage bo x . Y ou could us e a message bo x for o utput fr om a progr am b y using a tagged output , con verted to a s tring , as the output str ing f or MS GBO X. T o con v ert any tagged r esult , or any algebr ai c or non- tagged v alue , to a str ing , use the fu nct ion → S T R a v ailable at „° @) TYPE@ @  STR . Using a message bo x for pr ogram output Th e fu nct ion @@@p@@@ , fr om the last e x ample , can be modifi ed to r ead: « “ Enter V, T and n: “ {“  :V: :T: :n: “ {2 0} V } INPUT OBJ →→ V T n « V T n ‘ (8.31451_J/(K*mol))*(n*T/V) ‘ EVAL “ p” → TAG → STR MSGBOX »» St ore the pr ogram bac k into v ar iable p b y using „ @@@p@@@ . R un the pr ogr am by pr essing @@@p@@@ . Ent er value s of V = 0. 01_m^3, T = 300_K , and n = 0.8_mol, w hen prom pted. As in the earli er v er sion o f @@@p@@@ , bef or e pr essing ` f or in put , the stac k w ill look lik e this: T he fir st pr ogr am output is a mes sage bo x containing the str ing:
P age 21-3 9 Press @@@OK@@@ to cancel message b o x output . The stack w ill now look like this: Including input and output in a m essage bo x W e could modify the pr ogram so that not onl y the output , but also the input , is inc luded in a message bo x . F or the case of pr ogram @@@p@@@ , the modifi ed pr ogr am wi ll look lik e: « “ Enter V, T and n: “ { “  :V: :T: :n: “ {2 0} V } INPUT OBJ →→ V T n « V → STR “  ” T → STR “  ” n → STR “  ” ‘ (8.31451_J/(K*mol))*(n*T/V)‘ EVAL “ p” → TAG → STR MSGBOX » » Notice that y ou need to add the follo wing p iece of code after eac h of the v ari able names V , T , and n, w ithin the sub-pr ogram: → STR “  ” T o get this p iece o f code typed in the fi rst time use: „° @) TYPE@ @  STR ‚Õ ‚ë ™ Becau se the f uncti ons f or the TYP E menu r emain a v ailable in the s oft menu k e ys , fo r the second and third occ urr ences o f the piece o f code ( → STR “  ” ) w ithin the sub-pr ogr am (i .e ., after v ar ia bles T and n , r especti vel y), all y ou need to use is : @  STR ‚Õ ‚ë ™
P age 21-40 Y ou w ill notice that after ty ping the k e ys tr ok e sequence ‚ë a ne w line is gener a t ed in the stac k. T he last modif icati on that needs to be included is to type in the plu s sign three times after the call t o the functi on at the v ery e nd of the sub-pr ogram . T o see the pr ogr am oper ating: Θ Stor e the progr am back into var ia ble p by using „ @@@p@@@ . Θ Run the pr ogr am by pr essing @@@p@@@ . Θ Enter v alues o f V = 0. 01_m^3, T = 30 0_K, and n = 0.8_mo l , when pr ompt ed. As in the earli er v ersi on of [ p ], bef or e pre ssing [ENTER] f or input , t he stac k w ill lo ok lik e this: T he fir st pr ogr am output is a mes sage bo x containing the str ing: Press @@@OK@@@ to cancel me ssage bo x output . Not e : The plu s sign ( ) in this pr ogr am is used to concate nate strings. Co ncatenation is simpl y the operati on of j oining indi v idual char acter str ings .
P age 21-41 Incorpor ating units within a program As y ou ha ve bee n able to obse r v e fr om all the ex amples f or the diffe r ent vers ion s of pro gram @@@p@@@ pr es ented in this cha pter , attac hing units to input v alues may be a t ediou s pr ocess . Y ou could ha v e the pr ogr am itself attach those units to the input and output v alues . W e w ill illustr ate thes e options b y modify ing y et once mor e the pr ogr am @@@p@@@ , as f ollo ws . R ecall the con tents of pr ogram @@@p@@@ to the stack b y using ‚ @@@p@@@ , and modify them to look like this: « “ Enter V,T,n [S.I.]: “ {“  :V: :T: :n: “ {2 0} V } INPUT OBJ →→ V T n « V ‘ 1_m^3 ’ * T ‘ 1_K ’ * n ‘ 1_mol ’ * → V T n « V “V ” → TAG → STR “  ” T “T ” → TAG → STR “  ” n “ n ” → TAG → STR “  ” ‘ (8.31451_J/(K*mol))*(n*T/V)‘ EVAL “ p” → TAG → STR MSGBOX » » » T his new v ersi on of the pr ogram inc ludes an additi onal le vel o f sub- pr ogr amming (i .e ., a thir d le ve l of pr ogram s ymbols « », and s ome steps u sing lists , i .e ., V ‘ 1_m^3 ’ * { } T ‘ 1_K ’ * n ‘1_mol ’ * EVAL → V T n Th e in terpr etat i on o f this pi ece of cod e is as follo ws . (W e use input str ing value s of :V:0.01 , :T:300 , and :n:0.8 ): 1. V : T he value of V , as a tagged input (e .g ., V : 0. 01) is placed in the stac k . Not e : I’v e separ ated the pr ogr am arb itrar ily into se v er al lines f or eas y r eading . This is not neces sar ily the w ay that the pr ogr am show s up in the calc ulator’s s tack . The s equence of commands is cor rec t , ho w ev er . A lso , r ecall that the char acte r  does not sho w in the stac k , inst ead it pr oduces a ne w line .
P age 21-4 2 2. ‘ 1_m^3 ’ : The S .I. units cor r esponding t o V are then placed in stac k lev el 1, the tagged input f or V is mo v ed to stack lev el 2 . 3 . * : B y multipl y ing the contents of s tack le vels 1 and 2 , w e gener ate a number w ith units (e .g ., 0. 01_m^3) , but the ta g is lost . 4. T ‘ 1_K ’ * : Calc ulating v alue of T inc luding S .I. units 5. n ‘ 1_mol ’ * : Calc ulating v alue of n inc luding units 6. → V T n : T he v alues of V , T , and n , located r especti v ely in s tack le vels 3, 2 , and 1, are pa ssed on to the ne xt lev el of sub-pr ogr amming. T o see this v ers ion of the progr am in action do the f ollo w ing: Θ Stor e the progr am back into var ia ble p by using [  ][ p ]. Θ Run the pr ogram b y pr essing [ p ]. Θ Enter v alues of V = 0. 01, T = 300, and n = 0.8 , when pr ompted (no units r equir ed now). Bef or e pre ssing ` f or inpu t , the stac k will loo k lik e this: Press ` to run the pr ogr am. T he output is a mes sage bo x containing the string :
P age 21-4 3 Press @@@OK@@@ to cancel me ssage bo x output . Me s sag e bo x output without units Let ’s modify the progr a m @@@p@@@ once mor e to eliminate the us e of units thr oughout it . The unit-less pr ogram w ill 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 w hen run w ith the in put data V = 0. 01, T = 300, and n = 0.8 , pr oduces the messa ge bo x output: Press @@@OK@@@ to c ancel the mes sage bo x output . Relational and logical oper ators So far w e hav e w ork ed mainl y w ith sequenti al pr ogr ams. T he Us er RPL language pr o v ides st atements that allo w branc hing and looping of the pr ogram flo w . Man y of these mak e dec isions bas ed on whe ther a logical st atement is true or not . In this secti on w e pre sent so me of the elements used to constr uct suc h logical s tatements , namel y , r elational and logi cal oper ators . Relational oper ators R elational oper ators ar e those oper ators us ed to compar e the r elati v e positi on of tw o obj ects . F or e x ample , dealing w ith re al numbers onl y , r elati onal
P age 21-44 oper ators ar e used to mak e a statement r egarding the r elativ e position of t w o or mor e r eal numbers . Depending on the ac tual numbers us ed, su ch a st atement can be true (r epr es ented b y the numer i cal value o f 1. in the calc ulator ) , or fals e (r epr ese nted by the numer ical value of 0. in the calc ulator ) . T he relati onal oper ators a vaila ble for pr ogramming the calc ulator ar e: ___________ _____________________ ____________________ Oper ator Mea ning Ex ample ___________ _____________________ ____________________ ːːʳ “is equal to ” ‘ x==2’ ≠ “is not equal to ” ‘3 ≠ 2’ ˏ “is less than ” ‘ m<n ’ > “is great er than ” ‘10>a ’ ≥ “is greater th an or equa l to ” ‘ p ≥ q’ ≤ “is less than or eq ual to ” ‘7 ≤ 12’ ___________ _____________________ _____________________ All of the oper ators, e x cept == (w hich can be c reated b y t y ping ‚Å ‚Å ) , ar e av ailable in the k e yboar d. T he y ar e also av ailable in „° @) TEST@ . T w o numbers , var iables, o r algebr aics connec ted b y a r elational oper ator f orm a logical e xpr essi on that can take v alue of true (1.) , f alse (0.) , or could simpl y not be ev aluated . T o deter mine whether a logi cal state ment is tr ue or not , place the stat ement in stac k lev el 1, and pr ess EV AL ( μ ) . Ex amples: ‘2<10’ μ , r esult: 1. (tr ue) ‘2>10’ μ , r esult: 0. (fals e) In the ne xt e x ample it is assumed that the var iable m is not initiali z ed (it has not been gi ve n a numer i cal value): ‘2==m ’ μ , r esult: ‘2==m ’ T he fact that the r esult fr om e v aluating the stateme nt is the same or iginal stat ement indicate s that the stateme nt cannot be e v aluated unique ly .
P age 21-45 Logical oper ators L ogical oper ator s ar e logical partic les that ar e used to jo in or modify simple logical s tatements . The logical ope rat ors a vaila ble in the calculat or can be easily acc essed thr ough the ke ys trok e sequence: „° @ ) TEST@ L . T he av ailable logi cal oper ator s ar e: AND , OR, X OR (e xc lusi ve or ) , NO T , and S AME . The oper ators w i ll pr oduce results that ar e true or f alse , depending on the truth-v alue of the logi cal stat ements affec ted . Th e oper ator NO T (negation) applie s to a single logical s tateme nts. All o f the others appl y to tw o logical statements . T abulating all pos sible combinations o f one or two st atements together w ith the r esulting v alue of appl y ing a certain logical oper ator pr oduces w hat is called the truth t able of the oper ator . T he follo wing ar e tru th tables of eac h of the standar d logical oper ators a v ailable in the calc ulator : p NOT p 10 01 pq p A N D q 111 100 010 000 pq p O R q 111 101 011 000
Pa g e 2 1 - 4 6 T he calculat or include s also the logi cal oper ator S AME . This is a non-standar d logical ope rat or used t o deter mine if two ob jec ts ar e identi cal . If they are identi cal , a value o f 1 (true) is r eturned , if no t, a value of 0 (f alse) is r etur ned. F or ex ample , the f ollo wing e xer cis e , in RPN mod e , re turns a v alue of 0: ‘S Q(2)’ ` 4 ` SA M E P lease noti ce that the use of S AME implies a v ery str ic t interpr etati on of the w ord “i dentical . ” F or that r eason , S Q(2) is not identi cal to 4, although the y both e valuate , numer icall y , to 4. Pr ogram br anching Br anching o f a progr am flo w implies that the pr ogr am mak es a decisi on among two or mor e possible fl ow paths . T he User RP L language pr o v ides a n umber of commands that can be us ed for pr ogram br anching . T he menus con taining thes e commands are acce ss ed thr ough the ke ys tr ok e sequ ence: „° @) @BRCH@ T his menu sho ws sub-men us f or the pr ogr am construc ts T he pr ogr am construc ts IF…THEN..EL SE…END , and CA SE…THEN…END w ill be r ef er red t o as pr ogram branc hing cons truc ts. The r emaining cons tru cts, namely , S T AR T , F OR , DO , and WHI LE , ar e appropr iate fo r controlling r epetitiv e pr ocessing w ithin a pr ogr am and will be r ef err ed to as pr ogr am loop constr ucts . The latter types o f pr ogram cons truc ts ar e pr esented in mor e detail in a later s ectio n. pq p X O R q 110 101 011 000
P age 21-4 7 Br anc hing w ith I F In this secti on w e pr esen ts e xample s using the constr ucts IF…THEN…END and IF…THEN…ELSE…END . T he I F…THEN…END construct T he IF…THEN…END is the simplest of the IF pr ogr am constr ucts . The gener al fo rmat of this co nstruc t is: IF logical_statement THEN program_statements END . T he oper ation of this co nstru ct is as f ollo w s: 1. Ev aluate logical_st atement . 2 . If logical_st atement is true , perfor m pr ogr am _st atements and continue pr ogr am flo w afte r the END statemen t . 3 . If logical_s tatement is fals e , skip pr ogr am_statements and co ntinue pr ogr am flo w afte r the END statemen t . T o type in the particle s IF , THEN, ELSE , and END , us e: „° @) @BRCH@ @ )@IF@@ Th e fu nct ion s @@@IF@@ @@THEN @@ELSE@ @@ END@@ ar e av ailable in that menu t o be t y ped selecti vel y by the u ser . Alternati vel y , to produce an IF…THEN…END constru ct dir ectl y on the stac k , use: „° @) @BRCH@ „ @ ) @IF@@ T his will c r eate the f ollo wing in put in the stac k:
P age 21-48 W ith the cur sor  in fr ont of the IF stat ement pr ompting the us er fo r the logical stat ement that wi ll acti vate the I F cons truct when the pr ogr am is e xec ut ed. Ex ample : T ype in the fo llow ing progr am: « → x « IF ‘x<3 ’ THEN ‘x^2 ‘ EVAL END ”Done ” MSGBOX » » and sa v e it under the name ‘f1 ’ . Pre ss J and v er ify that v ari able @@@f1@@@ is indeed av ailable in your var ia ble menu . V er ify the follo wing r esults: 0 @@@f1 @@@ Re sult: 0 1.2 @@@f1 @@@ Re sult: 1.44 3.5 @@@f1@@@ Result: no ac tion 10 @@@ f1 @@@ Re sult: no acti on T hese r esults conf irm the cor rec t oper ation o f the IF…THEN…END construc t . T he progr am, as w r itten , calculat es the func tion f 1 (x) = x 2 , if x < 3 (and not output otherwise) . The IF…THEN…ELSE…E ND construct T he IF…THEN…ELSE…END constr uct per mits two alt ernati ve pr ogram f lo w paths based on the tr uth value o f the logical_s tatemen t . The ge neral f or mat of this constr uct is: IF logical_state ment THEN p rogram_stat ements_if_tru e ELSE program_statements_if_false END . T he oper ation of this co nstru ct is as f ollo w s: 1. Ev aluate logical_st atement . 2 . If logical_st atement is tr ue, perf orm pr ogram s tatemen ts_if_true and contin ue pr ogr am flo w after the END s tatement . 3 . If logical_st atement is false , perfor m pr ogr am statements_if_f alse and contin ue pr ogr am flo w after the END s tatement . T o pr oduce an IF…THEN…ELSE…END cons truc t dir ectl y on the stac k, use: „° @) @BRCH@ ‚ @ )@IF@@ T his will c r eate the f ollo wing in put in the stac k:
P age 21-4 9 Ex ample : T y pe in the f ollo w i ng pr ogram: « → x « IF ‘ x<3 ’ THEN ‘ x^2 ‘ ELSE ‘ 1-x ’ END EVAL ” Done ” MSGBOX » » and sa v e it under the name ‘f2 ’ . Pre ss J and ve rify that var iable @@@f2@@@ is indeed av ailable in your var ia ble menu . V er ify the follo wing r esults: 0 @@@f2@@@ Result: 0 1.2 @@@f2@@@ Result: 1.44 3 . 5 @@@f2@@@ Result: - 2 . 5 10 @@@f2@@@ R esult: -9 T hese r esults conf irm the corr ect oper ation o f the IF…THEN…ELSE…END constr uct . The pr ogr am, as w ritten , calc ulates the func tion Nested I F…THEN…ELSE…END constr uc ts In mos t computer pr ogramming language s wher e the IF…THEN…ELSE…END construct is a v ailable , the gener al for mat used for pr ogram pr esenta ti on is the fo llo w ing: IF logical_statement THEN program_statements_if_true ELSE program_statements_if_false END In designing a calc ulator pr ogr am that include s IF constr ucts , y ou could s tart by w riting b y hand the pseudo -code f or the IF constru cts as sho wn a bov e . F or e x ample , f or pr ogr am @@@f2@@@ , yo u could wr ite Not e : F or this partic ular case , a vali d alternati ve w ould ha v e been to use an IFTE fu ncti on of the f orm: ‘f2(x) = IF TE(x<3,x^2 ,1- x)’ ⎩ ⎨ ⎧ − < = otherwise x x if x x f , 1 3 , ) ( 2 2
P age 21-50 IF x<3 THEN x 2 ELSE 1-x END While this simple cons truc t w orks f ine w hen y our f uncti on has onl y tw o br anche s, y ou ma y need to nes t IF…THEN…ELSE…END constru cts to deal w ith func tion w ith three or mor e branc hes . F or e xample , conside r the functi on Her e is a possible w a y to e valuate this f uncti on using IF… THEN … ELSE … END constr ucts: 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 ex p( x) ELSE -2 END END END END ⎪ ⎪ ⎪ ⎩ ⎪ ⎪ ⎪ ⎨ ⎧ − < ≤ < ≤ < ≤ − < = elsewhere x if x x if x x if x x if x x f , 2 15 3 ), exp( 3 5 ), sin( 5 3 , 1 3 , ) ( 2 3 π π
P age 21-51 A comple x IF construc t like this is called a set o f n ested IF … THEN … EL SE … END constr ucts . A poss ible wa y to e valuate f3(x), based on the nested IF constr uct sho wn abo ve , is to w rite the pr ogr am: « → 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 » » Stor e the progr am in v ar iable @@@f3@@@ and tr y the f ollo w ing e valuati ons: 1. 5 @@f3 @@@ Res ul t : 2 .2 5 (i . e ., x 2 ) 2. 5 @@@f3@@@ Res ul t : 6.2 5 (i.e ., x 2 ) 4.2 @@@f3@@@ Res ul t : - 3 .2 (i .e ., 1- x) 5. 6 @@@f3@@@ Res ul t -0.6 312 66… (i .e., sin(x), with x in r adians) 12 @@@f3@@@ Res ul t : 16 2 7 5 4.7 91419 (i .e ., e xp(x)) 23 @@@f3@@@ Res ul t : - 2 . (i .e ., - 2) T he CASE construct T he CASE constr uct can be us ed to code sev eral po ssible pr ogr am flu x paths, as in t he c ase of the neste d I F con struct s p r e sente d ea rlier . The gen er a l forma t of this cons truc t is as f ollo ws: CASE Logical_statement 1 THEN program_statements 1 END Logical_statement 2 THEN program_statements 2 END . . . Logical_statement THEN program_statements END Default_program_statements (optional) END When e val uating this constru ct , the pr ogr am tes ts each o f the logical_stateme nts until it f inds one that is tr ue . T he progr am ex ec utes the cor re sponding
Pa g e 2 1 - 52 pr ogr am_stateme nts , and pa sses pr ogram f lo w to the statement f ollow ing the END state ment. T he CASE , THEN, and END st atements ar e a vailable f or selecti ve typ ing by using „° @) @ BRCH@ @ ) CASE@ . If y ou ar e in the BRCH menu , i .e., ( „° @) @ BRCH@ ) y ou can use the f ollo w ing shortc uts to type in y our CA SE cons truc t (The locati on of the c ursor is indi cated by th e symb o l  ): Θ „ @) CASE@ : St ar ts the case cons truc t pr o vi ding the pr ompts: CA SE  THEN END END Θ ‚ @) CASE@ : Comple tes a CA SE line b y adding the par ti cle s THEN  END Ex ample – pr ogr am f 3 (x) using the CA SE statement T he functi on is def ined by the f ollo w ing 5 e xpr essi ons: Using the CA SE statement in U ser RPL language w e can code this functi on as: « → x « CASE ‘x<3 ‘ THEN ‘x^2 ‘ END ‘x<5 ‘ THEN ‘1-x ‘ END ‘x<3* π ‘ THEN ‘SIN(x) ‘ END ‘x<15 ‘ THEN ‘EXP(x) ‘ END –2 END EVAL » » Stor e the pr ogr am into a v ari able called @@f3 c@ . T hen, try the fo llo w ing ex er cis es: 1. 5 @@f3c@ Re su l t : 2 .2 5 (i .e ., x 2 ) 2. 5 @@f3c@ Res u l t : 6.2 5 (i .e ., x 2 ) 4.2 @@f3c@ Re su l t : -3 .2 (i .e ., 1- x) ⎪ ⎪ ⎪ ⎩ ⎪ ⎪ ⎪ ⎨ ⎧ − < ≤ < ≤ < ≤ − < = elsewhere x if x x if x x if x x if x x f , 2 15 3 ), exp( 3 5 ), sin( 5 3 , 1 3 , ) ( 2 3 π π
Pa g e 2 1 - 5 3 5. 6 @@ f3c@ Re s ul t : -0.6 312 6 6… (i .e ., sin(x) , w ith x in r adians) 12 @@f3c@ Re su l t : 1 6 2 7 54.7 91419 (i .e., e x p(x)) 23 @@f3c@ Res u lt - 2 . (i .e ., - 2) As yo u can see , f3c produces e xactl y the same r esults as f3 . The onl y diffe r ence in the pr ogr ams is the branc hing constr ucts u sed . F or the cas e of fu nct ion f 3 (x) , w hi ch r equir es fi ve e xpr essi ons fo r its def initi on, the CA SE cons truct ma y be easi er to code than a number of ne sted IF … THEN … ELSE … END cons truc ts. Pr ogram loops Pr ogr am loops ar e constr ucts that per mit the pr ogr am the e xec ution of a n umb e r of st atements r epeatedl y . F or ex ample , suppose that y ou w ant to calc ulate the summation of the s quar e of the int eger numbers f r om 0 to n , i .e ., T o calc ulate this summation all that y ou ha ve t o do is use the ‚½ key w ithin the equation edit or and load the limits and e xpr essi on f or the summation (e x amples of summati ons ar e pr esent ed in Chapter s 2 and 13) . Ho w ev er , in or der to ill ustr ate the use o f pr ogr amming loops, w e will calc ulate this summation w ith our ow n User RP L codes . Ther e ar e f our differ ent commands that can be used to code a pr ogr am loop in Us er RPL , thes e ar e S T ART , FOR , DO , and WHILE . T he commands S T ART and F OR use an inde x o r counte r to deter mine ho w man y times the loop is e x ecu ted . The co mmands DO and WHILE re ly on a logical statemen t to dec ide w hen t o ter minate a loop e x ecu tion . Ope rati on of the loop commands is de sc ri bed in detail in the fo llo w ing secti ons . Th e ST ART c on st ruc t The S T AR T c onstruct uses two values of an ind e x to ex ecute a numb er of statements r e peatedl y . Ther e ar e two v ersi ons of the S T ART cons truct: ST A RT … N E X T a n d ST A R T … ST E P . Th e STAR T … N E X T ve r s io n i s u s e d wh e n t h e inde x incr ement is equ al to 1, and the S T ART…S TEP ver sion is us ed when the inde x incr ement is determined b y the user . ∑ = = n k k S 0 2
P age 21-54 Commands in v ol ved in the S T AR T constru ct ar e av ailable thr ough: „° @) @BRCH@ @ )START @ST ART W ithin the BRCH men u ( „° @) @BRCH@ ) the follo wi ng ke ys tr ok es ar e a vailabl e to gener ate S T AR T construc ts (the s y mbol indicates c ur sor positi on) : Θ „ @START : Starts the S T AR T…NEXT constru ct: S T AR T  NEXT Θ ‚ @START : Starts the S T AR T…S TEP construc t: S T ART  ST E P The S T ART…NEXT construct T he gener al fo rm of this statemen t is: start_value end_value START program_statements NEXT Becau se f or this case the inc r ement is 1, in or der for the loop to end y ou should ensur e that start_value < end_value . Otherw ise y ou w ill pr oduce w hat is called an inf inite (ne ver -ending) loop . Ex ample – calc ulating of the summation S de fined abo v e T he S T AR T…NEXT constr uct contains an inde x who se v alue is inaccessible to the use r . Since f or the calc ulation o f the sum the inde x itself (k, in this case ) is needed , we m ust c r eate our o wn inde x , k , that we w ill inc r ement w ithin the loop eac h time the loop is ex ecut ed. A po ssible impleme ntati on f or the calc ulation o f S is the pr ogr am: « 0. DUP → n S k « 0. n START k SQ S 1. ‘ k‘ STO ‘ S‘ STO NEXT S “ S” →TAG » » T ype the pr ogr am in, and s av e it in a var iable called @@ @S1@@@ . Her e is a bri ef explanati on of ho w the pr ogr am wor ks:
Pa g e 2 1 - 5 5 1. T his pr ogr am needs an integer numbe r as inpu t . Th us , bef or e e xec utio n, that number (n) is in st ack le v el 1. The pr ogram is the n ex ec uted . 2 . A z er o is enter ed , mo v ing n to st ack le vel 2 . 3 . The command DUP , w hic h can be typed in as ~~dup~ , copies the contents of s tack le v el 1, mo ves all the stac k le vels u pw ards , and places the cop y ju st made in stac k le vel 1. T hus, afte r DUP is ex ecut ed , n is in stac k le ve l 3, and z er oes f ill st ack le vels 1 and 2 . 4. T he piece of code → n S k s tor es the value s of n , 0, and 0, r especti vel y into local v ar iab les n , S, k . W e sa y that the var ia bles n , S, and k ha v e been initiali z ed (S and k to z er o , n to whate v er value the user c hooses). 5 . The p iece of code 0. n START identif ies a S T ART loop w hos e index w ill tak e values of 0, 1, 2 , … , n 6 . The sum S is inc r ement ed b y k 2 in the pi ece of code that r eads: k SQ S 7 . T he inde x k is incr emented b y 1 in the piece o f code that reads: 1. k 8. At this point , the updated value s of S and k are a v ailable in stac k lev els 2 and 1, r especti vel y . The pi ece of code ‘ k‘ STO stores the v a lue from stack le vel 1 into local v ar iable k . The updat ed value of S no w occ upie s stac k le vel 1. 9 . The p iece of code ‘ S‘ STO sto r es the value f r om stac k le vel 1 in to local va riab le k. Th e sta ck is now emp t y . 10. The partic le NEXT incr eases the inde x by one and se nds the contr ol to the beginning of the loop (s tep 6) . 11. The loop is r epeated until the loop inde x r eaches the max imum v alue , n. 12 . The las t part of the pr ogram r ecalls the la st v alue of S (the summation), tags it , and places it in stac k lev el 1 to be v ie w ed b y the user as the pr ogr am output. T o see the pr ogr am in action , step by s tep , y ou can use the debugger as f ollo w s (use n = 2) . Le t SL1 mean stac k lev el 1: J2 [‘] @@@S1@@ ` P lace a 2 in le v el 2 , and the pr ogr am name , ‘S1’ , in lev el 1
P age 21-5 6 „°LL @) @RUN@ @@DBG@ Start the debugger . SL1 = 2 . @SST ↓ @ SL1 = 0., SL2 = 2 . @SST ↓ @ SL1 = 0., SL2 = 0. , SL3 = 2 . (DUP) @SST ↓ @ Empty stac k (-> n S k) @SST ↓ @ Empty stac k ( « - st art subpr ogr am) @SST ↓ @ SL1 = 0., (s tart value of loop inde x) @SST ↓ @ SL1 = 2 .(n) , SL2 = 0. (end v alue of loop inde x) @SST ↓ @ Empty stac k (S T AR T – beginning of loop) --- loop e xec ution n umber 1 f or k = 0 @SST ↓ @ SL1 = 0. (k) @SST ↓ @ SL1 = 0. (S Q(k) = k 2 ) @SST ↓ @ SL1 = 0.(S), SL2 = 0. ( k 2 ) @SST ↓ @ SL1 = 0. (S k 2 ) @SST ↓ @ SL1 = 1., SL 2 = 0. (S k 2 ) @SST ↓ @ SL1 = 0.(k) , SL2 = 1., SL3 = 0. (S k 2 ) @SST ↓ @ SL1 = 1.(k 1), SL2 = 0. (S k 2 ) @SST ↓ @ SL1 = ‘k ’ , SL2 = 1., SL3 = 0. (S k 2 ) @SST ↓ @ SL1 = 0. (S k 2 ) [St or es v alue of SL2 = 1, into SL1 = ‘k ’] @SST ↓ @ SL1 = ‘S’ , SL2 = 0. (S k 2 ) @SST ↓ @ Empty st ack [S tor es value of SL2 = 0, int o SL1 = ‘S’] @SST ↓ @ Empty stac k (NEXT – end of loop) --- loop e xec ution n umber 2 f or k = 1 @SST ↓ @ SL1 = 1. (k) @SST ↓ @ SL1 = 1. (S Q(k) = k 2 ) @SST ↓ @ SL1 = 0.(S), SL2 = 1. ( k 2 ) @SST ↓ @ SL1 = 1. (S k 2 ) @SST ↓ @ SL1 = 1., SL 2 = 1. (S k 2 ) @SST ↓ @ SL1 = 1.(k) , SL2 = 1., SL3 = 1. (S k 2 ) @SST ↓ @ SL1 = 2 .(k 1) , SL2 = 1. (S k 2 ) @SST ↓ @ SL1 = ‘k ’ , SL2 = 2 ., SL3 = 1. (S k 2 )
P age 21-5 7 @SST ↓ @ SL1 = 1. (S k 2 ) [S tor es v alue of SL2 = 2 , into SL1 = ‘k ’] @SST ↓ @ SL1 = ‘S’ , SL2 = 1. (S k 2 ) @SST ↓ @ Empty st ack [S tor es value of SL2 = 1, int o SL1 = ‘S’] @SST ↓ @ Empty stac k (NEXT – end of loop) --- loop e xec ution n umber 3 f or k = 2 @SST ↓ @ SL1 = 2 . (k) @SST ↓ @ SL1 = 4. (S Q(k) = k 2 ) @SST ↓ @ SL1 = 1.(S), SL2 = 4. ( k 2 ) @SST ↓ @ SL1 = 5 . (S k 2 ) @SST ↓ @ SL1 = 1., SL2 = 5 . (S k 2 ) @SST ↓ @ SL1 = 2 .(k) , SL2 = 1., SL3 = 5 . (S k 2 ) @SST ↓ @ SL1 = 3 .(k 1) , SL2 = 5 . (S k 2 ) @SST ↓ @ SL1 = ‘k ’ , SL2 = 3 ., SL3 = 5 . (S k 2 ) @SST ↓ @ SL1 = 5 . (S k 2 ) [S tor es v alue of SL2 = 3, into SL1 = ‘k ’] @SST ↓ @ SL1 = ‘S’ , SL2 = 5 . (S k 2 ) @SST ↓ @ Empty st ack [S tor es value of SL2 = 0, int o SL1 = ‘S’] @SST ↓ @ Empty stac k (NEXT – end of loop) --- fo r n = 2 , the loop inde x is e xhau sted and contr ol is pas sed to the st atement fo llo w ing NEXT @SST ↓ @ SL1 = 5 (S is r ecalled to the stac k) @SST ↓ @ SL1 = “S” , SL2 = 5 ( “S” is placed in the stac k) @SST ↓ @ SL1 = S:5 (tagging outpu t value) @SST ↓ @ SL1 = S:5 (lea v ing sub-pr ogram ») @SST ↓ @ SL1 = S:5 (lea v ing main pr ogr am ») T he step-b y-st ep listing is f inished. T he r esul t of r unning pr ogr am @@@S1@@ wit h n = 2, i s S : 5 . Chec k also the follo wing r esults: J
P age 21-5 8 3 @@@S1@@ Res ul t: S:14 4 @@@S1@@ Res ul t : S:30 5 @@@S1@@ Res ul t: S:55 8 @@@S1@@ Res ul t : S:204 10 @@@S1 @@ Res ul t: S:385 20 @@@S1@@ Res u lt : S:2870 30 @@@S1@@ Res ul t: S:9455 100 @@@S1@@ Re su l t : S:338350 The ST ART…STEP construct T he gener al fo rm of this statemen t is: start_value end_value START program_statements increment NEXT T he start_value , end_value , and increment of the loop inde x can be positi v e or negati ve q uantities . F or increment > 0 , e x ec utio n occur s as long as the inde x is less than o r equal to end_value . F or increment < 0 , e x ec utio n occ urs as long as the inde x is gr eater than or equal to end_value . Ex ample – gener ating a list of v alues Suppos e that yo u want to gener ate a list of v alues of x fr om x = 0.5 to x = 6 . 5 in inc r ements of 0.5 . Y ou can wr ite the f ollo w ing pr ogr am: « → xs xe dx « xs DUP xe START DUP dx dx STEP DROP xe xs – dx / ABS 1 →LIST » » and stor e it in var ia ble @GLIST . In this pr ogr am , xs = starting v alue of the loop , xe = ending value of the loop , dx = inc remen t value f or loop . The pr ogr am places v alues of xs, xs dx , xs 2 ⋅ dx, xs 3 ⋅ dx , … in the stack . Th en, it calc ulates the number of elements gener a t ed using the pi ece of code: xe xs – dx / ABS 1. F inally , the pr ogr am puts together a list w ith the elements placed in the st ack . Θ Chec k out that the pr ogram call 0. 5 ` 2. 5 ` 0. 5 ` @GLIST pr oduces the list {0. 5 1. 1.5 2 . 2 . 5}. Θ T o see step-b y-step oper ation use the pr ogram DBUG f or a short lis t , for e xample:
P age 21-5 9 J 1 # 1.5 # 0. 5 ` Enter p ar ameters 1 1. 5 0.5 [ ‘ ] @GLIST ` Ente r the pr ogr am name in le v el 1 „°LL @) @RUN@ @@DBG@ St art the debugger . Use @SST ↓ @ to s tep into the pr ogr am and see the detailed oper ati on of each command . T he FOR construct As in the case of the S T AR T command, the F OR command has tw o v ari ations: the FO R…NEXT constr uct , for loop inde x inc r ements of 1, and the F OR…S TEP constr uct , for loop inde x incr ements selec ted b y the use r . Unlik e the S T AR T command , ho w e ver , the FOR command does r equir e that w e pro vi de a name fo r the loop inde x (e .g ., j, k, n). W e need not to w or r y abou t incr ementing the inde x oursel v es, as done in the e xample s using S T AR T . The value cor re sponding to the inde x is av ailable f or calc ulations . Commands in v olv ed in the FO R construc t ar e av ailable thr ough: „° @) @BRCH@ @ )@FOR W ithin the BRCH menu ( „° @) @BRCH@ ) the fo llow ing ke ystr ok es ar e av ailable to gener ate FOR cons tructs (the s ymbo l  indi cates c ur sor po sitio n) : Θ „ @) @FOR : S tarts the FOR…NEXT construc t: FOR  NEXT Θ ‚ @) @FOR : S tarts the FOR…S TEP constr uct: FOR  ST E P The FOR…NE XT construct T he gener al fo rm of this statemen t is: start_value end_value FOR loop_index program_statements NEXT
P age 21-60 T o av oid an inf inite loop , mak e sur e that start_value < end_value . Ex ample – ca lc ulate the summation S using a F OR…NEXT construc t T he follo w ing pr ogram calc ulates the summation Using a FOR…NEXT loop : « 0 → n S « 0 n FOR k k SQ S ‘ S‘ STO NEXT S “ S” →TAG » » Stor e this pr ogram in a v ar iable @@ S2@@ . V er ify the follo wing e xe r c ises: J 3 @@@S2@@ Res ul t: S:14 4 @@@S2@@ Res ul t: S:30 5 @@@S2@@ Res ul t: S:55 8 @@@S2@@ Res ul t: S:204 10 @@@S2 @@ Res ul t: S:385 20 @@@ S2 @@ Res ul t: S:2870 30 @@@S2@@ Res ul t: S:9455 100 @@@S2@@ Res ul t: S:338350 Y ou ma y hav e noticed that the pr ogr am is muc h simpler than the one stor ed in @@@S1@@ . Ther e is no need to initiali z e k , or to inc r ement k w ithin the pr ogr am . The pr ogr am itself tak es car e of pr oduc ing such inc r ements . The FOR…S TEP construct T he gener al fo rm of this statemen t is: start_value end_value FOR loop_index program_statements increment STEP T he start_value , end_value , and increment of the loop inde x can be positi v e or negati ve q uantities . F or increment > 0 , e x ec utio n occur s as long as the inde x is less than o r equal to end_value . F or increment < 0 , e x ec utio n occ urs as long as the inde x is gr eater than or equal to end_value . Pr ogram statements ar e ex ec uted at least once (e .g ., 1 0 START 1 1 STEP ret u rn s 1 ) ∑ = = n k k S 0 2
P age 21-61 Ex ample – gener ate a list of number s using a FOR…S TEP construc t T ype in the pr ogram: « → xs xe dx « xe xs – dx / ABS 1. → n « xs xe FOR x x dx STEP n →LIST » » » and stor e it in var ia ble @GLIS2 . Θ Chec k out that the pr ogram call 0. 5 ` 2. 5 ` 0. 5 ` @GLIS2 pr oduces the list {0. 5 1. 1.5 2 . 2 . 5}. Θ T o see step-b y-step oper ation use the pr ogram DBUG f or a short lis t , for e xample: J 1 # 1.5 # 0. 5 ` Enter p ar ameters 1 1. 5 0.5 [‘] @GLIS2 ` Ente r the pr ogr am name in le v el 1 „°LL @) @RUN@ @@DBG@ St art the debugger . Use @SST ↓ @ to s tep into the pr ogr am and see the detailed oper ati on of each command . T he DO construc t T he gener al str uctur e of this command is: DO program_statements UNTIL logical_statement END T he DO command starts an indef inite loop e x ecu ting the pr ogr am_stat ements until the logi cal_stat ement r eturns F ALSE (0) . The logical_statement must cont ain the value o f an index w hose v alue is changed in the program_statements . Ex ample 1 - This pr ogram pr oduces a counte r in the upper left cor ner of the sc r een that adds 1 in an indef inite loop until a k e y str oke (pr ess an y k e y) stop s the counter : « 0 DO DUP 1 DISP 1 UNTIL KEY END DROP » Command KEY ev aluates to TRUE when a ke y str ok e occurs. Ex ample 2 – calc ulate the summati on S using a DO…UNT IL…END constru ct
P age 21-6 2 T he follo w ing pr ogram calc ulates the summation 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 ” → T AG » » Stor e this pr ogram in a v ar iable @@ S3@@ . V er ify the follo wing e xe r c ises: J 3 @@@S3@@ Res u lt : S:14 4 @@@S3@@ Res ul t : S:30 5 @@@S3@@ Res u lt : S:55 8 @@@S3@@ Res ul t : S:204 10 @@@S3 @@ Res ul t: S:385 20 @@@ S3 @@ Res u l t: S:2870 30 @@@S3@@ Res ul t: S:9455 100 @@@S3@@ Res u lt : S:338350 Ex ample 3 – gener ate a lis t using a DO…UNT IL…END constr uct T ype in the follo w ing pr ogr am « → xs xe dx « xe xs – dx / ABS 1. xs → n x « xs DO ‘x dx’ EVAL DUP ‘x’ STO UNTIL ‘x ≥xe’ END n →LIST » » » and stor e it in var ia ble @GLIS3 . Θ Chec k out that the pr ogram call 0. 5 ` 2. 5 ` 0. 5 ` @GLIS3 pr oduces the list {0. 5 1. 1.5 2 . 2 . 5}. Θ T o see step-b y-step oper ation us e the progr am D BUG f or a short list, f or e xample: J 1 # 1.5 # 0. 5 ` Enter p ar ameters 1 1. 5 0.5 [‘] @GLIS3 ` Ente r the pr ogr am name in le v el 1 „°LL @) @RUN@ @@DBG@ St art the debugger . Use @SST ↓ @ to s tep into the pr ogr am and see the detailed oper ati on of each command . ∑ = = n k k S 0 2
Pa g e 2 1 - 6 3 T he WHILE construct T he gener al str uctur e of this command is: WHILE logical_statement REPEAT program_statements END T he WHILE stateme nt w ill r epeat the program_statements wh il e logical_statement is tr ue (non z er o) . If not , pr ogram contr ol is pa ssed to the stat ement r ight afte r END . The program_statements must in c lu de a loop index that get s modifi ed bef or e the logical_statement is c hec k ed at the beginning of the ne xt r epetiti on . Unlik e the DO command , if the firs t e valuati on of logical_s tatement is fals e , the loop is nev er e x ec uted . Ex ample 1 – calc ulate the summati on S using a WHILE…REP EA T…END cons truc t T he follo w ing pr ogram calc ulates the summation Using a WHI L E…REPE A T…END loop: « 0. → n S « WHILE ‘ n ≥0‘ REPEAT n SQ S ‘ S‘ STO n 1 – ‘ n‘ STO END S “ S” →TAG » » Stor e this pr ogram in a v ar iable @@ S4@@ . V er ify the follo wing e xe r c ises: J 3 @@@S4@@ Resu l t: S:14 4 @@@S4@ @ Re s ul t : S:30 5 @@@S4@@ Resu l t: S:55 8 @@@S4@@ Res u lt : S:204 10 @@@S4 @@ Res ul t: S:385 20 @@@S 4@@ Re s ul t : S:2870 30 @@@S4@@ Re su lt : S:9455 100 @@@S4@@ Res u lt : S:338350 Ex ample 2 – gener ate a list using a WHILE…REPE A T…END construc t T ype in the follo w ing pr ogr am « → xs xe dx « xe xs – dx / ABS 1. xs → n x « xs WHILE ‘ x<xe‘ REPEAT ‘ x dx‘ EVAL DUP ‘ x‘ STO END n → LIST » » » ∑ = = n k k S 0 2
P age 21-64 and stor e it in var ia ble @GLIS4 . Θ Chec k out that the pr ogram call 0. 5 ` 2. 5 ` 0. 5 ` @GLIS4 pr oduces the list {0. 5 1. 1.5 2 . 2 . 5}. Θ T o see step-b y-step oper ation us e the progr am D BUG f or a short list, f or e xample: J 1 # 1.5 # 0. 5 ` Enter p ar ameters 1 1. 5 0.5 [‘] @GLIS4 ` Ente r the pr ogr am name in le v el 1 „°LL @) @RUN@ @@DBG@ St art the debugger . Use @SST ↓ @ to s tep into the pr ogr am and see the detailed oper ati on of each command . Err ors and er ror tr apping T he functi ons of the P RG/ERR OR sub-men u pr o v ide w ay s to manipulat e err ors in the calc ulator , and trap er r ors in pr ograms . The P R G/ERROR sub-me nu , av ailable thr ough „°LL @) ERROR@ , contains the f ollo w ing func tions and sub-menus: DOERR This f unction e x ecutes an u ser-de fine er r or , thus causing the calc ulator to behav e as if that partic ular err or has oc c urr ed . The f unction can tak e as argument either an integer number , a binar y in teger number , an er r or mess age , or the number z er o (0) . F or e xampl e , in RPN mode , ente ring 5` @DOERR , produces the follow ing err or message : Err or : Memory Clear If y ou ent er #11h ` @ DOERR , pr oduces the f oll ow ing m essage : E rro r: Undef ined FPTR Name
P age 21-6 5 If y ou enter “ TR Y A G AIN” ` @DOERR , p r od uces t he follo wing messag e: TR Y AGA I N F inally , 0` @DOERR , pr oduc es the m essage: I nterrupted ERRN T his functi on r etur ns a number r epr es enting the most r ecent err or . F or e x ample , if y ou try 0Y$ @ERRN , y ou get the n umber #30 5h . This is the binary integer r epr esenting the er r or : Inf inite R esult ERRM This f uncti on re turns a char acter str ing r epr esenting the err or message of the most r ecent err or . F or e xample , in Appr ox mode , if y ou tr y 0Y$ @ERRM , y ou get the f ollo w ing str ing: “Inf inite R esult” ERR0 T his functi on clear s the last er ro r number , so that , ex ec uting ERRN after w a r ds, in Appr o x mode , w ill r etur n # 0h. F or e x ample , if y ou tr y 0Y$ @ER R0 @ERRN , y ou get # 0h . Also , if y ou tr y 0Y$ @ERR0 @ERRM , y ou get the e mpty stri ng “ “ . LA S T A RG T his functi on r eturns cop ies of the ar guments of the command or func tion e x ecu ted most r ecently . F or e x ample , in RPN mode , if y ou us e: 3/ 2` , and then u se func tio n L A S T ARG ( @ LASTA ) , y ou w ill get the values 3 and 2 listed in the st ack . Another e x ample , in RPN mode , is the f ollo w ing: 5U` . Using L A S T ARG af te r these entr ies pr oduces a 5 . Sub-menu IFERR Th e @) IFERR sub-menu pr o v ides the f ollo w ing func tions:
P age 21-66 T hese ar e the components of the IFERR … THEN … END construc t or of the IFERR … THEN … EL SE … END constr uct . Both logi cal constr ucts ar e used fo r tr appi ng err or s dur ing pr ogr am ex ec uti on . Within the @) ER ROR sub-men u , enter ing „ @) IFERR , or ‚ @) IFERR , w ill place the IFERR struc tur e components in the stac k , r eady f or the us er to f ill the missing ter ms, i .e ., T he gener al fo rm of the tw o er r or - tr apping cons truc ts is as fo llo ws: IF trap-c lause THEN err or -clau se END IF tr ap-cla use THEN er r or -cla use EL SE normal-c lause END T he oper ation o f these logi cal constr ucts is similar to that of the IF … THEN … END and of the IF … THEN … ELSE … END constr ucts . If an err or is detected during the e x ec ution of the tr ap-clause , then the e rr or -c lause is e x ecuted . Other w ise , the normal-c lause is e xec uted. As an e x ample , consider the fo llow ing pr ogram ( @ERR1 ) that tak es as input tw o matr ices , A and b , and chec ks if there is an er r or in the tr ap c lause: A b / (RPN mode , i .e ., A/b) . If ther e is an err or , then the pr ogr am calls functi on LS Q (Least S Q uar es, see Chap ter 11) to sol ve the sy stem of equ ations: «  A b « IFERR A b / THEN LSQ END » » T ry it w i th the ar guments A = [ [ 2 , 3, 5 ] , [1, 2 , 1 ] ] and b = [ [ 5 ] , [ 6 ] ]. A simple di v ision o f these tw o ar guments pr oduces an err or : /Err or : Inv ali d Dimensi on . Ho w ev er , w ith the err or - tr apping constr uct of the pr ogram , @ERR 1 , w ith the same ar guments pr oduces: [0.2 6 2 2 9 5…, 0.44 2 6 2 2…].
P age 21-6 7 User RP L pr ogramming in algebraic mode While all the pr ogr ams pre sent ed earli er are pr oduced and run in RPN mode , y ou can al wa y s type a pr ogr am in Us er RPL w hen in algebrai c mode b y using func tion RP L>. T his functi on is a vaila ble thr ough the command catalog . As an e x ample , try cr eating the follo wing pr ogr am in algebr aic mode , and stor e it into var iable P2 : « → X ‘2.5-3*X^2’ » F irst , acti vate the RP L> func tion f r om the command catalog ( ‚N ) . All func tions acti vated in AL G mode hav e a pair of par enthes es attached to the ir name . The RP L> func tion is not e x ception , e x cept that the par entheses mus t be r emo v ed befo re we ty pe a pr ogr am in the sc r een . Use the ar r o w k ey s ( š™ ) and the delete k ey ( ƒ ) to eliminate the par entheses fr om the RPL>() statement . At this point y ou will be r e ad y to type the RP L pr ogr am. T he f ollo w ing fi gur es sho w the RP L> command w ith the pr ogr am bef or e and after pr essing the ` key . T o sto r e the pr ogr am use the S T O command as follo w s: „îK~p2` An e valuati on of pr ogr am P2 for the ar gument X = 5 is sho wn in the ne xt scr een : While y ou can wr ite pr ograms in algebr aic mode , w ithout using the func tion RP L>, some of the RP L constr ucts w ill produce an er r or message w hen y ou pr es s ` , fo r e xample:
P age 21-6 8 Wher eas , using RP L, ther e is no proble m when loading this pr ogram in algebr aic mode:
Pa g e 22 - 1 Chapter 2 2 Pr ogr ams for gr aphic s manipulation T his chapt er include s a number of e x amples sho w ing ho w to use the calculat or’s func tions f or manipulating gr aphics int er acti v el y or thr ough the us e of pr ogr ams. As in Cha pter 21 w e r ecommend u sing RPN mode and setting s ys tem f lag 117 to S OFT menu labels. « » W e intr oduce a var iety of calculator gr aphic applications in C hapter 12 . The e x amples of Cha pter 12 r epr ese nt inter acti ve pr oduc tion of gr aphics u sing the calc ulator ’s pr e -pr ogr ammed input f orms . It is also possible to u se gr aphs in y our pr ogr ams, f or e x ample , to complement n umeri cal r esults w ith graphi cs . T o accomplish suc h tasks, w e f irst intr oduce func tion in the P L O T menu . T he PL O T menu Commands f or setting up and pr oduc ing plots ar e av ailable thr ough the PL O T menu . Y ou can a cce ss the PL O T menu b y using: 81.01 „°L @) MODES @) MEN U@ @@MENU@ . T he menu thus pr oduced pr ov ide s the user access t o a var iety of gr aphi cs func tions . F or applicati on in subsequent e xamples , let’s us er -def ine the C (GRAPH) k e y to pr o v ide acce ss to this menu as desc r ibed belo w . User-def ined k e y f or the PL O T menu Enter the follo wing k ey str ok es to deter mine whether y ou ha ve an y user -defined k e y s alread y sto red in y our calculator : „°L @) MODES @) @KEYS@ @@RCLKE@ . Unless y ou hav e user -def ined some k ey s , you should get in r etur n a list cont aining an S, i .e ., {S}. T his indicat es that the St andard ke yboar d is the only k e y defi nition stor ed in y our calculator .
Pa g e 22 - 2 T o us er -def ine a k e y yo u need to add to this list a command or pr ogram fo llo w ed by a r efer ence to the k e y (see details in C hapter 20) . T y pe the list { S << 81.01 M ENU >> 13.0 } in the stac k and use f uncti on S T OKEY S ( „°L @) MODES @) @ KEYS@ @@ STOK@ ) to user-def ine k e y C as the access to the PL O T me nu . V er if y that suc h list w as stor ed in the calculator b y using „°L @) MODES @) @ KEYS@ @@ RCLK@ . T o acti vate a us er def ined k e y y ou need to pr ess „Ì (same as the ~ k e y) befor e pr essing the k e y or k e y str ok e combinatio n of inter est . T o acti v ate the PL O T me nu , w ith the k e y def inition us ed abo ve , pre ss: „Ì C . Y ou will get the fo llow ing menu (pr ess L to mov e to se cond menu) Description of the P L O T menu T he follo w ing diagr am sho ws the men us in P L O T . The n umber accompan y ing the differ ent menus and f uncti ons in the diagr am ar e used a s re fe re nce in the subsequent de scr iption o f those objec ts. T he soft menu k ey label ed 3D , S T A T , FL A G , PTYP E , and PP AR , pr oduce additional men us , whi ch wi ll be pr esent ed in mor e detail late r . At this po int w e desc r ibe the f unctio ns dir ectl y accessible thr ough so ft menu k e y s f or menu number 81. 0 2 . T hese ar e: Not e : W e w ill not w or k an y e xe r c ise w hile pr esenting the P L O T men u , its func tions or sub-men us . This secti on w ill be more lik e a tour o f the conte nts of P L O T as they r elate to the differ ent t y pe of gr aphs av ailable in the calc ulator .
Pa g e 22 - 3 LA BE L (10) T he functi on L ABEL is us ed to label the ax es in a plot including the v ar iable names and minimum and max imum value s of the axe s. T he var ia ble names ar e select ed fr om info rmatio n contained in the var ia ble PP AR. AU TO ( 1 1 ) T he func tion A UT O (A UT Oscale) calc ulates a dis play r ange for the y-ax is or fo r both the x - and y-ax es in two -dimensi onal plots according to the ty pe of plot def ined in PP AR. F or any o f the thr ee -dimensional gr aphs the f uncti on A UT O pr oduces no ac tion . F or t w o -dimensional plots, the f ollo w ing acti ons ar e perfor med b y A UT O: Θ FUNCTION: based on the plotting r ange of x , it samples the func tion in E Q and deter mines the minimum and max imum v alues of y . Θ CONIC: sets the y-ax is scale equal to the x -ax is scale Θ POLAR: based on the v alues of the independen t var iable (ty pi cally θ ), i t samp les the f uncti on in E Q and de ter mines minimum and max imum v alues of both x and y . Θ P A RAME TRIC: pr oduce s a similar r esul t as P OL AR ba sed on the v alues o f the par ameter def ining the equati ons for x and y . Θ TRUTH: pr oduces no acti on . Θ B AR: the x -axis r ange is set fr om 0 to n 1 w her e n is the number of elements in Σ D A T . The r ange of v alues o f y is based on the conten ts of Σ D A T . T he minimum and maximum v alues of y ar e determined s o that the x -ax is is alw ay s inc luded in the gra ph. Θ HIS T OGRAM: similar to B AR. Θ S CA T TER: se ts x - and y-axis r ange based on the contents of t he independent and dependent var iable s fr om Σ D AT. INFO (12) T he functi on INF O is inter acti ve onl y ( i .e ., it cannot be pr ogr ammed) . W hen the corr esponding sof t men u ke y is presse d it pr o v ides infor mation about the c urr en t plot par ameter s.
Pa g e 22 - 4 EQ ( 3) T he var ia ble name EQ is r es er v ed by the calc ulator to stor e the c urr ent equatio n in plots or solut ion to eq uations (s ee chapt er …) . T he soft menu k ey la beled E Q in this menu can be us ed as it w ould be if y ou hav e y our v ar iable men u av ailable , e .g., if y ou pr es s [ E Q ] it w ill lis t the c urr ent contents of tha t v ari able . ERASE ( 4) T he functi on ERASE er ases the c urr ent con tents of the gr aphics w indow . In pr ogr amming, it can be us ed to ensure that the gr aphics w indo w is clear ed bef or e plotting a ne w gr aph . DRAX (5) T he functi on DR AX dr aw s the axe s in the cur r ent plot , if any is v isible . DRA W (6) T he functi on DR A W dr aw s the plot def ined in P P AR . Th e PT YPE m en u un de r PL OT (1 ) T he PTYP E menu lis ts the name of all tw o -dimensi onal plot type s pre - pr ogr ammed in the ca lc ulator . T he menu contains the f ollo wing menu k ey s: T hese k ey s corr es pond to the plot types F uncti on, C oni c, P olar , P arametr ic , T ruth , and Diff E q , pr esented earli er . Pr essing one of thes e soft menu k ey s , while typing a pr ogram , w ill place the corr es ponding functi on call in the progr am. Press L ) @ PLOT to get bac k to the main PL O T menu . Th e PP A R m en u ( 2) T he PP AR menu lists the diff er ent options fo r the PP AR var iable as gi v en b y the fo llo w ing soft menu k e y labels . Pr ess L to mov e to ne xt menus:
Pa g e 22 - 5 T he follo w ing diagr am illu str ates the f uncti ons av ailable in the P P AR menu . T he letter s attached to eac h f unction in the di agr am ar e used f or r ef er ence purpos es in the desc ripti on of the func tions sho wn belo w . INFO (n) and PP AR (m) If y ou pr ess @INFO , or enter ‚ @PPAR , while in this menu , yo u w ill get a listing of the c urr ent P P AR s ettings, f or ex ample: T his infor mation indi cates that X is the independent v ar iable (Indep), Y is the dependent v ar iable (Depnd), the x-ax is range goe s fr om –6 . 5 to 6 . 5 (Xrng), the y-ax is r ange goes f r om –3 .1 to 3 .2 (Yr ng) . T he last p iece of inf or mation in the sc r een , the value of Res (r esoluti on) deter mines the int erval of the independent var iable used f or gener ating the plot . T he soft menu k e y labels inc luded in the PP AR( 2) menu r epr esent commands that can be used in pr ogr ams . The se commands include: Not e : the S CALE commands sho w n her e actuall y r epr esent S CALE , S CALEW , S CALEH, in that or der .
Pa g e 22 - 6 INDEP (a) T he command IND EP spec ifi es the independent v ar iable and its plotting r ange . T hese spec ifi cations ar e stor ed as the thir d paramet er in the v ar ia ble PP AR. T he def ault v alue is 'X'. T he v alues that can be assigned t o the independent var iable spec if icati on ar e: Θ A var iable name , e.g ., ' Vel ' Θ A var ia ble name in a li st , e .g ., { Vel } Θ A var iable name and a range in a lis t , e.g ., { Vel 0 20 } Θ A range w ithout a v ari able name, e .g., { 0 20 } Θ T w o valu es r epresenting a r ange, e .g., 0 20 In a pr ogr am, an y o f these spec ifi cations w ill be follo wed b y the command INDEP . DEPND (b) T he command D EPND spec ifi es the name of the dependent var iable . F or the case of TRUTH plots it also spec ifi es the plotting r ange . The de fault v alue is Y . T he t y pe of s pec ifi cations f or the DEPND v ari able ar e the same as those f or the INDEP var ia ble . XRNG (c) and YRNG (d) T he command XRNG spec ifi es the plotting r ange fo r the x-ax is, w hile the command YRNG spec if ies the plotting r ange for the y-ax is. T he input f or an y of thes e commands is t w o numbers r epr esen ting the minimum and maxim um value s of x or y . The v alues of the x- and y-ax is r anges ar e stor ed as the or der ed pairs (x min , y min ) and (x max , y max ) in the two f irs t elements of the va riab le PP A R. D efau lt val ue s fo r x min and x max ar e -6. 5 and 6. 5, re specti v ely . Def ault value s fo r x min and x max ar e –3 .1 and 3 .2 , re spec ti ve l y . RE S (e) T he RE S (RE Solu tion) command s pecif ies the in terval betw een v alues of the independent v ari able w hen pr oduc ing a spec ifi c plot . The r esoluti on can be e xpr es sed in ter ms of us er units as a r eal number , or in ter ms of pi xe ls as a binary integer (n umbers starting w ith #, e .g ., #10) . The r eso lutio n is stor ed as the f ourth item in the PP AR v ari able .
Pa g e 22 - 7 CENTR (g) T he command CENTR tak es as ar gument an or der e d pair (x ,y) or a value x , and adju sts the fi rst tw o elements in the v ari able P P AR, i .e., (x min , y min ) and (x max , y max ) , so that the center of the plot is (x ,y) or (x , 0) , r especti vel y . S CALE (h) T he SCALE command dete rmines the plotting scale r e pr esent ed by the number of u ser units per tic k mar k. T he def ault scale is 1 user -unit per tic k mark . Whe n the command S CALE is used , it tak es as ar guments tw o numbers , x scal e and y scale , r epr esenting the ne w hor i z ontal and vertical s cales. T he effec t of the S CALE command is to adjus t the parame ters (x min , y min ) and (x max , y max ) in PP AR to accommodate the desir ed scale . The cent er of the plot is pre served . SC A LE W ( i ) Gi v en a f actor x fac tor , the command S CALEW multiplies the hori z ontal scale by that fac tor . The W in S CA LEW s tands fo r 'wi dth.' T he e xec uti on of S CA LEW ch an ge s th e va lu es of x min and x max in P P A R . SC A LE H ( j ) Gi ven a factor y fac tor , the command S CALEH multipli es the ve r ti cal scale b y that fac tor . The H i n SCA LE H s tan d s for 'h eigh t .' Th e execut ion of SCA LE W ch an ge s th e va lu es of y min and y max in P P A R . AT I C K ( l ) T he command A T ICK (Ax es T ICK mark) is u sed to set the ti ck -mark annotati ons fo r the axe s. The input v alue f or the A TICK command can be one of the fo llo w ing: Θ A real v alue x : sets both the x - and y-axis ti ck annotatio ns to x units Θ A list of two r e al v alues { x y }: sets the ti ck annotati ons in the x- and y-ax es to x and y units, r espec ti v el y . Θ A binary integer #n: sets both the x - and y-ax is tic k annotati ons to #n p ix els Not e : Changes intr oduced by using S CALE , S CALEW , or S CALEH, can be us ed to z oom in or z oom out in a plot .
Pa g e 22 - 8 A list o f two b inar y intege rs {#n #m}: sets the ti c k annotations in the x - and y- ax es to #n and #m pi xels , r espec tiv el y . AXE S (k) T he input value f or the axes command consis ts of e ither an order ed pair (x,y) or a list {(x ,y) atic k "x-ax is label" "y-ax is label"}. The par ameter atick s tands f or the spec ifi cation of the tic k marking annotati ons as desc r ibed abov e f or the command A T ICK . T he or der ed pair re pre sents the ce nter of the plot . If only an or der ed pair is gi ve n as input to AXE S, onl y the axe s or igin is alter ed . The ar gument to the command AXE S, w hether an or der ed pair or a list of value s, is stor ed as the fifth par ameter in P P AR. T o r eturn to the PL O T menu , pres s @) PLOT . Press L to reac h the second menu of the PL O T menu set . RE SET (f) T his button w ill re set the plot par ameter s to de fa ult value s. The 3D menu within PL OT ( 7) T he 3D menu cont ains two su b-menus , PTYP E and VP AR, and one v ar ia ble , E Q. W e ar e famili ar alread y w ith the meaning of E Q, ther efor e , we wi ll concentrat e on the conten ts of the PTYP E and VP AR menus . T he diagr am belo w sho ws the br anching o f the 3D menu .
Pa g e 22 - 9 The PTYP E menu within 3D (IV) T he PTYP E menu under 3D cont ains the follo w ing functi ons: T hese f uncti ons corr espond to the gr aphi cs opti ons Slopef ield , Wir efr ame , Y - Slice , P s-Contour , Gri dmap and Pr -Sur f ace pre sented ear lie r in this chapt er . Pr essing one o f these s oft menu k e y s , while ty ping a pr ogram , will place the cor re sponding f unction call in the progr am . Pre ss L @) @3D@@ to get back to the main 3D menu . The VP AR me nu within 3D (V ) T he var ia ble VP AR stands f or V olume P AR ameter s, r e fer r ing to a par allelepiped in space w ithin w hic h the thr ee -dimensional gr aph of inter est is cons truc ted . When pr es s [VP AR] in the 3D menu , y ou w ill get the fo llo w ing functi ons . Pres s L to mov e to the ne xt menu: Ne xt , we de sc ribe the meaning of thes e func tions: INFO (S) and VP AR (W) When y ou press @INFO (S) y ou get the infor mation sho wn in the le ft -hand si de s cre en s h ot a bo ve. The ra n g es i n Xv ol , Yv o l , and Zvo l desc r ibe the e xtent of the par allelepiped in s pace wher e the gr aph w ill be gener ated . Xr ng and Yrng desc r ibe the r ange of values o f x and y , r espec ti vel y , as independent v ari ables in the x -y plane that w ill be used t o gener ate f unctions o f the fo rm z = f(x,y). Press L and @INFO (Y ) to obtain the infor mation in the r ight -hand si de scr een shot abo v e . Thes e are the v alue of the location of the v i ewpo int f or the thr ee - dimensional gr aph (Xe ye , Y ey e , Z e ye), and of the number o f steps in x and y to gener ate a gr id f or surface plots .
Pa ge 22- 1 0 XV OL (N) , YV OL (O) , and ZV OL (P) T hese f unctions t ake as input a minimum and maxi mum value and ar e used to spec ify the extent o f the parallelep iped wher e the gr aph w ill be gener ated (the v ie w ing par allelepiped). Thes e values ar e s tor ed in the v ar iable VP AR. T he def ault values f or the r anges XV OL , YV OL, and ZV OL a r e –1 to 1. XXRNG (Q) and YYRNG (R) T hese f unctions t ake as input a minimum and maxi mum value and ar e used to spec ify the r anges of the v ar iables x and y to gener ate functi ons z = f(x,y). The def ault v alue of the r anges XXRNG and YYRNG wi ll be the same as those o f XV OL and YV OL. E YEPT (T) T he functi on E YEPT t ak es as in put r eal value s x, y , and z repr esenting the location o f the vi e wpoint f or a thr ee -dimensional gr aph . T he vi e wpoint is a point in s pace fr om whi ch the thr ee -dimensional gr aph is observ ed . Changing the v ie wpoint w ill pr oduce diffe r ent vi e ws o f the graph . T he f igur e belo w illus tr ates the i dea of the v ie w po int w ith r es pect to the actual gr aphic s pace and its pr oj ecti on in the plane of the sc r een. NUMX(U ) and NUMY (V) T he functi ons NUMX and NUMY ar e used to spec if y the n umber of points or step s along each dir ecti on to be used in the gener ation of the base gr id f r om whi ch to obtain values of z = f(x ,y) . VP AR (W ) Th i s is j ust a re fe ren c e to t h e va ria bl e V P A R. RE SET (X) Re sets par ameters in sc r een to their def ault values . Press L @) @3D@@ to r eturn to the 3D menu . Press @) PLOT to r eturn to the P L O T menu .
Pa ge 22- 1 1 The S T A T menu within PL O T T he S T A T menu pr o v ide s access to plots r elated to st atistical anal y sis. W ithin this menu w e find the f ollo wing men us: T he diagr am belo w sho ws the br anc hing of the S T A T me nu w ithin P L O T . The numbers and let t ers accompan ying eac h f unction or menu ar e us ed f or r ef er ence in the des cr ipti ons that follo w the f igur e .
Pa ge 22- 1 2 The P T YP E m enu wi thin ST A T (I) The P TYP E menu pr o v ides the f ollo wing f uncti ons: The se ke ys cor res pond to the p lot ty pes Bar (A ) , H istogr am (B) , and Scatter (C) , pr esented ear lier . Pr essing one of these soft menu k ey s, w hile typing a pr ogr am, w ill place the corr esponding f uncti on call in the pr ogram . Pr ess @) STA T to get back to the S T A T menu . The D A T A menu w ithin ST A T (I I) T he D A T A menu pr o vi des the follo w ing functi ons: T he functi ons list ed in th is menu ar e us ed to manipulate the Σ D A T statis tical matr i x. The f unctio ns Σ (D) and Σ - (E), add o r re mov e data r o ws fr om the matr i x Σ D AT. C L Σ (F) c lear s the Σ D A T (G) matri x, and the soft men u k e y labeled Σ D A T is just u sed as a referenc e for in teract i ve a pp lic atio ns. Mo r e details on the us e of these f uncti ons are pr esented in a later c hapter on statis tical appli cations . Pr ess @) STA T to return to the S T A T menu . Th e Σ P AR menu within ST A T (II I ) Th e Σ P AR menu pr ov ides the follo wing f uncti ons: INFO (M) and Σ PA R ( K ) T he k ey INF O in Σ P AR pr ov ides the inf ormatio n sho wn in the sc r een shot abo ve . T he infor mation lis ted in the sc r een is contained in the v ari able Σ PA R . T h e v alues sho w n are the def ault v alues f or the x -column , y-column, int er cept and slope of a data f itting model, and the type of mode l to be fit t o the data in Σ D AT.
Pa ge 22- 1 3 X COL (H) T he command XC OL is used t o indicate w hi ch o f the columns of Σ D A T , if mor e than one , w ill be the x - column or independent var iable column . YC O L ( I ) T he command Y COL is used to indicate w hic h of the columns of Σ DA T , i f m o re than one , w ill be the y- column or dependent v ar iable column . MODL (J ) T he command MODL r efe rs to the model to be selec ted to f it the data in Σ DA T , if a data f it ting is implement ed. T o see w hic h options ar e av ailable , pr ess @! MODL . Y ou w ill get the fo llow ing menu: T hese f uncti ons corr es pond to L inear F it , Lo garithmi c F it, Exponen tial F it , P o w er F it , or Best F it. Data fit ting is descr ib ed in more detail in a later chapter . P r ess ) £@PAR to r eturn to the Σ PA R m e n u . Σ PA R ( K ) Σ P A R i s j us t a ref e ren c e to t he va ri a bl e Σ P AR fo r inter acti v e use . RE SET (L) T his functi on r ese ts the conten ts of Σ P AR to its def ault v alues . Press L @ ) STAT to r eturn to the S T A T menu . Press [P L O T] to re turn to the m ain PL O T m enu . The FLAG menu w ithin PL O T T he FL A G menu is actuall y inter acti v e , so that y ou can select an y of the fo llo w ing options: Θ AXE S: w hen selected , ax es ar e show n if v isible within the plot ar ea or vo lu m e . Θ CNCT : w hen se lected the plot is pr oduced so that indi vi dual points ar e connected .
Pa ge 22- 1 4 Θ SIMU: w hen selec ted, and if mor e than one gr aph is to be plotted in the same set o f axe s, plots all the gr aphs simultaneousl y . Press @) PLOT to r eturn to the PL O T menu . Generating plots w ith progr ams Depending on w hether w e ar e dealing w ith a tw o -dimensional gr aph def ined by a fun ctio n, by d at a from Σ D A T , or b y a thr ee -dimensional f unctio n, y ou need to set u p the var iables P P AR, Σ P A R , and /or VP AR befo r e gener ating a plot in a pr ogr am. T he commands sho wn in the pr e v io us sec tion help yo u in setting up suc h v ar iab les. F ollo wing w e desc r ibe the gener al for mat f or the var ia bles neces sar y to pr oduce the diff er ent t y pes of plots a vailable in the calc ulator . T w o -dimensional graphics T he two -dime nsional gr aphic s gener ated b y func tions , namel y , F unction , C onic , P ar ametr ic , P olar , T ruth and Diff er ential E quation , use P P AR w ith the f ormat: { (x min , y min ) (x max , y max ) indep res axes ptype depend } T he t w o -dimensional gr aphic s gener ated f r om data in the statisti cal matr i x Σ D A T , name ly , Bar , Hist ogram , and Sca tte r , use the Σ P A R v ari able w i th the fo llo w ing fo rmat: { x-column y-column slope intercept model } w hile at the same time using PP AR with the f ormat sho wn abo v e . T he meaning of the diff er ent par ameters in P P AR and Σ P AR wer e p r esented in the pr e v iou s secti on .
Pa ge 22- 1 5 T hree -dimensional gr aphics T he thr ee -dimensional gr aphi cs a vaila ble , namel y , options Slopef ield , Wir efr ame , Y -Sli ce , P s-Contour , G r i dmap and Pr -Surface , use the VP AR var ia ble w ith the fol low ing fo rmat: { x left , x right , y near , y far , z low , z high , x min , x max , y min , y max , x eye , y eye , z eye , x step , y step } T hese pairs o f values o f x, y , and z , repr esent the f ollo w ing: Θ Dimensions o f the vi e w paralle lepiped ( x left , x right , y near , y far , z low , z high ) Θ Range o f x and y independent var iable s ( x min , x max , y min , y max ) Θ Locati on of v ie wpoint ( x eye , y eye , z eye ) Θ Number of st eps in the x - and y-dir ections ( x step , y step ) T hree -dimensi onal gr aphi cs also r equir e the PP AR var ia ble w ith the par ameters s hown a bove. T he var iable EQ All plots , ex cept those bas ed on Σ D A T , also r equir e that yo u def ine the fu nctio n or f unctions to be plotted by st or ing the expr essions or r efer ences to thos e func tions in the v ar iable E Q. In summar y , to pr oduce a plot in a pr ogram y ou need t o load EQ, if r equir ed . T hen load PP AR, P P AR and Σ P AR , or P P AR and VP AR . F inally , us e the name of the pr oper plot type: FUNCT ION, C ONIC, P OL AR , P AR AME TRIC, TR UTH, DIFFEQ, B AR, HIS T OGR AM, S CA T TER , SL O P E , WIREFR AME , Y SLICE , P CONT OUR, GR IDMAP , or P AR S URF A CE , to pr oduce y our plot . Ex amples of inter ac ti ve plots using the P L O T menu T o better under stand the w ay a pr ogr am w orks w ith the PL O T commands and var iables , tr y the f ollo w ing e xample s of inter activ e plots using the PL O T menu . Ex ample 1 – A functi on plot: „ÌC Get P L O T menu (*) @) PTYPE @FUNCT Selec t FUNCTION as the plot type ‘ √ r’ `„ @ @EQ@@ Sto r e fu nc tion ‘ √ r’ into EQ
Pa ge 22- 1 6 @) PPAR Sho w plo t paramet ers ~„r` @INDEP Def ine ‘ r’ as the indep . var iable ~„s` @DEPND Def ine ‘ s ’ as the dependen t var ia ble 1 \# 10 @XRNG De f ine (-1, 10) as the x -r ange 1 \# 5 @YRN G L Def ine (-1, 5 ) as the y-r ange { (0, 0) {.4 .2} “Rs ” “Sr ”} ` Axes de finiti on list @AXES Def in e ax es center , tic ks, label s L @) PLOT Re tu rn to PL O T m en u @ERASE @DRAX L @L ABEL Er ase p ictur e , dr aw ax es, la bels L @ DRAW Dr a w func tion and sho w p ictur e @) EDIT L @ MENU Remo ves men u labels LL @) PICT @CANCL R eturns to nor mal calculator dis play Ex ample 2 – A parame tri c plot (Us e R AD as angle s) : „ÌC Get P L O T me nu @) PTYPE @PARAM Select P AR AME TRIC as the plot t y p e { ‘S IN(t) i*SIN( 2*t)’ } ` Def ine comple x fu nctio n X iY „ @ @EQ@@ St ore comple x f unction into E Q @) PPAR Sho w plo t paramet ers {t 0 6 .2 9} ` @INDEP Def ine ‘t’ as the indep .var iable ~y` @DEPND Def ine ‘Y ’ as the depe ndent v ari able 2.2 \# 2.2 @XRN G Def ine (- 2 .2 , 2 .2) as the x -range 1.1 \# 1.1 @YRNG L De f ine (-1.1,1.1) as th e y-r ange { (0, 0) {.4 .2} “X(t)” “Y(t )”} ` Axes de finiti on list @AXES Define axes center , ticks, lab els L @) PLOT Re tu rn to PL O T m en u @ERASE @DRAX L @L ABEL Er ase p ictur e , dr aw ax es, la bels L @ DRAW Dr a w func tion and sho w p ictur e @) EDIT L @ MENU LL @)PICT @CANCL Fi n i s h p l o t Ex ample 3 – A polar plot : „ÌC Get P L O T me nu @) PTYPE @POLAR Selec t POLAR as the plot ty pe ‘1 S IN( θ )’ `„ @@EQ@@ St or e complex f unct . r = f( θ ) into E Q (*) PL O T menu av ail able thr ough user -defined ke y C as sho wn earli er in this Chapter .
Pa ge 22- 1 7 @) PPAR Sho w plo t paramet ers { θ 0 6. 2 9} ` @INDEP Def ine ‘ θ ’ as the indep . V a r i ab le ~y` @DEPND Def ine ‘Y ’ as the depe ndent v ari able 3 \# 3 @XRNG Def ine (-3, 3) as the x -r ange 0. 5 \# 2. 5 @YRNG L Def i ne (-0. 5,2 .5 ) as the y-range { (0, 0) {. 5 .5} “ x ” “ y”} ` Ax es def inition lis t @AXES Define axes center , ticks, lab els L @) PLOT Re tu rn to PL O T m en u @ERASE @DRAX L @L ABEL Er ase p ictur e , dr aw ax es, la bels L @ DRAW Dr a w func tion and sho w p ictur e @) EDIT L @ MENU Remo ve men u labels LL @) PICT @CANCL R eturn to nor mal calculator dis play F r om these e x amples w e see a pattern f or the inter acti v e gener ation o f a t w o - dimensional gr aph thr ough the PL O T menu: 1 – Se lect P TYPE . 2 – St or e func tion to plot in var iabl e EQ (u sing the pr oper fo rmat , e .g ., ‘X(t) iY(t)’ f or P AR AMETR IC) . 3 – Enter name (and r ange , if nec essar y) o f independent and dependent va riab le s 4 – Ente r axes spec ifi cati ons as a list { cente r atic k x -label y-label } 5 – Us e ER A SE , DRAX, L ABEL , DRA W to pr oduce a f ully la beled gr aph w ith ax es T his same appr oac h can be used t o pr oduce plots w ith a pr ogr am, e xcept that in a pr ogr am y ou need to add the command P ICTURE after the DRA W functi on is called to r ecall the gr aphi cs sc r een to the s tac k. Ex amples of pr ogr am-g ener ated plots In this secti on w e sho w ho w to implement w ith pr ogr ams the gener ation o f the last thr ee e xample s. A cti vat e the PL O T menu bef or e y ou st ar t t y ping t he pr ogram to fac ilitate enter ing graphing com mands ( „ÌC , see abo v e) . Ex ample 1 – A functi on plot . Enter the f ollo win g pr ogram:
Pa ge 22- 1 8 « S tart pr ogram {PPAR EQ} PURGE P ur ge c urr ent PP AR and E Q ‘ √ r’ STEQ Sto r e ‘ √ r’ i nto E Q ‘r’ INDEP Set independent v ari able to ‘ r’ ‘s’ DEPND Set dependent v ar iable t o ‘ s ’ FUNCTION Selec t FUNCTION as the plot type { (0.,0.) {.4 .2} “Rs” “Sr” } AXES Se t axe s inf or matio n –1. 5. XRNG Se t x r ange –1. 5. YRNG Se t y r ange ERASE DRAW DRAX LABEL Era se & dr a w plot , axes , and labels PICTURE » R e call g r ap hics sc reen to stack St ore the pr ogr am in var i able P L O T1. T o run it , pre ss J , if needed, then pr ess @ PLOT1 . Ex ample 2 – A parame tri c plot . Enter the f ollo wing pr ogr am: «S t a r t p r o g r a m RAD {PPAR EQ} PURGE Change t o radi ans, pur ge v ars. ‘SIN(t) i*SIN(2*t)’ STEQ S tor e ‘X(t) iY(t)’ into E Q { t 0. 6.29} INDEP Se t indep . v ari able to ‘ r’ , w ith range ‘Y’ DEPND Set dependent v ar iable t o ‘Y ’ PARAMETRIC Select P AR AMETRIC as the plot type { (0.,0.) {.5 .5} “X(t)” “Y(t)” } AXES Set ax es inf ormati on –2.2 2.2 XRNG Set x r ange –1.1 1.1 YRNG Set y r ange ERASE DRAW DRAX LABEL Era se & dr a w plot , axes , and labels PICTURE R e call g r ap hics sc reen to stack » End pr ogr am Stor e the progr am in var iable P L O T 2 . T o run it , pr ess J , if needed , then pr ess @ PLOT2 .
Pa ge 22- 1 9 Ex ample 3 – A polar plot . Enter the follo wing pr ogr am: «S t a r t p r o g r a m RAD {PPAR EQ} PURGE Change t o radi ans, pur ge v ars. ‘1 SIN( θ)’ STEQ Store ‘ f( θ )’ into E Q { θ 0. 6.29} INDEP Set indep . v ariable to ‘ θ ’ , w ith r ange ‘Y’ DEPND Set dependent v ar iable t o ‘Y ’ POLAR Selec t POLAR as the plot ty pe { (0.,0.) {.5 .5} “x” “y”} AXES Set ax es inf ormati on –3. 3. XRNG Set x r ange –.5 2.5 YRNG Set y r ange ERASE DRAW DRAX LABEL Era se & dr a w plot , axes , and labels PICTURE R e call g r ap hics sc reen to stack » End pr ogr am St or e the pr ogram in v ari able PL O T3 . T o run it , pr ess J , if needed , then pr ess @ PLOT3 . T hese e x er c ise s illustr ate the use o f PL O T commands in pr ogr ams. T he y ju st sc r atc h the surface of pr ogr amming applicati ons of plots . I inv ite the r eader to tr y the ir o wn e x er c ises on pr ogramming plots . Dr aw ing commands for use in pr ogramming Y ou can dr aw fi gur es in the gr aphi cs w indo w dir ectl y fr om a pr ogram b y using commands suc h as thos e contained in the P ICT menu , accessible by „°L @PICT@ . The func tions a vailable in this menu ar e the f ollo wing . Press L to mo ve to ne xt menu: Ob vi ousl y , the commands LINE , TLINE , and B O X, perfor m the same oper ations as the ir inter a c ti v e counter part, gi ven the a ppr opr iate in put . Thes e and the other func tions in the P ICT menu r ef er to the gr aphic s wi ndow s w hose x - and y- r anges ar e deter mined in the var ia ble PP AR , as demonstr ated abo v e for diffe r ent gr aph t y pes. T he func tions in the PI CT command ar e desc ribed ne xt:
Pa ge 22- 2 0 P I CT T his soft k e y re fer s to a var iable called PICT that stor es the cur r ent conten ts of the gr aphi cs w indo w . This v ar iable name , ho w ev er , cannot be placed within quot es, an d ca n only stor e graph i cs object s. In tha t sens e , PIC T is like no oth er calc ulato r v ari ables . PDI M T he functi on P DIM tak es as input e ither tw o or der ed pairs (x min ,y min ) (x max ,y max ) or two b inar y integer s #w and #h . The eff ect o f PDIM is to replace the c urr ent contents of P ICT w ith an empty sc r een. W hen the ar gument is (x min ,y min ) (x max ,y max ) , these v alues become the r an ge of the user-defined co or d inates in PP AR. W hen the ar gument is #w and #h , the range s of the us er -def ined coor dinates in P P AR r emain unchanged , but the si z e of the gr aph c hanges to #h × #v pi xels . PICT and the graphics screen PICT , the stor age ar ea for the c urr ent graph , can be thought of as a two dimensional gr aph w ith a minimum si z e of 131 pi x els w ide b y 64 p i xels hi gh . The ma x imum width of PICT is 204 8 pix el s , with no restr iction on t he ma x i mum hei ght . A pi xel is eac h one of the dots in the calculator ’s sc r een that can be turned on ( dark) or off (c lear ) to pr oduce te xt or gr aphs. T he calc ulator s cr een has 131 pi xels b y 64 pi xels , i .e ., the minimum si z e f or PICT . If y our PICT is lar ger than the scr een, then the P ICT gr aph can be thought of as a two dimensional domain that can be s cr olled thr ough the calc ulator’s sc r een , as illus tr ated in the diagr am sho wn ne xt . LINE T his command tak es as in put two or dered pair s (x 1 ,y 1 ) (x 2 , y 2 ) , or tw o pairs of pi xel coor dinate s {#n 1 #m 1 } {#n 2 #m 2 }. It dra w s the line bet w een those coor dinates. TLINE T his command (T oggle LINE) tak es as input tw o order ed pairs (x 1 ,y 1 ) (x 2 , y 2 ), or two pair s of pi xel coor dinates {#n 1 #m 1 } {#n 2 #m 2 }. It dr aw s the line between th ose coor dinates , turning o ff pi x els that ar e on in the line path and vic e ver sa.
Pa ge 22- 2 1 BO X T his command tak es as in put two or dered pair s (x 1 ,y 1 ) (x 2 , y 2 ) , or tw o pairs of pi xel coor dinates {#n 1 #m 1 } {#n 2 #m 2 }. It dr a ws the bo x who se diagonals ar e r epr esente d by the tw o pairs of coor dinates in the input . ARC T his command is u sed to dr aw an ar c. AR C tak es as in put the fol low ing obj ects : Θ Coor dinates of the center o f the ar c as (x,y) in u ser coor dinates or {#n, #m} in p i xe ls. Θ Radius o f ar c as r (us er coor dinate s) or #k (p ix els) . Θ Initial angle θ 1 and final angl e θ 2 . P IX?, P IX ON, and PI X O FF T hese f uncti ons tak e as input the coor dinate s of point in us er coor dinates , (x,y), or in pi xels {#n , #m}.
Pa ge 22- 22 Θ P IX? C hecks if p i xe l at location (x ,y) or {#n , #m} is on. Θ P IX OFF tur ns off pi x el at location (x ,y) or {#n, #m}. Θ P IX ON turns on p i x el at location (x ,y) or {#n , #m}. PVIEW T his command take s as input the coor dinates of a po int as use r coor dinates (x ,y) or pi x els {#n, #m}, and place s the contents of PICT w ith the u pper left cor ner at the location o f the point s pec ifi ed. Y ou can also us e an empty list as ar gument , in whic h case the p ictur e is center e d in the s cr een. PVIEW does not acti v ate the gr aphic s cur sor or the pic tur e menu . T o acti vate an y of those featur es use P ICTURE . PX  C Th e fu nct ion P X  C con verts pi xel coo rdinates {#n #m} t o user -unit coordinat es (x ,y) . C  PX Th e fu nct ion C  P X con ve r ts u ser -unit coo rdinat es (x,y) to p i xe l coordinat es {#n #m}. Pr ogramming e x ampl es using dr aw ing func tions In this secti on w e use the commands des cr ibed abov e t o pr oduce gr aphi cs w ith pr ogr ams. Pr ogr am listing ar e pro vi ded in the at tac hed disk ette or CD RO M. Ex ample 1 - A pr ogram that u ses dr a wing commands T he follo wing pr ogram pr oduces a dra w ing in the gr aphics s cr een. (T his pr ogr am has no other purpo se than to sho w ho w to use calc ulator commands to pr oduce dr a w ings in the displa y .) «S t a r t p r o g r a m DEG Se lect degr ees fo r angular measur es 0. 100. XRNG Set x range 0. 5 0. YRNG Set y r ange ERASE Er ase pi ctur e (5 ., 2 . 5) (9 5 ., 4 7 .5 ) BO X Dr aw bo x fr om (5,5) to ( 9 5, 9 5) (5 0., 5 0.) 10. 0. 36 0. ARC Dr a w a c ir cle cen ter (5 0,5 0) , r =10.
Pa g e 22 - 23 (5 0., 5 0.) 12 . –180. 180. AR C Dr a w a c ir c le center (5 0,5 0) , r= 12 . 1 8 FOR j Dr aw 8 line s w ithin the c ir cle (50., 5 0 .) DUP L ines ar e center ed as (5 0,5 0) ‘12*COS( 45 *(j-1))’  NUM Calc ulate x, other end at 5 0 x ‘12*SIN( 4 5*(j-1))’  NUM Calc ulates y , other end at 5 0 y R  C Con vert x y t o (x ,y) , co mple x num . A dd (5 0,5 0) to (x,y) LINE Dr aw the line NEXT End of F OR loop { } PVIEW Sho w pi ctur e » Ex ample 2 - A progr am to plot a na tur al ri ver c r oss-s ectio n T his applicati on may be us ef ul for det ermining ar ea and w etted per imeters of natur al r i ve r cr oss-sec tio ns. T yp icall y , a natur al ri ver c r os s secti on is surve y ed and a ser ie s of points , r epre senting coor dinates x and y w ith r espect to an arb itr ar y se t of coor dinates ax es. T hese po ints can be plotted and a sk etch o f the c r oss s ecti on pr oduced f or a gi ve n wate r surface ele vati on . The f igur e belo w illustr ate the terms pr esented in this par agr aph . T he progr am, a vailable in the disk et t e or CD RO M that comes with y our calc ulator , u tili z es f our sub-pr ograms FRAME , DXBED , G TIF S , and INTRP . T he main pr ogr am, called XSE CT , tak es as input a matr i x of v alues of x and y , and the ele vati on of the w ater surf ace Y (see f igur e abo v e) , in that or der . The pr ogr am pr oduces a gra ph of the cr oss sec tion indi cating the input data w ith points in the gr aph , and sho ws the fr ee sur f ace in the cr oss-sec tion .
Pa g e 22 - 24 It is suggest ed that you c r eate a separ a t e sub-dir ectory to sto r e the progr ams. Y ou could call the sub-dir ectory RIVER , since w e ar e dealing w ith irr egular open c han nel c r os s-secti ons , t y pi cal of r i ver s . T o see the pr ogram XSE CT in acti on, use the f ollo wi ng data sets . Enter the m as matr ices o f t w o columns, the fir st column being x and the s econd one y . Stor e the matr ice s in var ia bles w ith names such as XYD1 (X- Y Da t a set 1) and XYD2 (X- Y Dat a set 2) . T o r un the pr ogr am place one of the data se ts in the stac k, e .g., J @XYD1! , then type in a w ater surface el ev ation , say 4. 0, and pre ss @XSECT . The calc ulator w ill sho w an sk etch o f the cr os s-secti on w ith the corr esponding w ater surface . T o e xit the gr aph d i splay , pre ss $ . T ry the f ollo wing e xamples: @XYD1! 2 @XSECT @XYD1! 3 @XSECT @XYD1! 4 @XSECT @XYD1! 6 @XSECT P lease be patie nt w hen running pr ogr am XSE CT . Due to the re lati vel y lar ge number of gr aphics f uncti ons used , not counting the n umer ical iter ations , it ma y tak e s ome time to pr oduce the gr aph (a bout 1 minu te) .
Pa g e 22 - 2 5 P ix el coordinates T he fi gur e belo w sho w s the gr aphic coor dinate s fo r the t y pi cal (minimum) scr een of 13 1 × 64 pi xels . P i x els coor dinates ar e measured f r om the top left corner of the screen {# 0 h # 0h}, w hich corresponds to user-defined coor din ates Data set 1 Data set 2 xy x y 0.4 6 . 3 0.7 4.8 1. 0 4 .9 1. 0 3 . 0 2 .0 4 .3 1 .5 2 .0 3. 4 3.0 2.2 0 . 9 4. 0 1 .2 3 .5 0.4 5. 8 2 .0 4 .5 1 .0 7. 2 3 . 8 5 . 0 2 . 0 7. 8 5 . 3 6 . 0 2 . 5 9. 0 7 . 2 7 . 1 2 . 0 8. 0 0.7 9. 0 0 . 0 10. 0 1.5 10. 5 3 .4 11. 0 5 . 0 Not e : The pr ogram FRAME , as ori ginally pr ogr ammed (see diskette or CD R OM) , doe s not maint ain the pr oper scaling o f the gr aph . If y ou w ant to maintain pr oper scaling , replace FRAME w ith the f ollo w ing pr ogram: « STO Σ MINΣ MAX Σ 2 COL  DUP  COL DRO P – AXL ABS AXL 20 / DUP NEG SWAP 2 COL  ROW DROP SWAP  yR xR « 131 DUP R  B SWAP yR OBJ  DROP – xR OBJ  DROP - / * FLOOR R B PDIM yR OBJ  DROP YRNG xR OBJ  DROP XRNG ERASE » » T his progr am keep s the w idth of the P ICT var ia ble at 131 p i xe ls – the minimum pi xel si z e f or the hori z ontal ax is – and adj us ts the number of pi xe ls in the v ertical ax es so that a 1:1 scale is maintained between the v ertical and hor i z ontal axes .
Pa ge 22- 26 (x min , y max ) . T he maxim um coordinate s in terms of pi xels cor r espond to the lo w er ri ght corner of the sc r een {# 8 2h #3Fh}, w hic h in use r-coor d inate s is the point (x max , y min ) . T he coor dinates of the two other corner s both in pi xel as w ell as in user - def ine d coor di nates ar e show n i n the figur e . Animating gr aphic s Her ein w e pr es ent a w a y to pr oduce animatio n by using the Y -Sli ce plot ty pe . Suppo se that y ou wa nt to animat e the tr av eling w av e , f(X,Y) = 2 . 5 sin(X- Y) . W e can tr eat the X a s time in the animation pr oduc ing plots of f(X,Y ) vs . Y for diffe r ent value s of X. T o pr oduce this gr aph use the f ollo w ing: Θ „ô sim ultaneousl y . S elect Y -Sli ce f or TYP E . ‘2 . 5*SIN(X - Y)’ f or E Q. ‘X’ f or INDEP . Pre ss L @@@OK@@@ . Θ „ò , simultaneou sly (in RPN mode) . U se the f ollo w ing v alues: Θ Pr ess @ERA SE @DRAW . Allo w some time for the calc ulator to gener ate all the needed gr aphi cs. W hen r eady , it will sho w a tra v eling sinus oi dal w av e in y our scr een.
Pa g e 22 - 27 Animating a collec tion o f graphics T he calc ulato r pr o v ide s the f unction ANIMA TE to animate a number o f gr aphi cs that hav e been placed in the st ack . Y ou can gener ate a gr aph in the gr aphic s sc r een b y using the commands in the PL O T and PICT men us . T o place the gener ated gr aph in the stac k, u se PICT R CL. When y ou hav e n graphs in levels n thr ough 1 o f the s tac k, y ou can simpl y use the command n ANIMA TE to pr oduce an animat ion made o f the gr aphs y ou placed in the st ack . Ex ample 1 – Animating a r ipple in a wate r surface As an e xample , t y pe in the f ollo w ing pr ogr am that gener ates 11 gr aphi cs sho w ing a c ir cle center ed in the middle of the gr aphi cs sc r een and who se r adius inc reas e by a constant v alue in eac h subsequent gr aph. «B e g i n p r o g r a m RA D Set angle units t o radi ans 131 R  B 64 R  B PD IM Set PIC T to 13 1 × 64 pix els 0 100 XRNG 0 100 YRNG Set x - and y-range s to 0 -100 1 11 FOR j Start loop w ith j = 1 .. 11 ER A SE Er ase c urr ent PICT (5 0., 50.) ‘5*(j-1)’  NUM Cent ers o f c ir cle s (50 ,5 0) 0 ‘2* π ’  N U M A RC D raw ci rcl e c en t er r = 5 ( j- 1 ) PICT R CL P lace c urr ent PICT on stac k NEXT End FOR -NE XT loop 11 ANIMA TE Animate » End pr ogr am Stor e this pr ogr am in a v ar iable called P ANIM (Plo t ANIMation). T o run the pr ogr am pr ess J (if needed) @PANIM . It tak es the calc ula t or mor e than one minut e to gener ate the gr aphs and get the animati on going . T here f ore , be r eally pati ent her e . Y ou w ill see the hour glass s ymbol u p in the scr een for what seems a long time be fo r e the animati on , r esembling the r ipples pr oduced by a pebble dr opped on the surface o f a body of q uies cent w ater , appears in the sc r een. T o s top the animation , pr ess $ . T he 11 gra phics ge ner ated b y the pr ogram ar e still av ailable in the stac k. If y ou want to r e -star t the animati on, sim ply use: 11 ANIMA TE . (Func tion
Pa g e 22-2 8 ANIMA TE is av ailable b y us ing „°L @) GROB L @ANIMA ) . T he animation w ill be r e -started. Pr ess $ to stop the animati on once mor e . Notice that the number 11 w ill still be lis ted in stac k le v el 1. Pr ess ƒ to dr op it f r om the stack. Suppos e that yo u want t o keep the f igur es that compose this animation in a v ari able . Y ou can cr eate a list of the se fi gur es , let’s call it WLIS T , b y using: 11 „° @) TYPE@ @  LIST ³ ~~wlist~ K Press J to r e co ver y our list of vari ables. The var iable @WLIST should no w be listed in yo ur soft-menu k e ys . T o re -animat e this list of v ar iables y ou could use the f ollo w ing pr ogr am: « St art pr ogr am WLIS T P lace list WLI S T in st ack OB J  Decompo se list , stac k le v el 1 = 11 ANIMA TE Start animation » End pr ogram Sa ve this pr ogr am in a var ia ble called RANIM (R e -ANIMate) . T o run it , pre ss @RANIM . T he follo w ing pr ogram w ill animate the gr aphic s in WLIS T f orwar d and backw a r ds: « S tart pr ogr am WLIS T DUP P lace list WLI S T in st ack , mak e e xtr a cop y REVLI S T R e ver se o rde r , concatenate 2 lists OB J  Decompose list in elements, lev el 1 = 2 2 ANIMA TE Start animation » End pr ogram Sa ve this pr ogr am in a var ia ble called RANI2 (R e -ANImate ver si on 2) . T o run it , pr ess @ RANI2 . T he animation n ow sim ulates a r ipple in the surface o f otherw ise quie scent w ater that gets r ef lected f r om the walls o f a ci r cular t ank back tow ar ds the center . Pres s $ to s top the animation .
Pa g e 22 - 2 9 Ex ample 2 - Animating the plotting of diff er ent po w er f uncti ons Suppos e that yo u want t o animate the plotting of the functi ons f(x) = x n , n = 0, 1, 2 , 3, 4, in the same set o f axe s. Y ou could use the f ollo w ing pr ogr am: «B e g i n p r o g r a m RA D Set angle units to r adians 131 R  B 64 R  B PD IM Set PICT scree n to 13 1 × 64 pi x els 0 2 XRNG 0 20 YRNG Se t x - and y-range s 0 4 FOR j S tart loop w ith j = 0,1,…, 4 ‘X^j ’ S TE Q Stor e ‘X^j’ in v ar iable E Q ER A SE Er ase c urr ent PICT DR AX L ABEL DRA W Dr aw ax es , labels, f unction PICT R CL P lace c urr ent P ICT on stac k NEXT End FOR -NEXT loop 5 ANIMA TE Animat e » St ore this pr ogr am in a v ar iable called P W AN (P o W er func tion AN imation) . T o run t he pr o gr am press J (if needed) @ PWAN . Y ou will see the calc ulator dr aw ing eac h indi v idual po w er func tion be for e starting the animation in w hich the f i v e functi ons w ill be plotted q uic kly one af t er the othe r . T o stop the animation , pre ss $ . More information on the AN IMA TE func tion T he ANIMA TE fu nction a s used in the tw o pr ev ious e xam ples utili z ed as input the gr aphi cs to be animated and their number . Y ou can use additi onal inf ormati on to pr oduce the animation , such a s the time int erval betw een gr aphi cs and the number of r epetitions of the gr aphic s. T he gener al for mat of the ANIMA TE functi on in such ca ses is the fo llo w ing: n-graphs { n {#X #Y} delay rep } ANIMATE n r epr es ents the numbe r of gr aphi cs , {#X #Y} s tand fo r the pi xel coor dinates of the lo wer r ight corne r of the ar ea to be plotted (see f igur e belo w) , delay is the number o f seconds allo w ed bet w een consec utiv e graphi cs in the animatio n, and rep is the number o f repetiti ons of the animati on. Graphic objects (GROBs) T he wo r d GROB st ands for GR aphi cs OBjec ts and is used in the calc ulator ’s en vi r onment to r epr ese nt a pi x el-b y-pi x el desc r iption of an image that has been
Pa ge 22- 3 0 pr oduced in the calc ulator’s sc reen . T her ef or e , when an image is con v er ted into a GROB , it becomes a s equence of binary digits ( b inary dig its = bit s ), i . e . , 0’s and 1’s . T o illustr ate GR OBs and con ve rsi on of image s to GR OBS consider the f ollo w ing e xe r c ise . When w e pr oduce a gr aph in the calculat or , the gra ph become the contents of a spec ial v ar iable called P ICT . T hus , to see the las t contents of P ICT , y ou could use: P ICT RCL ( „°L @) PICT @PICT „© ). T he displa y show s in stac k le vel 1 the line Graphic 131 ×80 (if using the standar d scr e e n siz e) f ollo we d by a sk etch of the top part of the gr aph. F or exa mp l e , If y ou pr ess ˜ then the gr aph contained in le v el 1 is sho wn in the calc ulator ’s gr aphic s displa y . Pr ess @CANCL t o r eturn to nor mal calculator displa y . T he gr aph in lev el 1 is still not in GROB f ormat , although it is , b y def initi on, a gr aphi cs ob jec t . T o conv er t a gr aph in the stac k into a GR OB , use: 3` „°L @) GROB @  GROB . No w w e hav e the f ollo w ing info rmati on in lev el 1: T he fir st part of the desc r iption is similar to what w e had or iginall y , namely , Graphic 131 ×64 , b ut no w i t is expressed as Graphic 13128 × 8 . Ho w ev er , the gr aphic displa y is now r eplaced by a sequ ence of z er o e s and ones r ep r esenting the p i xels of the or iginal gr aph. T hus, the or i gina l gr aph as no w been con v erted to its equi v alent r epr esent ation in bits . Y ou can also con vert equatio ns into GROB s. F or ex ample , using the equation w rit er t y pe in the equati on ‘X^2 3’ into st ack le v el 1, and then pr ess
Pa ge 22- 3 1 1` „°L @) GROB @  GROB . Y ou w ill no w hav e in le v el 1 the GROB desc r ibed as: As a gr aphic ob ject this eq uation can no w be placed in the gr aphi cs displa y . T o r ecov er the gr aphics dis play pr ess š . Then , mo ve the c urso r to an empt y sect or in the graph , and pr ess @) EDIT LL@ REPL . The equatio n ‘X^2 -5’ is placed in the gr aph , fo r ex ample: T hus , GROBs can be us ed to document gr aphics b y plac ing equations , or te xt , in the gr aphi cs displa y . T he GROB menu T he GROB men u , acces sible thr ough „°L @) GROB @  GROB , contains the fol low i ng func tion s. P r ess L to mov e to the next menu:  GRO B Of these f uncti ons w e hav e alr ead y used S UB , REPL , (fr om the gra phics EDI T menu), ANIMA TE [ ANIMA], and  GR OB . ([ PR G ] is simpl y a w ay to r eturn to the pr ogr amming menu .) While using  GR OB in the tw o pr ev ious e xamples y ou ma y hav e noticed that I u sed a 3 w hile con verting the gr aph into a GROB , w hile I used a 1 when I con v er ted the equati on into a GROB . This par ameter of the fu ncti on  GROB indi cates the si z e o f the objec t that is being con v erted into a GROB as 0 or 1 – f or a small objec t , 2 – medium, and 3 – lar ge . The other func tions in the GR OB menu ar e desc r ibed follo wing .
Pa g e 22 - 32 BLANK T he functi on BL ANK , w ith ar guments #n and #m, c r eates a blank gra phics obj ect of w i dth and height spec ifi ed by the v alues #n and #m, r es pecti v ely . T his is similar to the func tion P DIM in the GRAPH men u . GOR The fun ctio n GO R ( Grap hics OR ) ta k es as in put gr ob 2 (a target GROB) , a set of coor dinates , and gr ob 1 , and pr oduce s the super positi on of gr ob 1 onto gr ob 2 (or P ICT) starting at the spec if ied coor dinate s. T he coor dinates can be spec if ied as us er -def ined coor dinates (x ,y) , or pi x els {#n #m}. GOR uses the OR f unction to determine the s tatus of eac h pi xel (i .e ., on or off) in the ov erlapp ing r egion between gr ob 1 and gr ob 2 . GX OR T he functi on GX OR (Gra phics X OR) perf orms the same oper ati on as GOR, but using X O R t o determine the f inal status o f pi x els in the o v erlapp ing ar ea between gr aphic objec ts gr ob 1 and grob 2 .  LC D T ak es a spec ifi ed GROB and dis play s it in the calculator's dis pla y starting at the upper le ft corner . LC D  Cop ies the con tents of the s tac k and menu displa y into a 131 x 64 p i xel s GR OB . SIZE T he functi on SI ZE , whe n applied to a GROB , show s the GROB’s si z e in the fo rm of tw o number s. T he f irst n umber , sho wn in st ack le v el 2 , r epr esents the w idth of the gr aphi cs obj ect , and the seco nd one , in stac k le ve l 1, sh o ws its he ight . Not e : In both GOR and GXOR , whe n grob2 is r eplaced by P ICT , these func tions pr oduce no output . T o see the output y ou need to r ecall PICT to the stac k by u sing either PICT R CL or PICTURE .
Pa g e 22 - 3 3 An e xample o f a progr am using GROB T he follo w ing pr ogram pr oduces the gr aph of the sine f unctio n including a fr ame – dra w n w ith the func tion B O X – and a GROB t o label the gr aph. Here is the listing o f the progr am: «B e g i n p r o g r a m RA D Set angle units t o radi ans 131 R  B 64 R  B PD IM Set PICT scree n to 13 1 × 64 pi x els -6 .2 8 6 .2 8 XRNG –2 . 2 . YRNG Set x - and y-range s FUNCT ION Selec t FUNCTION ty pe fo r gr aphs ‘SIN(X)’ S TE Q S tor e the f uncti on sine into E Q ERASE DR AX LABEL D RA W Clear , dra w axe s, labels , gr aph (-6 .2 8 ,- 2 .) (6 .2 8 ,2 .) BO X Dr aw a fr ame ar ound the gr aph PICT R CL P lace c o ntents of PICT on stac k “S INE FUNCTION” P lace gr aph la bel str ing in stac k 1  GROB Co nv ert str ing in to a small GROB (-6 ., 1. 5) S W AP C oor dinates to place label GROB GOR Co mbine P ICT w ith the label GROB PICT S T O Sa ve comb ined GROB into P ICT { } PVIEW Bring P ICT to the stac k » End pr ogr am Sa ve the pr ogr am under the name GRP R (GR OB PR ogr am) . Pr ess @GRP R to run the pr ogr am. T he output w ill look lik e this: A pr ogram w ith plot ting and dr awing functions In this secti on w e de velop a pr ogr am to produce , dr aw and label Mohr ’s c ir cle fo r a gi ven conditi on o f two -dimensio nal str ess . The le f t-hand side f igur e belo w sho w s the giv en stat e of str ess in two -dimensi ons, w ith σ xx and σ yy being normal st r esses, and τ xy = τ yx being s hear stresses . The ri ght -han d side fi gu r e
Pa g e 22 - 3 4 sho w s the state o f str es ses w hen the element is r otated b y an angle φ . In this case, the normal str esses are σ ’ xx and σ ’ yy , w hile the shear stresses ar e τ ’ xy and τ ’ yx . The relationsh ip bet w een the origina l state of str esses ( σ xx , σ yy , τ xy , τ yx ) and the stat e of str ess w hen the ax es ar e r otat ed counte r cloc kw ise b y f ( σ ’ xx , σ ’ yy , τ’ xy , τ ’ yx ) , can be r e pr esen ted gr aphi cally b y the cons truct sho wn in the f igur e belo w . T o constru ct Mohr’s c irc le w e use a Cartesi an coor dinate s y stem w ith the x -ax is cor re sponding to the no rmal str esse s ( σ ), and the y-ax is corr esponding to the sh ear stresses ( τ ). Locate the po ints A( σ xx , τ xy ) and B (σ yy , τ xy ) , and dr a w the segment AB. The point C wher e the segment AB cr osses the σ n ax is w ill be the center o f the c irc le . Noti ce that the coor dinates of po int C ar e (½ ⋅ (σ yy σ xy ), 0) . W hen constr ucting the c ir cle b y hand, y ou can u se a compas s to tr ace the c ir c le since y ou kno w the locati on of the center C and of tw o poin ts, A and B . Let the s egment A C r epr esen t the x -axis in the or i ginal state of str ess . If yo u want to d e termin e the state of str ess for a set of ax es x’-y’ , r otated coun ter clo ckw ise b y an angle φ w ith r espect to the or i gina l s et of ax es x -y , dra w segment A ’B’ , center ed at C and r otated c lock wis e b y and angle 2φ w ith r es pect to segment AB . The coor dinate s of point A ’ wi ll giv e the values ( σ ’ xx , τ’ xy ), w h i l e those of B’ will giv e t he values ( σ ’ yy , τ’ xy ).
Pa g e 22 - 35 The stress cond ition for whic h t he she ar stress , τ ’ xy , is z er o , ind i cated by segment D’E’ , produces the s o -called princ ipal str esses , σ P xx (at point D’) and σ P yy (at point E’). T o obtain the pr inc ipal stre sses y ou need to r otate the coor dinate s y stem x ’-y’ by an angle φ n , counter c lockw ise , w ith r espec t to the s y stem x -y . In Mohr’s c irc le , the angle betw een s egments A C and D’C measur es 2 φ n . The stress cond ition for whic h t he she ar stress , τ ’ xy , is a maximum , is giv en b y seg ment F ’G’ . Un der su ch cond itions both normal str esses, σ ’ xx = σ ’ yy , ar e equal . The angle corr esponding to this ro tation is φ s . T he angle bet w een segment A C and segment F’C in the fi gur e re pre sents 2 φ s . Modular progr amming T o de ve lop the pr ogr am that will plot Mohr ’s c ir cle gi ven a st ate of str ess , w e w ill use modular pr ogr amming . Basicall y , this appr oach co nsists in decomposing the pr ogr am into a number of sub-pr ograms that ar e cr eated as
Pa g e 22-3 6 separ ate v ar iables in the calc ulator . Thes e sub-pr ogr ams are then link ed by a main pr ogr am, that w e w ill call MOHRCIRCL . W e will fir st c r eate a sub- dir ect or y called MOHR C w ithin the HOME dir ectory , and mov e into that dir ect or y t o type the pr ograms . T he next s tep is to c r eate the main pr ogr am and sub-pr ogr ams wi thin the sub- dir ect ory . T he main pr ogr am MOHRCIR CL use s the foll ow ing sub-pr ograms: Θ IND A T : R equests input o f σ x, σ y, τ xy f rom user , pr oduc es a li st σ L = { σ x, σ y, τ xy} as output . Θ C C &r : Uses σ L as input , pr oduces σ c = ½( σ x σ y) , r = r adiu s of Mohr ’s c ir cle , φ n = angle for pr inc ipal str esses , as outpu t . Θ D AXE S: Uses σ c and r as input , determine s ax es r anges and dr aw s ax es fo r the Mohr’s c ir cle cons truc t Θ P C IRC: Uses σ c , r , and φ n as input , dr aw’s Mohr ’s c ir cle b y pr oduc ing a P AR AME TRIC plot Θ DDIA M: U ses σ L as input , dr aw s the segment AB (see Mohr’s c ir cle f igur e abo v e) , j oining the inpu t data po ints in the Mohr’s c ir cle Θ σ LBL: Uses σ L as input , place s labels to ide ntify po ints A and B with labels “ σ x ” and “ σ y” . Θ σ AXS: P laces the la bels “ σ ” and “ τ ” in the x - and y-axe s, r especti vel y . Θ P TTL: P laces the title “Mohr ’s c ir c le ” in the fi gur e . Running the pr ogram If y ou typed the pr ogr ams in the orde r sho wn a bov e, y ou will ha v e in y our sub- dir ect or y M OHRC the f ollo w ing v ari ables: P TTL, σ AXS , PLPNT , σ LBL , P P T S , DD IAM. Pressing L you f ind also: P CIRC, D AXE S , A TN2 , CC&r , INDA T , MO H RC. Be fore r e - ord erin g th e va ria bl es, ru n t h e p rog ram on c e by pres si ng the so ft -k ey labe led @MOHRC . Use the f ollo w ing: @MOHRC L aunche s the main pr ogr am MOHRCIR CL 25˜ Ente r σ x = 2 5 75˜ Ente r σ y = 7 5 50` Ente r τ xy = 50, and f inish data entry .
Pa g e 22 - 37 At this point the pr ogram MOHR CIRCL s tarts calling the su b-pr ograms t o pr oduce the fi gur e . Be pa ti ent . The r esulting Mohr ’s c ir cle w ill look as in the pic tur e to the le ft. Becau se this v ie w of P ICT is in vok ed through the f uncti on PVIEW , w e cannot get an y other inf ormati on out of the plot beside s the fi gur e itself . T o obtain additional inf ormati on out o f the Mohr’s c ir cle , end the progr am by pr essing $ . Then , pre ss š to r ecov er the contents of P ICT in the gr aphics en vir onment . The Mohr’s c ir cle no w looks lik e the pic tur e to the ri ght (see abov e) . Press the soft -m enu k e ys @TRACE and @ ( x,y ) @ . A t the bot t om of the scr een you w ill f ind the value o f φ corr esponding to the po int A( σ x, τ xy) , i .e ., φ = 0, (2.50E1, 5.00E1). P res s th e rig h t - a rrow key ( ™ ) to incr ement the v alue of φ and see the cor r esponding v alue of ( σ ’ xx , τ’ xy ) . F or e xam ple , f or φ = 4 5 o , w e hav e the val ue s ( σ ’ xx , τ’ xy ) = (1. 00E2 , 2 . 5 0E1) = (100, 2 5). The v alue of σ ’ yy w ill be fo und at an angle 90 o ahead , i .e ., w her e φ = 4 5 90 = 13 5 o . Pr ess the ™ k e y until r eaching that value o f φ , w e find ( σ ’ yy , τ’ xy ) = (-1. 00E-10,- 2 . 5E1) = (0, 25 ) . T o f ind the princ ipal normal v alues pr es s š until the cur sor r eturns to the inter secti on of the c ir c le w ith the positi v e secti on of the σ - a x i s . T h e v a l u e s f o u n d at that point ar e φ = 5 9 o , and ( σ ’ xx , τ’ xy ) = (1. 06E2 ,-1.40E0) = (106, - 1.40) . No w , w e expec ted the value o f τ ’ xy = 0 at the location o f the princ ipal axe s. What happens is that , because w e hav e limited the r esolu tion on the independent v ari able to be Δφ = 1 o , w e miss the actual po int w her e the shear str es ses become z er o . If you pr es s š once mor e , you f ind v alues of ar e φ = 58 o , and ( σ ’ xx , τ’ xy ) = (1. 06E2 ,5 .5 1E -1) = (106 , 0.5 51) . What this
Pa g e 22 - 3 8 inf ormatio n tell us is that some w here betw een φ = 5 8 o and φ = 5 9 o , the shear stress, τ ’ xy , becomes z er o . T o f ind the actual v alue of φ n, pr ess $ . T hen type the list corr esponding to the v alues { σ x σ y τ xy}, for this case , it w ill be { 25 75 50 } [ENTER] Then , pres s @CC&r . The las t r esult in the output , 5 8.2 8 2 5 2 5 5 8 8 5 o , is the ac tual val ue of φ n. A pr ogram to calculate principal stresses T he pr ocedur e follo wed abo ve t o calculat e φ n , can be pr ogr ammed as f ollo w s: Pr ogr am P RNS T : « Start pr ogr am P RNS T (PR iNc ipal ST r esses) IND A T Ente r data as in pr ogr am MOHRCIR C CC &r Calcul ate σ c , r , and fn, as in MOHR CIRC “ φ n”  T A G T ag angle f or pr inc ipal stresses 3 ROLLD Mo ve tagged angle to le vel 3 R  C DU P Con vert σ c and r t o ( σ c , r ) , dupli cate C  R “ σ Px”  T A G Calc ulate pr inc ipal str es s σ Px, t ag i t SW A P C  R - “ σ Py”  T A G S wa p ,calculat e str ess σ Py , tag it. » End pr ogram P RNS T T o run the pr ogram us e: J @PRNST St ar t pr ogr am P RNS T 25˜ Ente r σ x = 2 5 75˜ Ente r σ y = 7 5 50` Ente r τ xy = 50, and f inish data entry . T he r esult is: Ordering the v ariables in the sub-director y R unning the pr ogr am MOHR CIRCL f or the f irs t time pr oduced a couple of ne w v ari ables , PP AR and EQ. T hese ar e the P lot P AR ameter and E Quation v ar iable s
Pa g e 22 - 3 9 necess ar y to plot the c irc le . It is suggest that w e r e -or der the var iable s in the sub-dir ectory , so that the pr ogr ams @MOHRC and @PRNST ar e the two f ir st v ari ables in the soft-menu k e y labels. T his can be accomplished b y cr eating the list { MOHRCIRCL PRNS T } using: J„ä @MOHRC @PRNST ` And then , order ing the list by using: „° @) @MEM@@ @) @DIR@@ @ ORDER . After this call to the f uncti on ORDER is pe rfor med, pr ess J . Y ou w ill no w see that w e ha ve the pr ogr ams MOHR CIRCL and PRN S T being the f ir st tw o var iables in the menu , as w e e xpected . A second e x ample of Mohr ’s c ir cl e calculations Determine the pr inc ipal str esses for the stress state def ined by σ xx = 12 . 5 kP a , σ yy = -6 .2 5 kP a, and τ xy = - 5 .0 kP a . Dr aw Mohr ’s c ir c le , and det ermine fr om the f igur e the v alues of σ ’ xx , σ ’ yy , and τ ’ xy if the angle φ = 3 5 o . T o determine the princ ipal stresses u s e the pr ogr am @PRNST , as follo ws: J @PRNST St ar t pr ogram P RNS T 12.5˜ Enter σ x = 12 .5 6.25\˜ Enter σ y = -6.2 5 5 \` Ent er τ xy = -5, and f inish data entry . T he r esult is: T o dr a w Mohr’s c ir cle , use the pr ogram @MOHRC , as follo ws: J @MOHRC St ar t pr ogram P RNS T 12.5˜ Enter σ x = 12 .5 6.25\˜ Enter σ y = -6.2 5 5 \` Ent er τ xy = -5, and f inish data entry . T he r esult is:
Pa ge 22- 4 0 T o find the v alues o f the str ess es corr esponding to a r otatio n of 3 5 o in the angle of th e stressed p art i cle, w e use: $š Clea r sc reen, show PICT in graphics scr een @TRACE @ (x,y ) @ . T o mo ve c urs or ov er the c ir cle sho wing φ and (x ,y) Ne xt , pr ess ™ until y ou r ead φ = 3 5 . T he corr esponding coor dinates ar e (1.6 3E0, -1. 0 5E1) , i .e., at φ = 3 5 o , σ ’ xx = 1.6 3 kP a , and σ ’ yy = -10. 5kP a . An input for m for the Mohr ’s c ir cl e pr ogram F or a fanc ier w a y to input data , we can r eplace sub-pr ogr am IND A T , w ith the fo llo w ing pr ogram that ac tiv ates an input for m: « “MOHR’S CIRCLE” { { “ σ x:” “Normal stress in x” 0 } { “ σ y:” “Normal stress in y” 0 } { “ τ xy:” “Shear stress” 0} } { } { 1 1 1 } { 1 1 1 } INFORM DROP » W ith this pr ogr am substitu tion , running @ MOHRC w ill pr oduce an input f orm as sho w n ne xt: Press @@@OK@@@ to c ontin ue pr ogram e x ec ution . The r esult is the follo w ing f igur e:
Pa ge 22- 4 1 Since pr ogr am IND A T is use d also f or pr ogram @PRNST (P R iNc ipal S T resses), running that partic ular pr ogr am w ill no w use an input f or m, f or e x ample , T he r esult , after pr es sing @@@OK@@@ , is the follo wing:
Pa g e 23 - 1 Chapter 2 3 Character strings Char acter s tring s are calc ulator obj ects enc losed betw een double quotes . T hey ar e tr eated as te xt b y the calc ulator . F or e x ample , the str ing “SINE FUNCT ION” , can be transf or med into a GR OB (Gr aphic s Obj ect) , t o label a gr aph , or can be us ed as output in a pr ogr am. Sets o f char act ers ty ped by the user a s input to a progr am ar e tr eated as st ring s. A lso , man y obj ects in pr ogr am output ar e also str ings . String-r elated func tions in the T YP E sub-menu T he TYPE sub-men u is accessible thr ough the P RG (pr ogr amming) menu , i .e ., „° . T he functi ons pr o v ided in the TYPE su b-menu ar e also sho w n belo w . Among the f unctions in the TYPE men u that ar e use ful f or manipulating str ings we h ave: OB J  : Con verts s tring to the ob jec t it r epr esents  S TR: Con v erts an ob ject t o its string r epr esent ation  T A G: T ags a qu antity D T A G: R emov es the tag fr om a tagge d quantity (de -tags ) CHR: Creat es a one -c har acte r str ing corr esponding to the n umber used a s ar gument NUM: Re turns the code f or f irst c har acter in a s tr ing Ex amples of applicati on of thes e func tions to str ings ar e show n ne xt:
Pa g e 23 - 2 String concatenation Str ing s can be concatenated (j oined together ) b y using the plu s sign , f or exa mp l e: Concat enating str ings is a pr actical w a y to cr ea t e output in pr ogr ams. F or e x ample , concatenating "Y OU ARE " A GE " YEAR OLD" cr eate s the string "Y OU ARE 2 5 YE AR OLD", wher e 2 5 is stor ed in the var iable called A GE . T he CHARS m enu T he CHAR S sub-menu is acces sible thr ough the PR G (pr ogr amming) menu , i .e ., „° . T he functi ons pr o vi ded by the CHAR S sub-menu ar e the fo llo w ing:
Pa g e 23 - 3 T he operati on of NUM, CHR , OB J  , and  S TR w as pr esen ted ear lier in this Chapt er . W e hav e also s een the functi ons S UB and REP L in r elation t o gr aphic s earli er in this chapte r . Func tions S UB , REPL , P OS , S IZE , HEAD , and T AIL hav e similar eff e c ts as in lis ts, namel y : SI ZE: number o f a sub-str ing in a str ing (including spaces) P OS: positi on of f irs t occur r ence of a char acter in a str ing HEAD: e xtr acts f irst char a c ter in a str ing T AIL: remo ves f irs t char act er in a str ing S UB: e xtrac t sub-str ing gi v en starting and ending positi on REP L: r epla ce c har acter s in a str ing w ith a sub-str ing starting at gi ve n position SREP L: r eplaces a sub-st ring b y another sub-s tring in a st ring T o see thos e effec ts on acti on tr y the f ollo w ing e x er c ises: S tor e the str ing “ MY NAME IS C YRILLE ” into v ar iable S1. W e ’ll use this str ing to sho w ex amples of the fu nctions in the CHAR S menu: T he c har ac ters list T he entire collec tion of c har acter s av ailable in the calc ulator is accessible thr ough the k e y str ok e sequence ‚± W hen y ou highli ght any char acte r , sa y the y line feed char acte r  , y ou w ill see at the le ft side of the bottom o f the
Pa g e 23 - 4 sc r een the ke y str ok e sequence to get such c harac ter (  . fo r this case) and the numer ical code corr esponding to the c har acter (10 in this cas e) . Char acte rs that ar e not def ined appear a s a dark squar e in the c har acte rs list (  ) and sho w ( None ) at the bottom of the displa y , e ven t hough a numer ical code e xis ts f or all of them . Numeri cal c harac ter s sho w the cor r es ponding number at the bottom of the dis pla y . Le tters sh o w the code α ( i .e ., ~ ) f ollo w ed by the cor r esponding letter , for e x ample , whe n y ou highligh t M, yo u w ill see α M displa y ed at the lo w er left si de of the sc reen , indi cating the use of ~m . On the other hand , m sho ws the keys tro ke c o m bi n at io n α  M , or ~„m . Gr eek char acter s, suc h as σ , wi ll sho w the code α  S , or ~‚s . Some ch arac ter s, l ike ρ , do not hav e a k e ys tr ok e sequence as soc iat ed wi th them. Th erefore, t he on ly way to ob ta in su ch ch ara cte rs is th roug h t h e ch ara cte r l is t by highli ghting the desir ed char act er and pre ssing @ECHO1@ or @ ECHO@ . Use @ ECHO1@ to copy o ne char act er to the stac k and r etur n immediatel y to nor mal calc ulat or dis pla y . Us e @ECHO@ to cop y a ser ies of c har acter s to the stac k. T o r eturn to nor mal calc ulator displa y use $ . See Appendi x D for mor e details on the us e of spec ial char acter s. A lso , Appendi x G sho ws shortcuts f or pr oduc ing spec ial char a c ters .
Pa g e 24 - 1 Chapter 2 4 Calculator objec ts and flags Numbers , lists, v ec tors, matri ces, algebr ai cs, etc ., ar e calc ulator objec ts. T hey ar e classif ied accor ding to its nature into 30 diff er ent t y pes , whic h ar e desc r ibed belo w . Fl ags ar e var i ables that can be u sed to con trol the calc ulator propert ies . F la gs w ere intr od uced in Chapter 2 . Description of calculator objec ts T he calculat or r ecogni z es the f ollo wing ob ject ty pes: ___________ _____________________ _____________________ ____________ Number T y pe Ex ampl e ___________ _____________________ _____________________ ____________ 0 R eal Number -1.23E-5 1 C omple x Number (-1.2,2.3 ) 2S t r i n g " Hello, world " 3 R eal Arr ay [[1 2][ 3 4]] 4C o m p l e x A r r a y [[(1 2) (3 4)] [(5 6) (7 8)] 5L i s t {3 1 'PI'} 6 Global Name X 7 L ocal Name y 8 Pr ogram <<  a 'a^2' >> 9 A lge braic obje ct 'a^2 b^2' 10 Binary Integer # 2F1E h 11 Gr aphi c Obj ect Graphic 1 31 × 64 12 T agged Ob ject R: 43 .5 13 Unit Obj ect 3_m^2 /s 14 XLIB Name XLIB 3 42 8 15 Dir ect ory DIR É END 16 L ibr ary Library 1 230"... 17 Bac k up Obj ect Backup MYDIR 18 Built-in F uncti on COS 19 Built-in Co mmand CLE R
Pa g e 24 - 2 Number T y pe Ex ampl e ___________ _____________________ _____________________ _______________ 21 Extended R eal Number Lo ng Real 2 2 Extended Comple x Number Long Complex 2 3 L ink ed Arr a y Linked rray 2 4 Char acter Ob ject Character 25 C o d e O b j e ct Code 2 6 Libr ary D at a Library Data 2 7 External Ob jec t E xternal 28 I n t e g e r 3423 142 2 9 Exter nal Obj ect Extern al 30 Exter nal Obj ect External ___________ _____________________ _____________________ _______________ F unc tion TYP E T his functi on, a v ailable in the PR G/TYP E () su b-menu , or thr ough the command catalog, is us ed to determine the type of an obj ect . The f unction ar gu me nt is the obj ect of int ere st . T he functi on r etur ns the objec t t y pe as indicated b y the numbers spec ified abo ve . Function VT YP E T his functi on oper ates similar t o functi on TYPE , but it applie s to a v ari able name , r eturning the type o f obj ect st ored in the v ar iable .
Pa g e 24 - 3 Calculator flags A flag is a v ar iable that can e ither be set or uns et . The st atus of a f lag affec ts the behav ior of the calc ulator , if the flag is a s y stem f lag, or o f a pr ogr am, if it is a user f lag . The y ar e desc r ibed in mor e detail ne xt . S y stem flags S y ste m flags can be access ed by using H @) FLAGS! . Pr ess the do wn ar r o w k e y to see a listing of all the s y stem f lags w ith their n umber and bri ef desc r ipti on. T he fir st tw o sc r eens w ith s y stem f lags ar e sho w n belo w : Y ou w ill r ecogni z e many o f these flag s becaus e the y ar e set or unset in the MODE S menu (e .g., f lag 9 5 for A lgebrai c mode , 103 fo r Comple x mod e , etc.) . Thr oughout this user ’s manual we ha v e emphasi z ed the differ ences bet w een CHOO SE bo xe s and S OFT menu s, w hic h ar e s elected b y setting or un-setting s ys tem flag 117 . Another e xample of s y ste m flag setting is that of s y stem f lags 60 and 61 that r elate t o the constant libr ar y (CONLIB , see Cha pter 3) . T hese flag s oper ate in the f ollo w ing manner : Θ us er flag 60: c lear (default):SI units , set: ENGL units Θ us er flag 61: c lear (default):use units, s et: value onl y Functions for setting and changing flags T hese f unctio ns can be used t o set , un -s et , or chec k on the statu s of u ser flags or sy stem fla gs . When used w ith these fun ctions sy stem fla gs are r eferr ed to w i th negativ e integer n umbers. T hus , s y stem f lag 117 will be r ef err e d to as f lag - 117 . On the other hand , use r flags w ill be re fe rr ed to as po siti ve integer numbers when a pply ing these f uncti ons. It is important to under stand that us er flag s hav e appli cations onl y in pr ogr amming to help co ntr ol the pr ogr am flo w . F uncti ons fo r manipulating calculat or flags ar e av ailable in the PR G/MODE S/ FL A G menu . T he PR G menu is acti vated w i th „° . T he f ollo w ing sc r eens (w ith sy stem flag 117 se t to CHOOSE bo x es) sho w the sequence o f scr eens to get to the FLA G menu:
Pa g e 24 - 4 T he functi ons contained w ithin the FL A G menu ar e the f ollow ing: The ope rati on of thes e func tions is as f ollo w s: SF Set a f lag CF Clear a flag F S? R eturns 1 if flag is set , 0 if not set FC? R eturns 1 if flag is c lear (not set), 0 if f lag is set F S?C T ests flag as F S does, then c lears it FC?C T es ts flag as FC doe s, then c lears it S T OF S tor es ne w s y stem f lag settings RCLF R ecalls ex isting flag settings RE SET Res ets cur r ent f ield v alues (could be us ed to re set a f lag) User flags F or progr amming purpos es , flags 1 thr ough 2 5 6 ar e av ailable to the u ser . T he y hav e no meaning to the calc ulator oper ation .
Pa g e 2 5 - 1 Chapter 2 5 Date and T ime F unc tions In this Chapt er w e demonstr ate some o f the func tions and calc ulations using times and date s. T he TIME menu T he TIME men u , av ailable thr ough the ke ys trok e sequence ‚Ó (the 9 k ey) pr o v ides the f ollo w ing f unctio ns, w hic h ar e des cr ibed ne xt: Setting an alarm Option 2 . Set alarm .. pr o vi des an input fo rm to let the us er set an alarm . The input f or m looks lik e in the f ollo wing f i gur e: T he Message: input f ield allo ws you t o enter a c harac ter str ing identify ing the alarm . T he T ime: f ield lets y ou enter the time for ac ti vating the alar m . The Dat e: f ield is used to se t the date f or the alarm (or f or the fir st time of acti vati on, if r epetition is r equir ed) . F or e xample , yo u could set the f ollo w ing alarm . T he left- hand side f igur e sho ws the alar m w ith no r epetition . The r ight -hand f igur e sho w s the op ti ons f or r epetition after pr essing @CHOOS . After pr es sing @@@OK@@@ the alarm w ill be set .
Pa g e 2 5 - 2 Br ow sing alarms Option 1. Br o ws e alarms ... in the T IME menu lets y ou r e v ie w y our cur r ent alarms . F or e x ample , after enter ing the alarm us ed in the ex ample a bov e, this option w ill show the f ollo w ing scr een: T his s cr een pro vi des four s oft menu k ey labe ls: EDIT : F or editing the select ed alarm , pr ov iding an alarm s et input for m NEW : F or pr ogr amming a ne w alarm P URG: F or deleting an alar m OK : Re turns to normal displa y Setting time and date Option 3 . Set time , date… pr ov ides the f ollo w ing input for m that let’s the user set the c urr ent time and date . Details w er e pr o v ided in Chapt er 1. TI ME T o ol s Option 4. T ools… pr ov ide s a number of f uncti ons use ful f or c lock ope rati on , and calc ulations w ith times and dates . The f ollo w ing f igur e sho ws the f uncti ons av ailable unde r TIME T ools:
Pa g e 2 5 - 3 T he applicati on of these f uncti ons is demonstr ated belo w . D A TE: P laces c urr ent date in the stac k  D A TE: Set sy stem date to specif ied v alue T IME: P laces c ur r ent time in 2 4 -hr HH.MM S S f ormat  T IME: Set s y stem time to spec if ied v alue in 2 4 -hr HH.MM. S S f ormat T ICK S: Pr ov ides s y stem time as binary integer in units of c loc k tic ks w ith 1 tic k = 1/819 2 sec ALRM.. : Su b-men u w ith alarm manipulati on f uncti ons (des c ribed lat er ) D A TE : Adds or subtr act a number o f day s to a date DD A Y S(x ,y) : Retur ns number of da ys bet w een dates x and y  HMS: Con v er ts time f r om dec imal to HH.MM S S HM S  : Con verts time fr om HH.MMS S to dec imal HM S : Add tw o times in HH.MM S S for mat HM S -: Su btr act tw o times in HH .MMS S f ormat T S TR(time , date) : C on verts time , date to s tr ing for mat CLKAD J(x) : Adds x tic ks to s y st em time (1 tic k = 1/819 2 s ec ) Fu n c ti o n s  D A TE ,  T IME , CLKAD J ar e used t o adju st date and time . Ther e ar e no e x amples pr o v ided her e for thes e func tio ns. Her e are e xamples of func tions D A TE , TIME , and T S TR: Calculations with dates F or calcul ations w ith dates, u se func tions D A TE , D D A Y S . Her e is an e xample of appli cation o f these fu nctions , together w ith an ex ample of f uncti on TICK S:
Pa g e 2 5 - 4 Calculating with tim es Th e fu nct ion s  HMS , HM S  , HMS , and HM S - ar e us ed to manipulate value s in the HH.MM S S for mat . This is the same f ormat us ed to calc ulate w ith angle measur es in degr ees, min utes , and seconds. T hu s, thes e oper ations ar e usef ul not onl y fo r time calculati ons, but als o for angular calc ulations. Ex a m ples ar e pr o v ided ne xt: Alarm functions Th e su b -me nu TIM E/ T o ol s… /A L RM … p r ovid es th e fo llowin g fun ctio ns : T he oper ation of the se func tions is pr o vi ded next: A CK: A ckno wledge s past due alar m A CKALL: Ac kno w ledges all pas t due alarms S T O ALA RM(x): Stor es alar m (x) int o sy stem alarm list R CL AL ARM(x): Recalls s pec if ied alarm (x) f r om s y stem alar m list DEL ALA RM(x): Deletes alar m x f r om s ys tem alar m list FIND AL ARM(x): Retur ns fi rst alar m due after spec if ied time T he argument x in f uncti on S T O ALA RM is a list cont aining a date re fer ence (mm .ddyyy), time of da y in 2 4 hr f or mat (hh.mm), a str ing cont aining the te xt of the alarm , and the number of r epetiti ons of the alarm . F or e x ample , STO L RM({6.092003, 18.25,"Test", 0} . T he ar gument x in all the other alar m func tions is a positi ve int eger number indi cating the number of the alar m to be r ecalled , deleted , or f ound . Since the handling of alar ms can be easil y done w ith the T IME menu (see abo v e) , the alarm-r elated func tions in this sec tion ar e more lik ely to be us ed for pr ogr amming purpos es.
Pa g e 26 - 1 Chapter 2 6 M anaging memory In Chapte r 2 w e intr oduced the basic co ncepts of , a nd ope rati ons fo r , cr eating and managing var i ables and dir ec tor ies . In this Chapt er w e disc uss the management of the cal culat or’s memory , including the partition of memo r y and tec hniques f or backing u p data. Me mo ry S t r uct ur e T he calculator co ntains a tot al of 2 . 5 MB of memory , out of w hic h 1 MB is us ed to st or e the oper ating s y stem (s yst em memory) , and 1. 5 MB is u sed f or calc ulato r oper ation an d data sto r age (user ’s memory) . Us ers do n ot hav e access to the s ys tem memory c om ponent . T o see the wa y in w hich the u ser’s memory is partitio ned, u se the FILE S func tion ( „¡ ). A possible r esult is sho w n belo w: T his scr een indicates the e x istence o f thr ee memor y po rts, beside s the memory cor r esponding to the HO ME dir ecto r y (s ee Chapte r 2 in this guide) . T he memory por ts a v ailable ar e: Θ Po r t 0 , l a b e l e d I R A M Θ P ort 1, labeled ER AM Θ P or t 2 , labeled FL A SH P or t 0 and the HOME dir ectory share the same ar ea of memory , so that the mor e data stor ed in the HO ME dir ectory , for e xample , the le ss memory is av ailable f or P ort 0 stor age . The tot al si z e of memory fo r the P ort 0/HOME dir ect or y memory ar ea is 2 41 KB.
Pa g e 26 - 2 P or t 1 (ERAM ) can contain up to 12 8 KB of data . P ort 1, together with P ort 0 and the HOME dir ectory , cons titute the calc ulator’s RAM (R andom Acce ss Memory) segment of calc ulator ’s memory . T he R AM memory segment r equir es contin uous elec tr ic po w er suppl y f r om the calculat or bat t er ies t o operat e. T o av o id los s of the R AM memory contents, a CR20 3 2 bac ku p bat t ery is inc luded . See additional details at the end o f this c hapter . P or t 2 belong s to the calc ulator’s F lash RO M (Read- Onl y Memory) segment , w hic h does not r equir e a po we r supply . Ther efo r e , r emo vi ng the bat t er ies o f the calc ulato rs w ill not affec t the calculat or’s F lash RO M segment . P or t 2 can s tor e up to 108 5 KB o f data . A f ourth po r t , P ort 3, is av ailable fo r use w ith an SD fla sh memory car d. An e x ample is sho wn belo w . T he por t a ppears in F ile Manage r only w hen an SD car d is inserted . T he HOME director y When using the calc ulator you ma y be cr ea ting v ar iables to st or e intermediate and fi nal re sults. So me calc ulator oper ations , such as gr aphics and st atisti cal oper ations , c reat e their o w n var iables f or st oring data. T h e se v ari ables w ill be stor ed in the HOME dir ectory o r one of its dir ector ie s. Details on the manipulation o f v ari ables and dir ectori es ar e pr esented in Ch apter 2 . P ort me mo ry Unlik e the HO ME dir ectory , the memory in ports 0, 1 and 2 cannot be sub- di v ided into direc tor ies , and it can only cont ain back up objec ts or libr ar y obj ects . T hese ob jec t t y pes ar e desc r ibed belo w .
Pa g e 26 - 3 Chec king objec ts in memor y T o see the ob jec ts stor ed in memor y y ou can use the FILE S func tio n ( „¡ ). Th e sc ree n b el ow sh ows t he H OM E d i rec to r y wi th five d i re cto ri es, n a m ely , TRIANG , MA TR X , MPFI T , GRP HS , and CA SDI R . Additi onal dir ector ie s can be vi e wed b y mo v ing the c ursor do wn w ar ds in the dir ect or y tr ee . Or y ou can mov e the c urs or up w ar ds to selec t a memory port . When a gi ven dir ectory , sub-direc tory or port is selected , pr es s @@@OK@@@ to see the contents of the s elected object . Anothe r wa y to acces s port memory is b y using the LIB menu ( ‚á , assoc iated w ith the 2 k ey). T his acti on produ ces the follo wing s cr een: If y ou hav e an y library acti v e in y our calculat or it w ill be sho w n in this s cr een. One suc h libr ary is the @) HP49D (de mo) libr ar y sho wn in the sc r een abo ve . Pressing t he correspondin g soft -me nu k ey ( A ) w ill acti vate this libr ary . Pr essing the port soft menu k ey s w ill open that memor y port . Additi onal inf ormati on on libr ar ies is pr esented belo w .
Pa g e 26 - 4 Bac k up objec ts Bac ku p obj ects ar e used t o copy data f r om y our home dir ect or y int o a memor y port. The pur pose of bac king up obj ects in memory port is to pr eserve the contents of the objects f or f utur e usage . Back up objec ts hav e the fo llow ing ch ara cte ris ti cs: Θ Bac k up obj ects can onl y e xis t in port memor y (i .e ., y ou cannot back u p an objec t in the HOME dir ect or y , although y ou can mak e as man y copies of it as y ou want) Θ Y ou ca nno t modif y the contents of a back up objec t (you can , ho w ev er , cop y it back to a dir ectory in the HOME dir ectory , modif y it ther e , and bac k it up again modifi ed) Θ Y ou c an s tor e either a single objec t or an entire dir ector y as a single back up objec t . Y ou cannot, ho we v er , cr eate a bac k up objec t out of a number of se lected obj ects in a dir ector y . When y ou c r eate a back up object in port memory , the ca lc ulator obtains a cy c lic r e dundanc y chec k (CRC) or c hec ksum value ba sed on the binary data contained in the obj ect . This v alue is stor ed wi th the b ac k up ob ject , an d is used b y the calc ulator to monito r the integr it y of the bac k up ob ject . W hen y ou r est or e a back up obj ect into the HOME dir ectory , the calc ulator r e calc ulates the CR C value and compar es it to the or iginal v alue. If a disc r epancy is noticed , the calc ulator w arns the us er that the r estor ed dat a may be cor rupt ed. Bac king up objects in por t memory T he oper ation of bac king up an objec t fr om u ser memory into one of the memory por ts is similar to the oper ati on of cop ying a v ar iable f r om one sub- dir ectory to another (see details in Chapte r 2) . Y ou can, f or e xample , use the F ile Manager ( „¡ ) to cop y and delete bac k up obj ects as y ou wo uld do w ith nor mal calc ulator ob jects . In addition , ther e ar e spec if ic commands f or manipulating bac k up objec ts, a s desc ribed ne xt .
Pa g e 26 - 5 Bac king up and r estoring HOME Y ou can back u p the cont ents of the c urr ent HOME dir ectory in a single bac k up obj ect . T his ob jec t w ill contain all var iables , k e y assi gnments , and alar ms c urr en tly def ined in the HO ME dir ectory . Y ou can also r esto r e the contents o f y our HOME dir ectory fr om a back u p objec t pr ev iousl y st ored in port me mor y . T he instruc tions f or thes e oper ations f ollo w . Bac king up the HO ME dir ec tory T o back up the c ur r ent HOME dir ectory using algebr aic mode , enter the command: AR CHIVE(:P ort_Number : Back up_Name) Her e , P ort_N umber is 0, 1, 2 (or 3, if an SD memory car d is available -- see belo w) , and Bac k up_Name is the name of the bac k up objec t that w ill st or e the contents of HOME . T he : : c o ntainer is enter ed by using the k ey str ok e sequence „ê . F or ex ample, to back up HO ME into HOME1 in P ort 1, use: T o bac k up the HOME dir ectory in RPN mode , us e the command: : P or t_Numbe r : Back up_Name ` ARCHIVE Restoring the HOME direc t or y T o r est or e the Home dir ectory in algebr aic mode us e the command: RE S T ORE(: P ort_Number : Bac k up_Name) F o r e x a m p l e , t o r e s t o r e t h e H O M E d i r e c t o r y o u t o f b a c k u p o b j e c t H O M E 1 , u s e : RESTORE(:1 :HOME1) In RPN mode use: : P ort_Number : Bac k up_Name ` RE S T ORE
Pa g e 26 - 6 Stor ing, deleting, and r estoring back up objects T o c r eate a bac k up obj ect us e one of the f ollow ing appr oaches: Θ Use the F ile Manager ( „¡ ) t o c o p y t h e o b j e c t t o p o r t . U s i n g t h i s appr oach , the back up obj ect w ill hav e the same name as the o ri ginal object . Θ Use the S T O command t o copy the obj ect t o a port . F or e xample , in algebr aic mode , t o back up v ar iabl e A into a back up obj ect named AA in port 1, u se the k e ys tro ke s equence: @@@A@@@ K „ê1™~a~a` Θ Use the AR CHIVE command to cr eate a back up of the HOME dir ectory (see abo ve) . T o delete a bac k up obj ect f r om a por t: Θ Use the F ile Manager ( „¡ ) to delete the ob ject as y ou would a var iable in the HOME dir ectory (see C hapter 2) . Θ Use the PUR GE comman d as f ollo ws: In algebr aic mode , use: PUR GE(: P ort_Nu mbe r : Back up_Name) In RPN mode, us e: : P ort_Nu mbe r : Back up_Name PUR GE T o r estor e a back up object: Θ Use the F ile Manager ( „¡ ) to cop y the back up objec t fr om P ort memory to the HOME dir ect ory . Θ When a back up ob ject is r es tor ed, the calc ulator perfor ms an integrity c heck o n the r es tor ed ob jec t by calc ulating its CR C v alue . An y disc r epancy betw een the calc ulated and the stor ed CRC v alues r esult in an err o r message indi cating a corrupted data . Not e: When y ou res tor e a HO ME dir ectory back up two thing s happen: Θ The bac k up dir ectory ov er w r ites the c urr ent HO ME dir ectory . Th us , an y data not bac ked up in the c u r r ent HOME dir ectory will be lo st . Θ The calc ulator r estarts. T he contents o f history or stac k ar e lost .
Pa g e 26 - 7 Using data in backup objects Although y ou cannot dir ectl y modify the contents o f back up objec ts, y ou can use tho se cont ents in calculat or oper ations. F or e x ample , y ou can r un pr ogr ams stor ed as back up objec ts or us e data fr om back up obj ects t o run pr ograms . T o run bac k up-obj ect pr ogr ams or use data f r om back up objects y ou ca n u se the F ile Manager ( „¡ ) to c op y back up object c o ntents to the scr e en . Alte rnati v ely , you can us e functi on EV AL to run a pr ogr am stor ed in a back up obj ect , or functi on RCL to r e co ver data fr om a back up obj ect as follo ws: Θ In algebrai c mode:  T o e valuate a back u p obj ect , ente r : EV AL(argument(s), : P ort_Numb e r : Back up_Name )  T o r ecall a back up obj ect t o the co mmand line , en ter : RCL(: P ort_Number : Back up_Name) Θ In RPN mode:  T o e valuate a back u p obj ect , ente r : Ar gument(s) ` : P or t_Numbe r : Back up_Name EV AL  T o r ecall a back up obj ect t o the co mmand line , en ter : : P or t_Number : Bac k up_Name ` RC L Using SD car ds T he calculat or has a memory card po r t int o whi ch y ou can ins er t an SD f lash car d for bac king up calc ulator ob jects , or fo r dow nloading obj ects f r om other sour ces. The SD car d in the calc ulator w ill appear as port number 3 . Inserting and remo ving an SD car d T he SD slot is located on the bottom edge of the calc ulator , j ust belo w the number k e y s. SD car ds must be ins erted fac i ng do wn . Most car ds ha ve a label on w hat would u sually be consi der ed the top of the car d. If y ou ar e holding the HP 5 0 g w ith the k e yboar d fac ing up , then this side of the SD car d should f ace do wn or a wa y fr om you w hen being ins erted into the HP 5 0g. T he card w ill go int o the slot withou t r esistance f or mos t of its length and then it w ill r equir e sligh tly mo r e for ce to full y insert it . A fully ins erted car d is almost flu sh w ith the case , leav ing onl y the top edge of the car d visible .
Pa g e 26 - 8 T o r emo ve an SD car d , turn o ff the HP 50 g, pr ess ge ntly on the e xposed edge of the car d and push in . The car d should spring out o f the slot a small distance , allo w ing it now to be easil y r emo ved f r om the calculator . F ormatting an SD card Most SD car ds will alr ead y be fo rmatted, but the y may be f or matted wi th a file s y stem that is incompati ble w ith the HP 50g. T he HP 5 0g w ill only w ork w ith car ds in the F A T16 or F A T3 2 for mat . Y ou can f ormat an SD car d fr om a P C, or f r om the calc ulator . If y ou do it f r om the calc ulator (using the method des cr ibed belo w) , mak e sur e that y our calc ulato r has fr esh o r fairl y ne w batter ie s. Note : fo rmatting an SD car d delete s all the data that is cur r en tly o n it . 1. Insert the SD card int o the card slo t (as explained in the pr ev i ous sec tion). 2 . Hold do wn the ‡ k e y and then pr ess the D k ey . Re lease the D key and then r elease the ‡ k ey . The s ystem menu is di splayed with sever al choic es. 3 . Pr ess 0 f or FO RMA T . The f or matting pr ocess begins . 4. When the f or mat ting is f inished, the HP 5 0g displa y s the message "FORMA T FINISHED . P RE S S A NY KEY T O E XIT". T o ex it the s ystem men u , hold do wn the ‡ k ey , pr ess and r elease the C k e y an d then r elease the ‡ key . T he SD card is no w r eady f or us e . It will ha ve been f orm at ted in F A T3 2 for mat . Alter nativ e method When an SD car d is inser t ed, !FORMA! appears an additi onal menu item in F ile Manager . Selecting this option r efor mats the card , a pr ocess w hic h also delet es e very object on the car d .
Pa g e 26 - 9 Accessing objects on an SD card Acce ssing an obj ect f r om the SD car d is similar to whe n an objec t is located in ports 0, 1, or 2 . How ev er , P ort 3 wi ll not appear in the menu when using the LIB fu ncti on ( ‚á ) . T he SD file s can only be managed u sing the F iler , or F i le Manager ( „¡ ). When st ar ting the F iler , the T ree v ie w w ill appear as fo llo ws if y ou hav e an SD car d inserted: L ong names of f iles on an SD car d ar e supported in the F iler , but ar e displa y ed as 8. 3 c har acter s, as in DO S, i .e . , display ed names w ill hav e a max imum of 8 c har acter s w ith 3 char ac ters in the suff ix . T he type of eac h ob ject w ill be displa y ed , unless it is a P C obj ect or an ob ject o f unkno wn ty pe . (In these cas es , its type is listed as S tr ing.) In additio n to using the F ile Manager oper ations , y ou can use f uncti ons S T O and RCL to st ore ob jects on , and recall objects f r om, the SD car d , as sho wn belo w . Y ou can also us e the PUR GE command to er ase bac k up obj ects in the SD car d. L ong names can be u sed w ith these commands (namel y , S T O , RCL , and P URGE). Stor ing objects on an SD card T o sto r e an objec t , use f uncti on S T O as f ollo ws: Θ In algebr aic mode: Ente r obj ect , pr es s K , ty pe the name of the stor ed object u sing port 3 (e .g ., :3:V R1 ), p r e s s ` . Θ In RPN mode: Ente r obj ect , t y pe the name of the sto r ed obj ect u sing port 3 (e .g ., :3:V R1 ), pr e s s K .
Pa g e 26 - 1 0 Note that if the name of the object y ou intend to st ore on an SD car d is longer than ei ght c harac ters , it will a ppear in 8. 3 DOS f or mat in por t 3 in the F iler once it is stor ed on the ca r d. Recalling an object from an SD car d T o r ecall an ob ject f r om the SD card onto the sc r een, u se functi on RCL , as fo llo w s: Θ In algebr aic mode: Press „© , type the name of the stor ed objec t using port 3 (e .g ., :3:V R1 ), pr e s s ` . Θ In RPN mode: T ype the name of the stor ed objec t using port 3 (e .g., :3:V R1 ), p r e s s „© . W ith the RCL command , it is possible to r ecall v ari able s by s pec ifying a path in the command , e .g., in RPN mode: :3: {p ath} ` RC L. Th e pa th, li ke i n a DO S dri ve , is a ser ies o f dir ectory names that together s pec if y the po sition o f the var iable w ithin a dir ectory tr ee . How ev er , some v ari ables sto r ed w ithin a back up obje ct cannot be r ecalled b y spec if y ing a path. In this cas e , the full back up obje ct (e .g ., a dir ectory) w ill hav e t o be recalled , and the indi vi dual var iables then accessed in the sc r een. Note that in the case of objects w ith long file s names , yo u can spec ify the f ull name of the obj ect , or its tr uncated 8. 3 name , w hen issuing an R CL command. Ev aluating an object on an SD card T o e valuat e an obje ct on an SD car d , insert the car d and then: 1. Pr es s !ê . This puts a dou ble colon on the edit line with the c urs or blinking betw een the colons . This is the w a y the HP 5 0g addr ess es items stor ed in its v ar iou s por ts . P or t 3 is the SD car d por t . 2. P re s s 3™³~~ [name of the obj ect] ` . T his w ill place the name and path of the obj ect t o be e valuated on the st ack . 3 . T o e valuat e the objec t , pr ess μ .
Pa g e 26 - 1 1 Note that in the case of objects w ith long file s names , yo u can spec ify the f ull name of the objec t , or its truncat ed 8. 3 name , when ev aluating an obj ect on an SD car d. P urging an object from the SD card T o pur ge an ob ject f r om the SD car d onto the s cr een , us e functi on P URGE , as fo llo w s: Θ In algebr aic mode: Press I @PURGE , type the name of the stor ed object u sing por t 3 (e .g ., :3:V R1 ), pr e s s ` . Θ In RPN mode: T ype the name of the stor ed objec t using port 3 (e .g., :3:V R1 ), p r e s s I @PURGE . Note that in the case of objects w ith long file s names , yo u can spec ify the f ull name of the obj ect , or its tr uncated 8. 3 name , w hen issuing a P URGE command . P urging all objects on the SD card (b y re for matting) Y ou can pur ge all obj ects fr om the SD car d by re for matting it . When an SD car d is inserted , FORMA appears an additional men u item in F ile Manager . Selec ting this option r ef or mats the entir e card , a pr ocess w hi ch also delet es e very object on the car d . Specif y ing a directory on an SD card Y ou can stor e , r ecall , ev aluate and pur ge objec ts that are in dir ector ies on an SD car d. Note that to w ork w i th an ob ject at the r oot le vel o f an S D car d , the ³ k ey is u sed . But w hen w orking w ith an objec t in a subdir ect or y , the name cont aining the direc tory p ath m ust be enc lo sed using the …Õ key s. F or ex ample , suppo se y ou w ant to stor e an objec t called PR OG1 into a dir ectory called PR OGS on an SD car d . With this obj ect still on the fir st le vel o f the stack , p r ess: !ê3™…Õ~~progs…/prog1`K
Pa g e 26 - 1 2 T his will s tor e the obj ect pr ev iousl y on the stac k onto the SD card int o the dir ect or y named P ROG S into an obj ect named P ROG1. Not e: If PR OGS doe s not e xis t, the dir ectory will be au tomaticall y cr eated. Y ou can spec ify an y number of nested subdir ector ies . F or ex ample , to re fer t o an obj ect in a thir d-le vel su bdir ectory , y our s ynt ax w ould be: : 3:”DIR 1/DIR2/DIR 3/NA ME” Note that pr essing ~ …/ pr oduces the f or w ard slash c har acter . Using libr aries L ibr ari es ar e user -cr e at ed binar y-language pr ogr ams that can be loaded into the calc ulator and made av ailable f or use fr om w ithin any su b-dir ectory of the HOME dir ect or y . In additi on , the calculator is shipped w ith tw o librar ies that together pr ov ide all the f unctio nality of the E quati on Li br ar y . L ibr ari es can be do wnloaded into the calc ulator a s a r egular var iable , and , then , installed and attac hed to the HOME dir ectory . Installing and attac hing a libr ar y T o install a libr ary , list the libr ary contents in the stac k (use ‚ vari abl e sof t - menu k e y , or f unction R CL) and s tor e it into p ort 0 or 1. F or ex ample , to install a libr ar y v a r iable into a port use: Θ In algebr aic mode:S T O(L ibr ary_var iable , por t_n umber ) Θ In RPN mode: L ibrary_var iable ` port_number K After inst alling the libr ar y conten ts in por t memo r y y ou need t o attach the libr ar y to the HOME dir ectory . This can be accomplished by r ebooting the calc ulator (tur ning the calc ulator off and bac k on) , or b y pr essing , simult aneousl y , $C . At this po int the libr ary should be av ailable fo r use . T o see the libr ary acti vati on menu us e the LIB menu ( ‚á ) . T he libr ary name w ill be listed in this me nu .
Pa g e 26 - 1 3 Libr ary numbers If y ou us e the LIB menu ( ‚á ) and pr ess the so ft menu k e y corr es ponding to port 0, 1 or 2 , yo u wi ll see libr ar y n umbers list ed in the soft menu k e y labels . E ac h library has a thr ee or f our -digit n umber assoc iated w ith it . (F or e x ample , the two libr ar ies that mak e up the Eq uation L ibr ary are in port 2 and ar e number ed 2 2 6 and 2 2 7 .) The se numbers ar e assigned b y the library c reator , and ar e used f or deleting a libr ary . Deleting a library T o delete a libr ar y fr om a port , use: Θ In algebr aic mode:P URGE(:port_n umber: lib_n umber ) Θ In RPN mode: : port_number : lib_number P URGE Wher e lib_number is the libr ar y number de scr ibed abov e . WA R N I N G : L ibr ari es 2 2 6 and 2 2 7 in port 2 constitut e the Eq uation L ibr ary . Y ou can delete these libr ar ies j ust a s y ou can a user -cr eated libr ary . How e v er , if y ou ar e thinking of deleting thes e libr ari es but ther e is some lik elihood that y ou w ill need to use the E quation L ibr ary in the futur e , y ou should copy them t o a P C, using the HP 4 8/50 Calc ulator C onnecti v ity K it , befo r e deleting them on the calc ulator . Y ou w ill then be able to r e -inst all the librar i es later whe n yo u need to us e the E quati on L ibr ar y . Creating libr aries A libr ar y can be w r itten in Asse mbler language , in S ys tem RP L language , or b y using a libr ar y-cr eating library suc h as LBMKR . T he latter progr am is av ailable online (see f or e x ample , http://www .hpcalc .or g) . T he details of progr amming the calc ulator in Ass embler language or in S y stem RP L language ar e be yo nd the scope o f this doc ument . T he user is in v ited to f ind additio nal infor mation on the sub jec t online . Bac k up batter y A CR20 3 2 back up battery is included in the calc ulator to pr ov ide po we r bac k up to v olatile memory w hen changing the main batter ie s. It is r ecommended that y ou r eplace this bat te r y e v er y 5 y e ar s. A s cr een message
Pa g e 26 - 1 4 w ill indicat e when this battery needs r eplacement . The diagr am belo w sho ws the location o f the back up bat t er y in the top compartment at the back o f the calc ulat or .
Pa g e 27- 1 Chapter 2 7 T he Equation Libr ar y T he E quation L ibrary is a collection o f equations and commands that enable y ou to so lv e simple s c ience and e ngineer ing pr oblems. T he libr ary consists o f mor e than 300 equatio ns gr ouped int o 15 techni cal subj ects con taining mor e than 100 pr oblem titles . E ach pr oblem title co ntains one or mor e equatio ns that help y ou s olv e that t y pe o f pr oblem . Appendi x M contains a table o f the gr oups and pr oblem titles av ailable in the E quati on L ibr ar y . Note: the e xamples in this c hapt er assu me that the oper ating mode is RPN and that flag –117 is s et . (F lag –117 should be set w hene v er y ou use the nume ri c sol ver to s olv e equati ons in the equati ons library .) WA R N I N G : Y ou can delet e the E quation L ibr ar y if y ou need mor e r oom on y our calc ulator . Li brar ies 2 2 6 and 2 2 7 in por t 2 cons titute the E quation L ibrary , and the y can be de leted ju st lik e an y use r -cr eated libr ar y . How ev er , if y ou ar e thinking of deleting thes e libr ari es but ther e is some lik elihood that you w ill need to us e the E quation L ibrary in the futur e, y ou should cop y them to a P C, using the HP 4 8/4 9 Calc ulator C onnecti v ity Kit , befo re del eting them on the calc ulator . Y ou w ill then be able to r e -install the libr ari es late r whe n y ou need to use the E quation L ibrary . (Deleting a library is e xplained in c hapter 2 6.) Solv ing a Pr oblem wi th t he Equation L ibr ar y F ollo w these st eps f or sol v ing an equation u sing the E quation L ibrary . 1. Pr es s G—` EQLIB EQNLI to start the E quati on L ibr ar y . 2 . Set the unit options y ou want b y pr essing the ##SI## , #ENGL# , and UNITS men u keys. 3 . Highli ght the su bjec t y ou w ant (f or e xample , F luids) and pr ess ` . 4. Highli ght the title y ou want (f or e x ample , Pr essur e at Depth) and pres s ` . 5 . The f irs t equatio n is display ed. Pr ess #NXEQ# to display subs equent equations . 6. P res s #S OLV# to st ar t the Sol ver .
Pa g e 27- 2 7 . F or each kno wn v ar iable , t y pe its value and pr ess the corr esponding menu k e y . If a v ari able is not show n , pre ss L to disp la y fur th er variab les. 8. Optional: su pply a gues s f or an unkno wn v ar iable . This can speed up the soluti on pr ocess or help to f oc us on one of s ev er al soluti ons. Enter a gue ss ju st as y ou w ould the v alue of a know n v ari able . 9. P r e s s ! f ollow ed b y the menu k e y of the var i able for w hic h y ou ar e sol v ing . If y ou w ant to sol v e all the equati ons in the selec ted title , pre ss ! ##ALL# . The S ol ver the n calculat es value s for all the v ar iable s not pr ev iou sly def ined b y y ou . Using the Solver When y ou se lect a subj ect and a title in the E quatio n Libr ar y , y ou spec ify a set or one or mor e equations . Then , when y ou pr ess #SOLV# , y ou leav e the E quati on L ibr ar y catalog s and start sol v ing the equations y ou ’ve s elected . When y ou pre ss #SOLV# in the E quati on L ibrary , the appli cation does the fo llo w ing:  The set o f equations is s tor ed in the appr opri ate v ari able: EQ for o ne equati on , EQ and Mpar for mor e than one equation . ( Mpar is a re serv ed v ari able used b y the Multiple -E quati on Sol ver .) Note: because EQ and Mpar ar e var i ables , yo u can hav e a diffe ren t EQ and Mpar fo r e ach dir ect or y in memor y .  Eac h v ari able is c r eated and se t to z er o unle ss it alr eady e xis ts . (If the var iable name has been used b y the solv er befor e, then it is a global v ari able and ther ef or e alr eady e x ists: until y ou pur ge it.)  Eac h v ari able ’s units are se t to the conditi ons yo u spec if ied: S I or English , and units used or not used— unles s the var i able alr eady e x ists and has units dimensionall y consist ent w ith w hat yo u spec if ied . (T o change f r om English to S I units or vi ce ve rsa , y ou mus t fir st pur ge the e x isting v ari ables or e xplic itly ente r the units w ith the values .)  The appr opr iate s ol ver is s tarted: the S OL VR for one equati on, the Multiple - E quation S olv er for mor e than one equation .
Pa g e 27- 3 Using the m enu k ey s T he actions o f the unshifted and shifted var iable menu k ey s f or both sol ver s ar e identi cal. No tice that the Multiple Eq uation S olv er us es two f orms o f menu labels: blac k and w hite . The L k ey dis play s additional menu labels , if r equir ed . In addition , each s olv er ha s spec ial me nu k e ys , whi ch ar e desc ri bed in the f ollo w ing table . Y ou can tell w hi ch sol ver is s tarted by looking at the spec ial me nu labels. Actions for Sol v er Menu K e ys Operat ion SOL VE applicati on Multiple-Equatio n Solv er Store val ue ! !!!!!!!!X!!!!!!!! !! !!!!!!!!X!!!!!!!! ! Solv e f or value ! ! !!!!!!!!X!!!!!!!! ! ! ! !!!!!!!!X!!!!!!!!! ! #%X%# R ecall v alue … ! !!!!!!!!X!!!!!!!!! … ! !!!!!!!!X!!!!!!!!! … #%X%# Ev aluate equation # EXPR= Ne xt equati on (if appl i cab le) #NXEQ# Undef i ne all ##ALL# Solv e for all ! ##ALL# Pr ogr ess cat alog … # #ALL# Set states !MUSER! ! MCALC!
Pa g e 27- 4 Br o wsing in the Equation L ibrary When y ou se lect a sub ject and title in the E quation L ibrary , y ou spec ify a set of one or mor e equati ons. Y ou can get the follo wing inf ormation a bout the equati on set fr om the E quatio n Li brary catalogs:  The equations themse lv es and the number of equations .  The v ari able s used and their units . (Y ou can also change the units .)  A pictur e of the p h y s i ca l s ystem (for most equat i on se ts) . Vie wing equations All equati ons ha ve a displa y for m and some appli cations als o hav e a calc ulati on f or m . T he displa y fo rm gi v es the equati on in its basic f or m, the f orm y ou w ould see in books . The calc ulati on for m include s computati onal r ef inements . If an equation has a comput ational f orm , an * appears in the upper left corner o f the equation displa y . Op erations for vie wing Eq uations an d P ic tures K e y Ac tion Ex ampl e #EQN# # NXEQ# Sho ws the displ ay f or m of c urr ent o r next equati on in E quati onW rit er for mat . ` Sho ws the displ ay f or m of c urr ent or ne xt equati on as an algebr aic o bj ect . ` or ˜ sho w s the ne xt equati on , — sho w s the pr e v io us . 'B=(μ0*μr* I)/ (2*à*r)' Sho ws calc ulati on for m by putting a list containing the c urr ent s et of equations o n the stack. {'B=IFTE(r <rw,CO NST(μ0)*μr *I*r/ (2*à*rw^2) ,CONST (μ0)*μr*I/ (2*à*r))' } rI B r μμ π ⋅⋅ = ⋅⋅ 0 2
Pa g e 27- 5 Vie wing v ariables and sel ecting units After y ou select a sub jec t and title , y ou can vi e w the catalog of names , desc r iptions , and units for the v ari ables in the equati on set b y pre ssing #VARS# . T he table belo w summari z es the oper ations av a i lable to y ou in the V ari able catalogs . Oper atio ns i n V ariable catalo gs Vie wing the picture After y ou se lect a subj ect and title , y ou can v ie w the pi ctur e of the pr oblem (if the title has a p ic tur e) . T o see the p ic tur e , pr ess @#PIC#@ . While the pic tur e is display ed, y ou can: Key Ac t i o n L T oggles be t w een the catalog of des cr ipti ons and the catalog of un its. #!#SI## @ENGL# Mak es S I or English units acti ve , unless this conf lic ts w ith the units alr ead y def ined fo r an ex isting (global) var iable . P urge e x isting var iables (or enter the s pec ifi c units) t o eliminate conf lic ts. !UNITS T oggles betw een units u sed and units n ot us ed . Cr eates or c hanges all equati on v ar iable s to hav e indicated unit type and us age . #PURG# P ur ges all equati on var i ables f or this title in the cur re nt dir ectory . This als o eliminates S I vs . English units conf lic ts.
Pa g e 27- 6  Pres s to stor e the p ictur e in PIC T , the graphi cs memor y . Then y ou can use © PIC T (o r © PICTURE) to v ie w the pic tur e again after y ou hav e quit the E q uation L ibr ar y .  Pres s a menu k ey or to v ie w other equation infor mation . Using the M ultiple -Equation Sol ver T he E quation L ibrary starts the Multiple -E quation So lv er aut omaticall y if the equati on set contains mor e than one equation . Ho w e ver , yo u can also start it up e xplic itly using y our o wn set o f equations (see “Def ining a set o f equations ” on page 2 7 -8) . When the E quation L ibr ar y st arts the Multiple -E quation S olv er , it fir st st ore s the equati on set in EQ and st or es a copy of the equati on set , the lis t of var iables , and additional inf or mation in Mpar . Mpar is then used t o set up the S olv er menu f or the c urr ent equati on set . (Note that altho ugh y ou can v ie w and edit EQ dir ectl y lik e any othe r var iable , Mpar can o nly be edited indir ectl y (b y e x ecu ting commands that modify it) as it is str uctur ed as libr ar y data dedi cated to the Multiple -E quation So lv er applicati on .) T he fo llo w ing table summar i z es the ac tions f or the s olv er menu k e y s. T he L k ey sho ws additi onal menu labels . Solv er Menu K e ys Ope rat io n K e y Acti on Store val ue ! !!!!!!!!X!!!!!!!!! %%X$$ Cr eates a v ar iabl e if necessary , and mak es it us er -def ined . If the v alue has no units, the units o f the pr e vi ous v alue ar e appended , if an y . Solv e f or value ! ! !!!!!!!!X!!!!!!!!! ! %%X$$ Creates a var iable if necessar y , solves f or its value , and mak es it not u ser - def ined . R ecall v alue … ! !!!!!!!!X!!!!!!!!! … %%X$$ R ecalls value o f v ar iable to the stac k .
Pa g e 27- 7 T he menu labels f or the var iable k ey s ar e w hite at fir st , but c hange during the solu tion pr ocess as des cr ibed belo w . Becau se a solu tion in v olv es man y equations and man y v ar ia bles, the Multiple - E quati on Sol ver mu st k eep tr ack o f var ia bles that are u ser -def ined and not def ined—those it can ’t c hange and those it can. In additi on , it k eeps tr ack of v ari ables that it used or f ound during the last s olutio n pr ocess . T he menu labels indicat e the state s of var i ables . The y ar e auto maticall y adj usted as yo u stor e v aria bles and sol v e fo r var i ables . Y ou can chec k that v ari ables ha ve pr oper state s when y ou suppl y guess es and fi nd soluti ons . Notice that mar ks the var iables that w er e us ed in the last sol ution—the ir v alues ar e compatible w ith each other . Other v ar iable s may not ha v e compatible v alues beca use the y ar en ’t inv ol ved in the soluti on . Undef ined all %ALL% Mak es all v ar iable s not us er -def ined , but does not spec if y the ir values . Solv e for all ! %ALL% Cr eates var iables if neces sar y and sol v es for all that ar e not user -defined (or as m an y as possibl e) . Pr ogr ess cat alog … % ALL% Sho w s infor mation abou t the last solut i on. User -d ef ine d MUSER Sets states to user -define d f or v ar iable or list of v ar ia bles on the stac k . Calculated MCALC Sets states to not u ser -def ined (calc ulated r esul t) for var ia ble or list o f v ari ables on the stac k
Pa g e 27- 8 Mea nings of Menu Labe ls Defining a set o f equations When y ou design a s et of eq uations , y ou should do it w ith an under standing o f ho w the Multiple -E quation Sol ver use s the equations to sol ve pr oblems. T he Multiple -E quati on Sol v er uses the sa me pr ocess y ou ’d use t o sol ve f or an unkno wn v ar ia ble (assuming that y ou w er e not allo wed to cr eate additi onal var iable s) . Y ou’d look thr ough the se t of equations f or one that has onl y one v ari able that y ou didn ’t kno w . Y ou ’d then use the r oot -f inder to f ind its value . T hen you w ould do this again until y ou ’v e found the var iable you w ant . Y ou should c hoos e y our equati ons to allo w likel y unkno w n var iables t o occur indi v iduall y in equations . Y ou mus t av oi d hav ing tw o or more unkno wn v ari ables in all equati ons. Y ou can also spec ify equations in an or der that ’s best fo r y our pr oblems. Label Meaning ! !!!!!!!!X0!!!!!!!! ! Va l u e x0 is not de fined b y y ou and not us ed in the last s oluti on. It can c hange with the ne xt soluti on. ! !!!!!!X0!!ëëëë!! ! Va l u e x0 is not def ined b y y ou , but it w as f ound in the last solu tion . It can change in the ne xt solu tion . $$X0$$ Va l u e x0 is def ined b y y ou and no t used in the las t soluti on . It cannot c hange in the ne xt solu tion (unles s y ou sol v e onl y for this va riab le ) . $#X0# qqqq ! Va l u e x0 is def ined b y y ou and us ed in the last sol ution . It cannot c hange in the ne xt solu tion (unles s y ou sol v e onl y for this va riab le ) .
Pa g e 27- 9 F or ex ample , the f ollo w ing thr ee equati ons defi ne initial v eloc ity a nd acceler atio n based on tw o observed dis tances and times . T he fir st tw o equations alone ar e mathematicall y suff ic ient f or solv ing the problem , but eac h equati on contains tw o unkno w n var ia bles. Adding the thir d equation allo ws a succe ssf ul solu tion beca use i t contains only one of the unkno wn v ar ia bles . T o cr eate more r o bu st equations, y ou can inc lude functio ns that ensure pr oper and fas ter calculati ons—f or e xample , CONS T and TD EL T A, UB A SE , EXP , and IFTE . If y our equati ons use an y o f the f ollo w ing func tions , their v ari ables w on ’t necessa ril y be detected by the Multiple -Eq uation S olv er : Σ , ∫ , ∂ , |, QUO T E , AP PL Y , T VR OO T , and CONS T . T he list of equations in EQ may contain menu de finiti ons, but tho se def initions ar e igno r ed by MINI T whe n it cr eates Mpar . Ho w ev er , y ou can r eor der the menu labe ls using MI TM (desc r ibed belo w) . T o c r eate a set of equations f or t he Multiple -Equation Sol ver 1. Enter each equati on in the s et onto the stac k. 2. P re s s — to begin the Interac ti ve S tac k and then mo ve the c ursor up to the le ve l containing the f irst equati on y ou enter ed. 3 . Pr ess to combine them int o a list . 4. Pr es s ³ ~ e ~ q K to store the list into t he EQ vari ab le. 5. P re ss G—` EQLIB EQLIB $MES# !MINIT! to cr eate M par and pr epare the equation s et f or use w ith the Multiple -Equati on S olv er . 1 01 a x vt = ⋅ 2 02 a x vt = ⋅ 1 21 2 )) ( ( x a xt t =⋅ −−
Pa g e 27- 1 0 6. P res s !MS OLV! to launc h the sol v er w ith the new se t of equati ons. T o c hange the title and menu for a set of equations 1. Mak e sur e that the set o f equati ons is the c urr ent set (a s the y are u sed w hen the Multiple -E quati on Sol ve r is launc hed) . 2 . Enter a te xt str ing containing the ne w title onto the s tac k. 3 . Enter a lis t containing the v ari able names in the or der you w ant them t o appear on the menu . Use a "" t o insert a blank label. Y ou mus t include all v ari ables in the o ri ginal menu and no other s, and y ou must mat ch upper case and lo w er case c har acter s. 4. Pr es s G—` EQLIB EQLIB $MES# !MINIT! . Interpr eting results fr om the M ultiple -Equation Sol ver T he Multiple -E quation S ol ver so lv es for v ar iables b y r epeatedl y looking thr ough the set o f equations f or one that contains only one v ar iable that’s unkno wn (not user -def ined and not found b y the sol v er during this soluti on) . It then u ses the r oot-fi nder to find that v alue . It continue s elimin ating unkno wn v ar iable s until it sol v es f or the var i able y ou spec if ied (or until it can ’t s ol ve f or an y mor e var iables) . E ac h time the Multiple -E quation S olv er starts sol v ing for a v ar iable , only the v ar iable s w ith black menu labels ar e kno w n. Dur ing the soluti on pr oces s, the Multiple -E quation S olv er show s the v ar iable it is c urr entl y sol v ing f or . It also sho w s the t y pe of r oot found (z er o , sign -r ev ersal , or e xtr emum) or the pr oblem if no r oot is found (bad gues ses or constant). T he follo wing mes sages indicate er r ors in the pr oblem setup:  Bad Guess(es) . Units may be missing or inconsis tent f or a v ari able . F or a list of g uesses, at least on e of th e list element s must have con sistent units .  Too Many Unknowns . The so lver eve ntu al ly e nc ou nte red only equati ons hav ing at least tw o unknow ns . E ither enter other kno w n values , or c hange the set of equati ons.
Pa g e 27- 1 1  Constant? T he initial v alue of a var iable may be leading the r oot - f inder in the wr ong direc tion . Suppl y a guess in the oppo site dir ectio n fr om a cr iti cal value . (If negati ve v alues ar e vali d , tr y one . ) Chec king solutions Th e va riab le s h avin g a š mark in their men u labels ar e r elated fo r the most r ecent soluti on. T he y for m a compatible set of v alues satisfy ing the equations used . T he values o f an y var iable s w ithout marks ma y not satisfy the equations becaus e those v ar iable s wer e not inv ol ved in the s olution pr ocess . If an y soluti ons see m improper , chec k for the f ollo w ing pr oblems:  W ro ng units. A kno wn or f ound v ar iable ma y hav e units diff er ent f r om thos e y ou assumed . Thes e are global v ar ia bles . If the v ar ia ble ex isted bef or e this calc ulation , then its unit sy stem (SI or English) tak es pr io rity . T o corr ect the units, either pur ge the var iable s bef or e solv ing the equati on , or enter the spec ifi c units y ou w a nt .  No units. If y ou ar e not u sing var ia bles, y our implied units may n ot be compatible among y our v ar iable s or w ith the impli ed units of cons tants or func tions . T he cur r ent angle mode sets the implied units f or angles .  M ultiple r oots. An equati on may ha ve multiple r oots, and the s ol ver ma y ha ve f ound an inappr opr iate one . Supple a gues s for the v ar iable to foc us the sear ch i n the appr opr iat e r ange .  W ron g varia bl e s ta tes. A kn own o r u nk nown varia bl e m ay no t h ave t he appr opr iat e state . A kn o wn v ar iable should ha v e a b l ack men u label, and an unkno wn v ar iable should ha ve a w hite labe l.  Inconsistent conditions . If y ou enter v alues that ar e mathemati cally inconsistent f or the equations , the applicati on may gi ve r esults that satisfy some eq uations but no t all. T his include s ov er -spec ify ing the pr oblem, w here y ou enter values f or mor e var i ables than ar e needed to def ine a ph y sicall y r eali z able pr oblem—the e xtr a v alues may c r eate an impossible or illogical pr oblem. ( T he solu tions satisfy the equations the sol ver u sed , but the sol ver doe sn ’t try to v er ify that the soluti on satisf ies all o f the equations .)
Pa g e 27- 1 2  Not relat ed. A v ari able may not be in vol v ed in the soluti on (no mark in the label) , s o it is not com patible wi th the var ia bles that w er e inv ol ved .  W ro ng direc tion . T he initial value of a var iable ma y be leading the r oot- f inder in the wr ong direc tion . Suppl y a guess in the oppo site dir ectio n fr om a cr iti cal value . (If negati ve v alues ar e vali d, try one.)
Pa g e A - 1 Appendi x A Using input forms T his ex ample o f setting time and date illu str ates the use of input f orms in the calc ulator . Some gener al rules: Θ Use the ar r o w k ey s ( š™˜— ) to mov e fr om one f ield to th e ne xt in the input f or m. Θ Use an y the @CHOOS soft m enu k e y to see the options available f or any gi v en fi eld in the inpu t for m. Θ Us e the ar r o w k e ys ( š™˜— ) to selec t the pr ef er r ed option f or a gi v en fi eld, and pr es s the !!@@O K#@ ( F ) so ft menu k ey t o mak e the sele ction . Θ In so me instances , a chec k mark is r equir ed to select an opti on in an input f orm . In such cas e use the @ @CHK@@ sof t menu k e y to toggle the c heck mar k on and o ff . Θ Pr es s the @CANCL so ft menu ke y to clos e an input for m and re turn to the stack d isplay . Y ou can a lso press the ` key o r t h e ‡ key to c lo se the input f or m. Ex ample - Using input f orms in th e NUM.SL V menu Bef or e disc ussing thes e items in detail w e w ill pr esent s ome of the char acter isti cs of the input f or ms b y using input f orms f r om the financ ial calc ulation appli cation in the numer ical so lv er . Launc h the numer ical sol v er by using ‚Ï (asso c iated w ith the 7 ke y) . This pr oduces a choo se bo x that inc ludes the f ollo w ing options: T o get s tarted w ith f inanc ial calc ulations us e the do wn arr o w k e y ( ˜ ) to se lect item 5 . Sol v e f inance . Pr es s @@OK@ @ , to launc h the appli cation . The r esulting sc r een is an input f or m wi th input f ields f or a numbe r of v ari ables (n , I%YR , PV , PM T, F V ) .
Pa g e A - 2 In this par ti c ular case w e can giv e v alues to all but one of the var iables, s ay , n = 10, I%YR = 8. 5, PV = 10000, FV = 1000, and sol ve fo r va ri able P MT (the meaning of thes e var iables w ill be pr esent ed later ) . T r y the f ollo w ing: 10 @@O K@@ Enter n = 10 8. 5 @@ OK@@ Enter I%YR = 8. 5 10000 @@ OK@@ Ente r PV = 10000 ˜ 1000 @@ OK@@ Enter FV = 1000 — š @S OLVE! S elect and sol v e f or P M T T he r esulting s cr een is: In this input f orm y ou w ill notice the f ollo wi ng soft menu k ey labels: @EDIT Pr ess to edit highlighted f ield !) AMOR Amorti z ation men u - option spec ific to this appli cation @SOLVE Pr ess to so lv e f or highli ghte d fi eld Pr es sing L w e see the fo llo w ing soft menu k ey labels: !RESET Re set f ields t o default v alues
Pa g e A - 3 !CALC Pre ss to access the st ack f or calc ulations !TYPES Press to determine the t y pe of ob ject in h i ghlighte d f ield !CANCL Canc el operation @@OK@ @ Ac ce pt e ntr y If y ou pr ess !RESET y ou w ill be ask ed to se lect between the tw o options: If y ou select R es et value onl y the highli ghted v alue w ill be r eset t o the d e fa ult v alue . If , inst ead , y ou se lect Rest a ll , all the fi elds w ill be r eset to their def ault v alues (typi call y , 0) . At this point y ou can accep t y our cho ice (pr es s @@OK@@ ), or cancel the oper ation (pr ess !CANCL ). P r ess !CANCL in this instance. P ress !CALC to access the stack . The r esul ting scr een is t he f oll o wing: At this po int , y ou ha ve acce ss to the st ack , and the v alue last hi ghli ghted in the input f orm is pr ov ided f or y ou . Suppose that y ou want to hal ve this v alue . The fo llo w ing scr een follo ws in AL G mode after enter ing 113 6.2 2/2 :
Pa g e A - 4 (In RPN mode , w e would ha v e used 113 6 .2 2 ` 2 `/ ). Press @@OK@ @ to enter this ne w value . Th e input f orm w ill no w look l ik e this: Press !TYPES to se e the t y pe of dat a in the P MT f ield (the hi ghlight ed fi eld) . As a r esult , y ou get the f ollo w ing spec if icati on: T his indicates that the v alue in the P MT f ield mu st be a r eal number . Pr ess @@ OK@@ to r etur n to the input f or m, and pr es s L to r ecov er the f irst men u . Ne xt , pr ess the ` key o r t h e $ ke y to r eturn to the s tac k. In this instance , the fo llo w ing value s w ill be show n: T he top r esult is the v alue that wa s sol ved f or P MT in the fir st part of the e xer c ise . The s econd value is the calc ulation w e made to r edef ine the value o f PM T.
Pa g e B - 1 Appendi x B T he calc ulator ’s k e y board T he fi gur e belo w sho w s a diagr am o f the calc ulato r’s k e y board w ith the number ing of its r o ws and columns . T he fi gure sho ws 10 r ow s of k e y s combined w ith 3, 5, or 6 columns. R o w 1 has 6 k ey s, r o ws 2 and 3 ha ve 3 k ey s eac h , and r o w s 4 thro ugh 10 hav e 5 k e y s ea c h . Ther e are 4 ar r o w k ey s located on the r ight -hand si de of the k e yboar d in the space occ upi ed by r ow s 2 and 3 . E ach k e y has thr ee , f our , or
Pa g e B - 2 f i ve f uncti ons. T he main k e y func tions ar e sho wn in the f igur e belo w . T o oper ate this main k e y func tions simpl y pr ess the cor r esponding k e y . W e w ill r ef er to the ke y s by the r o w and column wher e the y are located in the sk etc h abo v e , th us , k e y (10,1) is the ON key . Mai n k ey functio ns in the calc ulator’s ke yboar d
Pa g e B - 3 M ain k e y functions Ke ys A thr ough F ke ys ar e ass oc iated w ith the soft men u options that appear at the bottom of the calc ulator’s dis play . T hu s, the se k e y s w ill acti v ate a v ari ety of func tions that c hange acco rding t o the acti v e menu .  Th e arrow k eys, —˜š™ , ar e used to mo ve one c har act er at a time in the dir ection o f the ke y pr ess ed (i .e ., up , do wn , left , or ri ght) .  Th e APP S f unction ac ti vate s the applicati ons menu .  Th e MODE f uncti on acti vat es the calc ulator’s mode s menu .  Th e TO O L functi on acti vate s a menu o f tools u sef ul for handling var ia bles and get ting help on the calc ulator .  Th e VA R func tion sho ws the v ar iables stor ed in the ac ti ve dir ectory , the ST O functi on is used to stor e c ont ents in var iables .  Th e NXT func tion is us ed to see additi onal so f t me nu options o r var ia bles in a dir ectory .  Th e HIS T f uncti on allo w s you acce ss to the algebr ai c -mode history , i .e ., the collec tion o f r ecent command entr ie s in that mode .  Th e EV AL k e y is used to e v aluate algebr aic and numer i c expr essions , the apos tr ophe ke y [ ‘ ] is used to ente r a set of apo str ophes f or algebr aic ex pre ss ion s.  Th e SY M B acti vate s the sy mbolic oper ations menu .  The delet e ke y ƒ is u sed to de lete char acter s in a line .  Th e y x k e y calc ulates the x pow er of y .  The k ey calc ulates the squar e r oot of a number .  Th e SI N , CO S, and TA N k e ys calculate the sine , cosine , and tangent , r especti vel y , of a number .  Th e EEX k e y is used to enter po w er of tens (e .g ., 5 × 10 3 , is enter ed as 5V3 , w hic h is sho w n as 5E3 ).  Th e /- k e y change s the sign of an entry , the X ke y enter s the char acte r X (upper cas e) .  Th e 1/x k e y calc ulates the in ver se o f a number , the k e y s , − , × , and ÷ , ar e used f or the fundament al arithmeti c operati ons (additi on, subtr ac tion , multiplicati on, and di visi on, r especti v ely).  Th e ALPHA k ey is combined w ith other ke ys to enter alphabeti c char acter s. x
P age B-4  Th e le ft-sh ift k ey „ and the r igh t -shift ke y … are combined w ith other k ey s to acti vat e menus, en ter char acters , or calc ulate functi ons as desc r ibed else wher e.  Th e numer ical k e y s ( 0 to 9 ) are u sed to enter the digits of the dec imal number s ys tem.  Ther e is a dec imal poin t k ey (.) and a space k e y ( SPC ).  Th e ENTER ke y is used to ent er a number , expr essi on , or functi on in the displa y or stack , and  Th e ON k ey is u sed to turn the calc ulator on. Alternate k e y func tions The left-shift ke y , k ey (8 ,1) , t he r i ght-shift k e y , ke y (9 ,1) , and the ALPHA k e y , key (7 , 1 ) , can be combi ned w ith so me of the other ke y s to ac ti v ate the alt ern ati ve functi ons sho wn in the k ey boar d. F or ex ample , the P key , key(4,4 ) , has t he follo wing si x func tions assoc iated w ith it: P Main functi on, t o acti vat e the S YMBolic menu „´ Left -shift functi on , to acti vate the MTH (Math) menu … N Ri ght-shif t f unction , t o acti vate the CA T alog funct ion ~p ALPHA func tion , to enter the upper -case letter P ~„p ALPHA-Left - Shift functi on, t o enter the lo wer -case let t er p ~…p ALPHA-Ri ght-Shift functi on , to enter the sy mbol P Of the six f unctions ass oc iated w ith the k ey onl y the fir st four ar e s ho wn in the k ey b oar d itself . T his is the w ay that the k ey l ooks in the k e yboar d: Notice that the color and the position o f the labels in the k ey , namel y , SY M B , MTH , CA T and P , indi cate w hich is the main func tion ( SY M B ), and w hic h of
P age B-5 the other thr ee functi ons is a ssoc iated w ith the le f t-shift „ ( MTH) , r ight-shif t … ( CA T ) , and ~ ( P ) k ey s. Diagr ams show ing the f uncti on or char acter r esulting fr om com b ining the calculat or k ey s w ith the lef t-shift „ , r ight-shift … , ALPHA ~ , ALPHA-left- shift ~„ , and ALP HA -r ight-shif t ~…, ar e pr esented ne xt . In these diagr ams, the r esulting char acter or functi on f or each k ey combi nation is sho wn in whit e back gr ound. If the left -shift , r ight-shif t or ALPHA k ey s ar e acti vated the y ar e show n in a shaded back gr ound . K e ys that do not get acti vated ar e show n in black bac k ground . Left-shift func tions The f ollo w ing sk etch sho ws the f unctions , char acters , or menus as soc iated w ith the differ ent calc ulator k e ys w hen the left -shift k e y „ is activ ate d .  The si x left -shift functi ons assoc iat ed with the A through F k ey s are assoc iated w ith the setting u p and produc tion of gr aphi cs and tables . When using thes e functi ons in the calc ulator ’s Algebr ai c mode of oper ation , pr ess the left - shif t k ey „ f irs t , an d then a n y of the k ey s in R o w 1. When using these func tions in the calc ulator’s RPN mode , y ou need t o pr ess the left-shift ke y „ simultaneousl y with the k ey in R o w 1 of your choice. F un ction Y= is u sed to enter f uncti ons of the for m y= f(x) f or plotting, function WIN is used to set par ameters of the plot w indo w , f uncti on GRAP H is used to pr oduce a gra ph, f uncti on 2 D/3D is used to selec t the t y pe of gr aph to be produced , functi on TBLSET is used to set par am e ters for a table of v alues of a functi on, func tion TA B L E is use d to g ener ate a table of values of a function,  Fu n c t io n FILE acti v ates the file br ow ser in the calc ulator’s memor y .  Th e CU S T OM func tion acti vates the c ustom menu opti ons, the i ke y i s u se d to enter the unit imaginary number i int o the s tack ( ) .  Th e UPDIR fun cti on mo ve s the me mory locati on one le v el u p in th e calculat or’s f ile tr ee .  Th e RC L functi on is used to r ecall values o f var ia bles.  Th e PRE V func tion sho w s the pr ev iou s set of si x menu options assoc iated w ith the soft menu ke ys . 1 2 − = i
Pa g e B - 6  Th e CMD functi on sho ws the mos t recent commands , the PRG fun ctio n acti v ates the pr ogramming men us , the MTRW f uncti on acti vat es the Matri x Wr i t e r, Left-shift „ functions of th e calculator ’s k ey board  Th e CMD functi on sho ws the mos t recent commands .  Th e PRG f uncti on acti vate s the progr amming menus .  Th e MTR W func tion acti vates the Matr i x W r iter .  Th e MTH func tion ac ti vate s a menu of mathemati cal func tion .  Th e DEL k e y is used to delete var iables .
Pa g e B - 7  Th e e x k e y calc ulates the e xponenti al func tion of x .  Th e x 2 k e y calculat es the squar e of x (this is r ef err ed to as the SQ fu nct ion) .  The A SIN , A CO S , and A T AN functi ons calc ulate the ar csine , ar ccosine , and ar c tangent f uncti ons, r especti vel y .  Th e 10 x func tio n calculat es the anti-logar ithm of x .  Th e k eys ≠ , ≤ , and ≥ , ar e used f or compar ing r eal numbers .  Th e AB S functi on calc ulates the a bsolu te v alue of a r eal number , or the magnitude of a complex number or o f a v ector .  Th e US ER function activ ates the us er-def ined ke y bo ar d menu .  Th e S.S L V f un ction activ ates t he s ymbolic solver menu .  Th e EXP &LN func tio n acti vat es the menu f or subs tituting expr essi ons in ter ms of the e xponential and natur al logar ithm functi ons .  Th e FINAN CE functi on acti vat es a menu fo r financ ial calc ulations .  Th e CAL C functi on acti v ates a menu of calc ulus func tions .  Th e MA TRICE S f unction ac ti vat es a menu f or c r eating and manipulation of m atri c es .  Th e CO NVE R T f uncti on acti vate s a men u fo r con v ersi on of units and other e xpr essio ns.  Th e ARI TH functi on acti v ates a menu o f arithmeti c func tions .  Th e DEF k e y is used to de fine a simple func tion as a v ar iable in the calc ulat or men u .  Th e CO NT ke y is u sed to continue a calculator ope rati on .  Th e ANS k e y r ecalls the last r esult w hen the calculat or is in Algebr aic oper ation mode .  Th e [ ] , ( ) , and { } k e ys are used to enter b r ack et s , p ar enth eses, or br aces.  Th e # k ey is u sed to enter number s in other than the ac ti ve number base .  Th e i nfi ni t y key ∞ is used to enter the inf inite s ymbol in an e xpr ession .  Th e pi key π is used to e nter the value or s y mbol for π (the r atio of the length of a c ir c umfer ence to its diameter ) .  The ar ro w ke ys , whe n combined w ith the left -shift k e y , mov e the c ursor to the fir st char acter in the dir ection of the ke y pressed .
Pa g e B - 8 Rig ht-s hif t … functions of the calculator ’s ke yboard Right-shift functions The sk etch abo v e show s the functi ons , char acter s, or men us ass oci ated w ith the diffe r ent calculator k ey s w hen the r igh t -shift k e y … is acti vated .  Th e fun ctio ns BE GIN, END , C OP Y , CUT and PA S T E ar e used f or editing purpo ses .  Th e UNDO k e y is used to undo the last calc ulator oper ation .  Th e CHAR S functi on acti v ates the spec ial c harac ters menu .  Th e EQ W func tio n is used to start the E quation W rit er .
Pa g e B - 9  Th e CA T f unction is us ed to acti vate the command catalog .  Th e CLEAR f unction c lear s the scr een.  Th e LN f uncti on calc ulates the natur al logar ithm.  The func tion cal culat es the x – th root o f y .  Th e Σ functi on is used to e nter summati ons (or the upper case Gr eek letter sigma).  Th e ∂ functi on is used to calc ulate der i vati v es.  Th e ∫ func tion is us ed to calc ulate integr als.  Th e LO G f unctio n calculat es the logar ithm of base 10.  Th e ARG func tion calc ulate s the argument o f a comple x number .  Th e ENTR Y function is u sed to change entry mode in editing .  Th e NUM. SL V functi on launc hes the NUMer ical S OL ver men u .  Th e TRIG functi on acti v ates the tr igonometr ic su bstitu tion menu .  Th e TIME f uncti on acti vat es the time menu .  Th e AL G func tion ac ti vate s the algebr a men u .  The S T A T f unction ac ti vate s the statisti cal operati ons menu .  Th e UNIT S func tion acti vates the menu f or units of measur ement .  Th e CMPLX func tion acti vates the comple x number func tions menu .  Th e LIB functi on acti v ates the libr ar y f uncti ons.  Th e BAS E func tion ac ti vat es the numer ic base con ve rsi on menu .  The OFF k e y turns the calc ulator of f , the  NUM ke y produce s a numer ic (or floating-po int) v alue of an e xpr essi on .  Th e “ “ ke y enter s a set of double -quotes used for enter ing te xt strings.  Th e __ k ey en ter s an under sco r e.  Th e << >> ke y en te rs t he sym bo l fo r a p rog ra m.  Th e  k e y enter s an arr o w r epr esenting an input in a pr ogr am.  Th e  k e y enters a r eturn char acter in pr ogr ams or te xt str ings.  The comma ( , ) k e y enter s a comma .  The ar ro w ke ys , w hen combined w ith the r ight-shif t k e y , mo ve the c urs or to the farthest c har ac ter in the direc tion of the k e y pr essed. ALP HA c har acters T he follo wing sk etch sho ws the c harac ter s assoc iated w ith the diffe r ent calc ulator k ey s w hen the ALPHA ~ is acti v ated . Notice that the ~ fu nct ion x y
Pa g e B - 1 0 is used mainl y to e nter the upper -case letter s of the English alpha bet ( A thr ough Z ) . T he numbers , mathematical s y mbols ( - , ), dec imal poin t ( . ) , and the space ( SP C ) ar e the same as the main functi ons of these k ey s. T he ~ fu nc tion pr oduc es an aster isk ( * ) whe n combined w ith the times k ey , i .e ., ~* . Alpha ~ fu nctions of the calculator ’s k e yboar d Alpha-l eft-shift characters T he follo wing sk etch sho ws the c harac ter s assoc iated w ith the diffe r ent calc ulator ke ys w hen the ALPHA ~ is combined w ith the left-shift ke y „ .
Pa g e B - 1 1 Notice that the ~„ combinati on is used mainl y to enter the lo wer -c ase letters of the English alphabet ( A through Z ) . T he number s, mathemati cal sym bo l s ( - , , × ) , dec imal p o int ( . ) , an d the space ( SPC ) ar e the same as the main func tions of these k ey s. The ENTER and CONT k e y s also w ork as their main func tion e v en whe n the ~„ combination is u sed. Alpha ~„ func tions o f the calculator’s ke y board
Pa g e B - 1 2 Alpha-right-shift c har ac ters T he follo wing sk etch sho ws the c harac ter s assoc iated w ith the diffe r ent calc ulat or k e y s w hen the ALPH A ~ is combined w ith the ri ght -shift k e y … . Alpha ~… func tions o f the calculator’s ke y board Notice that the ~… combinati on is used mainly to enter a n umber of spec ial c har acter s fr om into the calc ulator stac k. T he CLEAR, OFF ,  ,  , comma (,) , k ey ent ers and OFF k e y s also w ork as the ir main fu nction e v en w hen the ~… co mbination is used . The spec ial c har acter s gener ated b y the
Pa g e B - 1 3 ~… combination inc lude Gr eek let ter s ( α, β, Δ, δ, ε, ρ, μ, λ, σ, θ, τ , ω , and Π ) , other c har acter s gener ated by the ~… co mbinati on ar e |, ‘ , ^, =, <, >, /, “ , \, __, ~, !, ?, <<>>, and @.
Pa g e C - 1 Appendi x C CAS settings CA S stands f or C omputer A lgeb r aic S y stem . T his is the mathematical cor e of the calc ulator w her e the sy mbolic mathematical oper atio ns and functi ons ar e pr ogr ammed. T he CA S offe rs a number of settings can be adj ust ed according to the type of oper ation of inter est . T o see the optional CA S settings use the fo llo w ing: Θ Pr ess the H button to acti vate the CAL CUL A T OR MODE S input f orm . At the bottom of the display y ou will find the f ollo w ing soft me nu k e y optio ns: ) @FLAGS Pr ov ides men us f or manipulating calc ulator f lags (*) @CHOOS Lets the u ser ch ose options in the diff er ent f ields in the f orm ) @@ CAS@@ Pr ov ides an input f or m to change CA S settings ) @@DISP@ Pr ov ide s an input f orm t o change displa y setting s !!CANCL Clos es this input fo rm and r eturns to nor ma l display @@@OK@@@@ Use this k ey t o accept settings Pr essing the L k e y sho ws the r emaining options in the CAL CUL A T OR MODE S input f orm: @RESET Allow s the user to r eset a hi ghlighted option !!CANCL Clo ses this input f or m and r etur ns to normal displa y @@@OK@@@@ Use this k e y to accept settings (*) F lags ar e var iable s in the calc ulator , ref er r ed to by n umbers , whi ch can be “ set ” and “ u ns et” t o change certain calc ulator oper ating optio ns.
Pa g e C - 2 Θ T o r ecov er the or iginal men u in the CAL CULA T OR MODE S input box , pre ss the L k ey . Of inter est at this point is the c hanging of the CA S settings . T his is accomplished by pr essing the @ @ CAS@@ s oft menu k e y . The def ault v alues of the CA S setting ar e sho w n belo w: Θ T o nav igate thr ough the many opti ons in the CAS M OD E S input f orm , use the arr o w k e y s: š™˜— . Θ T o select or deselect an y of t he settin gs sho wn abo ve , select t he underline bef or e the option o f inter est , and t oggle the @  @CHK@@ s oft menu k e y until the r ight s etting is ac hie v ed. W hen an opti on is select ed, a chec k mark w ill be sho wn in the under line (e .g ., the Rig oro us and Simp Non-Rati onal opti ons abo ve). Uns elected options w i ll sho w no chec k mark in the under line pr eceding the option of inter est (e .g., the _Numer ic , _Appr o x , _Comple x, _V er bose , _Step/St ep , _Incr P o w options abo ve). Θ After ha v ing selected and uns elected all the options that y ou w ant in the CA S MODE S input f orm , pr ess the @@@OK@@@ soft menu k ey . This w ill tak e y ou back to the CAL CUL A T OR MOD E S input f orm . T o retur n to normal calc ulator displa y at this point , pr ess the @@@OK@@@ soft menu k ey once mor e. Selec ting the independent v ariable Man y of the func tio ns pr ov ided b y the CAS u se a pr e -dete rmined independen t var iable . By de fault , such v ar iable is c hose n to be the letter X (upper case) as sho w n in the CAS MODE S input bo x abo v e . How ev er , the us er can change this v ari able to an y other letter or combinati on of letters and n umbers (a var iable name mus t start w ith a letter ) b y editing the Indep v ar fi eld in the CAS MODE S input bo x.
Pa g e C - 3 A v ari able called VX ex ists in the calc ulator ’s {HOME CA SDI R} dir ect or y that tak es, b y def ault , the v alue of ‘X’ . T his is the na me o f the pre fer r ed independent v ar iable f or algebr aic and calc ulus a pplicati ons. F or that re ason , most e xamples in this C hapter u se X as the unkno wn v ar iable . If y ou use other independent v ar ia ble names, for e xam ple , w ith func tion HORNER , the CA S w ill not w ork pr o perl y . T he var i able VX is a permanent inha bitan t of the {HOME CA SD IR} dir ecto r y . Ther e are other CA S var i ables in the {HOME CASDIR}, e .g., REALAS SUME ( @REALA ), M O DU L O ( @MODUL ), C A S IN F O ( @CASIN ), e t c . Y ou can c hange the v alue of VX b y sto r ing a new algebr aic name in it , e .g., ‘ x ’ , ‘ y’ , ‘ m’ , etc. Pr efer abl y , keep ‘X’ as y our VX var i able for the e xamples in this manual . Also , a v oid u sing the var iable VX in y our pr ograms or equati ons, so as to not get it confu sed w ith the CA S’ VX. If y ou need to r ef er to the x -component of v eloc ity , f or e x ample , y ou can use vx or Vx. Selec ting the modulus Th e Modulo option o f the CAS MODE S input bo x r epr esents a nu mber (default v alue = 13 ) used in modular ar ithmetic . More de tails abou t modular ar ithmetic ar e pre sented else wher e . Numeric v s. s ymbolic CA S mode When the Numeri c CA S mode is selected , cer tain const ants pre -de fined in the calc ulator ar e display ed in the ir full f loating-poin t value . B y def ault , the _Numer i c option is uns elect ed, meaning that thos e pr e -def ined constants w ill be displa y ed as their s y mbol, r ather than their value , in the calculator dis play . The f ollo wing sc r een sho ws the v alues of the constant π (the r atio of the length of the c ir c umfer ence to its di ameter) in s ymbolic f or mat follo w ed by the n umeri c , or floating-po int , for mat . This e x ample cor r esponds to the Algebr aic oper ating mode .
Pa g e C - 4 T he same e x ample , corr es ponding to the RPN oper ating mode, is sho wn ne xt: Appr o x imate v s. Ex ac t CA S mode When the _ A ppr ox is s elected , sy mbolic oper ati ons (e.g ., def inite integrals , squar e roots , etc .) , w ill be calc ulated numer i cally . When the _A ppr o x is unselec ted (Ex act mode is acti v e) , s y mbolic oper ati ons wi ll be calculat ed as c losed-fo rm algebr aic e xpres sions , w henev er possible . T he follo wing s cr een sho ws a couple of s ymboli c e xpre ssio ns enter ed w ith an acti v e e xac t mode in Algebr aic oper ating mode: In Algebr aic mode , the obj ect e nter ed b y the us er is sho w n in the left -hand si de of the sc r een , fo llo wed immedi atel y by a r esult in the right-hand side of the sc r een. T he re sults sho wn abo v e show the s y mbolic e xpr essions f or ln(2) , i .e., the natur al logar ithm of 2 , and , i .e ., the s quar e r oot of 5 . If the _Numeri c CA S option is s elect ed, the cor r esponding r esults for the se oper ations ar e as fo llo w s: 5
Pa g e C - 5 T he k ey str ok es nece ssary for ent er ing these v alues in Algebr ai c mode ar e the fo llow ing: …¹2` R5` T he same calc ulations can be pr oduced in RPN mode . Stac k lev els 3: and 4: sho w the case of Ex act CAS se tting (i .e ., the _Numeri c CAS opti on is unselec ted) , w hile stac k lev els 1: and 2: sho w the case in whi c h the Numer ic CA S option is s elect ed. T he r equir ed ke ys tr ok es ar e: 2…¹ 5R A k e yboar d short c ut to toggle between AP PRO X and E X A CT mode is by holding the ri ght -shift k e y and pr essing the ENTER k e y simultaneousl y , i .e. , ‚ (hol d) ` . Real numbers v s. integer numbers CA S oper ations u tili z e in teger number s in or der to k eep ful l prec ision in the calc ulatio ns. Re al numbers ar e stor ed in the f orm o f a mantissa and an e xponent , and hav e limited prec ision . In APP RO X mode , ho we v er , whene v er y ou enter an int eger number , it is automati cally tr ansf ormed into a r eal number , as illus tr ated ne xt: Whene v er the calc ulato r lists an integer v alue f ollo w ed b y a dec imal dot , it is indicating that the int eger number has been con v erted to a real r epr esentati on . T his will indi cate that the number w as enter ed while the CAS w as se t to AP PR O X mode .
Pa g e C - 6 It is r ecommended that y ou se lect EXA CT mode as def ault CA S mode , and c hange to APP R O X mode if r equest ed b y the calc ulator in the perf ormance of an oper ation . F or add iti onal inf ormati on on r eal and integer numbers , as w ell as other c alcul at or’s obje cts, r efe r to Cha pte r 2 . Comple x vs . R eal CAS mode A comple x number is a n umber of the f or m a bi , w here i , def ined b y is the unit imaginar y number (e lectr ical engineer s pre fer to u se the s ymbol j ), and a and b ar e real numbers . F or e x ample , the n umber 2 3i is a comple x number . Additi onal infor mation on oper ations w ith comple x number s are pr esen ted in Chapt er 4 of this guide . When the _Comple x CAS opti on is selected , if an ope rati on r esults in a comple x number , then the re sult w ill be show n in the fo rm a b i o r i n t h e fo rm o f an or der ed pair (a ,b) . On the other hand, if the _Com ple x CA S opti on is unset (i .e ., the Real CA S option is ac ti ve), and an operati on r esults in a complex number , y ou w ill be ask ed to s w itc h to Comple x mode. If y ou decline , the calc ulator w ill report an er r or . P lease noti ce that , in CO MPLEX mode the CA S is able to perf orm a w ide r range of oper ations than in RE AL mode , but it will als o be consi der abl y slo wer . T hu s, it is r ecommended that y ou use the RE AL mode a s defa ult mode and s wit ch to CO MPLE X if r eques ted by the calc ulator in the perfor mance of an oper atio n. T he follo w ing ex ample sh o ws the calc ulati on of the quantity using the Algebr aic oper ating mode , f irst w ith the Real CA S option selec ted . In this case , yo u ar e ask ed if y ou w ant to change the mode t o Comple x: 1 2 − = i 2 2 8 5 −
Pa g e C - 7 If y ou pr ess the OK so ft menu ke y (), then the _Comple x optio n is for ced, and the r esult is the f ollo wing: T he k ey str ok es us ed abo ve ar e the follo w ing: R„Ü5„Q2 8„Q2` When ask ed to change to C OMP LEX mode , u se: F . If y ou dec ide not to accept the change t o COMP LEX mode , y ou get the f ollo wing er r or mes sage: V erb ose vs. no n -ve rbose CAS mo de When the _V erbose CA S option is s elected , certain calc ulus appli cations ar e pr o v ided w ith commen t lines in the main displa y . If the _V er bose CA S option is not selec ted, then tho se calc ulus appli cations w i ll sho w no comment lines. The comment lines w ill appear moment aril y in the top line s of the displa y w hile the oper ation is be ing calc ulated . Step-b y-step CAS mode When the _St ep/step CA S option is selec ted , certain oper ations w ill be show n step at a time in the display . If the _Step/s tep CA S option is not s elected , then intermediate steps w ill not be sho w n.
Pa g e C - 8 F or ex ample , hav ing selec ted the S tep/step opti on, the f ollo wing s cr eens sho w the step-b y-step di v ision of tw o poly nomials , namel y , (X 3 -5X 2 3X- 2)/(X- 2) . T his is accomplished b y using f uncti on DIV2 a s sho w n belo w . Pr ess ` to s h ow the f irst s tep: T he scr een infor m us that the calc ulator is oper ating a di v ision of poly nomials A/B , so that A = BQ R, w her e Q = quotie nt , and R = r emainder . F or the case unde r consider ation , A = X 3 -5X 2 3X- 2 , and B = X- 2 . T hese pol ynomi als ar e r epr esented in the scr een by lists of their coeff ic ients . F or e xample , the e xpr es sion A: {1,-5, 3,- 2} r e pr esents the pol y nomial A = X 3 -5X 2 3X- 2 , B:{1,- 2} r epr esents the pol yn omial B = X- 2 , Q: {1} r epr esents the pol y nomial Q = X, and R:{-3, 3,- 2 } r epr esents the pol y nomial R = -3X 2 3X- 2 . At this po int , pr ess , f or e x ample , the ` k ey . Continue pre ssing ` the k e y to pr oduce additional s teps: T hus , the intermedi ate steps sho wn r epr esent the coe ffi c ients o f the quotient and r esidual o f the step-b y-step s ynthetic di visi on as w ould hav e been p e rformed b y hand , i .e ., = − − − = − − − 2 2 3 3 2 2 3 5 2 2 2 3 X X X X X X X X
Pa g e C - 9 . Increasing-po w er CAS mode When the _Incr po w CA S option is selec ted , poly nomi als wi ll be listed so that the ter ms w ill hav e incr easing po we rs of the independent v ar iable . If the _Inc r po w CAS opti on is not select ed (defa ult v alue) then pol ynomi als w ill be list ed so that the ter ms wi ll hav e dec r easing pow ers of the independen t var i able . An e x ample is sho w n ne xt in Algebr ai c mode: In the f irst cas e , the poly nomial (X 3) 5 is e xpanded in incr easing or der of the po w ers of X , w hile in the second case , the poly nomial sho w s decr easing or der of t he powers of X . The k ey str ok es in both case s ar e the follo wing: „Üx 3™Q5` In the f irst cas e the _Inc r po w option w as s elected , w hile in the second it wa s not se lected . The s ame ex ample , in RPN notati on , is sho wn bel o w: T he same k e y str ok e sequence w as used to pr oduce each of these r esults: ³„Üx 3™Q5`μ 2 8 3 3 2 2 3 3 2 2 − − − − = − − − − X X X X X X X X
Pa g e C - 1 0 Rigor ous CAS setting When the _Ri gorous CA S option is se lected , the algebrai c e xpr essi on |X|, i .e., the absolute v alue , is not simplified to X . If the _R igor ous CA S option is not selec ted , the algebrai c e xpr essi on |X| is simplif ied t o X . T he CA S can sol v e a lar ger v ar iety of pr oblems if the r igor ous mode is no t set . Ho w ev er , the r esult , or the domain in whi c h the result ar e applica ble , might be mor e limited . Simplify non-rational CAS setting When the _Simp Non -R ational CAS opti on is selec ted, non-r ational e xpre ssions w ill be automati cally simplif ied . On the other hand, if the _Simp Non -R ational CA S option is not s elected , non -r ational e xpr essi ons w ill not be automati cally simplif ied . Using the CAS HELP facilit y T ur n on the cal c ulator , and pr ess the I k e y to acti vate the T OOL menu . Ne xt , pr ess the B so ft menu ke y , follo w ed b y the ` k ey ( the k e y in the lo w est r ight cor ner of the ke yboar d) , to ac ti vate the HELP fac ilit y . The displa y w ill lo ok as f ollo ws: At this po int yo u w ill be pr ov ided w ith a list of all CA S commands in alphabeti cal orde r . Y ou can use the do w n arr o w k ey , ˜ , to nav i ga te thr ough the list . T o mo ve up war ds in the list us e the up ar r o w k e y , — . The ar r o w ke ys ar e located on the r ight-hand side of the k e yboar d betw een the fir st and f ourth r o ws of k ey s. Suppo se that y ou w ant to f ind inf ormati on on the command A T AN2S (A r c T ANgent -to -Sine func tion). Pr ess the do wn arr o w k ey , ˜ , until the command A T AN2S is highli ghte d in the lis t:
Pa g e C - 1 1 Notice that , in this ins tance , soft menu k ey s E and F ar e the only o ne w ith as soc iated commands , namel y: !!CANCL E CANCeL the help f ac ilit y !!@@OK#@ F OK to ac tiv ate help fac ilit y f or the selected comma nd If y ou pr ess the !! CANCL E k e y , the HELP fac ilit y is skipped, and the calc ulator r eturns t o normal dis play . T o see the effect of usin g !!@@OK#@ in the HELP fac ilit y , le t’s r epeat the steps us ed abo ve f r om to the selection o f the command A T AN2S in the list of CA S commands: @HELP B` ˜ ˜ …(10 times) Then , pres s the !!@@OK#@ F k e y to obtain inf or mation abou t the command ATA N 2 S . T he help fac ility indicates that the co mmand, or f uncti on, A T AN2S replace s the val ue of atan(x) , the ar c tangent o f a v a lue x , b y its equiv alent in ter ms of the fu nct ion asin (ar csine), i .e ., T he fourth and f ifth lines in the displa y pr o v ide an e x ample of appli cation o f the func tion A T AN2S. Line f our , namel y , A T AN2S(A T AN(X)) , is the stat ement of the oper ation t o be perfor med , while line f i v e , namely , AS IN(X/ √ (X^2 1)) , is the re su l t. T he bottom line in the display , starting w ith the partic le See: , is a r ef er ence line listing other CA S commands related to the command A T AN2S.
Pa g e C - 1 2 Notice that the re ar e six co mmands assoc iated w ith the s oft menu k e y s in this case (y ou can chec k that ther e are onl y si x commands because pr essing the L pr oduces no additional men u items) . T he soft menu k e y commands ar e the f ollo w ing: @EXIT A EXI T the help f ac ilit y @ECHO B Cop y the e xampl e command to the stac k and e x it @@ SEE1@@ C See the f irst link (if an y) in the list of r ef er ences @@SEE2@ D See the second link (if an y) of the list of r e fer ences !@@SEE 3@ E See the third link (if an y) of the list o f r efe r ences @!MAIN F Re turn to the MAIN command list in the help fac ility In this case w e want t o ECHO the e xample into the stac k b y pr essing @ECHO B . T he r esulting displa y is the follo wing: T here ar e now f our lines o f the display occ upied w ith output . The f irs t two lines fr om the top corr espond to the f irst e x er c ise w ith the HELP f ac ility in whi ch w e cancel the r equest f or help . The thir d line fr om the top sho ws the mo st r ecent call to the HELP fac ilit y , while the last line sho ws the E C HO o f the e xample command . T o acti v ate the command pr es s the ` ke y . T he r esult is: Notice that , as ne w lines of output ar e pr oduced, the displa y (or stac k) pushes the e x isting lines up war ds and fills the bottom of the sc r een w ith mor e output . T he HELP fac ility , desc r ibed in this secti on, w ill be v ery usef ul to re fer to the def inition o f the man y CA S commands av ailable in the calculat or . E ach entr y in the CA S help fac ility , whene v er appr opr iate , w ill hav e an e xam ple of application of the command, as w ell as r efe rences as sho w n in thi s e x ample .
Pa g e C - 1 3 T o nav igate qui ckl y to a partic ular command in the help fac ility list w ithout ha ving to u se the arr o w k e ys all the time , we can us e a shortcu t consisting of typing the f irs t letter in the command’s name . Suppose that w e w ant to find inf ormati on on the co mmand IBP (Integr ation B y P ar ts), once the help f ac ility list is av ailable , use the ~ k e y (f irs t ke y in the f ourth r o w fr om the bottom of the k e yboar d) follo wed b y the k ey f or the letter i (the same as the k e y I ) , i .e ., ~i . T his w ill tak e y ou aut omaticall y to the f irs t command that starts w ith an i , namely , I B AS IS . Then , y ou can use the do w n arr o w k ey ˜ , tw ice , to f ind the command IBP . Pre ssing the !!@@OK# @ F k e y , we acti vate the help fac ilit y f or this command . Pr es s @!MAIN F to r eco v er the main list of commands , or @EXIT A to ex it the fac ility . Refer ences for non-CAS commands T he help fac ility contains entr ies f or all the commands dev eloped f or the CAS (Com puter Algebr ai c S y stem). Ther e is a lar ge number of other f uncti ons and commands that w er e or iginall y dev eloped fo r the HP 48G ser ies calc ulators that ar e not inc luded in the help f ac ilit y . Good r efer ences f or thos e commands ar e the HP 4 8G Seri es User’s Guide (HP P ar t No . 0004 8-9012 6) and the HP 48G Series Adv a nced User’s Ref erence Manua l (HP P art No . 000 4 8-9 013 6) both published b y H e wlett-P ack ar d Co mpan y , C orvallis , Or egon, in 19 9 3 . CAS End User T er m and Conditions Use o f the CA S Softwar e re quir es f r om the user an appr opr iat e mathematical kno wledge . T here is no w arr anty for the CAS S oft w ar e , to the extent per mitted b y applicable la w . Ex cept w hen otherwis e stated in w r iting the copy r ight holder pr o v ides the CA S Softwar e "As Is" w ithout w arr ant y of an y kind , either e xpre ss ed or implied , including , but not limited to , the impli ed war r anties of mer chant ability and f itness f or a partic ular purpo se . The entir e risk as t o the qual ity and perf ormanc e of the CA S So ftwa r e is w ith y ou . Should the CA S Softw ar e pro ve de fect iv e, y ou assume the cost o f all necessary servi c ing , r epair or corr ecti on.
Pa g e C - 1 4 In no e vent unle ss r equir ed b y applicable la w w ill an y copy r ight holde r be liable t o yo u for damage s, inc luding an y general , speci al , inc ident al or cons equential damage s ar ising out of the us e or inability to us e the CA S Softwar e (including but not limit ed to loss o f data or data being r ender ed inacc urate or losses sust ained b y y ou or thir d par ti es or a failur e of the CAS Softw ar e to oper ate w ith any othe r pr ogr ams) , ev en if su ch holder or other part y has been adv ised of the po ssib ility o f suc h damages . If re quir ed by appli cable law the max imum amount pa ya ble for damage s by the cop yr ight holder shall not e x ceed the r oy alt y amount paid b y He wlett-P ack ard to the cop yr ight holder fo r the CAS S oftwar e .
Pa g e D - 1 Appendi x D Additional c har acter set While y ou can us e an y of the u pper -case and lo w er -case English letter f r om the k e yboar d, ther e are 2 5 5 char acter s usable in the calc ulator . Including spec ial ch arac ter s l ike θ , λ , e tc., that that can be us ed in algebrai c expr essi ons. T o access the se char acters w e use the k ey str ok e combination …± (associated w ith the EV AL ke y) . T he r esult is the fo llow ing scr een: B y using t he arr ow k e ys , š™˜ — , we can nav igate thr ough the collec tion of c har acte rs . F or ex ample, mo v ing do w n war ds in the s cr een pr oduces mor e char act ers in the displa y: Mo vi ng farther do wn , w e see these c har acter s: T here w ill be o ne char act er highlighted at all times . The lo wer line in the displa y w ill sho w the short c ut fo r the highli ghted c harac ter , as wel l as the A S CII c harac ter code (e .g ., see the sc r een abov e: the short cut is α  Dα  9 , i .e., ~„d~…9 , and the code is 24 0 ) . T he display als o sho ws thr ee
Pa g e D - 2 func tions assoc iated w ith the soft menu k e y s, f4 , f5, and f6. The se func tions ar e: @MODIF : Opens a gr aphics s cr een w her e the us er can modif y highli ghted c harac ter . Use this opti on car ef ull y , since it w ill alter the modif ied c har acter u p to the ne xt r ese t of the calc ulator . (Imagine the eff ect of c hanging the gr aphi c of the c harac ter 1 to look lik e a 2!) . @ECHO1 : C opie s the highli ghted char acter to the command line or equati on wr iter (E QW) and ex its the c har acter set s cr een (i.e ., echoes a single c harac ter to the stack) . @ECHO : Cop ies the hi ghligh ted c harac ter t o the command line or equati on w r iter (E QW) , but the c urso r re mains in the char acter s et sc r een to allo w the use r to select additional c harac ters (i .e ., echoe s a str ing of c harac ter s to the stac k) . T o e x it the char acter s et sc r een pr ess ` . F or ex ample , suppo se y ou hav e to type the e xpr essi on: λ 2 2 μ 5 Her e is a suggested appr oach , using the st ack in eithe r Algebr aic or RPN mode: Use the ke y strok es: ³…± to get to the c harac ters sc r een . Next , use the arr o w k e ys to hi ghlight the char acter λ . Pr ess @ECHO 1 (i .e ., the E ke y) , and contin ue w ith the k e ys tr ok es: 2 *…± . Ne xt , us e the arr o w ke ys to highli ght the char acter μ . Pr ess @ECHO1 (i .e., the E k e y) , and f inish the e xpr essi on w ith the k ey str ok es: 5` . Her e is the re sult of this ex er cis e in Algebr aic and RPN modes , r espec ti ve ly : F ollo wing , we lis t some of the mo st common ~‚ keyst ro ke c o mb i na t io n s:
Pa g e D - 3 Gr ee k lett er s α (alpha) ~‚a β (beta) ~‚b δ (delta) ~‚d ε (epsilon) ~‚e θ (theta) ~‚t λ (lambda) ~‚n μ (mu) ~‚m ρ (r ho) ~‚f σ (sigma) ~‚s τ (tau) ~‚u ω (omega) ~‚v Δ (upper -case delta) ~‚c Π (upper -case pi) ~‚p Ot her char ac ters ~( t i l d e ) ~‚1 !( f a c t o r i a l ) ~‚2 ? (questi on mark) ) ~‚3 \ (backw ar d slash) ~‚5 (angle s y mbol) ~‚6 @ (at) ~‚` Some c har acter s commonly us ed that do not hav e simple k ey str ok e shor tc uts ar e: ⎯ x (x bar), γ (ga mma) , η (eta) , Ω (upper -case omega) . T hese char acter s can be “ echoed” f r om the CHAR S sc r een: …± .
Pa g e E - 1 Appendi x E T h e Selec tion T ree in the Equation W riter T he expr essi on tr ee is a diagr am sho w ing ho w the E quati on W r iter inte rpr ets an ex p r e ss io n. The fo rm of th e exp re ss io n t re e i s de t erm i ne d by a n u mb er o f r ul es kno wn as the hi er ar ch y of oper ation . T he rules ar e as follo ws: 1. Oper ations in par enthes es are e xec uted f irs t , fr om the innermo st to the outer most par entheses , and fr om left to ri ght in the e xpr essio n. 2 . Arguments o f functi ons are e x ecuted ne xt, f r om left to ri ght . 3 . F unctions ar e ex ec uted ne xt , fr om left to r ight . 4. P o w ers o f numbers ar e e xec uted ne xt, f r om left to r ight . 5 . Multiplications and di v isions ar e ex ec uted ne xt , fr om left to r ight . 6 . Additi ons and subtr acti on are e xec uted last , fr om left to r ight . Ex ec utio n fr om left t o ri ght means that , if tw o oper ati ons of the same hier ar c h y , sa y two multipli cations , e xis t in an expr ession , the f ir st multiplicati on to the left w ill be ex ec uted bef or e the s econd, and so on . Consi der , fo r ex ample, the e xpr essi on sho w n belo w in the equation w rit er : Th e i nse r tion curs or (  ) at this point is located to the r ight o f the 2 in the ar gument of the S IN func tion in the denominat or . Pr ess the do wn ar r o w k e y ˜ to tr igger the c lear , editing c ursor (  ) ar ound the 2 in the denominator . Ne xt , pre ss the left ar r o w k e y š , con tinuousl y , until the c lear , editing cu rsor is ar ound the y in the f irst f actor in the de nominator . Then , pr ess the upper -arr o w k ey to acti v ate the selection c ursor (  ) ar ound the y . By pr essing the uppe r arr o w k e y — , con tinuou sly , we can f ollo w the expr essi on tree that w ill tak e use f r om the y to the completi on of the e xpr ession . Her e is the sequence of oper ations hi ghligh ted b y the upper ar r ow k ey — :
Pa g e E - 2 Step A1 Ste p A2 Step A3 Ste p A4 Step A5 Ste p A6 W e notice the appli cation o f the hier ar ch y-of-oper ation r ules in this selecti on. F i r st the y (Step A1) . T hen, y-3 (S tep A2 , par enth eses) . Then , (y-3)x (Step A3, multiplicati on) . T hen (y-3)x 5, (Step A4 , additi on) . T hen , ((y-3)x 5)(x 2 4) (St ep A5, multiplicati on) , and f inall y , ((y-3)x 5)(x 2 4)/S IN(4x - 2) (St ep A6, di v ision) . It is important to point ou t that the m ultiplicati on in Step A5 inc ludes the f irst t erm , ((y-3)x 5) w ith a second te rm (x 2 4) , w hic h is alr ead y calculat ed. T o see the step s in calculating the se second ter m , pre ss the do wn ar r o w k ey ˜ , continuousl y , until the clear , editing cur sor is tr igger e d ar ound the y , once mor e . T hen, pr ess the ri ght arr o w k e y until these c ursor is o v er the x in the second te rm in the numer ator . T hen, pr ess the upper -arr o w k e y to selec t this x. T he steps in the e v aluation o f the expr essi on, s tarting fr om this po int , ar e sho wn belo w :
Pa g e E - 3 Step B1 S te p B2 Step B3 St ep B4 = Step A5 St ep B5 = Step A6 W e can also fol lo w the ev aluation o f the expr essi on starting fr om the 4 in the ar gument of the S IN func tion in the denominat or . Pr ess the do wn ar r o w k e y ˜ , continuousl y , until the clear , editing cur sor is tr igger e d ar ound the y , once mor e . T hen , pr ess the r ight arr o w ke y until these c ursor is o ver the 4 in the denominator . Then , pr ess the u pper -arr ow k ey — to sel ec t t hi s 4 . Th e ste ps in the e valuati on of the e xpr essi on, s tarting fr om this point , are sho wn belo w : Step C1 Step C 2
Pa g e E - 4 Step C3 Step C 4 St ep C5 = St ep B5 = Step A6 The expr ession t r ee f or t he expr ession p r esente d abov e is s ho wn next: T he steps in the e v aluation of the thr ee terms ( A1 thr ough A6 , B1 thro ugh B5, and C1 thr ough C5) ar e sho w n ne xt to the c ir c le containing numbers , v ari able s, or oper ators .
Pa g e F - 1 Appendi x F T he Applications (APP S) menu T he Applicati ons ( APP S) menu is av ailable thr ough the G key ( fi rs t key i n second r o w fr om the k e yboar d’s top) . T he G k e y sho ws the f ollo wi ng applicati ons: T he differ ent appli cations ar e desc ribed ne xt . P lot func tions.. Selec ting option 1. P lot f u nc tions .. in the APP S will pr oduce the f ollo w ing menu list of gr aph-r elated opti ons: T he six opti ons sho w n ar e equi v alent to the k ey str ok e sequen ces listed belo w: E quation entry… „ñ Pl o t wi nd ow . . „ò Gr aph dis pla y .. „ó Plot setup.. „ô T able setup .. „õ T able displa y .. „ö T hese appli cations ar e pre sented in detail in Chapt er 12 .
Pa g e F - 2 I/O func tions .. Selecting opti on 2 . I/O f uncti ons .. in the APP S menu w i ll pr oduce the f ollo w ing menu lis t of input/ou tput func tions T hese appli cations ar e desc r ibed next: Send to C alc ulator Send data to another calc ulator (or to a P C w ith an infr ared port) Get fr om C alculator Recei ve dat a fr om another calc ulator (or to a P C with an infr ared port) Pr int displa y Send sc r een to pr inter Prin t .. Print select ed o bject fr om cal culat or T r ansfe r .. T r ansfer data t o other dev i ce St ar t Se r v er .. Calc ulator set as a server f or communi cation w ith computers Y ou can connect t o another calc ulator or to a P C v ia inf r ar ed or vi a a cable . A USB cable is pr ov ided w ith the calc ulato r for a U SB connecti on . Y ou can also use a s eri al cable to connec t to the R S2 3 2 por t on the calc ulator . (T his cable is av ailable as a separ ate accessory .) Constants lib .. Selec ting option 3 . Cons tants lib .. in the AP P S menu opens the Constant L ibr ar y appli cation that pr ov ides v alues o f standar d phy sical constan ts:
Pa g e F - 3 T he Const ants Libr ar y is disc us sed in detail in C hapter 3 . Numeric sol ver .. Selec ting option 3 . Constan ts lib .. in the APP S menu pr oduces the nume ri cal solver me nu: This oper ation is equi valent to the k e y str ok e sequence ‚Ï . T he numer ical sol v er menu is pr esent ed in detail in Chapt ers 6 and 7 . Time & date .. Selec ting option 5 .Time & dat e .. in the APP S menu pr oduces the time and date menu: T his oper ation is eq ui val ent to the k ey str ok e seq uence ‚Ó . The time and date menu is pr esented in detail in Chapter 2 6.
Pa g e F - 4 Equation wr iter .. Selec ting option 6 .E quation w r iter .. in the APP S menu opens the equation wri ter: T his oper ation is eq ui val ent to the k ey str ok e seq uence ‚O . The equati on w rit er is intr oduced in det ail in Chapter 2 . Examples that u se the equatio n w rite r are a v ailable thr oughout this guide . F ile manager .. Selec ting option 7 .F ile manager . . in the AP P S menu launc hes the f ile manager appli cation: T his oper ation is eq ui val ent to the k ey str ok e seq uence „¡ .The f ile manager is intr oduced in C hapter 2 .
Pa g e F - 5 M atr ix W riter .. Selec ting option 8.Matr i x W r iter .. in the APP S me nu launche s the matri x wr iter : T his oper ation is eq ui val ent to the k ey str ok e seq uence „² .The Matr i x W r iter is pr esen ted in detail in Chapter 10. T e xt editor .. Selec ting option 9 .T e xt editor .. in the APP S me nu launche s the line te xt editor: T he te xt editor can be st ar t ed in many cas es by pr essing the do wn-a r r ow k e y ˜ . If the obj ect in the displa y is an algebr aic ob ject , pre ssing ˜ wi ll m os t lik el y start the Eq uation W riter . T he te xt editor is intr oduced in Chapte r 2 , and pr esen ted in detail in Appendi x L . M ath menu .. Selec ting option 10.Math menu .. in the AP PS menu pr oduces the MTH (mathematic s) menu:
Pa g e F - 6 T his oper ation is eq ui val ent to the k ey str ok e seq uence „´ . T he MTH menu is intr oduced in Chapt er 3 (r eal numbers). Other func tions f r om the MTH menu ar e pr esented in Chapters 4 (comple x numbers), 8 (lists) , 9 (vec tors) , 10 (matr i x cr eation) , 11 (matr ix oper ation), 16 (f as t F our ier tr ansfor ms) , 17 (pr obability appli cations), and 19 (numbers in diffe r ent bases). CAS menu .. Selec ting option 11.CA S menu .. in the APP S menu pr oduces the CA S or S YMBOLIC men u: T his operati on is also a vaila ble by pr essing the P key . Th e C AS or S YMBOLIC men u is intr oduced in Chapter 5 (algebr aic and arithmeti c oper ations). O the r functi ons fr om the CA S me nu ar e pr esented in Cha pters 4 (comple x numbers), 6 (equations so lutio ns) , 10 (matr i x c reati on) , 11 (matr i x oper ation), 13 (ca l culu s) , 14 (multi var iate calc ulus) , and 15 (v ector anal y sis) . Equation Libr ary Selec ting option 12 .E quati on L ibr ary in the APP S men displa y s the E Q LIBR AR Y MENU . F r om her e y ou can pr es s ! EQLIB! and then !EQNLI! to open the E quation Li b r a r y :
Pa g e F - 7 Note that flag –117 should be se t if you ar e going to us e the E quatio n L ibrary . Note too that the E quation L ibr ary w ill only appear on the AP P S menu if the two E quation L ibrary files ar e stor ed on the calculator . T he E quation L ibrary is e xplained in de tail in chapt er 2 7 .
P age G-1 Appendi x G Useful shortc uts Pr esented her ein ar e a number o f k e yboar d shor tc uts commonl y used in the calc ulat or : Θ Adjust di splay co ntr ast: $ (hold) , or $ (hold) - Θ T oggle betw een RPN and AL G modes: H\ @@@OK@@ or H\` . Θ Set/c lear s y stem f lag 9 5 ( AL G vs. RPN oper ating mode) H @) FLAGS —„—„—„ — @@CHK@ Θ In AL G mode, CF(-9 5) se lects RPN mode Θ In RPN mode , 95 \` SF selec ts AL G mode Θ A k ey board short c ut to toggle betw een AP PR O X and EX A CT mode is b y holding the ri ght -shift k e y and pr essing the ENTER k e y simultaneousl y , i .e ., ‚ (hold) ` . Θ Set/c lear s yst em flag 105 (EXA CT vs . APP RO X CA S mode) H @) FLAGS —„—„— —— @@CHK@ Θ In AL G mode, SF (-105) sele cts APPR OX CAS mo de CF(-10 5) selec ts EX A CT CAS mode Θ In RPN mode , 10 5 \` SF selec ts APP RO X CA S mode 10 5 \` CF se lects E X A CT CAS mode
P age G-2 Θ Set/c lear s ys tem flag 117 (CHOO SE bo xe s vs . S OFT menus): H @) FLAGS —„ —˜ @@CHK@ Θ In AL G mode, SF(-117) selects S O FT menus CF(-117) se lects CHOO SE BO XE S . Θ In RPN mode , 117 \` SF se lects S OFT me nus 117 \` CF selec ts SOF T menus Θ Change an gular measur e: o T o degr ees: ~~deg` o T o r adian: ~~rad` Θ S pec ial c har acte rs: o Angle s y mbol ( ∠ ): ~‚6 o F actor ial s ymbol (!): ~‚2 o Degr ee s y mbol ( o ) : ~‚ (hold) 6 Θ L ock/unloc k alpha k ey boar d: o Loc k alpha ke yboar d (upper cas e) : ~~ o Unlock alpha k ey boar d (upper case): ~ o Loc k alpha ke yboar d (lo w er case): ~~„~ o Unloc k alpha ke yboar d (lo w er case ) : „~~ Θ Gr eek let te rs: Alpha ( α ): ~‚a Beta ( β ): ~‚b DEL T A ( Δ ): ~‚c D e lta (d) : ~‚d Ep silon ( ε ): ~‚e Rho (ρ ): ~‚f Mu ( μ ): ~‚m Lam b da (λ ): ~‚n PI ( Π ): ~‚p Sigma (σ ): ~‚s Th eta ( θ ): ~‚t Ta u ( t ) : ~‚u Omega ( ω ): ~‚v
P age G-3 Θ S y stem- le vel operation (H old $ , r elease it after enter ing second or thir d k e y) : o $ (hold) AF : “Cold” r estart - all memory era sed o $ (hold) B : Cancels k e y str ok e o $ (hold) C : “W arm ” r est ar t - memory pr eserv ed o $ (hold) D : St ar ts inter ac tiv e self-test o $ (hold) E : St ar ts contin uous self-test o $ (hold) # : Deep-sleep sh utdo w n - timer off o $ (hold) A : P erforms disp la y scr een dump o $ (hold) D : Cancels ne xt repeating alar m Θ Menu s not accessible thr ough k e yboar d: In RPN, enter menu_number , type MENU . In AL G mode , type MENU(men u_number ) . Menu_numbe r is one of the fo llo w ing: o S T A T so ft menu: 9 6 o PL O T soft me nu: 81 o S OL VE soft menu: 7 4, or us e ‚ (hold) 7 o UT ILITY soft menu: 113 Θ Other menu s: o MA THS men u: ~~maths` o MAIN menu : ~~main` Θ O th e r keyb o a rd sh or t cu ts : o ‚ (hold) 7 : SOL VE menu (menu 7 4) o „ (hold) H : PR G/MODE S menu (Chapte r 21) o „ (hold) ˜ : St ar ts t e xt editor (A ppendi x L) o „ (hold) § : HO ME() , go to HOME dir ector y o „ (hold) « : R eco v er last acti ve menu o ‚ (hold) ˜ : List contents o f var iables or menu entr ies o ‚ (hold) ± : PR G/CHAR menu (Chapter 21) o ~‚Í : Changes ins ertion mode
P age H-1 Appendi x H T he CAS help facilit y T he CAS help f ac ilit y is a vaila ble thro ugh the k ey str ok e sequence I L @HELP ` . T he f ollo w ing sc r een shots sh o w the fir st menu page in the listing of the CAS help fac i lity . T he commands ar e listed in alphabeti cal or der . Using the v er ti cal arr o w k e ys —˜ one can na v igat e thr ough the help fac ilit y lis t . Some us eful hin ts on na vi gating thr ough this f ac ility ar e sho w n next: Θ Y ou can hold do w n the do wn ar r o w k e y ˜ and wa tch t he sc r een until the command y ou ’r e looking f or sho w s up in the sc r een . At this poin t , y ou can r elease the do wn arr ow k ey . Mo st lik el y the command of inter est w ill no t be select ed at this po int (y ou may o v ershoo t or under shoot it). How ev er , yo u can use the v ertical k e ys —˜ , one str ok e at a time , to locate the command y ou w ant , and then pr ess @@OK@@ . Θ If , while holding do w n the do wn ar r o w k e y ˜ y ou ov er shoot the command of inter est , y ou can hold dow n the up arr o w k e y — to mo ve bac k to war d s that command. R efine the selecti on w ith the ver t ica l keys —˜ , one str oke at a time. Θ Y ou can type the f irs t letter of the co mmand of inter est , and then us e the do w n arr o w k e y ˜ to locate that par ti c ular command. F or e x ample , if y ou ’r e looking f or the command DERIV . A fter acti vating the help faci lit y ( I L @HELP ` ), ty p e ~d . This w ill s elect the f irst o f the commands that start w ith D , i .e., DE GREE . T o f ind DERIV , pr ess ˜ , twi ce . T o a c ti vate the command, pr ess @@OK@@ .
P age H-2 Θ Y ou ca n type t w o or m or e letters of t he com mand of interest , by locking the alphabeti c k e y boar d. T his w ill tak e yo u to the command of int er est , or to its nei ghborhood. A fterwar d s, y ou need to unloc k the alpha k e yboar d, and u se the v ertical arr ow k ey s —˜ to locate the command , if needed. Pr ess @@OK@@ to locate the to acti vate the command . F or e x ample , to locate the command P R OPFRA C, y ou can use , on e of th e follo wing ke y strok e sequ ences: I L @HELP ` ~~pr ~ ˜˜ @@OK@ @ I L @HELP ` ~~pro ~ ˜ @@OK@ @ I L @HELP ` ~~prop ~ @@OK@@ See Appendi x C f or mor e informati on on the CAS (Comput er Algebr aic S y ste m) . Appendi x C includes other e xample s of appli cation of the CAS help faci lit y .
Pa g e I - 1 Appendi x I Command catalog list T his is a l ist of all commands in the command catalog ( ‚N ) . Those commands that belong t o the CA S (C omput er Algebr aic S y stem) ar e lis ted also in Appendi x H. CAS help f ac ilit y en tri es ar e a vailabl e for a gi v en command if the so ft menu k ey @HELP sho ws up w hen yo u highli ght that partic ular command . Pr ess this soft menu k e y to get the CA S help fac ility entr y f or the command. T he f irst f e w sc r eens of the catalog ar e sho wn belo w: Use r -installed libr ary commands wo uld also appear o n the command catalog list , using itali c fo nt . If the libr ar y inc ludes a help item , then the so ft menu k ey @HELP sho ws up w hen y ou highlight thos e user -cr eated commands.
Pa g e J - 1 Appendi x J T he MA THS me nu T he MA THS menu , accessible thr ough the command MA THS (av ailable in the catalog N ) , con tains the fo llo w ing sub-menu s: T he CMPLX sub-menu T he CM P L X su b-menu contains fu nctions pertinent to oper ations w ith complex numbers: T hese f uncti ons are des cr ibed in Chapter 4. T he CONST ANTS sub-menu T he CONS T ANT S sub-menu pr o v ide s access to the calc ulator mathematical cons tants . Thes e are de sc ri bed in Chapte r 3:
Pa g e J - 2 T he HYPERBOLIC sub-menu T he HYPERB OLIC sub-menu co ntains the h y perboli c func tio ns and their in v ers es . T hese f unctions ar e descr ibed in Chapter 3 . T he I NTE GER sub-menu T he INTEGER su b-menu pr o v ides f uncti ons for manipulating integer number s and some pol ynomi als. T hese f unctions ar e pre sented in Cha pter 5: T he MO DULAR sub-menu T he MOD ULAR sub-menu pr o v ides f unctions f or modular arithmeti c w ith number s and poly nomi als. T hes e functi ons ar e pre sented in Cha pter 5:
Pa g e J - 3 T he POL YNOM IAL sub-menu T he POL YNOMIAL sub-men u includes f uncti ons for ge ner ating and manipulating pol yno mials . The se func tions ar e pr es ented in Chapte r 5: T he TES T S sub-menu T he TE S TS su b-menu inc ludes r elati onal oper ator s (e .g ., ==, <, etc .) , logical oper ators (e .g., AND , OR, et c.), the IFTE f uncti on, and the A SS UME and UNA S SUME commands . R elational and logi cal oper ators ar e pre sented in C hapter 21 in the conte xt of pr ogr amming the calculator in U ser RPL language . T he IFTE functi on is intr oduced in Cha pter 3 . F unc tions A S SUME and UNA S S UME are pr esented ne xt , using their CA S help f ac ility entr ies (see A ppendi x C) . ASSUME UNASSUME
Pa g e K - 1 Appendi x K Th e MA I N m en u T he MAIN menu is av ailable in the command catalog . This menu inc lude the fo llo w ing sub-menu s: T he CASCF G command T his is the f irs t entr y in the MAIN menu . T his command conf igur es the CA S . F or CA S conf igur ation inf orm atio n see A ppendi x C. T he AL GB sub-menu T he AL GB sub-menu inc ludes the f ollo w ing commands: T hese f uncti ons, ex cept for 0.MAIN MENU and 11.UNA S S IGN are a v ailable in the AL G k e y board me nu ( ‚× ) . Detailed e xplanation of the se func tions can be f ound in Chapt er 5 . F unction UN AS SIGN is des cr i bed in the f ollo wi ng entry fr om the CA S men u:
Pa g e K - 2 T he DIFF sub-m enu T he DI FF sub-me nu contains the f ollo w ing f unctio ns: T hese f unctions ar e also av ailable thr ough the CAL C/DI FF sub-menu (s tart wi th „Ö ) . T hese f uncti ons ar e desc r ibed in Chapte rs 13, 14, and 15, e x cept fo r func tion TR UNC, w hic h is desc r ibed next us ing its CAS help f ac ilit y en tr y : T he MA THS sub-menu T he MA THS men u is desc r ibed in detail in Appendi x J . T he TRIGO sub-menu T he TRIGO menu contains the f ollo w ing func tio ns:
Pa g e K - 3 T hese f uncti ons are als o av ailable in the TRIG menu ( ‚Ñ ) . Description of these f uncti ons is incl uded in C hapter 5 . T he SOL VER sub-m enu T he S OL VER menu include s the fo llo w ing func tions: T hese f uncti ons are a v ailable in the CAL C/S OL VE menu (st art with „Ö ). T he functi ons ar e des cr ibed in Cha pters 6, 11, and 16 . T he CMPLX sub-menu T he CMPLX me nu inc ludes the f ollo w ing func tions: T he CMPLX menu is also a vaila ble in the k ey boar d ( ‚ß ) . So me of the func tions in CMPLX ar e also av ailable in the MTH/C OMP LEX menu (s tart with „´ ) . Compl e x num ber funct i on s are presented in Chapter 4. Th e A R IT s u b- m en u T he ARIT men u include s the foll ow ing sub-menus:
Pa g e K - 4 T he sub-menus INTE GER , MODUL AR , and P OL YNOMIAL ar e pre sented in detail in Appe ndi x J. The E XP &LN sub-menu T he EXP&LN menu contains the follo w ing functions: T his menu is also acces sible thr ough the k e yboar d by using „Ð . T he functi ons in this menu are pr esented in Chapter 5 . T he MA TR sub-m enu T he MA TR menu contains the follo wing f unctions: T hese f uncti ons ar e also a vaila ble thr ough the MA TRICE S menu in the k e yboar d ( „Ø ) . T he func tio ns ar e desc r ibed in Chapter s 10 and 11. T he REWRI TE sub-menu T he REWRI TE menu cont ains the follo wing f uncti ons:
Pa g e K - 5 T hese f uncti ons ar e av ailable thr ough the CONVER T/REWR ITE me nu (start w ith „Ú ) . T he func tions ar e pr esent ed in Chapter 5, ex cept for f uncti ons XNUM and XQ , whi ch ar e desc ribed ne xt using the corr es ponding entr ies in the CA S help fac i lity ( IL @HELP ): XNUM X Q
Pa g e L - 1 Appendi x L L ine editor commands When y ou tr igger the line editor b y u sing „˜ in the RPN stac k or in AL G mode , the follo wing s oft menu f unctions ar e pr ov ided (pr ess L to see the r emaining fu nctions): T he functi ons ar e br ief ly de sc ribed as follo ws:  SKIP: Skips char acters t o beginning of w or d. SKIP  : Skips char acte rs to end of w or d .  DEL : D elete c haracters to beginnin g of w or d. DEL  : D elete c har acters to end of wo rd . DEL L: Delete c har act er s in line . INS: When sele cted inser ts c ha r acters at cursor locat i on. If not selecte d , the c ursor r eplaces char acter s (o verw r ites) inst ead of inse r ting c har acte rs. EDIT : E dits selec tion .  BE G: Mo v e to beginning o f w or d .  END: Mark end o f selecti on. INFO: Pr o vi des inf or mation on C ommand L ine editor , e .g .,
Pa g e L - 2 T he items sho w in this scr e en are s elf-e xplanator y . F or e x ample , X and Y positi ons mean the po sition on a line (X) and the line number (Y ) . Stk Siz e means the number of ob jects in the AL G mode history or in the RPN stac k. Mem(KB) means the amount o f fr ee memory . Clip Si z e is the number of c har acte rs in the clipboar d. Sel S i z e is the number o f char acter s in the cur r ent sele ction . EXE C: Ex ecu te command select ed. HAL T : S top co mmand ex ec uti on . T he line editor als o pr o v ide the f ollo w ing sub-men us: SEARCH: S earc h c harac ters or w or ds in the command line . It include s the fo llo w ing fu ncti ons: GO T O: Mo v e to a desir ed location in the command line . It include s the fo llo w ing fu ncti ons: Sty le: T ext s t y les that can be us ed in the comma nd line:
Pa g e L - 3 T he SEARCH sub-menu T he functi ons of the SE ARCH sub-me nu ar e: Fi n d : Use this functi on to find a str ing in the command line . The input f orm pr o v ided w ith this command is sho wn next: Rep l ac e : Use this co mmand to f ind and r eplace a s tr ing. T he input f or m pr o v ided for this co mmand is: F ind next .. : F inds the next s ear ch patter n as def ined in F ind Re place Selecti on : Replace selec tio n with r epla ce ment pat ter n def ined w ith R eplace command. R eplace/F ind Next : Replace a patter n and sear ch f or another occ urr ence . The patter n is def ined in R eplace . Rep l ac e Al l : R eplace all occ urr ence o f a certain patte rn . T his co mmand as ks fo r confir mation f rom the user bef ore replac ing pattern . Fa st R e p la c e A l l : R eplace all occur r ences o f a certain patter n w ithout c hec king w ith the user .
Pa g e L - 4 T he GO T O sub-menu T he functi ons in the GO T O sub-men u are t he follo w ing: Goto L ine: to mo ve to a spec ifi ed line. T he input fo rm pr o v ided w ith this command is: Goto P ositi on : mov e to a spec ifi ed position in the command line . The input fo rm pr o v ided f or this command is: Lab els : mo v e to a spec if ied label in the co mmand line . T he St y le sub-menu Th e St yl e s u b- me nu in clu d es th e fo ll owin g s t yle s: BOL : Bold IT A LI : Italics UNDE : Under line : In ver se T he command FONT allo w the user to select the f ont f or the command editor . Ex amples of the differ ent styl es ar e sho wn belo w:
Pa g e L - 5
Pa g e M - 1 Appendi x M T abl e o f Built-In Equations T he E quation Libr ar y consists o f 15 sub jects cor r esponding t o the secti ons in the table belo w) and mor e than 100 titles. T he n umbers in par e ntheses belo w indicat e the number of equati ons in the set and the number of v ari ables in the set . T here ar e 315 equati ons in total using 3 9 6 var iable . Subjec ts and T itles 1 : C olumns and Beams ( 1 4, 20) 1: Elasti c Buckling ( 4, 8) 6: Simple Sheer (1, 7) 2 : E ccentr ic C olumns (2 , 11) 7 : C antile ver De flecti on (1, 10) 3: Simple Deflec tion (1, 9) 8: C antilev er Slope (1, 10) 4: Simple Slope (1, 10) 9 : Cantile v er Moment (1, 8) 5: Simple Moment (1, 8) 10: C antilev er Shear (1, 6) 2: E le ct r i ci ty (4 2, 5 6) 1: Co ulomb ’s La w (1, 5) 13: Capac itor Char ge (1, 3) 2 : Ohm ’s La w and P o w er ( 4, 4) 14: DC Induct or V oltage (3, 8) 3: V oltage Di v ider (1, 4) 15: RC tr ansi ent (1, 6) 4: C urr ent Di v ider (1, 4) 16: RL tr ansient (1, 6) 5: Wir e R esis tance (1, 4) 17 : Re sonant F r equency ( 4 , 7) 6: Ser ies and P ar allel R (2 , 4) 18: Plat e Capac itor (1, 4) 7 : Seri es and P ar allel C (2 , 4) 19 : C ylindr i cal Capac itor (1, 5) 8: Ser ies and P ar allel L (2 , 4) 20: S olenoi d Inductance (1, 5 ) 9 : Capac ita nce Ener gy (1, 3) 21: T or oi d Inductance (1, 6) 10: Inducti v e Energ y (1, 3) 2 2 : Sinuso idal V oltage (2 , 6) 11: RL C Curr ent Dela y (5, 9 ) 2 3 : Sinu so idal Cur r ent (2 , 6) 12 : DC Ca pac itor C urr ent (3, 8)
Pa g e M - 2 3: Fluids ( 2 9 , 29) 1: Pr essur e a t D epth (1, 4) 3: F lo w w ith Lo ss es (10, 17) 2 : Bernoulli E quation (10, 15 ) 4: F lo w in F ull P ipes (8 , 19) 4 : F o r ces an d Energy (3 1 , 3 6) 1: L inear Mechanic s (8, 11) 5: ID Elas tic Collisi ons (2 , 5) 2 : Angular Mec hanics (12 , 15 ) 6: Dr ag F or ce (1, 5) 3: Centr ipetal F or ce (4 , 7) 7 : L aw of Gra vitati on (1, 4) 4: Hook e ’s La w (2 , 4) 8: Mass–Ener gy Relatio n (4 , 9) 5: Gases ( 1 8 , 2 6) 1: Ideal Gas La w (2 , 6) 5: Isentr opic F low ( 4, 10) 2 : Ideal Gas State Change (1, 6) 6: R eal Gas La w (2 , 8) 3: Isother mal Expansion ( 2 , 7) 7 : Real Gas S tate Change (1, 8) 4: P olytr opi c Pr ocesse s (2 , 7) 8: K inetic T heor y ( 4, 9) 6 : He at T ransfer ( 1 7 , 3 1 ) 1: Heat Capac ity (2 , 6) 5: Conduc tion and 2 : Ther mal Expansion ( 2 , 6) Con v ecti on ( 4, 14)) 3: Condu ction ( 2 , 7) 6: Blac k Body R adiati on (5, 9) 4: Co nv ecti on (2 , 6) 7: M a g n e t i s m ( 4 , 1 4 ) 1: Str aight Wir e (1,5) 3: B F ield in S olenoi d (1, 4) 2 : F or ce Bet w een Wir es (1, 6) 4: F i eld in T or oi d (1, 6) 8: Motion (22, 2 4 ) 1: L inear M oti on (4 , 6) 5: C ir c ular Motion (3, 5) 2 : Object in F r ee F all (4 , 5) 6: T erminal V eloc it y (1, 5) 3: Pr oj ectile Moti on (5, 10) 7 : Es cape V eloc ity (1, 14) 4: Angular Motion ( 4, 6)
Pa g e M - 3 9: Op ti cs ( 1 1 , 1 4) 1: La w of Ref r acti on (1, 4) 4: Spher i cal Ref lecti on (3, 5) 2 : Criti cal Angle (1, 3) 5: Spher i cal Ref r acti on (1, 5) 3: Br ew ster’s L a w (2 , 4) 6: Thin L ens (3, 7) 1 0: Osc illations ( 1 7 , 1 7) 1: Mass–S pr ing S ys tem (1, 4) 4: T orsio nal P endulum (3, 7) 2 : Sim ple P endulum (3, 4) 5: Sim ple Harmoni c ( 4, 8) 3: Coni cal P endulum ( 4, 6) 1 1 : P l ane Geom etry ( 3 1 , 2 1 ) 1: Cir cle (5, 7) 4: Regular P oly gon (6 , 8) 2 : Ellipse (5, 8) 5: Cir c ular R ing ( 4, 7) 3: R ectangle (5, 8) 6: T r iangle (6 , 10 7) 1 2 : Solid Geometr y ( 1 8, 1 2) 1: Cone (5, 9 ) 3: P ar allelepiped ( 4, 9 ) 2 : C y linder (5, 9) 4: Spher e (4 , 7) 1 3 : Solid Sta te De vices ( 3 3, 5 3 ) 1: PN Step J unctio ns (8, 19 ) 3: Bipolar T r ansistor s (8, 14) 2 : NMOS T r ansistor s (10, 2 3) 4: J FE T s ( 7 , 15 ) 1 4 : Stress Analy sis ( 1 6, 28 ) 1: Normal S tr ess ( 3, 7) 3: Str es s on an Element (3, 7) 2 : Shear Str es s (3, 8) 4: Mohr’s C ir cle ( 7 , 10) 1 5 : W ave s (1 2 , 1 5 ) 1: trans vers e W av es (4 , 9) 3: Sound W ave s (4 , 8) 2: Lon g i tu d i na l W ave s (4, 9)
Pa g e N - 1 Appendi x N Inde x 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 Measur e 1-23 Angle symbol ( ∠ ) G-2 Angle units 22-27, 22-29 , 22-33 Angula r measure G-2 ANIMATE 22-27 Animating graphi cs 22-26 Animation 22-26 Anti-derivatives 13-14 Approximate CAS mode C-4 Approximate vs. Exact CAS mode C- 4 APPS menu F-1 ARC 22-21 AREA in plots 12-6 Area units 3-19 ARG 4-6 ARITHMETIC menu 5-9 ASIN 3-6 ASINH 3-9 ASN 20-6 ASR 19-6 ASSUME J-3 ATAN 3-6 ATANH 3-9 ATICK 22-7 Augmented matrix 11-32 AUTO 22-3 AXES 22-8, 22-13 AXL 9-24 AXM 11-16 AXQ 11-53 B B  R 19-3
Pa g e N - 2 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 3-16 CALCULATOR MODES input form C-1 Calculator restart G-3 Calculus 13- 1 Cancel next repeating alarm G-3 Cartesian representation 4-1 CAS help facility listing H-1 CAS HELP facility C-10 CAS independent variable C-2 CAS menu.. F-6 CAS modulus C-3 CAS settings 1-26, C-1 CASDIR 2-35 CASE construct 21-51 CASINFO 2-37 Cauchy equation 16-51 CEIL 3-14 CENTR 22-7 Chain rule 13-6 Change sign 4-6 Character set D-1 Character strings 23-1 Characteristic polynomial 11-45 Characters list 23-3 CHARS menu 23-2 Chebyshev polynomials 16-55 CHINREM 5-10, 5-17 Chi-square distribution 17-11 CHOOSE 21-31 Choose box 21-31 CHOOSE boxes 1-4 CHR 23-1 CIRCL 12-45 Class boundaries 18-6 Class marks 18-5 Classes 18-5 CLKADJ 25-3
Pa g e N - 3 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 no rm 11-7 Column vectors 9-18 COL- 10-2 0 COMB 1 7-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. Real CAS mode C-6 Composing lists 8-2 CON 10-8 Concatenation operator 8-4 COND 11-10 Condition number 11-10 Confidence intervals for the variance 18-33 Confidence intervals in linear regres- sion 18-52 Confidence intervals 18-22 Conic curves 12-20 CONJ 4-6 CONLIB 3-29 Constants lib F-2 Continuous self-test G-3 CONVERT 3-27 CONVERT Menu 5-26 Convolution 16-47 Coordinate System 1-24 Coordinate transformation 14-9 COPY 2-27 Correlation coef ficient 18-11 COS 3-7 COSH 3-9 Covariance 18-11 CRDIR 2-41 Creating subdirectories 2-39 CROSS 9-11 Cross product 9-11 CST 20-1 CSWP 10-20 Cumulative distribution function 17-4 Cumulative fr equency 18-8 Curl 15-5 CURS 2-20 CUT 2-27 CYCLOTOMIC 5-10 CYLIN 4-3 D D  R 3-14 DARCY 3-32 DATE 25-3 Date functions 25-1 Date setting 1-7 DATE 25-3
Pa g e N - 4 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 13-12 Derivatives higher order 13-13 Derivatives implicit 13-7 Derivatives of equations 13-7 Derivatives partial 14-1 Derivatives step-by-step 13-16 Derivatives with ∂ 13-4 DERVX 13-3 DESOLVE 16-7 DET 11-12 De-tagging 21-33 Determinants 11-13, 11-40 DIAG  10-13 Diagonal matri x 10-13 DIFF menu 16-3 DIFFE sub-menu 6-29 Differential equation graph 12-26 Differential equations 16-1 differential equations 12-26 Differential equations, Fourier series 16-40 Differential equations, graphical solu- tions 16-57 Differential equations, Laplace trans- form 16-16 Differential equations, linear 16-4 Differential equations, non-linear 16- 4 Differential equations, numerical solu- tions 16-57 Differential equations, slope fields 16- 3 Differential equations, solutions 16-2 Differential, total 14-5 Differentials 13-19 Dirac’s delta function 16-15 Directional derivative 15-1 Display adjustment 1-2 Display font 1-27 Display modes 1-27 Display screen dump G-3
Pa g e N - 5 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 END 2-27 ENDSUB 8-11 Energy units 3-20 Engineering format 1-21 ENGL 3-30 Entering vectors 9-2 EPS 2-37 EPSX0 5-22 EQ 6-26 Equation Library F-6, M-1 Equation Library 27-1 Equation Writer (EQW) 2-10 Equation writer properties 1-29 Equation Writer, Selection Tree E-1 Equations, linear systems 11-17 Equations, solving 27-1 EQW BIG 2-11 CMDS 2-11 CURS 2-11 Derivatives 2-30 EDIT 2-11 EVAL 2-11 FACTOR 2-11 HELP 2-11 Integrals 2-32 SIMPLIFY 2-11 Summations 2-29 ERASE 12-20, 22-4 ERR0 21-65 ERRM 21-65
Pa g e N - 6 ERRN 21-65 Error trapping in programming 21-64 Errors in hypothesis testi ng 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 Fast 3D plots 12-34 Fast Fourier transform 16-47 Fast Replace All L-3 FCOEF 5-11 FDISTRIB 5-28 FFT 16-47 Fields 15-1 File manager.. menu F-4 Financial calculations 6-9 Find next.. L-3 Finite arithmetic ring 5-13 Finite population 18-3 Fitting data 18-10 Fixed format 1-19 Flags 24-1 FLOOR 3-14 FOR construct 21-59 Force units 3-20 Format SD card 26-10 FOURIER 16-26 Fourier series 16-26 Fourier series and ODEs 16-41 Fourier series for square wave 16-38 Fourier series for triangular wave 16-34 Fourier series, complex 16-26 Fourier transforms 16-42 Fourier transforms, convolution 16-47 Fourier transforms, definitions 16-45 FP 3-14 Fractions 5-23 Frequency distribution 18-5 FROOTS 5-11, 5-24 Full pivoting 11-35 Function plot 12-2 FUNCTION plot operation 12-13 FUNCTION plots 12-5
Pa g e N - 7 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 vari able 21-2 Global variabl e 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 animation 22-26 Graphics options 12-1 Graphics programming 22-1 Graphs 12-1 Graphs bar plots 12-29 Graphs conic curves 12-20 Graphs differential equations 12-26 Graphs Fast 3D plots 12-34 Graphs Gridmap plots 12-40 Graphs histograms 12-29 Graphs parametric 12-22 Graphs polar 12-18 Graphs Pr-Surface plots 12-41 Graphs saving 12-7 Graphs scatterplots 12-31 Graphs slope fields 12-33 Graphs SYMBOLIC menu 12-49 Graphs truth plots 12-28 Graphs wireframe plots 12-36 Graphs Y-Slice plots 12-39 Graphs Zooming 12-47 GRD 3-1 Greek letters G-2 Greek letters D-3 Gridmap plots 12-40 GROB 22-29 GROB menu 22-31 GROB programming 22-33 GROBADD 12-50 Grouped data 8-18 Grouped data statistics 8-18 Grouped data variance 8-19 GXOR 22-32 H HADAMARD 11-5 HALT L-2 Harmonic mean 8-15 HEAD 8-11 Header size 1-30 Heaviside’s step function 16-15
Pa g e N - 8 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 Histogram s 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-10 IBERNOULLI 5-10 ICHINREM 5-10 Identity matrix 11-6 identity matrix 10-1 IDIV2 5-10 IDN 10-9 IEGCD 5-10 IF...THEN..ELSE...END 21-48 IF...THEN..END 21-47 IFERR sub-menu 21- 65 IFTE 3-36 ILAP 16-11 Illumination units 3-21 IM 4-6 IMAGE 11-55 Imaginary part 4-1 Improper integrals 13-20 Increasing-power CAS mode C-9 INDEP 22-6 Independent variable in CAS C-2 Infinite seri es 13-20 Infinite seri es 13-22 INFO 22-3 INPUT 21-22 Input forms programming 21- 21 Input forms use of A-1 Input string prompt programming 21-21 Input-output functions menu F-2 INS L-1 INT 1 3-14 Integer numbers C - 5 Integers 2- 1 Integrals 13-14 Integrals definite 13-15 Integrals double 14-8 Integrals improper 13-20 Integrals multiple 14-8
Pa g e N - 9 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 func- tions 17-13 Inverse function graph 12-11 Inverse Laplace transforms 16-10 Inverse matrix 11-6 INVMOD 5-11 IP 3-14 IQUOT 5-10 IREMAINDER 5-10 Irrotational fields 15-5 ISECT in plots 12-6 ISOL 6-1 ISOM 11-55 ISPRIME? 5-10 ITALI L-4 J Jacobian 14-9 JORDAN 11 -47 K KER 11-56 Key Click 1- 25 Keyboard B- 1 Keyboard ALPHA characters B-9 Keyboard ALPHA-left-shift characters B-10 Keyboard ALPHA-right-shift charac- ters B-12 Keyboard alternate key functions B-4 Keyboard left-shift functions B-5 Keyboard main key functions B-2 Keyboard right-shift functions B-8 Kronecker’s delta 10-1 L LABEL 12-45 Labels L-4 LAGRANGE 5-11, 5-19 Laguerre’s equation 16-56 LAP 16-11 LAPL 15-4 Laplace transforms 16-10 Laplace transforms and ODEs 16-17 Laplace transforms inverse 16-10 Laplace transforms theorems 16-12 Laplace’s equation 15-4 Laplacian 15-4 Last Stack 1-25 LCM 5-11, 5-20 LCXM 11-16 LDEC 16-4 Least-square function 11-22, 11-24 Least-square method 18-50
Pa g e N - 1 0 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 differ ential equations 16-4 Linear regression additional notes 18- 50 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 LINSOLVE 11-41 LIST 2-34 LIST menu 8-8 List of CAS help facility H-1 List of command catalog I- 1 Lists 8-1 LN 3-6 Ln(X) graph 12-8 LNCOLLECT 5-5 LNP1 3-9 Local variables 21-2 LOG 3-5 LOGIC menu 19-5 Logical operators 21-43 Lower-triangular matrix 11-50 LQ 11-49, 11-51 LQ decomposition 11-49 LSQ 11-24 LU 11-49 LU decomposition 11-49 LVARI 7-11 M Maclaurin series 13-23 MAD 11-48 Main diagonal 10-1 MAIN menu G-3 MAIN menu K-1 MAIN/ALGB menu K-1 MAIN/ARIT menu K-3 MAIN/CASCFG command K-1 MAIN/CMPLX menu K-3 MAIN/DIFF menu K-2 MAIN/EXP&LN menu K-4 MAIN/MATHS menu (MATHS menu) J-1 MAIN/MATR menu K-4 MAIN/REWRITE menu K-4 MAIN/SOLVER menu K-3 MAIN/TRIGO menu K-2 Manning’s equation 21-15 MANT 3-14 MAP 8-12 MARK 12-44
Pa g e N - 1 1 Mass units 3-20 Math menu.. F-5 MATHS menu G-3, J-1 MATHS/CMPLX m enu J-1 MATHS/CONSTANTS menu J-1 MATHS/HYPERBOLIC menu J-2 MATHS/INTEGER menu J-2 MATHS/MODULAR menu J-2 MATHS/POLYNOMIAL menu J-3 MATHS/TESTS menu J-3 matrices 10-1 Matrix "division" 11-27 Matrix augmented 11-32 Matrix factorization 11-49 Matrix Jordan-cycle decomposition 11-47 MATRIX menu 1 0-3 Matrix multiplication 11-2 Matrix ope rations 11-1 Matrix Quadratic Forms 11-52 Matrix raised to a power 11-5 Matrix term-by-term multiplication 11-4 Matrix transpose 10-1 Matrix writer 9-3 Matrix Writer 10 -2 MATRIX/MAKE menu 10-3 Matrix-vector multiplication 11-2 MAX 3-13 Maximum 13-12, 14-5 MAXR 3-16 Mean 18-3 Measures of central tendency 18-3 Measures of spreading 18-3 Median 18-3 Memory 26-1 to 26-10 MENU 12-46 Menu numbers 20-2 Menus 1-3 Menus not accessible through key- board G-3 MES 7-9 Message box programming 21-37 Method of least squares 18-50 MIN 3-13 Minimum 13-12, 14- 5 MINIT 7-12 MINR 3-16 MITM 7-11 MKISOM 11-56 MOD 3-13 Mode 18-4 MODL 22-13 MODSTO 5-11 Modular arithmetic 5-12 Modular inverse 5-16 Modular programming 22-35 MODULO 2-37 Modulus in CAS C-3 Moment of a force 9-16 MSGBOX 21-31 MSLV 7-4 MSOLVR 7-12 MTH menu 3-7 MTH/LIST menu 8-8 MTH/PROBABILITY menu 17-1 MTH/VECTOR menu 9-10 MTRW 9-3
Pa g e N - 1 2 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.SLV 6-13 Number Format 1-17 Number in bases 19-1 Numeric CAS mode C-3 Numeric solver menu F-3 Numeric vs. symbolic CAS mode C-3 Numerical solution of ODEs 16-57 Numerical solution to stiff ODEs 16- 65 Numerical solver 6-5 NUMX 22-10 NUMY 22-10 O OBJ  9-19 Objects 2-1, 24-1 OCT 19-2 Octal numbers 3-2 ODEs (ordinary differential equa- tions) 16-1 ODEs Graphical solution 16- 57 ODEs Laplace transform applications 16-17 ODEs Numerical solution 16-57 ODETYPE 16-8 OFF 1-2 ON 1-2 OPER menu 11-15 Operations with units 3-25 Operators 3-7 OR 19-5 ORDER 2- 34 Organizing data 2-33 Orthogonal matrices 11-50 Other characters D-3 Output tagging 21-33 P PA2B2 5- 10 Paired samp le tests 18-41 Parametric plots 12-22 PARTFRAC 5-5 Partial derivatives 14-1 Partial derivatives chain rule 14-4 Partial derivatives higher-order 14-3
Pa g e N - 1 3 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 PLOT operations 12-5 Plot setup 12-50 PLOT SETUP environment 12-3 PLOT WINDOW environment 12-4 PLOT/FLAG menu 22-13 PLOT/STAT menu 22-11 PLOT/STAT/DATA menu 22-12 PLOTADD 12-50 Plots program-generated 22-17 Poisson distribution 17-5 Polar coordinate plot 12-18 Polar coordinates doubl e integrals 14-9 Polar plot 12-18 Polar representation 4-1, 4-3 POLY sub-menu 6-29 Polynomial Equations 6-6 Polynomial fitting 18-59 Polynomials 5-17 Population 18-3 POS 8-11 POTENTIAL 15-3 Potential function 15-3, 15-6 Potential of a gradient 15-3 Power un its 3-20 POWEREXPAND 5-29 POWMOD 5-11 PPAR 12-3, 12-11 Prediction e rror linear regression 18-52 Pressure unit s 3-20 PREVPRIME 5 - 10 PRG menu shortcuts 21-9 PRG menu 21-5 PRG/MODES/KEYS sub-menu 20-5 PRG/MODES/MENU menu 20-1 PRIMIT 2-37 Probability 17-1 Probability density function 17-6 Probability distributions continuous
Pa g e N - 1 4 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 pr ompt 21-21 Programming interactive input 21-19 Programming message box 21-37 Programming modular 22-35 Programming output 21-33 Programming plots 22-14 Programming sequential 21-19 Programming tagged output 21-34 Programming using units 21-37 Programming with GROBs 22-33 Programs with drawing functions 22-24 PROOT 5-21 PROPFRAC 5-10 , 5-23 Pr-Surface plots 12-41 Ps-Contour plots 12 -38 PSI 3-1 5 PTAYL 5-11, 5-21 PTYPE 22-4 Purging from SD card 26-11 PUT 8-10 PUTI 10-6 PVIEW 22-22 PX  C 19-7 Q QR 11-52 QR decomposition 11-52 QUADF 11-52 Quadratic form diagonal representa- tion 11-53 QUOT 5-11, 5-21 QXA 11-53 R R  B 19-3 R  C 4-6 R  D 3-14 R  I 5-27 RAD 3-1 Radians 1-23 Radiation units 3-21 RAND 17-2 Random numbers 17-2 RANK 11-11 Rank of a matrix 11-9, 11-11 RANM 10-11 RCI 10-25 RCIJ 10-25 RCLKEYS 20-6
Pa g e N - 1 5 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. RREF, rref 11-43 Relational operators 21-43 REMAINDER 5-11, 5-21 RENAM 2-34 REPL 10-12 Replace L-3 Replace All L-3 Replace Selection L-3 Replace/Find Next L-3 RES 22-6 RESET 22-8 Restart calculator G-3 RESULTANT 5-11 Resultant of forces 9-15 REVLIST 8-9 REWRITE menu 5-27 Right-shift functions B-8 Rigorous CAS mode C-10 RISCH 13-14 RKF 16-67 RKFERR 16-7 1 RKFSTEP 16-69 RL 19-6 RLB 19-7 RND 3-14 RNRM 11-9 ROOT 6-26 ROOT in plots 12-5 ROOT sub-menu 6-26 Row norm 11-9 Row vectors 9-18 ROW 10-23 ROW  10-23 ROW- 10-24 RR 19-6 RRB 19-7 RRK 16-68 RSBERR 16-71 RSD 11-44 RSWP 10-24 R ∠ Z 3-2 S Saddle point 14-5 Sample correlation coefficient 18-11 Sample covariance 18-11 Sample vs. population 18-5 Saving a graph 12-7 Scalar field 15-1 SCALE 22-7 SCALEH 22-7 SCALEW 22-7 Scatterplots 12-31 Scientific format 1-20 Scope global variable 21-4 SD cards 26-7 to 26-11
Pa g e N - 1 6 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-2 9 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-1 SL 19-6 SLB 19-7 Slope fields 12-33 Slope fields for differential equations 16-3 SLOPE in plots 12-6 SNRM 11-8 SOFT menus 1-4 SOLVE 5-5, 6-2, 7-1, 27-1 SOLVE menu 6-26 SOLVE menu (menu 74) G-3 SOLVE/DIFF menu 16-67 SOLVEVX 6-3 SOLVR menu 6-26 SORT 2-34 Special characters G-2 Speed units 3-20 SPHERE 9-15 SQ 3-5 Square root 3-5 Square wave Fourier series 16-38 SR 19-6 SRAD 11-10 SRB 19-7 SREPL 23-3 SST 21-35 Stack properties 1-28 Standard deviation 18-4 Standard format 1-17 START ..STEP construct 21-58 START...NEXT construct 21-54 STAT menu 18-15 STAT menu (menu 96) G-3 Statistical inference probability distri- butions 17-9 Statistics 18-1 Step function (Heaviside’s) 16-15 Step-by-step CAS mode C-7 Step-by-step integrals 13-16 STEQ 6-14
Pa g e N - 1 7 Stiff differential equations 16-67 Stiff ODE 16- 66 Stiff ODEs numerical solution 16-67 STOALA RM 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 erro rs (SSE) 18-63 Sum of squared totals (SS T) 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 SYMBOLIC menu 12-49 Synthetic division 5-25 SYST2MAT 11-43 System flag (EXACT/APPROX) G-1 System flag 117 (CHOOSE/SOFT) 1- 5, G-2 System flag 95 (ALG/RPN) G-1 System flags 24-3 System of equations 11-18 System-level operation G-3 T Table 12-17, 12-25 TABVAL 12-50, 13-9 TABVAR 12-50, 13-10 Tagged output programming 21-34 TAIL 8-11 TAN 3-7 TANH 3-9 Taylor polynomial 13-23 Taylor series 13-23 TAYLR 13-24 TAYLR0 13-24 TCHEBYCHEFF 5-22 Tchebycheff polynomials 16-55 TDELTA 3-33 Techniques of integration 13-18 Temperature units 3-20 TEXPAND 5-5 Text editor.. menu F-5 Three-dimensional plot programs 22- 15 Three-dimensional vector 9-12 TICKS 25-3 TIME 25-3 Time & date... menu F-3 Time functions 25-1 TIME menu 25-1 Time setting 1-7, 25-2 TIME tools 25-2 Time units 3-19 Times calculations 25-4
Pa g e N - 1 8 TINC 3-34 TITLE 7-1 4 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 Transpos e 10-1 Triangle solution 7-9 Triangular wave Fourier series 16-34 TRIG menu 5-8 Trigonometric functions gr aphs 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 UFACT 3-28 UNASSIGN K-1 UNASSUME J-3 UNDE L-4 UNDO 2-62 UNIT 3-30 Unit prefixes 3-24 Units 3-17 Units in programming 21-37 Upper-triangular matrix 11-29, 11-33 USB port P-2 User RPL language 21-1 User-defined keys 20-6 Using input forms A-1 UTILITY menu (menu 113) G-3 UTPC 17-12 UTPF 17-13 UTPN 17-10 UTPT 17-11 UVAL 3-27 V V  9-11 VALUE 3-30 VANDERMONDE 10-13 Variable scope 21-4 Variables 26-1 Variance 18-4 Variance confidenc e intervals 18-33 Variance inferences 18-47 Vector analysis 15-1 Vector building 9-11
Pa g e N - 1 9 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. non-verbose CAS mode C-7 VIEW in plots 12-6 Viscosity 3-21 Volume units 3-19 VPAR 12-42, 22-10 VPOTENTIAL 15-6 VTYPE 24-2 V-VIEW 12-19 VX 2-37, 5-19 VZIN 12-48 W "Warm" calculator restart G-3 Weber’s equation 16-57 Weibull distribution 17-7 Weighted average 8-17 WHILE construct 21-63 Wireframe plots 12-36 Wordsize 19-4 X XCOL 22-13 XNUM K-5 XOR 19-5 XPON 3-14 XQ K-5 XRNG 22-6 XROOT 3-5 XSEND 2-34 XVOL 22-10 XXRNG 22-10 XYZ 3-2 Y YCOL 22-1 3 YRNG 22 -6 Y-Slice plots 12-39 YVOL 22-10 YYRNG 22-10 Z ZAUTO 12-48 ZDECI 12-48 ZDFLT 12-48 ZEROS 6-4 ZFACT 12-47 ZFACTOR 3-32 ZIN 12-47 ZINTG 12-48 ZLAST 12-47 ZOOM 12-18, 12-47 ZOUT 12-4 8 ZSQR 12-4 9 ZTRIG 12-4 9 ZVOL 22-1 0 Symbols  DEL L-1
Pa g e N - 2 0 ! 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
Pa g e LW- 1 L imited W arr ant y HP 5 0g graphing calc ulator ; W arr anty peri od: 12 months 1. HP war r ants to yo u , the end-user c us tomer , that HP har d war e, access or ies and suppli es w ill be fr ee fr om d e fec ts in mater ials and w orkmanship afte r the date of pur chas e , for the per iod s pecif ied abo v e . If HP r ecei ves noti ce of su ch def ects dur ing the w arr anty peri od, HP w ill, at its option , eithe r repair or r eplace p r oducts w hic h pr ov e to be def ecti v e . Replaceme nt pr oducts ma y be e ither ne w or lik e -ne w . 2. HP war rants t o y ou that HP softwar e wi ll not fail to e x ec ute its pr ogr amming instr ucti ons af t er the date of purc has e , for the pe ri od spec if ied abo v e , due to def ects in mater ial and w or kmanship when pr operl y ins talled and used . If HP r ecei ves noti ce of suc h defe cts duri ng the w arr anty per iod , HP w ill r eplace softw ar e media w hic h does not e x ecu te its pr ogr amming inst ructi ons due to suc h de fect s. 3. HP does not w arr ant that the oper ation of HP pr od uc ts w ill be uninter ru pted or err or fr ee. If HP is unable , w ithin a rea sonable time , to r epair or r eplace an y pr oduct to a co ndition as war rant ed , yo u w ill be entitled to a r ef und o f the p ur chase pr ice upon pr ompt retur n of the pr oduct w ith pr oof of pur chas e . 4. HP pr oducts ma y contain r emanuf actur ed par ts eq ui valen t to new in perfor mance or ma y hav e been subj ect to inc idental us e . 5. W arr anty does not appl y to def ects r esulting f r om (a) impr oper or inadequate mainte nance or calibrati on , (b) so ft w ar e , interfac ing , parts or suppli es not suppli ed b y HP , (c) unau thori z ed modificati on or misus e , (d) oper ation o utside of the pu blished env ir onmental spec ifi cations f or the pr oduct , or (e) impr oper site pr epar ation or maintenance . 6. HP MAKE S NO O THER EXP RE S S W ARRANT Y OR C ONDIT ION WHETHER WRI T TEN OR OR AL . T O THE EXTENT ALL OWED B Y L OCAL L A W , ANY IMPLIED W ARRANTY OR CO NDIT ION OF MER CHANT ABILITY , S A TI SF A CT OR Y QU ALI TY , OR FI TNE S S F OR A P AR TIC UL AR P URP OSE I S LIMI TED T O THE DURA TI ON OF THE E XPRE S S W ARR ANTY SET F ORTH ABO VE . Some countr ies , states or pr ov inces do not allo w limitati ons on the dur ation of an im plied w arr anty , so the abo v e limit ation o r ex clu sion mi ght not appl y to y ou . T his w arr ant y gi v es y ou spec ifi c legal ri ghts and yo u might also ha ve o ther ri ghts that vary fr om country to countr y , state to s tate , or pr o vince t o pr o v ince. 7. T O THE E XTENT ALL O WED B Y L OCAL L A W , THE REMEDI E S IN THIS
Pa g e LW- 2 W ARR ANTY S T A TEMENT ARE Y OUR SOLE AND EX CL US IVE REMEDIE S . EX CEPT A S INDICA TED ABO VE , IN NO EVENT WILL HP OR I T S S UP PLIER S BE LIABLE FOR L OS S OF D A T A OR F OR DIRE CT , SPE CIAL, INCIDENT AL , CON SE QUENT IAL (INCL UDING L O S T P ROFI T OR D A T A), OR O THER D AMA GE , WHETHER B ASED IN C ONTR A CT , T ORT , OR O THER WISE . Some countr i es, S tate s or pr o v inces do not allo w the e x clu sion or l imitation o f inc ide ntal or consequen tial damages , so the abo v e limitati on or e xc lusi on ma y not appl y to y ou . 8. The o nly w a r r antie s fo r HP pr oducts and s erv ices ar e set f orth in the e xpr ess w arr anty statements accompan y ing such pr oducts and servi ces . HP shall not be li able f or t echni cal or editori al err ors or omissi ons contained her ein . FOR CONSUMER TR ANS A CTIONS IN A USTRALIA AND NEW ZEALAND: THE W ARR ANTY TERMS CONT AINED IN TH IS S T A TEMENT , EX CEPT T O THE EXTENT LA WFULL Y P ERM I TTED , DO NO T EX CL UDE, RES TRICT OR MO DIFY AND ARE IN ADDI TION T O THE MAND A T OR Y ST A TUT OR Y RIGHTS AP P LICABLE T O THE SALE OF THIS PR ODUCT T O Y OU . Ser v ice Eur ope Country : Te l e p h o n e n u m b e r s Au str ia 4 3-1-3 60 2 77120 3 Belgium 3 2 - 2 - 712 6 219 Denmark 4 5-8- 2 3 3 2 844 E aster n E urope co untri es 4 2 0 -5 - 4 1 4 22 5 2 3 F inland 3 5 8-9-64000 9 F r ance 3 3-1- 4 9 9 3 9006 Ger man y 4 9-6 9-9 5 30 710 3 Gr eece 4 20 -5- 414 2 2 5 2 3 Holland 31- 2 -06 5 4 5 301 I t a l y 3 9 - 0 2 -75 4 1 978 2 N or way 4 7 - 6 3849 3 09 P or tugal 3 51- 2 2 9 5 7 0 200 Spain 3 4 -915-64 209 5 S wede n 4 6 -8 519 9 206 5
Pa g e LW- 3 Swi t ze r l a n d 41-1- 4 3 9 5 3 5 8 (German) 4 1 -2 2- 8 27878 0 ( F r e n c h ) 3 9-0 2 - 7 5419 7 8 2 (Italian) T urk e y 4 20 -5- 414 2 2 5 2 3 UK 44 - 20 7 - 4 5 80161 Cz ech R epubli c 4 20 -5- 414 2 2 5 2 3 South A f ri ca 2 7 -11- 2 3 7 6 200 L u xembour g 3 2 - 2 - 712 6 219 Other E ur opean coun tr ies 4 20 -5- 414 2 2 5 2 3 Asia P ac ific Country : Te l e p h o n e n u m b e r s Au str alia 61-3-9 841-5 211 Singapor e 61-3-9 841-5 211 L. America Country : Te l e p h o n e n u m b e r s Ar gentina 0 -810 -5 5 5-5 5 20 Br a zil Sao P aulo 3 7 4 7 - 77 9 9; RO T C 0 - 800-15 77 51 Me xi co M x C i t y 5 258 - 9 92 2 ; ROTC 0 1 - 800 - 4 7 2 -66 84 V enezuela 08 00 - 4 7 46 -8 3 6 8 Ch il e 8 00 - 360999 Co lumbia 9-800 -114 7 2 6 P e r u 0- 8 0 0- 1 0 1 1 1 Centr al Ameri ca & Car ibbean 1-8 00 - 711- 2 8 84 Guatemala 1-800 -99 9-5105 Pu e r t o R i c o 1 - 87 7 -232- 0 58 9 Costa Rica 0 - 800 -01 1-05 2 4 N.Amer ica Country : Te l e p h o n e n u m b e r s U .S . 1800 -HP INV ENT Canada (9 05) 206 - 4 6 6 3 or 800 - HP INVENT RO T C = R est of the countr y P lease logon to http://www .hp.com f or the lates t servi ce and support info rmation .
Pa g e LW- 4 Regulat or y inf ormation F edera l C o mmunications Commission Notice T his equipment has bee n tes ted and fo und to compl y w ith the limits for a C lass B digital de vi ce , pursuant t o P art 15 of the FCC R ules . T hese limits ar e designed to pr o v ide r easonable pr otection agains t harmf ul interfer ence in a r esidenti al installati on . This eq uipment gener ate s, us es, and can r adiate r adio fr equency ener g y and, if not inst alled and used in accordance w ith the instruc tions , may cause har mful interf er ence to radi o communicati ons. Ho we v er , there is no guar antee that interf er ence w ill not occur in a partic ular installati on. If this equipment doe s cause harmf ul interf er ence to r adio or tel ev ision r ecepti on, w hic h can be determined b y turning the equipme nt off and on, the u ser is encour aged to tr y t o corr ect the int erfer ence by one or mor e of the f ollo w ing measures: • Re o rie nt o r rel o c a te t h e re c eivi n g an t en n a. • Incr ease the separ ati on bet w een the equipment and the rece i ver . • Connec t the equipment into an outlet on a c ir c uit diffe r ent fr om that to w hich the r ecei ver is connected . • Consult the dealer or an e xperi enced r adio o r tele v ision t echni c ian f or help . Modifications T he FCC r equir es the us er to be notif ied that an y c hanges or modifi catio ns made to this dev ice that ar e not expr essly a ppr o ved b y Hew lett-P ack ar d Compan y may v oid the us er’s author ity to op er a t e the equ ipment . Cables Connec tions to this de vi ce mus t be made with shi elded cables w ith metallic RFI/ EMI connector hoods t o maintain compliance w ith FCC rule s and regulati ons . Declaration of Conf ormity for Pr oduc ts Mark ed with FCC Logo, United States Only
Pa g e LW- 5 This de v ice complie s with P ar t 15 of the FCC R ules. Oper ation is sub ject to the follo wing tw o c ondi tions: (1) this dev ice may not caus e harmful interf er ence , and (2) this de vi ce must accept an y interfer ence rece iv ed , including interf er ence that may ca use undesir ed oper ation . F or questi ons r egarding y our produc t, con tact: Hew lett -P ack ar d Compan y P . O . Box 6 92000, Mail Stop 5 30113 Houston, T ex as 77 2 6 9- 20 00 Or , cal l 1 - 80 0 - 4 7 4 - 6836 F or questi ons r egarding this FCC dec lar ation , contact: Hew lett -P ack ar d Compan y P . O . Box 6 92000, Mail Stop 510101 Houston, T ex as 77 2 6 9- 20 00 Or , cal l 1- 2 81-514 -3 3 3 3 T o identify this pr oduct , r efer to the part , ser ies, or model number found on the pr oduct . Canadian Notice This C lass B di gital appar atus meets all r equir em en ts of the Canadi an Interfer ence -Causing E quipment R egu l ations. Avis Can adi en Cet appar ei l numéri que de la class e B r especte tout es les ex igences du Règlement sur le m atér iel br ouilleur du Canada . European Union Regulatory No tice This pr od u ct complies w ith the foll ow ing E U Di r ecti ves: • Lo w V olt age Dir ecti v e 7 3/2 3/EE C • EMC Dir ecti ve 8 9/33 6/EEC Compli ance with thes e direc ti ves impli es confor mit y t o applicable har moni z ed E ur opean standards (E uropean Norms) w hic h ar e listed on the EU Dec larati on of Conf ormity issued by He wlett-P ack ard f or this produc t or pr oduct famil y .
Pa g e LW- 6 This compli ance is indicated b y the follo w ing confor mit y marking placed on the pr oduc t: Japanese Notice 䈖 䈱ⵝ⟎䈲䇮 ᖱႎಣℂⵝ⟎╬ 㔚ᵄ㓚ኂ⥄ⷙ೙ද⼏ળ (V CCI) 䈱ၮḰ 䈮 ၮ䈨 䈒 ╙ᖱႎᛛⴚⵝ⟎ 䈪 䈜 䇯 䈖 䈱ⵝ⟎䈲䇮 ኅᐸⅣႺ 䈪 ૶↪䈜 䉎 䈖 䈫 䉕 ⋡ ⊛ 䈫 䈚 䈩 䈇 䉁 䈜 䈏䇮 䈖 䈱ⵝ⟎䈏 䊤 䉳 䉥 䉇 䊁 䊧 䊎 䉳 䊢 䊮 ฃାᯏ 䈮ㄭធ 䈚 䈩 ૶↪ 䈘 䉏 䉎 䈫 䇮 ฃା㓚ኂ 䉕 ᒁ 䈐 ⿠ 䈖 䈜 䈖 䈫 䈏 䈅 䉍 䉁 䈜䇯 㩷㩷ขᛒ⺑᣿ ᦠ䈮 ᓥ 䈦 䈩 ᱜ 䈚 䈇 ข 䉍 ᛒ 䈇 䉕 䈚 䈩 䈒 䈣 䈘 䈇 䇯 K orean Notice Dispo sal of W aste Eq uipment b y Users i n Pri va te Househ old in the Eur opean Union This s ymbol on the pr oduct or on its pack aging indicates that thi s pr oduct mus t not be disposed of w ith your other household wast e. Instead , it is your r esponsibility to dispose of y our w aste equipment b y handing it ov er to a desi gnated collection po int for the r ecyc ling of wa ste electr ical and el ectr onic equipment . The separ ate collecti on and rec yc ling of y our wa ste equipment at the time of disposal w ill help to conserve natur al r esour ces and ensure that it is r ecy cled in a manner that prot ects human health and the env ir onment . F or mor e infor mation about w her e y ou can dr op off y our was te equipment for r ecy cling , please contact y our local c it y o ffice , your hou sehold wa ste disposal serv ice or the shop wher e you pur chased the pr oduct . This mark ing is v alid for non-T elec om pr odcts and EU harmoni zed T elecom products (e .g. Bluetooth) . xxxx* This marking is valid for E U no n-ha rmoni z ed T elecom products. *N oti f ied bo dy nu mbe r (us ed o nly if ap plica ble - refer t o th e prod uct label)