Sunday, October 18, 2020

HP 42S/DM42: Height of a Fire, Time to Clear a Corridor

 HP 42S/DM42:  Height of a Fire, Time to Clear a Corridor


HP 42S/DM42/Free42 Program:  FIREHGT


The program FHGT approximates the height of a fire in three scenarios:


* A relatively large fire

* A fire with a base area of approximately 0.5 meter

* A fire set in a corner


The general equation is:


H = factor * Q^0.4


H = height of a fire in meters, including the tip

factor = constant depending on the scenario the fire is set in

Q = energy release rate in kilowatts


00  {119-Byte Prgm}

01 LBL "FIREHGT"

02 "ENERGY? (kW)"

03 PROMPT

04 STO 01

05 LBL 00

06 "TYPE?"

07 AVIEW

08 "LARGE"

09 KEY 1 GTO 01

10 "0.5 M"

11 KEY 2 GTO 02

12 "CORNER"

13 KEY 3 GTO 03

14 MENU

15 LBL 10

16 STOP 

17 GTO 10

18 LBL 01

19 0.23

20 GTO 04

21 LBL 02

22 0.21 

23 GTO 04

24 LBL 03

25 0.075

26 GTO 04

27 LBL 04

28 CLMENU

29 EXITALL

30 RCL 01

31 0.4

32 Y↑X

33 ×

34 "HEIGHT=" 

35 ARCL ST X

36 AVIEW

37 END


Example:


Q = 2650 kW


large fire:  H = 5.38302238231 m

0.5 m fire:  H = 4.9149334795 m

corner fire:  H = 1.7553338554 m


HP 42S/DM42/Free42 Program:  SMOKE


The program SMOKE estimates:


*  The front velocity of the smoke, or how quickly the smoke fills a corridor

*  The time it takes for front velocity to fill the corridor.


Equations used:


V ≈ 0.5 * √(g * (1 - Ta/T) * H)

tf = L / Vf


g = acceleration of gravity, for Earth, g = 9.80665 m/s

Ta = ambient temperature

T = gas temperature  (Ta ≤ T)

H = height of the corridor in meters

L = length of the corridor in meters 


Note 1 - Ta/T = (Da - Dc) / Da

Da = density of the corridor of the ambient air

Dc = density of the fire fluid


00 {99-Byte Prgm}

01 LBL "SMOKE"

02 1

03 "AMB. TEMP?"

04 PROMPT

05 "GAS TEMP?"

06 PROMPT

07 ÷

08 -

09 9.80665

10 ×

11 "HEIGHT? (M)"

12 PROMPT

13 ×

14 SQRT

15 2

16 ÷

17 ENTER

18 "VEL= "

19 ARCL ST X

20 AVIEW 

21 STOP 

22 R↓

23 1/X

24 "LENGTH? (M)"

25 PROMPT

26 ×

27 "TIME="

28 ARCL ST X

29 AVIEW

30 END


Example:


Amb. Temp:  78 °F = 25.555555556 °C

Gas Temp:  103 °F = 39.44444444 °C

Height:  3.048 m

Length:  3.6576 m


Results:


Velocity:  1.622103844 m/s

Time:  2.254849474 s


Source:


Lawson, J.R. and Quintiere, J.G..   "Slide Rule Estimates of Fire Growth". Fire Technology, Vol. 21., No. 4, November 1985, pg. 267



Eddie


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

Review: Catiga CS-121

Review:  Catiga CS-121








Just the Facts:


Model:  CS-121 (could be other model numbers)

Company: Catiga

Type: Graphing

Battery:  Case contains 2 CS-2032 slots, but can run on 1

Logic: Algebraic

Memory Registers: 9 

Colors:  Many colors including Black, Red, Blue.  I purchased a blue CS-121.  


Case and Keyboard


The cover case and calculator casing for the CS-121 is very light.  When sliding the calculator into the case, you really have to listen for the snap to lock the calculator in place.  The keys are very fast and responsive, you will have no problems typing in expressions quickly.  


Screen


Like most graphing calculators, the CS-121 has a large screen.  However, the CS-121 does not use the screen like most graphing calculators.   The CS-121 operates as a large Casio fx-6300g instead.   Graphs take up part of the left side of the screen and you can see only the X or the Y (not both) coordinates during tracing.   The expression line is reduced to the bottom line of the screen.  


