Sunday, April 14, 2024

Spotlight: Sharp EL-5200

 Spotlight: Sharp EL-5200


As we come on the 13th (April 16) anniversary of this blog, I want to thank you. Blogging about mathematics and calculators is a joy in my life and I’m grateful for your support.



Today’s spotlight is about an early graphing calculator, which is a rare collector’s item today: the Sharp EL-5200, also known as the Sharp EL-9000.








Quick Facts



Model: EL-5200/EL-9000

Company: Sharp

Timeline: 1986 – late 1980s

Type: Graphing, Programmable

Memory: 5,120 bytes

Power: 2 x CR2032 batteries



Keyboard


There are excellent reviews and articles on the Sharp EL-5200/EL-9000, please check out the Sources section below.

The EL-5200 is a folding calculator which is housed in a wallet. On the left side, we have the scientific keys, the arrow keys, memory keys, and the numeric keypad. The keys are the normal calculator keys.

On the right side, there are the alphabetic keys and the utility keys. I think the key style on the right side is a membrane keyboard, but I am not sure.



The Four Main Modes



The four main modes of the Sharp EL-5200 are, which are listed in switch order:

STAT mode

COMP mode

AER II mode

AER I mode



AER II and AER I modes are programming mode, which is called the Algebraic Expression Reserve mode. The AER I mode is the classic AER mode while AER II is the newer version of programming mode.



The manual to the EL-9000 can be downloaded here: http://basic.hopto.org/basic/manual/Sharp%20EL-9000%20EN.pdf



STAT Mode

This is the calculator's statistics mode. Upon switching to this mode, we have the option of storing data points. Data points are stored in array S while basic statistics are stored in array Z. The basic statistics stored in array Z are:



Z[1] = n

Z[2] = Σx

Z[3] = Σx^2

Z[4] = Σxy

Z[5] = Σy

Z[6] = Σy^2



Be aware when you decide to store data, it takes up programming memory.

Three keys are remapped as follows:

[ RM ]: CD. Clear data. Erases a data point.

[ ⇒M ] (x, y): Adds a comma between the x point and y point.

[ M+ ] DATA: Adds a data point.



The statistic variables are access through the second function ([2ndF]) of the numeric keypad and arithmetic keys.



Linear regression is offered in the form of y = a + bx. The variable a is the y-intercept while the variable b is the slope.



Adding × n before pressing [ M+ ] {DATA} adds the frequency to the data point.



Graphs of statistical data are available, including histograms, linear regression lines, and scatter plots.



Fairly simple.



COMP MODE



This is our calculation mode. In addition to our regular scientific calculator, which operates in algebraic mode, there are other sub-modes included in COMP Mode.



Graphing




We can graph up to two functions at one time. The [ RANGE ] key allows to set the range parameters, while the [ AUTO ] key sets the zoom level automatically. The [DRAW] key draws the graph.



For example, to draw y(x) = x^2 + 5 using automatic zoom, key in [ GRAPH ] [ X ] [ x^2 ] [ + ] 5 [ AUTO ] [ DRAW ].



The screen takes up the entire left hand of the screen. The screen shows one coordinate at a time, X or Y. Switch between the two with the key sequence [ 2ndF ] [ ↑ ] {X<>Y}.



Matrices


The EL-5200 can store up to 26 matrices A-Z. Operations include determinant, inverse, transpose, and matrix arithmetic. We can get to the arrays at any time by pressing [ 2ndF] [↓].

In fact, the [ 2ndF ] [ ↓ ] toggles between the text (calculator), graphics, and data/array screen.

The [ 2ndF ] [ A ] {DIM} sequence can set the dimensions of a matrix.

In the data screen, we see two elements at one time.


Base Conversions


Integers can be converted between four bases: hexadecimal, binary, decimal, and octal. (bases 16, 2, 10, and 8, respectively) Not much more than arithmetic is offered.



Running Programs

Finally, COMP mode is where we run AER programs. Scroll through the programs with the [ PRO ] button. Start programs and enter data at the prompts by using the [ COMP ] key.


AER I MODE


AER I mode is the classic programming mode for Sharp programming calculators. This mode is meant for simple calculations. The [ f()=/? ] key puts the input form     f( )=. Enter the variables in between the parenthesis, and the variables will automatically be prompted. For example f(AB)= prompts for the variable A, then B. Only global variables (A – Z) are used. Implied multiplication is allowed. This mode is similar to the AER mode of EL-5100 from 1979.



