Showing posts with label geometric mean. Show all posts
Showing posts with label geometric mean. Show all posts

Saturday, April 19, 2025

Sharp EL-512: Lorentz Factor, Table, Geometric Mean, 3D Vectors

Sharp EL-512: Lorentz Factor, Table, Geometric Mean, 3D Vectors


Blog entries now made in Windows 11. 


Two Sharp calculators. Left: EL-510RN (current) and EL-512 from 1984
Two Sharp calculators. Left: EL-510RN (current) and EL-512 from 1984


Today’s blog will feature the classic Sharp EL-512 from the 1980s. The Sharp EL-512 is a keystroke programming calculator. The EL-512 has four program slots with a memory of 128 programming steps. All programs on the EL-512 are “entered in the blind” and must be entered in full each time.


Program commands:


[ x ]: prompt for a number. When editing a program, we will need to enter a valid number to continue the program.

LOOK: Stops the program and shows the immediate results.


Memory and recall:


STO: Stores the number in the display to memory register 1-9

x → M: Store the number in the display to memory M

M+: add to memory M

RM: recall memory M

Kn:

After a clear or an arithmetic key, just recalls the contents of memory register 1-9.

After entering a number, multiplies the number in the display by the contents of the memory register 1-9 (like RCL× K#)


To recall a register without alteration, it is always safe to multiply the register by 1:

1 Kn #


My review from 2020:

https://edspi31415.blogspot.com/2020/09/retro-review-sharp-el-512-scientific.html



Lorenz Factor


LF = (√(1-v²/c²))⁻¹

c = Speed of light in a vacuum = 299,792,452 m/s


Program:

x²

÷

299792458

x²

+/-

1

=

√

1/x


Examples:

v = 2.1E8 (2.1 * 10^8) m/s; Result: 1.401212716

v = 2,456,000 m/s; Result: 1.000033559

v = 1,000,000 m/s; Result: 1.060752


Table: Quadratic Polynomial


Generate a table using the function:


f(x) = K3 × x² + K2 × x + K1

where x increases by 1.


Before running the program, store the following:


x² coefficient: K3

x coefficient: K2

constant coefficient: K1

beginning value: Subtract 1, then store the starting value in M. For example, if we want to start with x = 1, store 0 in M.


Program:

1

M+

RM

x²

Kn 3

+

RM

Kn 2

+

1

Kn 1

=


Example:

f(x) = 0.3 × x² + 4 × x – 2.01

Start with x = 1


0.3 STO 3

4 STO 2

-2.01 STO 1

1-1 = 0 x→M

Run the program:


f(1) = 2.29

f(2) = 7.19

f(3) = 12.69

f(4) = 18.79

f(5) = 25.49



Geometric Mean


This program calculates the geometric mean (Π(x_i)^(1/n)) by the formula:

GM = 1/n × Σ(ln x_i) (x≠0)


This will require two program slots, so I’m using program slots 1: and 2:.


Memory registers used:

K1 = Σ(ln x_i)

M = n


Steps:

1. Store 0 to memory M (x→M) and memory 1 (STO 1)

2. Enter x_i and press 1:. Continue until you enter all the data. The number of data points is shown.

3. Press 2: to get the geometric mean.



Program 1:

ENT (enter a valid number)

LN

+

Kn 1

=

STO 1

1

M+

RM


Program 2:

RM

1/x

Kn 1

e^x


Example:

Find the geometric mean of 4, 9, 3, 7, 2, 8, 8, 5, and 6. 9 data points.


0 x→M, 0 STO 1

4 [1:], 9 [1:], 3 [1:], 7 [1:], 2 [1:], 8 [1:], 8 [1:], 5 [1:], 6 [1:]

[2:]

Result (geometric mean): 5.2254102087



3D Vectors: Norm of Two Vectors, Dot Product, Angle between Vectors


For this, I presume that the calculator is set to the desired angle setting (DRG). For the example, I have the EL-512 set to degree mode.


Store the vectors as follows:

First vector: [ register 1, register 2, register 3 ]

Second vector: [ register 4, register 5, register 6 ]


The program returns four values:

Norm of the first vector, stored in register 7

Norm of the second vector, stored in register 8

Dot product, stored in registered in M

Angle between two vectors, stored in register 9


Program:

1

Kn 1

↕

1

Kn 2

→rθ

↕

1

Kn 3

→rθ

STO 7

LOOK


1

Kn 4

↕

1

Kn 5

→rθ

↕

1

Kn 6

→rθ

STO 8

LOOK


1

Kn 1

Kn 4

x→M

1

Kn 2

Kn 5

M+

1

Kn 3

Kn 6

M+

RM

LOOK


÷

(

1

Kn 7

Kn 8

)

=

cos⁻¹

STO 9


Example:

First vector: [ 70, 64, 36 ]

Second vector: [ 55, 18, 94 ]

Results:

Norm of first vector: 101.4494948

Norm of second vector: 110.3856875

Dot product: 8386

Angle: 41.50953299°


Hope you enjoyed this trip down memory lane. Did you have or do you have a Sharp EL-512 or any similar calculator?


Eddie


All original content copyright, © 2011-2025. 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, October 21, 2018

HP 11C (and Emulators): The Four Means

HP 11C (and Emulators):  The Four Means

Introduction

The following program uses the statistical registers to calculate four types of mean:

Arithmetic Mean:  μ = Σx / n

Harmonic Mean:  HM = n / Σ(1/x)

Geometric Mean:  GM = (Πx) ^ (1/n)

Root Mean Square:  RMS = √(Σx^2 / n)


The HP 11C uses the following registers in statistical analysis.  Be sure to clear registers by pressing [ f ] [ x<>y ] (CLEAR REG) before beginning.  Also, after clearing the registers, store 1 in register 7 (R7).  

R0 = n
R1 = Σx
R2 = Σx^2
R3 = Σy
R4 = Σy^2
R5 = Σxy

LBL A:  Enter data
LBL B:  Analysis: μ [R/S], HM [R/S], GM [R/S], RMS

HP 11C Program: The Four Means

Don't forget to store 1 in R7 prior to running the program. 

001 42, 21, 11 LBL A
002 49 Σ+
003 43, 36 LAST x
004 44, 20, 7 STO× 7
005 15 1/x
006 44, 40, 6 STO+ 6
007 43, 32 RTN

008 42, 21, 12 LBL B
009 43, 0         x-bar 
010 32 R/S
011 45, 6         RCL 6
012 15 1/x
013 45, 0 RCL 0
014 20 *
015 31 R/S
016 45, 7         RCL 7
017 45, 0         RCL 0
018 15 1/x
019 14 y^x
020 31 R/S
021 45, 2         RCL 2
022 45, 0         RCL 0
023 10 ÷
024 11 √
025 43, 32 RTN

Example:
Sample set:  4.25, 4.08, 5.63, 6.13, 4.48, 7.02 ( 6 data points )

Keystrokes:

4.25 [ f ] [ √ ] (A)
4.08 [ f ] [ √ ] (A)
5.63 [ f ] [ √ ] (A)
6.13 [ f ] [ √ ] (A)
4.48 [ f ] [ √ ] (A)
7.02 [ f ] [ √ ] (A)

[ f ] [e^x] (B)   5.2650 (arithmetic mean, μ)
[R/S] 5.0556 (harmonic mean, HM)
[R/S] 5.1575 (geometric mean, GM)
[R/S] 5.3748 (root mean square, RMS)


Eddie
All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

Friday, May 25, 2018

TI-84 Plus CE Programs from Casio FX-702P


TI-84 Plus CE Programs from Casio FX-702P

Notes

Here are several programs from the “Bilbliotheque De Programmes” for the Casio FX-702P translated for the Texas Instruments TI-84 Plus CE.  I understand that there is an English version of the book, but I have yet to find it online.  I am thankful to Google Translate since I am not fluent in French. 

I named each of the programs FX702P##, starting with 02.  Of course, use the program name that fits. 

Basic doesn’t translate directly to the TI-84 Plus programming language.  First of all, there are no line numbers for the TI-84 Plus, separate labels had to be created.  I added more descriptive lines to prompts and results strings because (1) the TI-84 Plus CE has a lot more programming space than the 1,680 bytes the Casio FX-702P offered, and (2) it helped me understand what the programs were. 

The reference page ties to the page in the document, not the PDF page. 

TI-84 Plus CE Program FX702P02  (ref. page 85)
Geometric Mean:  Enter 0 to stop data entry

"GEOMETRIC MEAN (85)"
"2018-05-20"
1→A:1→B
Lbl 20
Disp "X-",A
Input X
If X=0:Goto 60
A+1→A:B*X→B
Goto 20
Lbl 60
Disp "G=",B^(1/(A-1))

TI-84 Plus CE Program FX702P03 (ref. page 117)
Chemistry:  Analysis of an Acid

"ACID PRGM, 2018-05-20"
"(117)"
For(J,1,10)
Input "T= (0:END)",T
If T=0:Stop
37-T→T
Input "P*=",A
Input "PH=",P
Input "H=",H
.019T→B:A*10^(B)→A
Disp "P*=",A
P-.0146T→P:Disp "PH=",P
.0307A→C:C*10^(P-6.11)→D
Disp "(HC03­)=",D:Pause
D-(9.5+1.63H)(7.4-P)-24→C
(1-.0143H)C→B
Disp "BE=",B
(1+10^(P-6.11))→I:.0307AI→I
Disp "I=",I:Pause
End


TI-84 Plus CE Program FX702P04  (ref. page 131)
Accounting:  Calculate Accounts Receivable on outstanding invoices

"BILL REDUCTION (131)"
"2018-05-20 EWS"
1→Z:0→E:0→F
Lbl IN
"AMT: A"+toString(Z)+":"→Str1
Input Str1,A
"PERCENT: B"+toString(Z)+":"→Str1
Input Str1,B
"DAYS: C"+toString(Z)+":"→Str1
Input Str1,C
int(A*B/100*C/365+.5)→D
E+A→E:F+D→F
"AMT: D"+toString(Z)+":"→Str1:Disp Str1,D
Pause
Z+1→Z
Menu("MORE DATA?","YES",IN,"NO",NO)
Lbl NO
ClrHome
Disp "TOTAL INVOICES:",E
Disp "TOTAL INTEREST:",F
Input "COMMISSION:",X
E-F-X→N
Disp "NET RECIEVABLE:",N


TI-84 Plus CE Program FX702P05 (ref. page 73)
Thermal Stress

Disp "THERMAL STRESS"
"2018-05-22 EWS"
Disp "LINEAR EXPANSION","COEFFICIENT"
Input "L1:",L
Input "L2:",M
Disp "ELASTIC","COEFFICIENT"
Input "E1:",E
Input "E2:",F
Disp "CROSS SECTION"
Input "A1:",A
Input "A2:",B
Input "T:",T
EF(L-M)T→C
C/(EA+FB)→C
­(BC)→R:AC→S
ClrHome
Disp "THERMAL STRESS","A:","B:"
Output(2,5,R)
Output(3,5,S)


TI-84 Plus CE Program FX702P06  (ref. page 206)
Construction:  Concentrated Load on a Beam

Disp "BEAM FIXED AT","BOTH ENDS UNDER","CONCENTRATED LOAD"
"(63) 2018-05-22 EWS"
Degree
Input "YOUNG MOD (KG/MM^4):",E
Input "INERTIA (MM^4):",I
Input "LENGTH (MM):",L
Input "SUPPORT-LOAD DIST:",A
Input "LOAD (KG):",P
E*I→B
Input "INTEREST POINT:",X
If X≤A
Then:A→Y:X→Z
Else:L-A→Y:L-X→Z
End
Z(L+2Y)→C:P(L-Y)^2/L^3→D
D*Z*Z/6/B*(C-3*Y*L)→F
tan^-1(D*Z/2/B*(C-2*Y*L))→S
D*(C-Y*L)→M
D*C/Z→W
ClrHome:Fix 4
Disp "FLEXION (MM):"," ANGLE:"," TORQUE:","SHELL LOAD:"
Output(1,14,F)
Output(2,14,S)
Output(3,14,M)
Output(4,14,W)
Float

TI-84 Plus CE Program FX702P07 (ref. page 41)
Electronics:  Active Low-Pass Filter

Disp "ACTIVE LOW-PASS FILTER"
"(41) 2018-05-22 EWS"
Input "FREQ (HZ):",F
Input "AF:",A
Input "C1 (MICRO-F):",C
C/1E6→C
√(2)/(4*A*π*F*C)→R
A*R→S
S/(A+1)→T
2*(A+1)*C*1E6→U
ClrHome
Disp "R1:","R2:","R3:",C2:"
Output(1,5,R)
Output(2,5,S)
Output(3,5,T)
Output(4,5,U)


Source: Casio.  “Bibliotheque De Programmes FX-702P” (French document)  1985

You can find a PDF of the book in French on this page: http://casio.ledudu.com/pockets.asp?type=53&lg=eng .  Scroll down to the bottom of the page.  Also, shout out to the casio.ledudu.com page because it is an excellent site!


Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

Python in Numworks: Duplicating and Grayscale

Python in Numworks: Duplicating and Grayscale All three scripts presented today use the math, random, and the Numworks specific ...