This is my biggest gripe of the CS-121.   This screen scheme may have worked on the fx-6300g and its relatives fx-6200g and HP 9g because they have small screens to work with, but the CS-121 should have full screen graphs and allowed the use of the entire screens for expressions in Home mode. 


Features of the CS-121


Left,  Catiga CS-121;  Right, Casio fx-6300g


The CS-121 isn't an entire clone of the fx-6300g because it does have some nice advanced features.  


Graphing:  Functions (up to 2 functions), Parametric (1 parametric pair)

Calculus:  Numeric Integrals of f(x)

Solver:  Solve for any variable

Complex Number Mode:  Arithmetic, Cube, Cube Root, Square, Square Root, Absolute Value, Argument (angle).   The [ENG] acts as the i key.  Switch between showing the real and complex results by pressing [ SHIFT ] [ = ].  All complex numbers operate in rectangular format (a + bi).  

Regressions:  Linear, Logarithm, Exponential, Power, Inverse, Quadratic.   Get the correlation ( r ) by pressing [SHIFT] [ ( ].  

Base-N:  The CS-121 adds boolean logic functions ([x^3] key):  And, Or, Nxor, Xor, Not, Neg

Drawing Tools:  Plot points, lines including lines between two points, horizontal, vertical, and tangent.   It is a little frustrating that the CS-121 does not use the entire screen for graphs because it would really enhance the use of the drawing tools.  


Memory


Let's talk about the memory.  It is very unusual for a graphing calculator to only have nine memory slots (A, B, C, D, E, F, X, Y, M with M+ and M-).  It's because the CS-121 does not have programming.  Yes, you can store an equation in the form var=f(vars) with the [SHIFT] [ Calc ] (PROG) key sequence and calculate using the stored equation by using [ Calc ].  


It is very rare that a graphing calculator does not have programming.  The rare Casio fx-6200g was a direct relative to the fx-6300g and it did not have programming.  


The Learn (LRN) Key


The [LRN] key allows users to shift graphs or change the size of the graphs.  Handy when learning about functions.  


Verdict


I like the keyboard and I like how responsive the calculator operates.  The CS-121 operates on not much batter (ultimately 1 CS-2032 battery).  As said before, my major gripe is the mismanaged use of the screen.   



Eddie


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

HPCC 2020 Virtual Conference and Document Website

 HPCC 2020 Virtual Conference and Document Website 


HPCC 2020 Virtual Conference


The HPCC 2020 Virtual Conference took place on October 10, 2020.   The HPCC is the Handheld and Portable Computer Club is a long running calculator and computer site based out of the United Kingdom.  Their meetings are held virtually on the 2nd and 4th Saturday of every month.  I have recently joined the HPCC and glad to be a part of the club. 

You can find more information on the meetings here:  http://www.hpcc.org, under the Home tab.  Membership rates are between £17 to £23 depending where you live.


The conference has the following speakers and topics:


Eric Rechlin:  USB Drive Update

Jake Schwartz:  Updates to the PPC Archive

Bob Prosperi:  Swiss Micros DM41X - A little late; a lot better

Eric Hazen:  HP-25 Re-implementation on Z80 with VFD display

Michael Park:  MP-29 - a tactile touchscreen calculator

Mark Power:  Prime G2

Sylvain Côté:  Clonix & NoV modules for the HP-41

Edward Shore:  CAS and Calculators

Gene Wright and Włodek Mier-Jędrzejowicz: HP's Worst Calculators

Godwin Stewart:  Presentation on DMConnect 

Will Marchant:  DM16 in a satellite launch campaign


Conference web page:  http://www.hpcc.org/conferences/index.html


Each talk has slides for download and the corresponding YouTube video.  Special thanks to Eric Rechlin. 


HP Documentation Website


Eric Rechlin of hpcalc.org has put together a new website where you can download manuals for Hewlett Packard calculators, past and present.  


Link:  https://literature.hpcalc.org


Coming soon:  the USB that contains information calculator conferences including manuals through 2020 will be available his commerce site,  https://commerce.hpcalc.org.


Eddie  (Edward Shore)


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

Casio Classpad: Theorem of Sós

Casio Classpad:  Theorem of Sós


Introduction: The Theorem of Sós

A set of triple rational numbers (a, b, λ) is considered to be a H-triple if

c = √(a^2 - 2 λ a b + b^2) is also a rational number.  (I)


Heron Triple

Should the set of rational numbers (a, b, λ) can be further test to see if to is also a Heron triple.  That criteria (see source) requires for some numbers λ' and A (area):

λ' = √(1 - λ^2) is a positive rational number, and

A = λ' * abs(a * b) / 2 is a natural number  (positive integer)


This implies for all cases for Heron Triples that abs(λ) < 1, or -1 < λ < 1.

If the H-triple passes, then it becomes a Heron triple and the sides (a, b, c) (see (I) above) are the lengths of a Heron triangle.  

It is possible that an H-triple is not a Heron triple.  

Today's blog focuses on H-triples.  


Generating H-Triples

Given relatively prime integers m and n (where gcd(m,n) = 1) and μ, an H-triple can be generated by the following equations:


(II)

a = μ * (m^2 - n^2)

b = μ * (2*m * (n + λ*m))

c = μ * (m^2 + 2*λ*m*n + n^2)

For a > 0, this requires that m > n.  In the program htrigen, I assume that μ = 1.  In the program, u = λ

Casio Classpad Program:  htrigen

(fx-CP400 and fx-CG500)


'2020-09-15 EWS

'H Triple

Local a,b,c,m,n,u

Input m, "m > n", "m?"

Input n, "m > n", "n?"

Input u, "λ? (rational)"

If gcd(m,n)≠1

Then

Print "m and n are not"

Print "relatively prime."

Stop

IfEnd

(m^2 - n^2) ⇒ a

(2 × m × (n + u × m)) ⇒ b

(m^2 + 2 × u × m × n + n^2) ⇒ c

Print "H-Triple:", ColorMagenta

Print "{a,b,λ}="

Print {a,b,u}, ColorBlue

Print "c="

Print c


Example:

m = 7, n = 3, λ = 2/3


Result:

a = 40, b = 322/3, c = 86


Testing the Theorem of Sós


The program htrist tests the criteria for the triple (a, b, λ). 


Testing numbers in a program to see that they are rational is not as easy as it appears. Thankfully, the functions numerator and denominator can be used on the Classpad.  The numerator function converts the number into an exact fraction and extracts its numerator.  Similarly, the denominator function converts the number into an exact fraction and extracts its denominator.  


For an irrational number such as √2, the Classpad determines the exact fraction to be 

√2/1.


Casio Classpad Program:  htrist

(fx-CP400 and fx-CG500)


'2020-09-15 EWS

'H Triple test

Local a,b,c,n,d,u

Input a

Input b

Input u, "λ? (rational)"

√(a^2 - 2 × u × a × b + b^2) ⇒ c

numerator(c) ⇒ n

denominator(c) ⇒ d

ClrText

Print {n, d}

If frac(n) = 0 and frac(d) = 0

Then

Print "H Triple", ColorGreen

Print {a, b, u}

Print "c ="

Print c

Else 

Print "No Solution", ColorRed

IfEnd


Example:

a = 85, b = 374, λ = 1


Results: 

c = 289,  n = 289, d = 1


Source:


Halbeisen, Lorezn and Hungrebühler, Nobert.  "Heron triangles and their elliptic curves" Journal of Number Theory 213 (2020) 232-253.  https://doi.org/10.1016/j.jnt.2019.12.005 


Eddie


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

Sines and Cosines: Adding and Subtracting Angles

 Sines and Cosines:   Adding and Subtracting Angles





Note:   


π/2 radians = 90°,   π radians = 180°


Sine


sin(x + π/2) = sin(x) cos(π/2) + cos(x) sin(π/2) = cos(x)


sin(x - π/2) = sin(x) cos(π/2) - cos(x) sin(π/2) = -cos(x)


sin(π/2 - x)  = sin(π/2) cos(x) - cos(π/2) sin(x) = cos(x)


sin(x + π) = sin(x) cos(π) + cos(x) sin(π) = -sin(x)


sin(x - π) = sin(x) cos(π) - cos(x) sin(π) = -sin(x)


sin(π - x)  = sin(π) cos(x) - cos(π) sin(x) = sin(x)


Cosine


cos(x + π/2) = cos(x) cos(π/2) - sin(x) sin(π/2) = -sin(x)


cos(x - π/2) = cos(x) cos(π/2) + sin(x) sin(π/2) = sin(x)


cos(π/2 - x) = cos(π/2) cos(x) + sin(π/2) sin(x) = sin(x)


cos(x + π) = cos(x) cos(π) - sin(x) sin(π) = -cos(x)


cos(x - π) = cos(x) cos(π) + sin(x) sin(π) = -cos(x)


cos(π - x) = cos(π) cos(x) + sin(π) sin(x) = -cos(x)


Eddie


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

TI-84 Plus CE: Lorenz Curves and the Gini Coefficient

TI-84 Plus CE:  Lorenz Curves and the Gini Coefficient

Introduction - Graphing Income Inequality

Developed by Max O. Lornez, the Lorenz curve displays the graphs of income distribution and income inequality.  Each point of represents a cumulative percentage of an income level.   An example of a Lorenz curve:

(25%, 9%):   The first 25% of a population earns 9% of the population's total income

(50%, 21%):  Half of the population earns only 21% of the total income.

(75%, 44%):  The bottom 75% of the population earns 44% of the total income.

(100%, 100%):  This represents the total population.  

The Lornez curve is compared against a straight line which connects points (0%, 0%) to (100%, 100%).    The ratio between the top area and the whole curve is called a Gini coefficient.  If the Gini coefficient is 0, then there is no income inequality.  On the other hand, the closer that the Gini coefficient is to 1, there is more income inequality.  The diagram below is a Lorenz curve.



Calculating the Gini Coefficient


Let:

A = the area above the Lorenz  curve and below the straight line

B = the area above the x axis and below the Lorenz curve

W = the total area = A + B = 1/2 * max(x value) * max(y value)  

Note: that the total area is the area of a right triangle


The Gini coefficient is defined as:

G = A / (A + B) = (W - B) / B


TI-84 Plus CE Program: LORENZ

430 bytes


"2020-09-13 EWS"

Menu("LORENZ CURVE", "EQUAL PERCENTILE", 1, "DATA", 2)

Lbl 1

Input "DATA?", L4

dim(L4) → N

cumSum(L4) → L6

seq(100J/N, J, 1, N) → L3

L3 → L5

Goto 3

Lbl 2

Disp "ASCENDING ORDER: Y"

Input "X DATA?", L3

Input "Y DATA?", L4

cumSum(L3) / sum(L3) * 100 → L5

sumSum(L3 * L4) / sum(L3 * L4) * 100 → L6

Goto 3

Lbl 3

"BELOW"

augment( {0}, L5 ) → L5

augment( {0}, L6 ) → L6

sum( seq(.5 * (L5(J) - L5(J-1)) * (L6(J) + L6(J-1)) /2 , J, 2, dim(L6) ) ) → B

"WHOLE"

.5 * max(L5) * max(L6) → W

(W - B) / W → G

Disp "GINI INDEX:", G

Pause

Func

PlotsOff

FnOff

FnOn 1

PlotsOn 1

10 → Xscl : 10 → Yscl

Plot1( xyLine, L5, L6, □, RED)

"max(L6)*X/100" → Y1

ZoomStat


There are two options:

1. Equal Percentile:  Enter the percentage of each bin.  The percentile of each class is divided equally. Example:  for ten data points, the percentiles are split in 10% increments.

(10%, y1%)
(20%, y2%)
(30%, y3%)
(40%, y4%)
(50%, y5%)
(60%, y6%)
(70%, y7%)
(80%, y8%)
(90%, y9%)
(100%, y10%)

2.  Data:  Enter x and y data.   For y data, make sure that list has all of its elements in ascending order.

The graph displays in values of percents.  X Axis: 0 to 100 (representing 0% to 100%).  Y Axis: 0 to 100 (representing 0% to 100%).

Examples

Example 1:  Equal Percentile  

The total health spending for high average per capita in 10% percentiles in 2002.  (see source for background information)

Percentile Percent of Health Spending
10% 0%
20% 0.1%
30% 0.6%
40% 1.2%
50% 2%
60% 3.4%
70% 5.4%
80% 9.1%
90% 16.5%
100% 61.7%


Enter Option 1: Data.   

Gini Index: 0.8633

List = { 0, .1, .6, 1.2, 2, 3.4, 5.4, 9.1, 16.5, 61.7 }




Example 2:  Data

Hourly employees of a company and their wages:

Number of Employees Hourly Wage
156 $15.00
195 $30.00
53 $50.00
49 $70.00

X Data:  {156, 195, 53, 49}
Y Data:  {15, 30, 50, 70}

Gini Index:  0.6379627898



Source:

Reindhardt, Uwe E.   "The Construct of Lorenz Curves and of The Gini-Coeficient to Decpict Degrees in Inequality in Health Care"  Princeton University, WWS 597  (Political Economy of Health Systems) 
Retrieved August 26, 2020 


Eddie

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

TI-84 Plus CE and HP 41C: Method of Successive Substitutions

 TI-84 Plus CE and HP 41C:  Method of Successive Substitutions


Repeating the Calculation Again and Again


With an aid of a scientific calculator, we can solve certain problems of the form:


f(x) = x.


Examples include: 


tan cos sin x = x  


e^-x = x


atan √x = x


sin cos x = x 


(acos x) ^ (1/3) = x


In any case with trigonometric functions, the angle mode will need to be in radians.  You will also need a good guess to get to a solution and to know that at some real number x, f(x) and x intersect.


Take the equation ln(3*x) = x with initial guess x0 = 1.512


Depending on the operating of the scientific calculator the keystrokes would be:


AOS:

1.512 [ = ]

Loop:  [ × ] 3 [ = ] [ ln ]


RPN:

1.512 [ENTER]

Loop:  3 [ × ] [ ln ]


ALG:  

1.512 [ENTER/=]

Loop:  ln( 3 * Ans) [ ENTER/= ]


Repeat the loop as many times as you like and hope you start seeing the answers converge.   After repeating the loop over and over and over again, at six decimal answers, the readout will be about 1.512135.


An approximate answer to ln(3x) = x, x ≈ 1.512134552


 If your calculator has a solve function, you can check the answer, but this method can be useful if your calculator does not have a solve function.


The program SUCCESS illustrates this method.


TI-84 Plus CE Program (TI-83 Family) Program:  SUCCESS

285 bytes


"2020-09-08 EWS"

Disp "SUCCESIVE SUBSTITUTION", "F(X)=X"

Disp "USE QUOTES FOR F(X)"

Input "F(X)? ", Y1

Input "GUESS? ", G

Input "PRECISION? ", P

0 → I

1 → T

Repeat T<10^-P

Y1 → Z

abs(Z - X) → T

Z → X

I + 1 → I

If I > 200

Then

Disp "ITERATIONS EXCEEDED", "NO SOLUTION FOUND"

Stop

End

End

ClrHome

Disp "SOLUTION=",  round(X,P), "ITERATIONS=", I, "ABS DIFF", T


HP 41C/DM41 Program: SUCCESS

This program calls on the subroutine, FX.   FX is where you enter f(x).  End FX with the RTN command.


01 LBL^T SUCCESS

02 ^T F<X>=X

03 AVIEW

04 PSE

05 ^T GUESS?

06 PROMPT

07 STO 00

08 ^T PRECISION?

09 PROMPT

10 STO 02

11 0

12 STO 03

13 1

14 STO 04

15 LBL 01

16 RCL 00

17 XEQ ^FX

18 STO 01

19 RCL 00

20 -

21 ABS

22 STO 04

23 RCL 01

24 STO 00

25 1

26 ST+ 03

27 200

28 RCL 03

29 X>Y?

30 GTO 02

31 RCL 02

32 CHS

33 10↑X

34 RCL 04

35 X>Y?

36 GTO 01

37 ^T SOL=

38 ARCL 01

39 AVIEW

40 STOP

41 ^T ITER=

42 ARCL 03

43 AVIEW

44 STOP

45 ^T DIFF=

46 ARCL 04

47 AVIEW

48 STOP

49 GTO 04

50 LBL 02

51 ^T NO SOL FOUND

52 AVIEW

53 STOP 

54 LBL 04

55 END


Examples for FX:


f(x) = sin cos x.   


Program:

LBL ^FX

RAD

COS 

SIN 

RTN


f(x) = e^-x


Program:

LBL ^FX

CHS

E↑X

RTN


Be aware, some equations cannot be solved in this manner, such as x = π / sin x and x = ln(1 / x^4).

Cheung, Y.L. "Using Scientific Calculators to Demonstrate the Method of Successive Substitutions"  The Mathematics Teacher.  National Council of Teachers of Mathematics.  January 1986, Vol. 79 No. 1 pp. 15-17  http://www.jstor.com/stable/27964746 



Eddie


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


HP 42S/DM42: Height of a Fire, Time to Clear a Corridor

 HP 42S/DM42:  Height of a Fire, Time to Clear a Corridor HP 42S/DM42/Free42 Program:  FIREHGT The program FHGT approximates the height of a...