Example: Circular Radius and Circumference

Title:

CIR.1

Code:

M: f( R ) = π × R^2 ⇒ A, 2 × π × R ⇒ C

(spaces are added for readability)


AER II MODE


AER II is the full programming mode. In this mode, we can use both global and local variables, with local variables being the default. Local variables include lower case letters and subscript numbers. Subscript numbers are entered by the sequence [ 2ndF ] [ number key ]. In this mode, the [ f()=/? ] key adds a question mark to the variable and creates a prompt. Unlike AER I, implied multiplication is not allowed.



Example: Graphing a Sine Wave

Title:

Graph A×sin(Bx+C). Set radians mode.

Code:

M: A = ? B = ? C = ? GRAPH A × SIN (B × X + C) AUTO DRAW

(spaces are added for readability)



There is no Radians mode command, so the user has to set Radians mode during program execution.


Common to Both Program Modes



M: This is the main loop.

, (comma): Displays the result of a calculation and pauses the execution. Press [ COMP ] to continue.

␣ (open space) : Finishes a calculation without stopping.

◣ (right triangle): Ends the current program or subroutine.

↳ ↰ : Loop markers

(comparison) -Y→[(do if true)] -N→[(do if false)]: If Then Else Structure.

[ 2ndF ] {SUB}: Creates a new subroutine. Switch between subroutines and the main loop by pressing [ 2ndF ] [ ↑ ] or [ 2ndF ] [ ↓ ].



To create a new program, go to either AER I or AER II mode, press [ COMP ], enter the title. The title is not limited to eight characters. Since we do not have string or string functions, include descriptive information and reminders in the title (see the example in AEI II Mode above).



I find the symbols taking a bit getting used to because we have symbols instead of the regular If-Then-Else-End structure, For-Next loop, Lbl-Goto structure, etc. AER can store complex formulas and best are for simple number crunching.



Overall Thoughts



I like the separate alphabetic keys, but the membrane keyboard calls for extra care when using those keys. The number of features of the EL-5200 are very invented and advanced for 1986. I wish the AER programs had line returns instead everything smashed together in wrap around lines, but it is more for readability. The calculator has a nice, compact form and is fun to work with.


In the future I will be posting AER programs for the EL-5200. It’s rarity makes the EL-5200/EL-9000 collectible.




Sources


Calculator Culture. “Sharp EL-9000 Graphing Calculator from 1986” November 27, 2023.

https://www.youtube.com/watch?v=cw7Gp2Qrmtk


Gelhaus, Matthew & Taia Gelahus. “Sharp EL-5200” gelahus.net. Last Updated December 21, 2023. http://www.gelhaus.net/cgi-bin/page.py?loc:8bit/+content:EL-5200.html Retrieved March 1, 2024.


Magyarra, Váltás “History and Programming of AER Calculators”. Milestone in the History of Calculators. Virtual Museum of Calculators. 2016. Retrieved March 25, 2024. http://www.arithmomuseum.com/szamologep.php?id=25&lang=en


Sharp Corporation. Sharp Scientific Calculator Super Scientific Model EL-9000 Operation Manual. 1986 http://basic.hopto.org/basic/manual/Sharp%20EL-9000%20EN.pdf

(website hosted by hopto.org) (this the same manual for the EL-5200)



Eddie


All original content copyright, © 2011-2024. 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, April 13, 2024

HP Prime: Hagen-Poiseuille Law

HP Prime: Hagen-Poiseuille Law


The Hagen-Poiseuille Law relates flow of water with the change in pressure in the pipe:


Q = K × D^4 × ΔP / (μ × L) where:


K = constant = π / 128 (dependent on the pipe’s diameter)

D = diameter of the pipe (in m)

L = length of the pipe (in m)

ΔP = change in pressure (in Pa)

Q = flow rate (in m^3/s)

μ = viscosity of water (Pa a)



Short Table of Viscosity of Water


Temperature

Viscosity of Water (mPa s)

5 °C (41 °F)

1.5182

10 °C (50 °F)

1.3059

15 °C (59 °F)

1.1375

20 °C (68 °F)

1.0016

25 °C (77 °F)

0.89

30 °C (86 °F)

0.7972


Note that 1 Pa s = 1,000 mPa s


The program references the above table for certain temperatures. The program asks for temperature in degrees Celsius (°C). If any other temperature is entered, the empirical formula known as the Vogel-Fulcher-Tammann Equation is used:


μ = 0.02939 × e^( 507.88 K ÷ (T K – 149.3 K))

