An alternative
(Version 0.6) 2005
Author: Jos?? Lauro Strapasson, Brazil. jlstrapasson@uol.com.br http://joselauro.com/42s.pdf
Index
Index
1 Introduction
2 Basic Operations
3 Memory
4 Probability
5 Complex numbers
6 Programming
7 Using the Solver
8 Numeric Integration
9 Statistics
10Matrices
11Other Bases
12Flags
License for this manual
1 Introduction
Since
This manual can interest people who:
a)Have a
b)Got the Free42 simulator and want to know how to use.
c)Have a palmtop with PalmOS and want a nice scientific calculator (get Free42)
d)Just want to have an idea how 42S was.
e)Have the official manual but don't want to read more than 300 pages!
Why
It is important to say that this manual is not complete and I don't want it to be. Two things I really don't want to see here are PRINTING and
If you want to download the fantastic Thomas Okken Free42 program please go to this web site http://home.planet.nl/~demun000/thomas_projects/free42/
In my opinion Free42 is even better than the real
For more information about
http://www.hp42s.com
http://www.hpmuseum.org/hp42s.htm
Here you can find emulators for
http://privat.swol.de/ChristophGiesselink (very nice)
http://www.geocities.com/hrastprogrammer/HP42X/index.htm
I would like to finish this introduction saying that would be nice to have
2 Basic Operations
2.1 RPN
Example: To make a simple operation like 2+2 in a normal algebraic calculator we do 2 + 2 =
which give to us 4.
To make this using a RPN calculator we do 2 ENTER 2 +
As we can see in RPN mode we first enter the data pressing the ENTER key after every data (except for the last in HP's RPN) and then we enter the operations.
Lets now consider the following calculation 4+(2x79).
In a RPN calculator we do 2 ENTER 79 x 4 +
But how one could do this in an algebraic calculator? If the calculator has the ( and ) sings it is just do
4 + ( 2 x 79 ) =
But if there are no () we do this in a good calculator by doing 4 + 2 x 79 =
By a good calculator we mean a calculator which knows that x and / are prior to + and
2 x 79 = and
4 + = or
2 x 79 + 4 =
What about calculate sin(33)? In a RPN calculator it is just do 33 sin
or if you prefer 33 ENTER sin
(in this case we don't need to press enter key)
But in an algebraic calculator we have two ways. In the classic old models it is like RPN and we do 33 sin
but in some modern models (which typically allow you to edit entered data using cursors) we do sin 33 =
So algebraic calculators are ambiguous because the many ways they work. RPN calculators are more standard and so less ambiguous.
The main key to understand how to use RPN in more complex calculus is to realize that in RPN we make calculations from ???inside??? to ???outside??? instead of from left to right.
Example:
8 x ln[5+sin(40)] in RPN is doing by
40 sin 5 + ln 8 x
In RPN we can make any calculation we do in algebraic devices and this is not only more elegant but also more effective since there are less ambiguity's and we use less key strokes.
For example, my
For more information on RPN, please see http://www.hpmuseum.org/rpn.htm
2.2 Turn ON/OFF
To turn your
To turn your
Actually ??? OFF is a redundancy since OFF can be only accessed by pressing ??? first. But (as in HP- 42S official manual) we will do this just to remember when we have to press ??? or not. If you press this key a second time all keys go back to the normal function.
2.3 Setting the display contrast
2.4 Training RPN using
Now that you have your 42S on try to do the following calculations:
1) 6x(4+3).
Answer
4 ENTER 3 + 6 x
2) 2+{2x[2+(2/2)]}
Answer
2 ENTER 2 / 2 + 2 x 2 +
IMPORTANT: For sake of simplicity sometimes we will use / instead of ??.
2.5 Menus
Not all functions of
ALPHA, MODES, DISP, CLEAR, SOLVER, ???f(x), MATRIX, STAT, BASE, CONVERT, FLAGS, PROB, CUSTOM, PGM. FCN, PRINT, TOP.FCN and CATALOG.
2.6 DISP Menu
The DISP menu is the first menu we have to see. It is above E key. So start by pressing ??? DISP. When you do this the DISP menu appears in the first line with the following functions.
FIX, SCI, ENG, ALL, RDX., RDX,
These functions appears just above ???+, 1/x,???x, LOG, LN and XEQ. Now with DISP menu active those keys don't represent their original functions but those of DISP menu. The same happens with all menus.
2.6.1 The FIX function.
The FIX ???function??? is not a function in the mathematical sense, but a calculator function. By using FIX function the display becomes with a fixed number of digits after decimal point.
Ok, press FIX. (I mean ???+ with DISP menu active) When you do this what appears is
FIX _ _
Then you have to enter a number up to 11. Example
FIX 0 4 set calculator to have 4 digits of precision after the decimal point. A number like ?? will appear as
3.1416
and ???2 will appear as 1.4142.
(You can verify this by doing ??? ?? and 2 ???x respectively)
If you put FIX 0 9 than those numbers will appear as
3.141592654
and
1.414213562.
It is important to say that this is not the actual precision the calculator will have but just the display precision. To see all calculator precision you have to press ALL in DISP menu (above LOG key). By doing so those numbers will appear as
3.14159265359
and
1.41421356237
As you can see the numbers are not truncated but rounded.
Not all numbers can be seem with a fixed decimal precision. If you put 4 digits for fixed precision the number ?? will appear as 3.1416 but if one calculate 108 (do this by doing 8 ??? 10x ) what you are going to see is 100,000,000.000 with 3 decimal digits. This happens because the calculator cannot show more than 12 digits at a same line.
2.6.2 The ALL function
We already talked about ALL function. It makes the calculator to show all of its precision.
2.6.3 The SCI function
The SCI function works just like FIX one but puts the calculator in ???scientific??? mode. The numbers will be shown as a decimal number between 0 and 1 times a power of 10.
For example 1000 will be represented as 1.00E3 with you put the calculator in scientific mode with 2 digits. 1.00E3 means 1.00x 103 . The ?? number will appear as 3.14E0.
Actually even when in FIX mode the calculator will turn in scientific notation to give some answers. For example if you calculate
Exercise. Show that
Answer:
First we put the calculator in FIX 3 mode by doing ??? DISP FIX 0 3.
Then we do 1 . 0 0 0 1 ENTER 1 ??? and we get the answer.
As you can see when you are in FIX mode a sign ??? appears on the right side of FIX name in the DISP menu. This means FIX mode is active. The same happens with SCI, ALL, etc.
It is out of our scope to give a full description of scientific notation. In case of need please report to a first book of physics for high school or college.
2.6.4 The ENG function
The ENG function puts the calculator in engineering notation. It looks like scientific notation but now the first number does not need to be between 0 and 1 but can be between 0 and 1000 and the power will be always 3 manifold.
Example: 100 will be represented by 100.E0 in ENG 2 mode while 1000 will be 1.00E3 in the same mode. Why do we get 100.E0 for 100 instead of 100.00E2 in ENG 2 mode? Because the calculator shows in engineering mode the same number of digits it shows in scientific mode.
2.6.5 RDX. And RDX, functions
In some countries like Brazil we use ',' for decimal point instead of '.' and also '.' instead of ',' for 1,000 and 1,000,000 etc.
For example ?? is written here (Brazil) as 3,141 etc and not as 3.141 etc. In FIX 3 mode one million is written here as 1.000.000,000 and not as 1,000,000.000 as in English use. By pressing RDX, you
make the calculator to use ',' for decimal point and by pressing RDX. we make it use '.' for decimal point. Again the active mode is followed by a ??? sing. Here, in this manual, I suppose the calculator using '.' for decimal point.
2.6 MODES Menu
To access MODES menu just press ??? MODES. (MODES is above +/- key).
DEG actives degree mode for trigonometric functions. In this mode a circumference has 360 degrees. RAD actives radian mode and in this mode a circumference has 2?? radians or just 2??. GRAD is not so useful and correspond to 400 degrains for a circumference.
For example: In degrees we have sin(90??)=1 and in radians we have sin(??/2)=1.
Try this: ??? ?? 2 / COS in radians mode. Why the result is not exactly zero?
Answer: Because the number that calculator entered was not exactly ?? but 3.14159265359.
REC actives rectangular mode (x,y) and POLAR actives polar mode (r,??). We will see this more in detail when study complex numbers.
The MODES menu has another line but we will discuss this later. We will discuss the others menus later too.
2.7 The Stack
No calculator can store an infinite amount of data. In algebraic calculators the ???( )??? are limited to a given number depending on the model. The same happens in RPN calculators. In some models like
There are four lines labeled x, y, z and t. (actually the name of the last two is not so important). So the stack is something like
t:0.0000
z:0.0000
y:0.0000
x:0.0000
But as the calculators display has only two lines just x and y lines are visible. When you enter a number (say 2 ENTER) what happens is the following.
i)The content of lines t and z are lost.
ii)The content of line y goes to line t. iii)The content of line x goes to line z.
iv)The content just entered goes to line y and line x.
So what you just entered appears twice. So if you do 2 ENTER + you will have 4 as answer.
This is a feature, a bad feature I think, of the HP RPN style of 42S (also in 33S, 12C, etc but not in HP48 or 49). In my opinion we could have a simpler RPN style. Anyway there is another way to enter data in RPN. It is just type what you want and press the desired function key.
For example, if you do 2 1/x before the 1/x function the calculator makes an automatic enter but in
this case the content just entered appears only once.
So if you do 2 1/x or another example 9 ???x what you will have will be
i)Only the content of the line 4 (line t) will be lost.
ii)The content of line 3 (z) goes to line 4 (t). iii)The content of line y goes to line 3 (z). iv)The content of line x goes to line y.
v)Your result will be in the first line x.
This second way to enter data looks more intuitive to me and I think it should be aways like this. But it is not!:( So to do 2+3 we have to do
2 ENTER 3 + (and not 2 ENTER 3 ENTER +).
(Actually one can also use EXIT to enter a number without duplication)
If you just press ENTER you duplicate what is in line x.
When making a calculation one should never forget about the limitation of the 4 lines of the stack.
The lines of the stack cannot contain only numbers but also matrices, complex numbers, etc.
The basic operations with the stack are: x><y and R???. The first changes line x with line y. The second makes the stack rolls down (line y goes to line x, line x goes to line t, line t goes to line z and line z goes to line y)
In the CLEAR Menu there are some interesting functions: CLST which clears all the stack (something missing in
The ??? is more used to correct a number when typing it.
Another useful function is ??? LASTx which gives the last calculated result.
2.8 Getting used to some keys of the keyboard
Let's discuss some basic keys of the calculator. We will start from superior left side.
??+ and ???
to have them in one.
LN and ??? ex : These functions calculate the base e=2.71828... logarithm and it's inverse. Unlike LOG these are very, very important functions!
But what about if we want a logarithm in another base? It would be nice to have a special key for this but it is just about remembering that
logx y=logz y /logz x where z is any other base.
If we take z=e=2.71828... we have
logx y=ln y /ln x .
Example: Calculate log2 8
Answer: 8 LN 2 LN / which give us 3 because 23=8 .
XEQ and ??? GTO: These are related to programming and we shall discuss this later. XEQ will also be discussed in ALPHA menu part.
STO and ??? COMPLEX : These are related to the memories and complex numbers. We will discuss this later.
RCL and ??? % : RCL is related to memories and we will discuss later. ??? % is the percentage function. To calculate 10% of 300 we do
300 ENTER 10 ??? % which gives 30 as answer.
Note that 300 remains in line y, so if you want to calculate 300 plus 10% you do
300 ENTER 10 ??? % +
R??? and ??? ?? : We already discuss these. The first rows down the stack and the other returns
??=3.14...
SIN and ??? ASIN : These are the sinus trigonometric function and its inverse. The angle type is set up as said before in MODES menu. The default is degrees. ASIN is the inverse usually called arcsine or sometimes sin???1
1/sin). It is important to remember that ASIN is not a real function since there is no single result. For example sin(135??)=sin(45??)=???2/2 but the calculator gives always ASIN(???2/2)=45??.
COS and ??? ACOS: These are the cosinus trigonometric function and its inverse.
TAN and ??? ATAN: These are the tangent trigonometric function and its inverse. Not all numbers can have a result for tangent. For example tan(90??) goes to infinite. The
ENTER and ??? ALPHA: The ENTER key does not need any comment. ??? ALPHA is the alpha- numeric menu used to enter letters instead of numbers. When you press ??? ALPHA what appears is
ABCDE FGHI JKLM NOPQ RSTUV WXYZ
These are
A B C D E
Then just pick the letter you want. But above you can see this symbol ??????. This symbol means the menu has more than on line. You can access the other lines by pressing ??? or ???. In this case there is just one more line with ??, ?? and ??. If you press FGHI you will have F G H I, etc.
Among all calculators I know this is in my opinion the best way to enter letters!
The main ALPHA menu also have ?????? symbol. The other line has the following submenus.
([{ ????????? <=> MATH PUNC MISC, much more than one will ever need! If you are inside a submenu and want to go back to main menu just press EXIT.
Why is alpha menu useful? Of course it is useful to label programs, data in memory but it is also useful to enter commands using XEQ key! For example XEQ ???SIN??? is the same of pressing SIN key. The ?????? are called automatically when pressing ??? ALPHA and ENTER. XEQ ???SINH??? calculates the hyperbolic sinus while XEQ ???OFF??? turns the calculator off. Finally we must say that ??? ALPHA is not always needed! In some cases like XEQ, GTO (we will see this later) a simple ENTER will do.
x><y and ??? LASTx: We already talked about.
E and ??? DISP: We already talked about DISP menu but what would be E? The E is the character meaning the power of 10 in scientific notation. For example, to enter 5.2x 1022
we
do 5 . 2 E 22 ENTER.
??? and ??? CLEAR: As said before ??? clears line x and if you are entering a number you can delete the last character. We already talked a little about CLEAR menu and we will discuss it again later.
???or ???: As said before we use this to change the line in a multi line menu. We will see ??? BST and
???SST later.
The keys from 0 to 9 have obvious functions.
. and ??? SHOW: The '.' is just the decimal point and ??? SHOW is used to show a number for an instant with all precision. For example: If you have ?? in the first line and you are using the display in FIX 4 you have 3.1416 but pressing ??? SHOW you will see 3.14159265359 for an instant.
We stop studying the keyboard here for now.
3 Memory
The real
In fact, 7200 bytes is a lot of memory for
This available memory is shared with everything including programs, variables, etc.
Let's start from the basic. To store a number which is in line x of the stack we use STO function.
The
??? ?? STO 10
To get it back it is just do this
RCL 1 0
If you want to make an operation you can use STO+,
2 STO ?? 1 0 divides the number in R10 by 2.
You can also use RCL+.
If 25 positions in the memory is not enough for you, you can change this number by using SIZE function (which is in the second line of MODES menu).
For example ??? MODES ??? SIZE 0 1 0 0 changes to have 100 positions, from R00 to R99.
Despite it is possible I suggest you to not use more than 100 positions. These positions are stored in a normal matrix called REGS.
(We, the poor owners of
But this kind of memory position only accept real numbers! What about if you want to store other things? Matrices, complex numbers of even other real numbers?
To do this
We had stored the ?? number in R10 but we can create a variable called for example ???PI??? to store it.
It is just to do
??? ?? ENTER STO ??? ALPHA ???PI??? ENTER.
Actually is not just PI you type but NOPQ P FGHI I but we wrote that for simplicity.
Now to get this number back it is just type RCL ???PI???. When you type RCL the ???PI??? should appear to you select it.
You can also use STO+,
We can deal with the four lines of the stack as we deal with the memory positions. In this case the lines of the stack are called ST X, ST Y, ST Z and ST T respectively. To access this we press '.' before the name of the line. For example:
5 STO . ST X puts 5 in line x of the stack while 5 STO . ST X STO . ST Y is a very extravagant way to enter 5 twice.
As the content of the stack can change easily I don't think ???STO .??? is a good thing. But I cannot say the same of ???RCL .??? which may be very useful to get the content especially of lines z and t. You can also use STO and RCL with +,
For example:
5 STO ?? . ST Z divides line z by 5.
3.1 The ??? CATALOG menu.
The ??? CATALOG menu has the following submenus:
FCN, PGM, REAL, CPX, MAT, MEM
FCN: It shows all the functions available in
PGM: It shows all variables with programs in the memory.
REAL: It shows all variables with real numbers in the memory. (But does not show numbers in R00 , etc)
CPX: It shows all variables with complex numbers.
MAT: It shows all variables with matrices. The REGS matrix always appears. It contains the numeric memories R00, R01, etc.
MEM: It shows all available memory.
3.2 More on the ??? CLEAR menu
We already saw some of the CLEAR menu functions, but there are also:
CLV: Clears variables we had stored using STO ???name???.
CLRG: Clears the R00, R01, etc, memories known as registers.
In the second line
CLLCD: Clears the LCD display (may be useful when plotting)
CLALL: Clears all the memory of the calculator.
3.3 The ??? CUSTOM menu
This is not related to memory but as we saw the FCN function in the CATALOG menu we are already able to talk about it.
The
To do this we use ??? ASSIGN. When you call this you can select a function from FCN and also some other things. We are interested in functions so press FCN. Now you find the function you want and then you press the position you want it appears in the CUSTOM menu.
Example: Let's put ABS (absolute value) in the first position of CUSTOM menu.
??? ASSIGN FCN ABS
In the display you are going to see:
ASSIGN ???ABS??? TO _
Then you pick a position, for example if you have ??? ??? ??? ??? ??? ??? and you press the first ??? your CUSTOM menu will become ABS ??? ??? ??? ??? ???.
As you can see the CUSTOM menu has also the ?????? symbol which means there are more than one line. There are three lines you can use when calling ASSIGN function which means 18 available positions.
(I would like to use this space to make a complain.:) There are some HP models with more than 2000 functions! Many functions does not mean always power but always mean complexity!)
4 Probability
Probability functions are in ??? PROB menu (over x key).
They are COMB, PERM, N!, GAM, RAN and SEED.
COMB: This calculates the number of combinations of N things taken r at a time. The order does not matter. A thing cannot appear more than one time.
Example: If we have the five letters a, e, i, o and u the possible combinations taken one at a time are {a,e,i,o,u}. This means 5 combinations.
Taken two at a time
{ae, ai, ao, au, ei, eo, eu, io, iu, ou}. This means 10 combinations.
Taken four at a time
{aeio, aeiu, aeou, aiou, eiou}. This means also 10 combinations.
The number of combinations is given by
PERM: This calculates the number of arrangements of N things taken r at a time. A thing cannot appear more than one time but now the order matters.
Example: Five cars are in a race. Their colors are red, blue, green, white and cyan. What are the possible results?
Solution: For the first position we have five possibilities. For the second position we have four possibilities, and three possibilities for the third position. So we have 5x4x3=60 different arrangements. To see this using 42S just enter 5, press ENTER, enter 3 and press PERM.
It is simple to realize that the number of arrangements is given by
A??? N , r ???=N.??? N ???1???...??? N ???r???1???= N !
??? N ???r ???!
In particular if r=N (all the things are taken) then the arrangements are called permutations and the number of permutation is N!.
Example: In how many ways we can
Solution: 4!=24.
N!: This just calculates the factorial of N given by
GAM: This is the Gamma function which is defined by
?? ???a???=??????0 xa???1 e???x dx
For a integer number we have
In this point
RAN: This is the random number generator which gives a
SEED: A sequence of
If the seed is zero the calculator will generate another seed.
5 Complex Numbers
5.1 Complex numbers in rectangular coordinates.
Unlike the
There is almost nothing special to say. Just enter
x: 0.0000 i1.0000
which means i.
(Just to you have an idea to do the same in
0 ENTER 1 +/- ENTER 0 ENTER .5 CMPLX yx and we will have 0 and 1 meaning i)
Despite it is possible we don't need to calculate the square root of
We can use ??? COMPLEX function which take line y and line x of the stack and creates a complex number y+ix.
Again unlike
Example: Show that i2 is
Solution:
0 ENTER 1 ??? COMPLEX ??? x2 which gives
5.2 Complex numbers in polar coordinates
When representing a point in R2 we can use any kind of coordinate system. The most more used are the rectangular (or Cartesian system) which use the usual coordinates x and y and the polar system which use the coordinates r and ??.
The relationship between them is
x= r cos ??, y= r sin ?? and r2=x2??? y2 , tan ??=y/x.
When dealing with complex numbers we can think is real axis as being the x and the imaginary axis as being y and then we can use also polar coordinates.
In this case i will be r=1 and ??=??/2 (90??).
To change between rectangular or polar modes use RECT and POLAR in ??? MODES menu.
6 Programming
Programming in
6.1 Basic programming.
Let's imagine you want to make a given calculation. For example: Suppose you want to solve a
Let's suppose a, b and c are in R00, R01 and R02 respectively and we are going to use R03 for ???. To solve this equation using
RCL 01 (This is b)
x2
4
RCL 00 (This is a)
RCL 02 (This is c, keep in mind we have only four lines in the stack) x
x
-
STO 03 (This is ???)
Unlike some other models, say 33S, we don't need to worry with ??? is negative. But we let the square root for late because in R03 the number cannot be complex. (Otherwise we would need to store it's root in a normal memory)
Now we calculate the first root RCL 01
+/- RCL 03
??? x
-
2 RCL 00
x
??
And the second root is given by RCL 01
+/- RCL 03
??? x
+
2
RCL 00 x
??
So what about if you have to solve more 100 of this kind of equation? Only changing the a, b and c values? It would be better to save all the steps in the calculator's memory and let it do the calculations for you. This is what calculators programming is about.
To enter in the program mode you must do ??? PRGM (above R/S key).
If the memory has no program you are going to see:
00???{
(If there is a program we can erase it by doing ??? CLEAR CLP before entering in program mode)
Now just enter the first sequence starting in RCL 01 x2 , etc. Every command will take a line and in the end you will have 08 -
09???STO 03
This means that this part of the program takes 9 lines. You can move through the program lines by using the ?????? cursors (which, of course, cannot be programmed). Two important things to say here are:
Now let's enter the second part of the program which gives to us the first root. (if you used the cursors you must go back where you stopped). After doing so we have
17 x 18?????
Again in the display the functions are not exactly as we know and ???x appears as SQRT.
Unless we store the result in a memory we must find a way to stop the program to see the result. This is doing by the function STOP which is entered by pressing R/S. (R/S means ???run and stop???) So after this we have
18 ?? 19???STOP
Finally we enter the last part of the program and after this we have 27 x
28?????
If you move using the cursors you will find .END. in line 29 (which is the end of the program) and in line zero we find 00???{
As we said the
After entered the program just press EXIT. Now enter the numbers a, b and c of the equation. For example for the equation x2???5 x???4=0 we enter
1 STO 00
5 +/- STO 01
4 STO 02
Now we just press R/S (to run the program) and we get 1, and pressing it again we have 4.
6.2 More than one program in the memory.
If we want to have more than one program in the memory we can use more than one program space. To create another program space just press ??? GTO ..
The ??? GTO command can be used in two different situations:
i)You are not in the programming mode.
ii)You are in programming mode.
But what is a label? A label is a name we give to a position in the program using the LBL command which is available in ??? PGN.FCN (it means ???program functions???) menu.
To create a label you must be in the programing mode (??? PRGM) and then just press LBL and then enter a name (1 to 7 letters). If you use only one letter you are not going to have the ?????? and the label won't appear automatically when you press XEQ which is good for local labels.
(Just for comparison, in 33S the label is just one letter)
Example: In the programing mode ??? PGN.FCN LBL A A A creates a label ???AAA??? which appears as LBL ???AAA??? in program. So when the program is running and it found GTO ???AAA???, for example, it will jump to the line which has LBL ???AAA??? instructions.
(Please note we don't need to press ??? ALPHA to access the A, B, C, etc in this case)
Example of a program
01 LBL ???AA???
02 GTO ???AA???
03 .END. (you don't enter this)
This program does nothing. It just run until you press EXIT. By the way, to run it you can use R/S when the calculator's ???pointer??? is over the program or you can use XEQ ???label???. In the present case you would use XEQ ???AA???.
The XEQ function calls a program (which must have a label) and runs it. You can use XEQ function both in programing mode and also out of programing mode.
When in programing mode XEQ function is programed and when the program finds the XEQ function it changes to the given program which must finish with RTN function.
So LBL ???label??? and RTN makes a kind of procedure and after the procedure is run it goes back to the previous position.
Example:
01 LBL S
02 +
03 RTN
04 LBL A
05 5
06 ENTER
07 7
08 XEQ S
091
10-
11.END.
This program called ???A??? creates a procedure ???S??? which does only a simple addition. In the line 07 the XEQ ???S??? makes the program to go to the procedure ???S??? and after that it goes back to the line next line 07 which is of course the line 08. The calculation is
You can use programmed GTO and XEQ even to call a label in another program space but this is not exactly a good use.
6.3 The X?0 and X?Y
Up to now we saw nothing about how we could do a IF instruction, like what we have in computer's programming languages like BASIC, Pascal or C.
In fact there is no IF, THEN, ELSE, ELSEIF, etc in the
X=0?, X???0?, X<0?, X>0?, X???0?, X???0?
and
X=Y?, X???Y?, X<Y?, X>Y?, X???Y?, X???Y?
The first group of functions involving the number 0 is accessed by the X?0
How do these functions work? Let's consider the first function ???X=0????. If the number in the first line of the stack (line x) is zero than the program works normally and it goes to the next line after ???X=0???? instruction. But if the condition is not true than the program jumps the next line and goes to the second line after the instruction. Usually the line after the instruction has a GTO ???label??? command and this makes the difference in the program flux.
All the other functions involving the 0 work in the same way. If the condition is true the program
works normally and if not the program jumps one line. The X?Y functions work in the same way but now the condition is about the lines x and y of the stack and not only about line x.
Example: A kind of ???timer???
01 LBL A
02 1
03 -
04 X=0?
05 STOP (Enter R/S)
06 GTO A
07 RTN
In this program you first enter a big integer number and then press XEQ ???A???. The program will subtract 1 from this number until get zero. Of course the bigger the number the bigger the time the program will spend. The Emu42 program (yes, I use it too) in my laptop using ???Authentic Calculator Speed??? option takes about 37s for the number 1000. Without this option or using Free42 is too much faster!
6.4 Real program examples.
Here is one of my favorite programs. It just see if a number is prime. (With a small change works in 33S too)
01 LBL ???PRIME???
02 STO 00
03 2
04 STO 01
05 MOD (Rmdr in
06 X=0?
07 GTO F
08 3
09 STO 01
10 RCL 00
11SQRT
12STO 02
13LBL B
14RCL 00
15RCL 01
16MOD
17X=0?
18GTO F
192
20STO + 01
21RCL 02
22RCL 01
23X???Y?
24GTO B
25RCL 00
26STO 01
27LBL F
28RCL 01
29RTN
7 Using the Solver
Unfortunately the
Let's suppose we want to solve the equation x2???5 x???4=0 . We are going to enter it in a program. For example:
01 LBL ???FX??? (???FX??? is the global name of the program)
02 MVAR ???X??? (You find this in Solver menu. I will explain this later) 03 RCL ???X???
04 X???2
05 5
06 RCL ???X???
07 x
08 -
094
10+
11END
Well, as you can see we don't enter the equation f(x)=0 but just the function f(x). The MVAR function tells the calculator what variables must appear in the solver menu. We suppose all variables are in the memory so we use RCL function.
Now we leave the program mode and we go to the Solver menu. What should appear is
Select Solve Program
Then in our case we select FX and we give a start value, for example 8 and we press X to enter this value. Again we press X to calculate the correct value of x which give to us X=4.
But this equation does not have only one solution. X=1 is also a solution. To get it we can enter 2 for example for the start value.
If you want to solve numerically many equations of the form a x2???bx???c=0 you can write a program such as
01 LBL ???FX???
02 MVAR ???A???
03 MVAR ???B???
04 MVAR ???C???
05 MVAR ???X???
06 RCL ???X???
07 X???2
08 RCL ???A???
09x
10RCL ???B???
11RCL ???X???
12x
13+
14RCL ???C'
15+
16END
When we leave the program mode and go to Solver menu again we select FX program and what we are going to see is
A B C X
Now just enter the values of A, B, C and a start value for X and we are done.:)
Some interesting things to say are:
Example: Consider the ideal gas equation PV=nRT where R is 8.3144472 J/mol . K.
We can write a program like
01 LBL ???GAS???
02 MVAR ???P???
03 MVAR ???V???
04 MVAR ???N???
05 MVAR ???T???
06 RCL ???P???
07 RCL ???V???
08 x
09 RCL ???N???
10 RCL ???T???
118.3144472
12x
13x
14-
15RTN
16END
So we will have in the solver menu P V N and T. If we want to know how many mols of a gas is inside a recipient of 1L at a 10.000Pa and 300K all we have to do is
10000 P 0.001 V 300 T
and we give a try for N, for example 1 N and then pressing N again we have 0.0040mols.
8 Numeric Integration
Suppose we want to solve numerically a integral of the form
???ba f ??? x???dx
we write the function in the same way we did in the solver case.
Example: Calculate ???10 x2 dx .
First we enter the function as a program
01 LBL ???FX???
02 MVAR ???X??? (also available in ???f(x) menu)
03 RCL X
04 X???2
05 RTN
06 END
Then we go to the ???f(x) menu and what we have is ???Select ???f(x) Program???. In our case we select FX then what appears is ???Set Vars; Select ???var??? and we select X (before that we may set some variables/constants if needed) and then we have to set LLIM (lower limit), ULIM (upper limit) and ACC (Accuracy factor). In our case 0 LLIM and 1 ULIM and for ACC we can use 0.001. Now just press ??? and we find 0.33333028. If we set ACC to 0.000001 we will have 0.33333333333. In the Free42 program the results may be little different.
9 Statistics
To enter statistical data we use the function ??+. For one variable statistic just enter the number and press ??+. For two variables statistic first enter y, press ENTER and then enter x (without pressing ENTER!) and finally press ??+.
To clear statistic data just do ??? CLEAR CL??.
The statistical functions are available in ??? STAT menu and they are:
??+: The same of pressing ??+.
SUM: Calculates the sum of the statistical data.
MEAN: Calculates the mean of the statistical data.
WMN: Calculates the weighted mean (x weighted by y).
SDEV: Sample standard deviation. (To calculate the Population standard deviation you must calculate the mean, add it to statistical data and then press SDEV)
CFIT: This is a
There is also a second line with ALL, LIN??, ??REG and ??RG? Functions.
Example: A particle of mass m1=1kg is at the position x1=2m while a particle of mass m2=3kg is at position x2=6m. What is the position of the center of the mass?
Solution: The position of the center of the mass is given by
x = x1 m1???x2 m2
cm m1???m2
This is a weighted mean where the physical mass is the statistical weight.
To calculate it using
??? CLEAR CL?? (cleaning statistical data)
Which gives to us 5.
9.1 The
The CFIT menu has the following functions:
FCSTX, FCSTY, SLOPE, YINT, CORR, MODL.
Let's start from MODL which is a
If the LINF is active the calculator will try to fit the data in a y=Mx+B model. If the LOG is active the calculator will try to fit the data in a y=M lnx+B model. If EXPF is active the model is y=B exp{Mx} and PWRF is y=B x^M.
How can I select the model? This depends one what kind of data you are using. If you really don't know try the BEST function which will change to what can be the best model.
The other functions in CFIT
YINT: Gives the value of B (the name comes from LINF model which is of course the main model).
SLOPE: Gives the value of M (again this comes from LINF model). FCSTX: Just run the model for
a given y and returns a estimated x. FCSTY: Returns a estimated y for a given x. CORR: Returns a number between
Of course if you have only two data the calculator will find LINF to best model and the correlation coefficient will be 1, which does not mean the estimation will be good!
9.2 The second line: ALL??, LIN??, ??REG and ??RG? Functions.
Unlike
R11 for ??x, R12 for ??x2, R13 for ??y, R14 for ??y2, R15 for ??xy and R16 for n.
This is like
R17 for ??ln x, R18 for ??(ln x)2, R19 for ?? ln y, R20 for ??(ln y)2, R21 for ??ln x ln y, R22 for ?? x ln y and R23 for ?? y ln x.
Why should I know this? Because now we know how to access statistical data in programming and also we know we cannot put important data in memories from R11 to R23 if we are going to use statistics. (33S is better)
Of course unless you need
We said the statistical data start in R11 but you can change this using ??REG and to view where it is starting just use ??RG? Function.
Conclusion: Four useless functions!:(
10 Matrices
Despite of its small display one of the nice features of
This
NEW, INV, DET, TRAN, SIMQ, EDIT
DOT, CROSS, UVEC, DIM, INDEX, EDITN
STOIJ, RCLIJ, STOEL, RCLEL, PUTM, GETM
Let's start from the first line.
NEW: This function creates a new matrix of a given size. Line y of the stack should contain the number of rows and line x should contain the number of columns. For example:
3 ENTER 2 ??? MATRIX NEW creates a 3x2 matrix.
This matrix is empty or null because all elements are zero. (See EDIT)
INV: Calculates the inverse of a matrix in line x of the stack. The given matrix must have the same number of rows and columns and a non zero determinant.
DET: Calculates the determinant of a matrix in line x of the stack. The given matrix must have the same number of rows and columns.
TRAN: Calculates the transposition of a matrix. The transpost is another matrix with rows changed by columns. If A is a matrix nxm and aij is an element of it then its transpost will be a matrix B where an element bij=aji.
SIMQ: Means ???Simultaneous Equations???. We are not going to see this here.
EDIT: This edits a matrix in line x of the stack. It has the following sub items:
In the first line we have
??? OLD ??? ??? GOTO ??? and there is also a second line we are not going to see.
When you call EDIT with a matrix in first line of the stack you are going to see something like
1:1=0.0000
This means the element (1,1) ???line one and column one??? of the given matrix is 0.0000. (Here we are using FIX 4 for the examples)
If you want to change this element just enter the new value. For example: 5 6 ENTER gives to us 1:1=56.0000.
To change another element it is just go to its position (we use ??? or ??? to change the column and ??? or ??? to change the line we are editing).
One can also use GOTO to go to a specific row and OLD to undo an entered element. In fact you don't need to press ENTER, just press ??? to move to the next element.
Exercise: Calculate the determinant of this matrix:
First line: 1 2 3
Second line:
Third line: 0 4
Solution: First we create a 3x3 matrix
3 ENTER ??? MATRIX NEW
We have x: [ 3x3 Matrix] in the display
Now we press EDIT and we have 1:1=0.0000 Let's enter all elements. (First line)
1 ??? 2 ??? 3
Let's go, for example to (2,1), to enter the second line. ??? ??? ??? 2 +/- ??? 3 ???5 ??? ??? ???
0 ??? 4 ???1 +/-
Then we press exit to stop editing. Now to calculate the determinant is just press DET which gives
One cannot create any size of matrix because we are limited by the available memory of the calculator. In my palm tungsten E using Free42 I can create a matrix of 90x90 and in my PC the Free42 program can give me a 5000x5000 or bigger while in the real
The EDIT function is not useful only to enter a matrix but also to see all the elements of matrix resultant from a calculation. Talking about matrix calculation, the
How can one use matrices to solve linear systems? The
But it would be more profitable to remember a little of linear algebra. If you have nxn linear system you can always write it as the matrix equation
A X = B
where A is nxn matrix called the coefficient matrix, B is nx1 column matrix called independent terms matrix and X is also a nx1 column matrix which contains the unknown variables.
By multiplying this equation by the inverse matrix of A we have
X = A???1 B.
So if you are able to perform the inverse of matrix and able to multiply matrices you can solve a linear system without needing to learn another calculator's function.
What about complex matrices? You cannot enter complex numbers in a normal matrix. You have to create a complex matrix first. The procedure to do this is like to create a complex number. First
you enter the real part then you enter the imaginary part and then you press??? COMPLEX.
As here it is not a normal sum but a matrix sum we have to enter two matrices of the same size. In fact one can create an empty complex matrix and then edit it. Example: To create a 3x3 complex matrix we do (with matrix menu active)
3 ENTER NEW ENTER ??? COMPLEX
Where '3 ENTER' puts the number 3 in line x and line y of the stack. 'NEW' creates a 3x3 real matrix. 'ENTER' creates another one and 'COMPLEX' makes the complex matrix.
We are not going to study the second and the third line of ??? MATRIX menu (too specialized) but there are two functions in the second line that may be useful. They are: DOT and CROSS.
As you know vectors can be represented by a single row or a single column matrix. In
There is nothing special to say about addition, subtraction or multiplication by a scalar since there is no difference for the case of a matrix. But if you want to calculate the dot product in the calculator you can use DOT function.
As you know if we have two vectors A and B the dot product is AxBx+AyBy+AzBz. If the number of dimensions is not 3 but N we calculate the dot product in the same way as A1 B1+...+AN BN. You probably won't use this because it is faster to do by hand! (We spend a lot of time just to enter the vector in the calculator)
The cross product which is given by
Example: Calculate AxB for
Solution: 'x' usually means cross product while '.' usually means dot product. Let's enter the vector A.
??? MATRIX 1 ENTER 3 NEW
EDIT 5 ENTER ???3 ENTER ???2 +/- ENTER EXIT STO ???A??? (In fact we don't need the ENTER)
Let's enter now the vector B. 1 ENTER 3 NEW
EDIT 1 ENTER ??????5 +/- ENTER EXIT STO ???B???
We had stored both matrices because when you use EDIT function if you press ENTER as we did, what you enter goes also to the stack and we would lost the first matrix.
Now we do
RCL A RCL B ??? MATRIX ??? CROSS
which gives the answer we can see using EDIT function.
11 Other Bases
To work with other bases we must use the ??? BASE menu (over the ???4???).
This menu has the following functions:
A...F: Select hexadecimal mode and show A to F.
HEXM: Select hexadecimal mode.
DECM: Decimal mode.
OCTM: Octal mode.
BINM: Binary mode.
LOGIC: Show the logic functions AND, OR, XOR, NOT, BIT?, ROTXY.
Example: How do we write 500 in hexadecimal mode?
Solution: In decimal mode enter 500 and then select HEXM. You will find 1F4.
12 Flags
The
But why do we need flags? Why not set up the calculator status using just the default menus? For me the most interesting reason is related to programming. Using flags you can get the status of the calculator or change it from a program.
To work with flags there are some functions in ??? FLAGS menu (over the ???6???) which are SF, CF, FS?, FC?, FS?C, FC?C. (Again
SF: Set flag. Makes a flag to be set(true).
CF: Clear flag. Makes a flag to be clear(false)
FS?: Flag set test. Says if the flag is set(true)
FC?: The same for clear(false)
FS?C: The same of FS? and CF together.
FC?C: The same of FC? and CF together.
Now let's study some of the flags.
00 to 10 and 81 to 99: These 30 flags are not related to the calculators status but are just ???binary memories??? you can use for what you want.
11: When you turn on the calculator if the flag 11 is set the calculator runs the program where the ???calculator's pointer??? is stopped and clears the flag 11.
24: If this flag is set the calculator will ignorate error messages. ???Out of Range??? will appear as 9.99999999999E499 in the
26: Turns audio on.
28: Use '.' instead of ',' (default).
29: If set the calculator separates digits in groups of three. For example: 5000000 becomes 5,000,000. (default)
You cannot change the flags from 36 to 80.
44: Always on. If true the calculator does not turn off after about 10 minutes.
65: Matrix editor.
68 to 71: Base modes. CCCC=Decimal (default), CCCS=Binary, CSSS=Octal and SSSS=Hexadecimal. It is a shame! Why not only two? :)
73: This flag if true makes the calculator to show complex numbers in polar notation.
An alternative
2005
Author: Jos?? Lauro Strapasson, Brazil.
LICENSE
This manual is available as is without any warranty.
It can be printed, put in web sites to download, freely used, etc, but cannot be translated or changed without author's permission (except for personal use).