Download Print this page

HP 9g User Manual page 2

Graphing calculator
Hide thumbs Also See for 9g:

Advertisement

You can convert numbers from metric to imperial units and vice versa.
See Example 33. The procedure is:
1.
Enter the number you want to convert.
2.
Press [ 2nd ] [ CONV ] to display the units menu. There are 7
menus, covering distance, area, temperature, capacity, weight,
energy, and pressure.
3.
Press [
] or [
] to scroll through the list of units until the
appropriate units menu is shown, then press [
] .
4.
Press [
] or [
] to convert the number to the highlighted
unit.
Physics Constants
You can use the following physics constants in your calculations:
Symbol Meaning
c
Speed of light
299792458 m / s
g
Acceleration of gravity
9.80665 m.s
-11
G
Gravitational constant
6.6725985 × 10
N.m
Molar volume of ideal gas
0.0224141 m
Vm
NA
Avogadro's number
6.022136736 × 10
e
Elementary charge
1.602177335 × 10
m e
Electron mass
9.109389754 × 10
m p
Proton mass
1.67262311 × 10
h
Planck's constant
6.62607554 × 10
k
Boltzmann's constant
1.38065812 × 10
IR
Gas constant
8.3145107 J / mol • k
IF
Faraday constant
96485.30929 C / mol
mn
Neutron constant
1.67492861 × 10
µ
Atomic mass constant
1.66054021 × 10
ε
Dielectric permittivity
8.854187818 × 10
0
µ
Magnetic permittivity
0.000001257 H / m
0
Flux quantum
2.067834616 × 10
φ
0
a
Bohr radius
5.291772492 × 10
0
µB
Bohr magneton
9.274015431 × 10
µN
Neutron magnetic moment
5.050786617 × 10
To insert a constant:
1.
Position your cursor where you want the constant inserted.
2.
Press [ 2nd ] [ CONST ] to display the physics constants menu.
3.
Scroll through the menu until the constant you want is underlined.
4.
Press [
]. (See Example 34.)
Multi-statement functions
Multi-statement functions are formed by connecting a number of
individual statements for sequential execution. You can use
multi-statements in manual calculations and in the program
calculations.
When execution reaches the end of a statement that is followed by
the display result command symbol (
), execution stops and the
result up to that point appears on the display. You can resume
execution by pressing [
]. See Example 35.
Graphs
Built-in Function Graphs
You can produce graphs of the following functions: sin, cos, tan, sin
-1
-1
-1
-1
-1
cos
, tan
, sinh, cosh, tanh, sinh
, cosh
, tanh
,
3
x
x
–1
x
, log, ln, 10
, e
, x
.
When you generate a built-in graph, any previously generated graph
is cleared. The display range is automatically set to the optimum. See
Example 36.
User-generated Graphs
You can also specify your own single-variable functions to graph (for
3
2
example, y = x
+ 3x
– 6x – 8). Unlike built-in functions (see above),
you must set the display range when creating a user generated graph.
Press the [ Range ] key to access
the range parameters for each axis:
minimum value, maximum value,
and scale (that is, the distance
between the tick marks along an
axis).
After setting the range, press [ Graph ] and enter the expression to be
graphed. See Example 37.
Graph ↔ Text Display and Clearing a Graph
Press [ G
T ] to switch between graph display and text display and
vice versa.
To clear the graph, please press [ 2nd ] [ CLS ].
Zoom Function
The zoom function lets you enlarge or reduce the graph. Press [ 2nd ]
[ Zoom x f ] to specify the factor for enlarging the graph, or press
[ 2nd ] [ Zoom x 1/f ] to specify the factor for reducing the graph. To
return the graph to its original size, press [ 2nd ] [ Zoom Org ]. See
Example 37.
Superimposing Graphs
A graph can be superimposed over one or more graphs. This
makes it easy to determine intersection points and solutions that
satisfy all the corresponding expressions. See Example 38.
Be sure to input variable X in the expression for the graph you
want to superimpose over a built-in graph. If variable X is not
included in the second expression, the first graph is cleared
before the second graph is generated. See Example 39.
Trace Function
This function lets you move a pointer around a graph by pressing
[
] and [
]. The x- and y-coordinates of the current pointer
location are displayed on the screen. This function is useful for
determining the intersection of superimposed graphs (by pressing
[ 2nd ] [ X
Y ]). See Example 40.
Note: Due to the limited resolution of the display, the position of the
pointer may be an approximation.
Scrolling Graphs
After generating a graph, you can scroll it on the display. Press [
[
] [
] [
] to scroll the graph left, right, up or down
respectively. See Example 41.
Plot and Line Function
The plot function is used to mark a point on the screen of a graph
display. The point can be moved left, right, up, or down using the
cursor keys. The coordinates of the point are displayed.
When the pointer is at the desired location, press [ 2nd ] [ PLOT ] to
plot a point. The point blinks at the plotted location.
Two points can be connected by a straight line by pressing [ 2nd ]
[ LINE ]. See Example 42.
Statistical Calculations
The statistics menu has four options: 1-VAR (for analyzing data in a
single dataset), 2-VAR (for analyzing paired data from two datasets),
REG (for performing regression calculations), and D-CL (for clearing
all datasets).
Single-Variable and Two-Variable Statistics
1.
From the statistics menu, choose 1-VAR or 2-VAR and press
[
].
2.
Press [ DATA ], select DATA-INPUT from the menu and press
[
].
3.
Enter an x value and press [
].
4.
Enter the frequency ( FREQ ) of the x value (in 1-VAR mode) or
Value
the corresponding y value ( in 2-VAR mode ) and press [
5.
To enter more data, repeat from step 3.
-2
6.
Press [ 2nd ] [ STATVAR ].
2
-2
7.
Press [
] [
] [
] or [
] to scroll through the statistical
kg
variables until you reach the variable you are interested in (see
3
-1
mol
table below).
23
-1
mol
Variable
Meaning
-19
C
n
Number of x values or x–y pairs entered.
-31
kg
or
Mean of the x values or y values.
-27
kg
Xmax or Ymax Maximum of the x values or y values.
-34
J.S
Xmin or Ymin
Minimum of the x values or y values.
-23
-1
J.K
Sx or Sy
Sample standard deviation of the x values or y
values.
σx or σy
Population standard deviation of the x values or
y values.
-27
kg
Σx or Σy
Sum of all x values or y values.
-27
kg
2
2
2
or Σy
Sum of all x
values or y
Σx
-12
F / m
Σx y
Sum of (x × y) for all x–y pairs.
CV x or CV y
Coefficient of variation for all x values or y
-15
Vs
values.
-11
m
R x or R y
Range of the x values or y values.
-24
2
A • m
8.
To draw 1-VAR statistical graphs, press [ Graph ] on the
-27
STATVAR menu. There are three types of graph in 1-VAR mode:
J / T
N-DIST (Normal distribution), HIST (Histogram), SPC (Statistical
Process Control). Select the desired graph type and press [
If you do not set display ranges, the graph will be produced with
optimum ranges. To draw a scatter graph based on 2-VAR
datasets, press [ Graph ] on the STATVAR menu.
9.
To return to the STATVAR menu, press [ 2nd ] [ STATVAR ].
Process Capability
(See Examples 43 and 44.)
1.
Press [ DATA ], select LIMIT from the menu and press [
2.
Enter a lower spec. limit value ( X LSL or Y LSL ), then press
[
].
3.
Enter a upper spec. limit value ( X USL or Y USL ), then press
[
] .
4.
Select DATA-INPUT mode and enter the datasets.
5.
Press [ 2nd ] [ STATVAR ] and press [
scroll through the statistical results until you find the process
capability variable you are interested in (see table below).
Variable
Meaning
Cax or Cay
Capability accuracy of the x values or y values
-1
,
Cpx or Cpy
Potential capability precision of the x values or y
2
,
, x
,
values,
,
Cpkx or Cpky Minimum (CPU, CPL) of the x values or y values,
where CPU is the upper spec. limit of capability
precision and CPL is lower spec. limit of
capability precision.
C
= Min (C
, C
pkx
PUX
C
= Min (C
, C
pky
PUY
ppm
Parts per million, Defection Per Million
Opportunities.
Note: When calculating process capability in 2-VAR mode, the x
and y
values are independent of each other.
n
Correcting Statistical Data
See Example 45.
1.
Press [ DATA ].
2.
To change the data, select DATA-INPUT . To change the upper
or lower spec. limit, select LIMIT . To change a
3.
Press [
] to scroll through the data until the entry you want to
change is displayed.
4.
Enter the new data. The new data you enter overwrites the old
entry.
5.
Press [
] or [
] to save the change.
Note: The statistical data you enter is retained when you exit
statistics mode. To clear the data, select D-CL mode.
Probability Distribution (1-Var Data)
See Example 46.
1.
Press [ DATA ] , select DISTR and press [
2.
Enter a a
value, then press [
x
3.
Press [ 2nd ] [ STATVAR ].
4.
Press [
] or [
] to scroll through the statistical results until
you find the probability distribution variables you want (see table
below).
Variable
Meaning
t
Test value
P(t)
The cumulative fraction of the standard normal
distribution that is less than t .
R(t)
The cumulative fraction of the standard normal
distribution that lies between t and 0. R(t) = 1 – t .
The cumulative fraction of the standard normal
Q(t)
distribution that is greater than t . Q(t) = | 0.5– t |.
Regression Calculation
There are six regression options on the REG menu:
LIN
Linear Regression
y = a + b x
Logarithmic Regression
y = a + b lnx
LOG
e ^
Exponential Regression
y = a • e
PWR
Power Regression
y = a • x
INV
Inverse Regression
y = a +
QUAD
Quadratic Regression
y = a + b x + c x
See Example 47~48.
1.
Select a regression option on the REG menu and press [
2.
Press [ DATA ], select DATA-INPUT from the menu and press
[
].
3.
Enter an x value and press [
].
4.
Enter the corresponding y value and press [
5.
To enter more data, repeat from step 3.
6.
Press [ 2nd ] [ STATVAR ].
7.
Press [
] [
] to scroll through the results until you find the
regression variables you are interested in (see table below).
]
8.
To predict a value for x (or y) given a value for y (or x), select the
x ' (or y ') variable, press [
] , enter the given value, and press
[
] again.
Variable
Meaning
a
Y-intercept of the regression equation.
b
Slope of the regression equation.
r
Correlation coefficient.
c
Quadratic regression coefficient.
Predicted x value given a, b, and y values.
x '
y '
Predicted y value given a, b, and x values.
9.
To draw the regression graph, press [ Graph ] on the STATVAR
menu. To return to the STATVAR menu, press [ 2nd ]
[ STATVAR ].
BaseN Calculations
You can enter numbers in base 2, base 8, base 10 or base 16. To set
the number base, press [ 2nd ] [ dhbo ], select an option from the
menu and press [
h , b , or o . (The default setting is d : decimal base). See Example 49.
The allowable digits in each base are:
Binary base ( b ): 0, 1
Octal base ( o ): 0, 1, 2, 3, 4, 5, 6, 7
Decimal base ( d ): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Hexadecimal base ( h ): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, IA , IB , IC , ID , IE , IF
Note: To enter a number in a base other than the set base, append
the corresponding designator ( d , h , b , o ) to the number (as in
].
h3 ).
Press [
] to use the block function, which displays a result in octal
or binary base if it exceeds 8 digits. Up to 4 blocks can be displayed.
See Example 50.
Negative Expressions
In binary, octal, and hexadecimal bases, negative numbers are
expressed as complements. The complement is the result of
subtracting that number from 10000000000 in that number's base.
You do this by pressing [ NEG ] in a non-decimal base. See Example
51.
Basic Arithmetic Operations for Bases
You can add, subtract, multiply, and divide binary, octal, and
hexadecimal numbers. See Example 52.
Logical Operation
The following logical operations are available: logical products (AND),
negative logical (NAND), logical sums (OR), exclusive logical sums
2
values.
(XOR), negation (NOT), and negation of exclusive logical sums
(XNOR). See Example 53.
Programming
The options on the program menu are: NEW (for creating a new
program), RUN (for executing a program), EDIT (for editing a
program), DEL (for deleting a program), TRACE (for tracing a
program), and EXIT (for exiting program mode).
].
Before Using the Program Area
].
Number of Remaining Steps: The program capacity is 400 steps.
] [
] [
] [
] to
The number of steps indicates the amount of storage space available
for programs, and it will decrease as programs are input. The number
of remaining steps will also decrease when steps are converted to
memories. See Array Variables above.
Program Type: You must specify in each program the calculation
mode that the calculator should enter when executing the program.
,
To perform binary, octal or hexadecimal calculations or conversions,
choose BaseN ; otherwise choose MAIN .
Program Area: There are 10 program areas for storing programs
(P0–P9 ). If an area has a program stored in it, its number is
displayed as a subscript (as in P
Program Control Instructions
The calculator's programming language is similar to many
programming languages, such as BASIC and C. You can access
) = C
(1–C
)
most of the programming commands from the program control
PLX
px
ax
) = C
(1–C
)
instructions. You display these instructions by pressing [ 2nd ]
PLY
py
ay
[ INST ].
n
Clear screen command
, select DISTR .
x
CLS
⇒ Clear the display on the screen.
Input and output commands
INPUT memory variable
⇒ Makes the program pause for data input. memory variable = |
appears on the display. Enter a value and press [
is assigned to the specified variable, and the program resumes
execution. To input more than one memory variable, separate
them with a semicolon (;).
PRINT " text " , memory variable
].
⇒ Print the text specified inside the double quotation marks and
].
the value of the specified memory variable.
Conditional branching
IF ( condition ) THEN { statement }
⇒ IF the condition is true, THEN statement is executed.
IF ( condition ) THEN { statement }; ELSE { statement }
⇒ IF the condition is true, the specified THEN statement is
executed, otherwise the ELSE statement is executed.
Jump commands
Lbl n
⇒ An Lbl n command marks a destination point for a GOTO n
jump command. Each label name ( Lbl ) must be unique (that is, not
repeated in the same program area). The label suffix n must be an
integer from 0 to 9.
GOTO n
⇒ When program execution encounters a GOTO n statement,
execution jumps to Lbl n (where n is the same value as the n in
the GOTO n statement).
Mainroutine and Subroutine
bx
GOSUB PROG n ;
b
⇒ You can jump between program areas, so that the resulting
execution is made up of code from different program areas. The
2
program from which other program areas are jumped to is the
mainroutine, and an area jumped to is a subroutine. To cause a
jump to a subroutine, enter PROG n where n is the number of the
] .
destination program area.
Note: The GOTO n command does not allow jumps between
program areas. A GOTO n command only jumps to the
corresponding label ( Lbl ) within the same program area.
].
End
⇒ Each program needs an END command to mark the end of the
program. This is displayed automatically when you create a new
program.
Increment and decrement
Post-fixed: Memory variable + + or Memory variable – –
Pre-fixed: + + Memory variable or – – Memory variable
⇒ A memory variable is decreased or increased by one. For
standard memory variables, the + + ( Increment ) and – –
( Decrement ) operators can be either post-fixed or pre-fixed. For
array variables, the operators must be pre-fixed.
With pre-fixed operators, the memory variable is computed before
the expression is evaluated; with post-fixed operators, the memory
variable is computed after the expression is evaluated.
For loop
FOR ( start condition; continue condition; re-evaluation )
{ statements }
]. An indicator shows the base you selected: d ,
The processing in this example is:
1.
2.
3.
Sleep command
Swap command
Relational Operators
The relational operators that can be used in FOR loops and
conditional branching are:
Creating a New Program
1.
2.
3.
4.
5.
Number of Remaining
Steps
Executing a Program
1.
2.
3.
4.
).
1
Debugging a Program
A program might generate an error message or unexpected results
when it is executed. This indicates that there is an error in the
program that needs to be corrected.
Using the Graph Function in Programs
Using the graph function within programs enables you to graphically
illustrate long or complex equations and to overwrite graphs
repeatedly. All graph commands (except trace and zoom) can be
included in programs. Range values can also be specified in the
program.
Note that values in some graph commands must be separated by
]. The value
commas (
Display Result Command
You can put
of a variable at that particular stage in program execution.
For example:
Line 1: INPUT A ; B = ln ( A + 100 )
Line 2: C = 13 × A ;
Line 3: D = 51 / ( A × B )
Line 4: PRINT " D = ", D ; END
1.
2.
3.
Deleting a Program
1.
2.
3.
4.
5.
Program Examples
See Examples 54 to 63.
 Hewlett-Packard Company 2002
All rights reserved. Reproduction, adaptation or translation without
prior written approval is forbidden except as allowed under copyright
laws.
Printed in China.
Part number: F2222-90020
⇒ A FOR loop is useful for repeating a set of similar actions while
a specified counter is between certain values.
For example:
FOR ( A = 1 ; A
4 ; A + + )
{ C = 3
×
A ; PRINT " ANS = " , C }
END
⇒ Result : ANS = 3, ANS = 6, ANS = 9, ANS = 12
FOR A = 1 : This initializes the value of A to 1 . Since A = 1 is
consistent with A ≤ 4 , the statements are executed and A is
incremented by 1.
Now A = 2 . This is consistent with A ≤ 4 , so the statements are
executed and A is again incremented by 1. And so on.
When A = 5 , it is no longer true that A ≤ 4 , so statements are not
executed. The program then moves on to the next block of code.
SLEEP ( time )
⇒ A SLEEP command suspends program execution for a
specified time (up to a maximum of 105 seconds). This is useful for
displaying intermediate results before resuming execution.
SWAP ( memory variable A, memory variable B )
⇒ The SWAP command swaps the contents in two memory
variables.
= = (equal to), < (less than), > (greater than), ≠ (not equal to), ≤
(less than or equal to), ≥ (greater than or equal to).
Select NEW from the program menu and press [
].
Select the calculation mode you want the program to run in and
press [
].
Select one of the ten program areas ( P0123456789 ) and press
[
].
Enter your program's commands.
• You can enter the calculator's regular functions as commands.
• To enter a program control instruction, press [ 2nd ] [ INST ] and
make your selection.
• To enter a space, press [ ALPHA ] [ SPC ].
A semicolon (;) indicates the end of a command. To enter more
than one command on a command line, separate them with a
semicolon. For example:
Line 1: INPUT A ; C = 0.5 × A ; PRINT " C = " , C ; END
You can also place each command or group of commands on a
separate line, as follows. In this case, a trailing semicolon can be
omitted.
Line 1: INPUT A ; C = 0.5 × A [
]
Line 2: PRINT " C = " , C ; END
CL
When you finish entering or editing a program, press [
/
ESC
return to the program menu, select RUN and press [
]. (Or
you can press [ PROG ] in MAIN mode.)
Select the relevant program area and press [
] to begin
executing the program.
To re-execute the program, press [
] while the program's
final result is on the display.
CL
To abort the execution of a program, press [
/
]. A message
ESC
appears asking you to confirm that you want to stop the
execution.
STOP : N Y
Press [
] to move the cursor to Y and then press [
Error messages appear for approximately 5 seconds, and then
the cursor blinks at the location of the error.
To correct an error, select EDIT from the program menu.
You also can select TRACE from the program menu. The
program is then checked step-by-step and a message alerts you
to any errors.
) as follows:
Range ( Xmin, Xmax, Xscl, Ymin, Ymax, Yscl )
Factor ( Xfact, Yfact )
Plot ( X point, Y point )
in a program if you want to be able to see the value
-------Stop at this point
Execution is interrupted at the point where you placed
.
At this time, you can press [ 2nd ] [ RCL ] to view the value of the
corresponding memory variable ( C in the above example).
To resume program execution, press [
].
Select DEL from the program menu and press [
].
To erase a single program, select ONE , the program area you
want to erase, and then press [
]
To erase all the programs, select ALL .
A message appears asking you to confirm that you want to delete
the program(s).
Press [
] to move the cursor to Y and then press [
To exit DEL mode, select EXIT from the program menu.
HDP1SG18EM1 MWB
] to
].
].

Advertisement

loading