= 0.02939 × e^( 507.88 K ÷ ((T °C + 273.15) K – 149.3 K))

= 0.02939 × e^( 507.88 ÷ (T + 123.85))


Equations


Calculating flow:

Q = (π × D^4 × ΔP)/(128 × μ × L)



Calculating Pressure Change:

ΔP = Q × μ × L × 128/(D^4 × π)


HP Prime Code: Hagen-Poiseuille Law


EXPORT HAGEN()

BEGIN

// 2024-02-22 EWS



// local variables

LOCAL ch1;

LOCAL u,t,d,l,p,q;

LOCAL t1,t2,t3;



// list of temps

t1:={"5°C","10°C","15°C",

"20°C","25°C","30°C","Other"};

t2:={1.5182,1.3059,1.1375,

1.0016,0.89,0.7972};

t3:={5,10,15,20,25,30};

// inputs

INPUT({{t,t1},d,l,{ch1,{"ΔPressure",

"Flow Rate"}}},

"Hagen-Poisuelle Law",

{"t:","d:","l:","Solve for:"},

{"Temp of water (ºC)","Pipe Diameter (m)",

"Pipe Length (m)"});



// temp to viscosity

// from table

IF t≤6 THEN

u:=t2(t)/1000;

t:=t3(t);

ELSE

// empirical formula

INPUT(t,"Enter temp in °C","t:");

u:=0.02939*e^(507.88/(t+123.85))/1000;

END;



PRINT();

PRINT("RESULTS:");

PRINT("Temperature: "+STRING(t)+" °C");

PRINT("Viscosity = "+STRING(1000*u)+" mPa s");



// solve for pressure

IF ch1==1 THEN

INPUT(q,"Enter flow rate","q:","m^3/s");

p:=q*u*l*128/(d^4*π);

PRINT("ΔPressure = "+STRING(p)+" Pa");

RETURN {t,u,p};

END;



// solve for flow rate

IF ch1==2 THEN

INPUT(p,"ΔPressure:","Δp:","Pa");

q:=(π*d^4*p)/(128*u*l);

PRINT("Flow Rate = "+STRING(q)+" m^3/s");

RETURN {t,u,q};

END;

END;



Examples


Example 1:

Temp = t = 20°C

Flow = q = 0.5 m^3/s

Solve for Δp

Results:

Viscosity = μ = 1.0016 mPa s

Pressure Change = Δp = 199.261988751 Pa


Example 2:

Temp = t = 10°C

Pressure Change = Δp = 150 Pa

Result:

Viscosity = μ = 1.3059 mPa s

Flow = q = 0.28868299137 m^3/s


Example 3:

Temp = t = 33°C

Flow = q = 0.36 m^3/s

Solve for Δp

Results:

Viscosity = μ = 0.748935277403 mPa s

Pressure Change = Δp = 107.277076309 Pa



Sources


Lauga, Eric. Fluid Mechanics: A Very Short Introduction. Oxford University Press: Oxford, UK 2022. pp. 36-37


“Fluid of Viscosity” Wikipedia. https://en.wikipedia.org/wiki/Viscosity Retrieved February 5, 2024.


“Viscosity of Liquids and Gases” and “Viscosity of Water” HyperPhysics. http://hyperphysics.phy-astr.gsu.edu/hbase/Tables/viscosity.html Retrieved February 8, 2024.


Until next time,


Eddie


All original content copyright, © 2011-2024. 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.

Thursday, April 11, 2024

Numworks Updates

Numworks Updates


Apologies that I have not done anything with Numworks in what seems to be forever. 


The current official software is Version 22:

*  Polar and algebraic form of complex numbers are displayed in the expanded results in Calculator mode

* Chi-Square test added to the Inference app

*  Better navigation of the Elements (Periodic Table) app

*  The toolbox button also can escape the toolbox without selecting a command or function


More information:

https://www.numworks.com/calculator/update/version-22/


Version 23 is in beta stage and some the intended offerings are:

*  1st and 2nd Derivative Plots in the Grapher app

*  f' and f'' notation for derivative

* Change in notion of polar and parametric functions, also become accessible in the variables menu

* Python:  The distance function becomes available Turtle module 


More information:

https://www.numworks.com/calculator/update/version-23/


Eddie


All original content copyright, © 2011-2024. 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, April 7, 2024

Swiss Micros SM32: Simulating a Choose Menu

Swiss Micros SM32: Simulating a Choose Menu


