Showing posts with label computer algebra systems. Show all posts
Showing posts with label computer algebra systems. Show all posts

Monday, August 29, 2022

Retro Review: HP 40gs

Retro Review:  HP 40gs




Quick Facts


Model:  HP 40gs

Company:  Hewlett Packard

Years:  2006-2010s

Type:  Graphing

Batteries: 4 x AAA plus backup batter CR2032

Operating Mode:  Algebraic

Memory Registers: 27 real variables (A - Z, Θ); and 10 of Lists (L#), Statistics (C#), Complex Numbers (Z#), Matrices (M#), Graphic Objects (G#)

Original Price:  about $100.00 

Memory:  256 KB RAM and 2 MB Flash


Other Features


*  Numerical calculus:  integral and derivative

*  Floor, ceiling, fraction, integer, mantissa, exponent parts

*  Complex numbers

*  Polynomial calculations and roots 

*  Matrices and lists

*  Conversions and library of scientific constants


A great feature is the HELPWITH command, as called with the keystrokes [ SHIFT ] [ 2 ] (SYNTAX).  



Keyboard


The keys are pretty responsive.  The keyboard is a beautiful dark gray with light gray and black keys.  The knocks:  first, the alpha characters are in gold, which the font does not contrast well the background.   Another thing I do not like is the alpha characters are placed below keys.  For example:  [ VARS ] has the character A, [ SIN ] has the character E.  


Another challenge is that the double quotes and single quotes are not available directly from the keyboard, and must be accessed through the CHARS menu.   In regular calculation, this may not make much of a difference, but in programming, it makes a big difference when it comes to messages and prompts.   The alpha-lock is regulated to a soft key.  



Equation Writer and CAS 


The HP 40gs has two ways to operate computer algebra system commands:


*  From Home, use of the symbolic variables which takes the form of S# (S1, S2, S3, etc).


*  Equation writer, which is selected by the (CAS) soft key.   In the equation writer, you can build and simplify equations.   The equation writer can use any variable, and is similar to the HP 48S and 48G family (including the HP 50g).   











Aplets 


Aplets are the HP 40gs' applications which includes:


*  Finance:  Time Value of Money and Amortization Table

*  Function:  Plot up to ten functions, F#(X)  where # 0-9

*  Inference:  Hypothesis tests

*  Linear Solver:  Solve 2 x 2 or 3 x 3 linear systems

*  Parametric:  Plot up to ten parametric pairs, X#(T), Y#(T)

*  Polar:  Plot up to ten polar equations, R#(Θ)

*  Quad Explorer: Dynamic graphing, y = a*(x+h)^2 + v

*  Sequences: Plot up to ten sequences, U#(N), with one or two initial conditions

*  Solve:  Store up to ten equations, solve for any one at a time

*  Statistics:  Statistics for 1 or 2 variables.  In 2 variable statistics, 8 regressions plus a user-defined 

*  StreamSmart:  Data streamer device which collects data, stream it, and analyze data 

*  Triangle Solve:  Solves for right triangles and regular triangles

*  Trig Explorer: Dynamic graphing:  f = sin(x ± n*π) and f = cos(x ± n*π)


Aplets can be modified and copied.  



Programming


The program language of the HP 40gs is the same as the HP 38G/39G series.  Each line, except for the last line, must end with a colon (:).   Arguments are separated with a semicolon (;).  


The learning curve of the programming language is little complex, especially when it comes to setting views and customizing aplets.   Thankfully the user guide is thorough, so make sure you have the book or the pdf download, which you can access here:


http://h10032.www1.hp.com/ctg/Manual/c00748685.pdf


  

Two Sample Programs


HP 40gs Program RANDLIST


Generate a list of random numbers of length N.


INPUT N; "LIST LENGTH"; "N:"; ""; 5:

MAKELIST(RANDOM,X,1,N,1)▶L0:

ΣLIST(L0)▶S:

S/N▶A:

-10 ▶Xmin:

10 ▶Xmax:

-10 ▶Ymin:

10 ▶Ymax:

ERASE:

DISPXY -6; 4; 2; "Σ:":

DISPXY 0; 4; 2; S:

DISPXY -6; 1; 2; "μ:":

DISPXY 0; 1; 2; A:

DISPXY -6; -2; 2; "n:":

DISPXY 0; -2; 2; N:

FREEZE:



HP 40gs Program PLOTPX


Asks for A, B, and C in a quadratic equation and stores it to the Function F0(X)


DISP 1; "2022-08-15 EWS":

DISP 2; "y=Ax^2+Bx+C":

FREEZE:

SELECT Function:

INPUT A; ""; "A"; ""; 1:

INPUT B; ""; "B"; ""; 1:

INPUT C; ""; "C"; ""; 1:

'A*X^2+B*X+C' ▶ F1(X)

CHECK 1:

MSGBOX "PRESS PLOT"


Note:  This language is similar to the later HP Prime, which most line ending with a semicolon.  



A Predecessor to the HP Prime?  Final Thoughts 


A lot of the features and structure of the HP 40gs would be present in the HP Prime:  among other things, a solver, program that can select aplets (apps) and set custom views but most of all, a separate CAS mode.  


The HP 40gs is a nice calculator with a ton of features.  I think the HP 40gs was rarely available in the United States because of the CAS mode, because like the HP 39gs, the 40gs is aimed towards the education market.  The key contrast could be better and adding the quotes to the keyboard would be nice.


Eddie


All original content copyright, © 2011-2022.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Saturday, November 13, 2021

TI-92 Plus: Solving Problems Step by Step

 TI-92 Plus:  Solving Problems Step by Step


This program should work with the TI-89 family (TI-89, TI-89 Titanium, Voyage 200).  





Some CAS Tricks Used


With the help of the TI-89/92 Plus manual and adding restrictions with the with ( | ) command:


ln(x^y) | x>0 and y>0 returns x


expand(ln(x∙y)) | x>0 and y>0 returns ln(x)+ln(y)


sin^-1(sin(x)) | x≥-π/2 and x≤π/2 returns x


tan^-1(tan(x)) | x≥-π/2 and x≤π/2 returns

(mod(2∙x-π,2∙π)/2) - π/2


√(x^2) | x≥0 returns x


Also, the part command can be used to pick out parts of an equation or expression.  Using left and right can extract sides of an equation.


Example:


left(2∙x+5 = 3∙y) returns 2∙x+5


right(2∙x+5 = 3∙y) returns 3∙y


TI-92 Plus Program: steps


The equations offered in this program are:


a∙x+c = b

a∙x+b = c∙x+d

a∙x^2 + c = b

y = a∙b^x

√(a∙x+c) = b∙x+d

x^2+(2∙a)∙x = b

1/x+1/a = 1/b

sin(a∙x)∙cos(a∙x) = b



Click on the picture below for the code:




Or you can download the file (.9xf) here:


https://drive.google.com/file/d/1c0DN8gkH_9jWWpSniilsZoYfOs9EBu7v/view?usp=sharing



Take care,


Eddie 



All original content copyright, © 2011-2021.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, February 7, 2021

TI-86 and DM42/HP42S: Square Root Simplification

TI-86 and DM42/HP42S:  Square Root Simplification


Introduction


The program SQROOT attempts to factor √N into the form A√B (N, A, and B are positive integers).  The program tests whether X^2 evenly divides into N from X = 1 to int(√N).  If successful, let A = X and B = N/X^2.


Example:  


√88   (N = 88)

int(√88) = 9


Test:

88/9^2 ≈ 1.0864

88/8^2 = 1.375

88/7^2 ≈ 1.7959

88/6^2 ≈ 2.4444

88/5^2 = 3.52

88/4^4 = 5.5

88/3^2 ≈ 9.7778

88/2^2 = 22    


2^2 (4) divides into 88 evenly.  


Then A = 2, B = 22.  Therefore √88 = 2√22


TI-86 Program:  SQROOT


*  This code should work on the TI-83/TI-84 Plus family with no or very minor adjustments.


*  The arrow -> is made of two characters:  the minus sign (-) and the greater than sign (>).  


"2021-01-06 EWS"

Disp "√N -> A√B"

Prompt N

iPart(√N)→X

While X≠0

If fPart(N/X^2)==0

Then

X→A 

N/X^2→B

Goto A

Else

X-1→X 

End

End

Lbl A

Disp "√N = A√B : A=", A, "B=" , B



HP 42S/DM42/Free42 Program: SQROOT


*  The character ├ appends (attaches) alpha strings together.  To designate strings to be attached, press ENTER while in ALPHA entry mode.


*  Similarly, pressing RCL while ALPHA mode will allow you to recall the value of a register and attach it to current alpha string.


* The ALL mode is similar to the standard and float mode.


* Registers:  R00 = N, R01 = A, R02 = B


00 {52-Byte Prgm}

01 LBL "SQROOT"

02 "N?"

03 PROMPT

04 STO 00

05 SQRT

06 IP

07 STO 01

08 LBL 00

09 RCL 00

10 RCL 01

11 X↑2

12 ÷

13 STO 02

14 FP

15 X=0?

16 GTO 01

17 1

18 STO- 01

19 GTO 00

20 LBL 01

21 ALL

22 CLA

23 "√"

24 ARCL 00

25 ├"="

26 ARCL 01

27 ├"√"

28 ARCL 02

29 END


Examples


√88 = 2√22


√46 = 1√46


√178 = 1√178


√200 = 10√2


Eddie


All original content copyright, © 2011-2021.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


DM42 and HP 42S: Quadratic Equation, Characteristic Polynomial, and Eigenvalues

DM42 and HP 42S: Quadratic Equation, Characteristic Polynomial, and Eigenvalues The programs are listed for the Swiss Micros DM42 an...