The following technique should work for the HP 33S and HP 35S, but most likely HP 32S/32SII due to the lack of memory (you could shorten or eliminate the messages, I suppose.).


What Is Needed


  • We will need at least two labels.
  • The user flags as needed. For the DM32, the user flags are from Flag 0 to Flag 4. This allows for up to five choices.
  • A choice variable. This variable holds the user’s choice from the menu. The algorithm presumes that the user will always enter a valid choice.
  • Clever calculation, as we start with the reference value in the X stack.
  • Flag 10, which allows us to display the choices and messages.



General Algorithm Format


LBL 1 (run the algorithm here)

CF 0 through CF 4 (as needed)

SF 10 ( [ |→ ] {FLAGS} {SF} [ . ] 0 )

“introduction message” (if desired)

PSE (follow each string with a pause)



LBL 2 (menu and main calculation)

“#a (description)”

PSE

“#b (description)”

PSE

INPUT CV (choice variable)


RCL CV

#a

x=y?

Value_a


RCL CV

#b

x=y?

INPUT α


STO α (store a reference value for future use)


(calculation)


CF 0, CF 1, CF 2, CF 3, CF 4 (clear all flags used)

CF 10

“RESULT =“ (if desired)

PSE (if desired)

VIEW (variable with result)

GTO (Lbl 1) or RTN


Notes: 

  • #a, #b, … corresponding flags, 0 – 4.
  • CV: choice variables (i.e. C, H, etc.)
  • α: reference value used
  • Choice #b demonstrates how we can allow the user to input their own value.


Entering Strings


Setting Flag 10 turns equation evaluation off. Now each typed “equation” now acts as a string. Enter strings by:


1. Pressing the right shift key [ |→ ], or the blue shift key on the DM32, then [ ST0 ] { EQN }.

2. Letters are entered by pressing [ RCL ] { letter }. Numbers can be entered as well. The equals key is entered by pressing [ |→ ]/[ blue shift ] [ ← ] { = }. The screen is 12 characters long before it scrolls. Note: We do not have the period or the question mark as available characters.

3. Press [ ENTER ] to go on to the next line.



Choice Variable


The choice variable is a pointer to the reference value. There is a one-on-one correspondence between the choice value and the reference value.


For example, say H is the choice variable and reference values are assigned as follows:


H = Choice Variable

Reference Value

1

13.5

2

14.7

3

16.1

If the user selects option 1, then 13.5 is placed on the X stack ready for calculation.

If the user selects option 2, then 14.7 is placed on the X stack ready for calculation.

If the user selects option 3, then 16.1 is placed on the X stack ready for calculation.



Example: Impedance of Transmission Lines


The characteristic impedance of transmission lines of a coaxial line is:


Z = K / √ε × log( D / L ) where:


K = √μ0 / (2 × π × √ε0 × log e) ≈ 138.059528959

D = inner diameter of outer conductor

L = outer diameter of inner conductor

ε = relative permittivity of dielectric medium (E)


The program give us three choices for the dielectric medium:


Material/Choice Variable ( C )

ε

1: Polythene (Flag 1)

2.3

2: Plexiglass (Flag 2)

3.2

3: Your Own (Flag 3)

Enter the ε of the material of your choice at the E? prompt


K is a constant that consists of the following scientific constants:


Vacuum Permeability

μ0 = 1.566370614 × 10^-6 H/m


Vacuum Permittivity

ε0 = 8.854187817 × 10^-12 F/m


Values are taken from the HP Prime, Software Version 2.1.14730 (2023 04 13).


SM32 Code

(Note: This should work on both the HP 33S and HP 35S; and the HP 35S can contain all the code in one label with the correct GTO commands)


// comment


// main program and initialization

T01 LBL T

T02 CF 1

T03 CF 2

T04 CF 3

T05 SF 10

T06 “TRANS-LINE IMP”

T07 PSE


// menu and calculation

M01 LBL M

M02 “REL PERMIT”

M03 PSE

M04 “1 POLYTHENE”

M05 PSE

M06 “2 PLEXIGLASS”

M07 PSE

M08 “3 YOUR OWN”

M09 PSE

M10 INPUT C


// set the flag based on the choice variable

M11 RCL C

M12 1

M13 x=y?

M14 SF 1


M15 RCL C

M16 2

M17 x=y?

M18 SF 2


M19 RCL C

M20 3

M21 x=y?

M22 SF 3


// enter reference value based on choice variable

M23 FS? 1

M24 2.3


M25 FS? 2

M26 3.2


M27 FS? 3

M28 INPUT E

M29 STO E


// calculation

M30 SQRT

M31 1/x

M32 138.059528959

M33 ×

M34 INNER DIAM

M35 PSE

M36 INPUT D

M37 OUTER DIAM

M38 PSE

M39 INPUT L

M40 ÷

M41 LOG

M42 ×

M43 STO Z


// clean up: clear all the flags for the next calculation

M44 CF 1

M45 CF 2

M46 CF 3

M47 CF 10

M48 VIEW Z

M49 STOP

// press R/S to do another problem

M50 GTO T




Examples

Let D = 0.68 in and L = 0.195 in.


Choice 1: Polythene. Resistance: 49.3835 Ω

Choice 2: Plexiglass. Resistance: 41.8669 Ω

Choice 3: ε = 1.95. Resistance: 53.6325 Ω



Source

Hewlett-Packard Company. HP-46 sample applications. Loveland, CO. February 1,1975. Part No. 00046-90018. pg. 26



Hope you find this useful,

Eddie


All original content copyright, © 2011-2024. 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, April 6, 2024

Radius and Apothem of Regular Polygons

Radius and Apothem of Regular Polygons


On this blog, let’s calculate the lengths of a regular polygon’s radius, apothem, and area knowing only the side length and internal angle.



A regular polygon is a polygon in which every side has an equal length, and every internal angle is equal.


Let x be the length of one side of the regular polygon, and θ be the internal angle of the polygon where:


θ = (n – 2) / n × 180°




The radius (r) of the regular polygon is a line segment from a vertex to the center of the polygon. The radius bisects the vertex, therefore cutting the internal angle in half.

The apothem (a) is a line segment from the center of the polygon to the center of the polygon’s line segment. If we extend the apothem beyond the border, the apothem splits the length of the side segment in half.

Zooming in, a right triangle is formed between the radius, apothem, and half of the polygon line segment.


By trigonometry:


tan (θ / 2) = a / (x / 2)

a = (x / 2) × tan (θ / 2)


and


cos (θ / 2) = (x / 2) ÷ r

r = x / (2 × cos (θ / 2))


Knowing the apothem, the area of the regular polygon is:


area = perimeter × a / 2


where the perimeter = n × x


Then:


area = (n × x) × a / 2

= 1 / 2 × n × x × a

= 1 / 2 × n × x × (x / 2 × tan(θ / 2))

= 1 / 4 × n × x^2 × tan(θ / 2)



Another Formula for an Area’s Regular Polygons


The area of a regular polygon is often stated as:


area = 1 / 4 × n × x^2 / (tan (180° / n)) = 1 / 4 × n × x^2 × cot (180° / n))


We can show that the two formulas for area are equivalent:


Note that:

θ = (n – 2) / n × 180°

θ = 180° - 360° / n

Divide both sides by 2:

θ / 2 = 90° - 180° / n

180° / n = 90° - θ / 2 [ I ]




Observe that the trigonometric identity, for any angle α:

tan(90° - α) = 1 / tan(α) = cot(α)

and

cot(90° - α) = 1 / cot(α) = tan(α) [ II ]


Then:

area = 1 / 4 × n × x^2 × tan(θ / 2)

= 1 / 4 × n × x^2 × cot(90° - θ / 2) [ II ]

= 1 / 4 × n × x^2 × cot(180° / n) [ I ]

= 1 / 4 × n × x^2 / tan(180° / n) [ I ]


In Summary:

Internal Angle: θ = (n – 2) / 2 × 180°

Apothem: a = (x / 2) × tan (θ / 2)

Radius: r = x / (2 × cos (θ / 2))

Area = 1 / 4 × n × x^2 × tan(θ / 2) = 1 / 4 × n × x^2 / tan(180° / n)

(Note: 180° = π radians)



Table of Apothem and Radius, with side length of 1


n

θ (in degrees)

θ / 2 (in degrees)

a (to 5 decimal places)

r (to 5 decimal places)

3

60

30

0.28868

0.57735

4

90

45

0.5

0.70711

6

120

60

0.86603

1

8

135

67.5

1.20711

1.30656

12

150

75

1.86603

1.93185


Eddie


All original content copyright, © 2011-2024. 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.

Spotlight: Sharp EL-5200

  Spotlight: Sharp EL-5200 As we come on the 13 th (April 16) anniversary of this blog, I want to thank you. Blogging about mathematic...