Sunday, May 31, 2020

HP12C: Rational Fractions and Horner's Method

HP12C: Rational Fractions and Horner's Method

Introduction

Here are three examples on how Horner's Method can be used to quickly calculate rational fractions with polynomials.   The program code is presented for the HP 12C.

Horner's rule involves repeated factoring until the polynomial is represented as a multiplication of polynomials.  The idea is to make it easier for some scientific calculators and four-function calculators to evaluate polynomials.  Using Horner's Method for the generic cubic polynomial:

a * t^3 + b * t^2 + c * t + d
t * (a * t^2 + b * t + c) + d
t * (t * (a * t + b) + c ) + d

On an RPN keystroke calculator, such as the HP 12C a possible code would look like:

STO  t   (from the X stack)
RCL a
*
RCL b
+
RCL t
*
RCL c
+
RCL t
*
RCL d
+
RTN

For the code below, the HP 12C uses the following registers:

R0 = x

R1 = a
R2 = b
R3 = c
R4 = d
R5 = e
R6 = f
R7 = g

All but x need to be stored ahead of time before running (you can change the code to suit your needs, of course).  x is entered before pressing [ R/S ].

For all of our numerical examples, I assigned the following values:

R0 = 1.72

R1 = 6
R2 = 3
R3 = 4
R4 = 5
R5 = 3
R6 = 1
R7 = 8

Example 1

(ax + b) / (cx^2 + dx + e) = (ax + b) / (x * (cx + d) + e)

Program  (key:  key code) - 16 steps

STO 0:  44, 0
RCL 1:  45,1
  *   :  20
RCL 2:  45, 2
  +  :  40
RCL 0:  45, 0
RCL 3:  45, 3
  *  :   20
RCL 4:  45, 4
  +  :  40
RCL 0:  45, 0
  *  :  20
RCL 5:  45, 5
  +  :  40
  ÷  :  10
GTO 00:  43, 33, 00

Result with variables stored above (FIX 4):  0.5684

Example 2

(ax + b) / (cx^3 + dx^ 2 + ex + f) = (ax + b) / (x * (x * (cx + d) + e) + f)

Program  (key:  key code) - 20 steps

STO 0:  44, 0
RCL 1:  45,1
  *   :  20
RCL 2:  45, 2
  +  :  40
RCL 0:  45, 0
RCL 3:  45, 3
  *  :   20
RCL 4:  45, 4
  +  :  40
RCL 0:  45, 0
  *  :  20
RCL 5:  45, 5
  +  :  40
RCL 0:  45, 0
  *  :  20
RCL 6:  45, 6
  +  :  40
  ÷  :  10
GTO 00:  43, 33, 00

Result with variables stored above (FIX 4):  0.3225

Example 3

(ax^2 + bx + c) / (dx^3 + ex^2 + fx + g)
= (x * (ax + b) + c) / (x * (x * (dx + e) + f) + g)

Program  (key:  key code) - 24 steps

STO 0:  44, 0
RCL 1:  45,1
  *   :  20
RCL 2:  45, 2
  +  :  40
RCL 0:  45, 0
RCL 3:  45, 3
  *  :   20
RCL 4:  45, 4
  +  :  40
RCL 0:  45, 0
  *  :  20
RCL 5:  45, 5
  +  :  40
RCL 0:  45, 0
  *  :  20
RCL 6:  45, 6
  +  :  40
RCL 0:  45, 0
  *   :  20
RCL 7:  45, 7
  +  :  40
  ÷  :  10
GTO 00:  43, 33, 00

Result with variables stored above (FIX 4):  0.6111


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, May 30, 2020

Retro Review: Sharp EL-506V

Retro Review:  Sharp EL-506V

Sharp EL-506V


Quick Facts

Model:  EL-506V
Company:  Sharp
Type:  Scientific
Years:  around 2003
Display:  10 digits
Batteries:  Solar (with LR-44 backup)
Original Retail Price:  Roughly $15 - $20
Logic:  Direct Algebraic Entry

Features

The Sharp EL-506V has the following modes, accessed by pressing [ 2ndF ] [ MATH ] then the appropriate number at the "0-3?" prompt:

0:  Normal (and Base Mode)
1:  Complex Number Mode
2: 3-VLE: 3 x 3 Linear Systems
3: Statistics

Entering the Statistics Mode will provide a further "0-6" prompt:
0:  SD:  Single Variable
1:  a + bx:  Linear  (y = a + bx)
2:  ...+cx²:  Quadratic  (y = a + bx + cx^2)
3:  e^x:   Exponential (y = a * exp(bx))
4:  ln x:  Logarithmic (y = a + b ln x)
5:  ax^b: Power (y = a*x^b)
6:  1/x:  Inverse (y = 1/x)

Normal Mode

Variables:

There are seven registers for the EL-506V:  A, B, C, D, X, Y, and M. The memory M has the store sum (M+) and store minus (M-) functions.  What is unusual is that there is no ALPHA key.  Instead, we will need to press [ 2ndF ] [ RCL ] to type alpha characters.

Base Conversions:

In Normal Mode, you can convert integers (fractional parts are not retained) to Hexadecimal, Octal, and Binary.   In only these three modes, you have the Boolean functions NOT, AND, OR, XOR, XNOR, and NEG. 

Calculus:

You can enact some calculus functions.  Start by typing in your function.  Don't forget to use [ 2ndF ] [ RCL] to type alpha characters. 

ALGB:  Evaluate the expression.  When the variable flashes, you are prompted for a value.

∫ dx:  Simpson's rule. Evaluates the definite integral of f(x).  You are prompted for a (lower limit), b (upper limit), and n (number of subdivisions, even).  Don't forget to enter f(x) first. 

d d/x:  Numerical Derivative of f(x).  You are prompted for a point (x) and a tolerance (dx)

Conversions and Constants:

The EL-506V has 40 conversions and constants, all which are listed on the help card that comes with the calculator. 

Fractions, decimal/degrees-minutes-seconds conversions, and random numbers complete the function set. 

Example Calculation 

Below is an example of how the display handles mathematical calculations.  Generally, numbers entered are being shown on the bottom line while everything else is shown on the top line. 


How the display operates during entering an expression

Note when editing saved expressions, everything is edited on the top line.  Inserting characters are automatic.  Delete characters by pressing [ DEL ]. 

Complex Mode

The [MATH] offers the rectangular/polar conversions.  Answers are shown in separate parts.  The real/radius part is shown first.  To see the imaginary/angle part, press [ 2nd ] [ Exp ] (←,→).

Keyboard and Verdict

I like the off-white background and how surprisingly the green, gray, and orange font shows on the calculator and keys.  It almost gives a glow-in-the-dark feel (no, the EL-506V does not glow in the dark, darn it!). 

The key response is adequate.

The calculator needs to be in total light for the display to work properly.  Maybe it just need fresh batteries, but that has been my experience so far.

This calculator is a good alternative if a modern scientific calculator is not available or you prefer a feature-rich vintage solar scientific calculator. 

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, May 24, 2020

Casio Comparison: fx-9750GII vs. fx-9750GIII

Casio Comparison:  fx-9750GII vs.  fx-9750GIII

Casio claims the fx-9750GIII is comparable to the TI-84 Plus.  But what about its predecessor: fx-9750GII? 

Casio fx-9750GII full shot of the calculator
Casio fx-9750GII

Screen: Casio fx-9750GII
Screen: Casio fx-9750GII

Case and Back: Casio fx-9750GII
Case and Back: Casio fx-9750GII

Casio fx-9750GIII full shot of the calculator
Casio fx-9750GIII

Screen: Casio fx-9750GIII
Screen: Casio fx-9750GIII

Case and Back: Casio fx-9750GIII
Case and Back: Casio fx-9750GIII


In the United States, we have a new graphing calculator from Casio, the fx-9750GIII.  It is an upgrade of the fx-9750GII in several ways:

*  A new Python programming mode
*  The spreadsheet and geometry modes are added
*  Storage memory of 3 MB is allocated to hold geometry, python, and flash files.  This is an addition to the about 61K of regular memory.
*  The fx-9750GIII now has textbook input and output options.   In textbook mode, you can control whether output defaults to exact answers (fractions, square roots, terms of pi) or approximate answers.

The fx-9750GIII's case is slightly smaller than the fx-9750GII, but the width is the same.  The fx-9750GIII has a lighter body as well.  I really like the lighter feel of the fx-9750GIII.  The fx-9750GIII's back has a 3D feel to it, which is nice.  I am also impressed with the keyboard and the color contrast. 

The package I purchased did not have a USB cord.   I believe the proper cord is a mini USB cord, probably can use the cord that came with the fx-9750GII (and similar calculators) and it should be fine. 

Performance wise, the two calculators are about even, with the fx-9750GIII slightly faster. I only did a little bit of testing so far.   Neither of them are slouches. 

For a more detailed comparison, you can download a PDF comparison here:
https://drive.google.com/open?id=1bMC27Mbjw4N41qv8CZ1UD5qTJopbAVZC

(PDF document created with LibreOffice Writer)

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.

Numworks/Casio MicroPython/Python: Calculus

Numworks/Casio MicroPython/Python:  Calculus 

Introduction

The following scripts creates the user functions for calculus:

f(x):  define your function in terms of x here.   This needs to be loaded into the script before running it.   Each of the functions that follow will use f(x).  You can call f(x) to evaluate the function at any value.

deriv(x):  The approximate derivative at point x.  The Five Stencil approximation is used. 

sigma(a,b):  Calculate the sum  (Σ f(x)) from x = a to x = b. 

integral(a,b,n):  Calculates the definite integral ( ∫ f(x) dx) from x = a to x = b.  The Simpson's rule is used with n divisions (n needs to be even)

solve(x0):  Uses Newton's Rule to find roots for f(x). 

Example

f(x) = -2x*^2 + 3x + 5
In Python:  -2*x**2+3*x+5

f(0): 5
f(10): -165
f(-10): -225

deriv(10): -37.00004450971999

Σ f(x): x = 1 to 25:  sigma(1,25): -8780

∫ f(x) dx: x = -3 to 1, n = 20:  integral(-3,1,20):  -10.666666666667

Solve f(x)=0, initial condition x0 = 2.5:  solve(5):  2.5 

Python Script: calculus.py

from math import *

# 2020-04-15 EWS

# define f(x) here
def f(x):
  return -2*x**2+3*x+5
  
# derivative
def deriv(x):
  # uses f(x), 5 stencil
  # h is tolerance
  h=1e-10
  d=(12*h)**-1*(f(x-2*h)-8*f(x-h)+8*f(x+h)-f(x+2*h))
  return d

# sum/sigma
def sigma(a,b):
  t=0
  n=b-a
  for i in range(n):
    t=t+f(i+1)
  return t

# integral by simpsons rule
def integral(a,b,n):
  t=f(a)+f(b)
  h=(b-a)/n
  for i in range(n-1):
    w=(i+1)/2
    if (w-int(w))==0:
      t=t+2*f(a+(i+1)*h)
    else:
      t=t+4*f(a+(i+1)*h)
  t=t*h/3
  return t

# solver
def solve(x0):
  tol=1e-14
  x1=x0-f(x0)/deriv(x0)
  while abs(x1-x0)>tol:
    x0=x1
    x1=x0-f(x0)/deriv(x0)
  return x1


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, May 23, 2020

HP 42S/Free 42S/DM42: Dynamic Growing Lists

HP 42S/Free 42S/DM42: Dynamic Growing Lists

Introduction

This blog entry will show how to create dynamic matrices that grow as additional entries are necessary. 

DIM:  (Syntax:   rows, cols, DIM)  Sets the initial dimensions of the matrix.

INDEX:  Sets the index pointer to I = 1 and J = 1. 

GROW:  Sets the HP 42S to grow mode.  This allows the matrix to build additional rows and columns by adding new elements.

J+:  Does one of two things in Grow Mode.  It either moves the pointer to the next column or creates a new row.  For a matrix with only 1 column as its initial dimension, J+ creates a new row automatically. 

Matrix:  1 to N

The first program, nLIST generates a one column matrix from 1 to n. 

LBL 00:  Main Loop
LBL 01:  Adds another row
LBL 02:  End of program and shows the resulting matrix, MATD in edit mode
R01:  counter variable counting from n (in X stack) to 1

HP 42S/Free 42S/DM42 Program:  nLIST

00 { 50-Byte Prgm }
01▸LBL "nLIST"
02 STO 01
03 1
04 1
05 DIM "MATD"
06 INDEX "MATD"
07 GROW
08▸LBL 00
09 RCL 01
10 STOEL
11 DSE 01
12 GTO 01
13 GTO 02
14▸LBL 01
15 J+
16 GTO 00
17▸LBL 02
18 EDITN "MATD"
19 END

Example:  8 nLIST returns
[[ 8 ]
[ 7 ]
[ 6 ]
[ 5 ]
[ 4 ]
[ 3 ]
[ 2 ]
[ 1 ]]

Press the soft keys ( ↑ ) and ( ↓ ) to scroll throw the matrix.  Press [EXIT] to exit the matrix.  The matrix MATD is stored as a stack element. 

Simulating HP Prime's idivis Command

The program IDIVIS simulates the IDIVIS command on the HP Prime.  IDIVIS lists all the divisors of an integer ( n ). 

LBL 00:  Main Loop - tests for divisors
LBL 01:  Adds any divisors and creates another row
LBL 02:  Decreases the counter variable
LBL 03:  Trims the excessive row by the DELR (delete row) command, ends the program and shows the resulting matrix, MATD in edit mode
R00:  n
R01:  counter variable counting from n (in X stack) to 1.  The program stops when R01 reaches 0 (it is skipped thanks to the DSE command). 
R02 = R00/R01 


HP 42S/Free 42S/DM42S Program: IDIVIS

00 { 64-Byte Prgm }
01▸LBL "IDIVIS"
02 STO 00
03 STO 01
04 1
05 1
06 DIM "MATD"
07 INDEX "MATD"
08 GROW
09▸LBL 00
10 RCL 00
11 RCL÷ 01
12 STO 02
13 FP
14 X=0?
15 GTO 01
16 GTO 02
17▸LBL 01
18 RCL 02
19 STOEL
20 J+
21▸LBL 02
22 DSE 01
23 GTO 00
24 GTO 03
25▸LBL 03
26 DELR
27 EDITN "MATD"
28 .END.

Examples

45 (IDIVIS) returns 1, 3, 5, 9, 15, 45 (press ↓ to reveal the next row in MATD)

27 (IDIVIS) returns 1, 3, 9, 27

53 (IDIVIS) returns 1, 53


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, May 17, 2020

Numworks/Casio MicroPython/Python: Financial Functions

Numworks/Casio MicroPython/Python:  Financial Functions 

My first python script for the Numworks calculator:  finance.py

Great calculator and glad I finally have one. 

Introduction

The following scripts creates the user functions for the following financial functions:

pchg(old, new):  Returns the percent change between two numbers
Example:  pchg(1400,2600) returns 85.71

taxlplus(amt, tax): Adds the tax rate to an amount. amt + tax%.  Results are rounded up to 2 decimal places.
Example:  taxplus(59,9.5) returns 64.6

uspv(n,i):  Takes n (number of payments) and i (periodic interest rate) and calculates the uniform present value factor.  PV = PMT * USPV.  Future value is assumed to be 0.
Example:  n = 36 payments, i = 0.25%.  uspv(36,0.25) returns 34.39

usfv(n,i):  Takes n (number of payments) and i (periodic interest rate) and calculates the uniform future value factor.  FV = PMT * USFV.  Present value is assumed to be 0.
Example:  n = 36 payments, i = 0.25%.  usfv(36,0.25) returns 37.62

mopmt(yrs,rate,loan):  Calculates the monthly payment of a loan with monthly payments.  Payments are assumed to be due at the end of each month.   Results are rounded to up to 2 decimal places. 
Example:  Loan of $238,000 for 30 years at 4.28% annual rate.  mompt(30,4.28,238000) returns 1175.0

annrate(ppy,cpy,rate):  Calculates the equivalent annual rate given ppy (payments per year), cpy (compounding payments per year), rate (estimated periodic rate).
Example:  ppy = 12, cpy = 2, periodic rate = 0.74%.   annrate(12,2,0.74) returns 9.0459

Source for annrate:
Roger F. Farish and The Staff of the Texas Instruments Learning Center.  Calculator Analysis for Business and Finance.  Texas Instruments, Inc.  1977.  ISBN 0-89512-015-1

sinkfund(yrs,rate,pymt):  Calculates the balance of a sink fund (savings account)  of monthly deposits.   Number of years and the annual interest rate are needed.  Deposits are assumed to be due at the end of each month.   Results are rounded to up to 2 decimal places. 
Example:  Monthly deposits of $400.00 for 5 years, at a rate of 2.9%.  sinkfund(5,2.9,400) returns 25793.77

piti(yrs,rate,loan,tax,insur):   Calculates the monthly payment of a mortgage given:  the term of the loan in years (yrs), the annual interest rate (rate), the mortgage (loan), the annual property tax (tax), and the annual property insurance (insur).  Payments are assumed to be due at the end of each month.  Results are rounded to up to 2 decimal places.
Example:  piti(30,3.3,160000,1349,240) returns 833.15

qualinc(inc,debt,taxins,rate,yrs):  Calculates the qualifying amount given the following parameters:  monthly income (inc), monthly debt payments (debt), monthly proper taxes and insurance (taxins), interest rate (rate), and term of the mortgage in years (yrs).   Mortgage payments are assumed to be due at the end of each month.   The standard debt:income ratio of 28:36 is used.  Results are rounded to up to 2 decimal places.
Example:  qualinc(4485,375,126.83,5.30) returns 207288.6


Python Script: finance.py

# 2020-04-12 EWS

from math import *

# percent change
def pchg(old,new):
  pch=(new-old)/old*100
  return pch

# add sales tax  
def taxplus(amt,tax):
  total=amt*(1+0.01*tax)
  return round(total,2)

# uniform pv factor pv=pmt*uspv
def uspv(n,i):
  factor=(1-(1+0.01*i)**(-n))/(0.01*i)
  return factor

# uniform fv factor fv=pmt*usfv
def usfv(n,i):
  factor=((1+0.01*i)**n-1)/(0.01*i)
  return factor
  
# monthly payment
def mopmt(yrs,rate,loan):
  pymt=loan/uspv(yrs*12,rate/12)
  return round(pymt,2)
  
# equivalent annual rate
def annrate(ppy,cpy,rate):
  irate=cpy*100*((1+0.01*rate)**(ppy/cpy)-1)
  return irate
  
# sinking fund
def sinkfund(yrs,rate,pymt):
  sink=pymt*usfv(yrs*12,rate/12)
  return round(sink,2)

# piti
def piti(yrs,rate,loan,tax,insur):
  pymt=loan/uspv(yrs*12,rate/12)+(tax+insur)/12
  return round(pymt,2)

# qualifying income 28:36 ratio
def qualinc(inc,debt,taxins,rate,yrs):
  a=min(inc*0.36-debt,inc*0.28)-taxins
  qual=a*uspv(yrs*12,rate/12)
  return round(qual,2)

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, May 16, 2020

HP 42S/Free42/DM42: Pulley Sheave and Fan Laws

HP 42S/Free42/DM42:  Pulley Sheave and Fan Laws

Basic Pulley Law - Fans

The basic relationship between a fan and it's motor is simple:

rpm1 * dai1 = rpm2 * dia2

where:

rpm1:   how fast the fan turns, in revolutions per minute
dia1:  the diameter of the fan's pulley
rpm2:  the speed of the motor, in revolutions per minute
dia2:  the diameter of the motor's pulley

A diagram is shown below of a motor-pulley/fan-pulley system.  The actual length of the pulleys will vary per system. 




The program PULLAW sets up the solver for this law.  To call up the solver, press [(shift)] [ 7 ] (SOLVER), select PULLAW.  

HP 42S/DM42/Free42 Solver Program: PULLAW

00 { 59-Byte Prgm }
01▸LBL "PULLAW"
02 MVAR "RPM1"
03 MVAR "DIA1"
04 MVAR "RPM2"
05 MVAR "DIA2"
06 RCL "RPM2"
07 RCL× "DIA2"
08 RCL "RPM1"
09 RCL× "DIA1"
10 -
11 END

Basic Sheave Law

The basic sheave law listed below describes how adjusting a sheave's airflow affects the motor's break horsepower:

bhp2 = (cfm2 / cfm1) ^ 3 * bhp1

CFM:  cubic foot per minute (airflow)
BHP:  brake horsepower of the motor 

The program SHLAW sets up the solver for this law.  To call up the solver, press [(shift)] [ 7 ] (SOLVER), select SHLAW.  

HP 42S/DM42/Free42 Solver Program: SHLAW

00 { 60-Byte Prgm }
01▸LBL "SHLAW"
02 MVAR "BHP1"
03 MVAR "CFM1"
04 MVAR "BHP2"
05 MVAR "CFM2"
06 RCL "CFM2"
07 RCL÷ "CFM1"
08 3
09 Y↑X
10 RCL× "BHP1"
11 RCL- "BHP2"
12 END

Basic Fan Laws

Three basic ratios are used in dealing in fan engineering, which are:

cfm ratio = cfm2 / cfm1 = rpm2 / rpm1

sp ratio = sp2 / sp1 = (rpm2 / rpm1) ^ 2

hp ratio = hp2/ hp1 = (rpm2 / rpm1) ^ 3

where:

rpm:  a fan's revolution per minute.   rmp1 and rpm2 represents different conditions of the fan

cfm:  airflow of a fan in cubic feet per minute.  You can use other units, just be consistent.

sp:  static pressure of a fan

hp:  break horsepower of a fan

HP 42S/Free42/DM42 Program: FANLAW

00 { 74-Byte Prgm }
01▸LBL "FANLAW"
02 "RPM2?"
03 PROMPT
04 "RPM1?"
05 PROMPT
06 ÷
07 STO 01
08 CLA
09 "CPM RATIO ="
10 AVIEW
11 STOP
12 ENTER
13 ENTER
14 ENTER
15 ×
16 STO 02
17 CLA
18 "SP RATIO ="
19 AVIEW
20 STOP
21 ×
22 CLA
23 "HP RATIO ="
24 AVIEW
25 .END.

Source:

Gladstone, John  Air Conditioning Testing and Balancing: A Field Practice Manual  Van Nostrand Reinhold Company.  New York.  1974  ISBN 0-442-22703-5

Barring any changes, this would be post 1111.   I know some people are still into the 11-11 thing... 

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, May 10, 2020

Retro Review: Radio Shack EC-4041

Retro Review:   Radio Shack EC-4041



Quick Facts:

Model:  EC-4041
Company:  Radio Shack
Type:  Scientific
Years:  around 1995
Display:  10 digits
Batteries:  Solar (with LR-44 backup)
Original Retail Price:  Roughly $15 - $20
Logic:  Direct Algebraic Entry (in Casio this is called V.P.A.M. - Visually Perfect Algebraic Method)
Equivalent of:  Casio fx-115S

Direct Algebraic Entry

In the 1990s, most scientific calculators made the move from a post input system to a algebraic entry method.   The calculator featured on this blog is part of the latter group.  Examples of Direct Algebraic Entry in action include:

Example 1:  tan 17°
[ MODE ] [ MODE ] [ 1 ] for Degrees
[ tan ]     (Screen:    tan on the upper left hand of the screen)
17          (Screen:   tan 17)
[ = ]         (Screen:   = 0.305730681)

Result: tan 17° = 0.305730681

Example 2:  (2^3.1 - 4) / 5
[ ( ] 2        (Screen:  (  2 )
[ x^y ]       (Screen:   ( 2 x^y  )
3.1 [ - ]     (Screen:  8.5741877 - )
4 [ ) ]         (Screen:  4.5741877
[ ÷ ] 5 [ = ]   (Screen:  = 0.91483754 )

Result:  (2^3.1 - 4) / 5 = 0.91483754

Example 3:  Rectangular/Polar Conversions

Rectangular to Polar
Syntax:    x R→P y

Convert (28, 18) to polar coordinates, angle in Degree mode
 [ MODE ] [ MODE ] [ 1 ] for Degrees
28 [ SHIFT ] [  + ] (R→P)    (Screen:   28 →P)
18 [ = ]

r = 33.28663395
[ SHIFT ] [ √ ] ( X ←→ Y )
θ = 32.73522627

Polar to Rectangular
Syntax:  r P→R θ

Convert (23.75 ∠ 48°) to rectangular coordinates
23.75 [ SHIFT ] [ - ] (R→P) 48 [ = ]

x = 15.8918519
[ SHIFT ] [ √ ] ( X ←→ Y )
y = 17.64968961

There are no arrow keys on the EC-4041.  Furthermore, the screen is only one line.  This makes for an interesting experience, as you have to be careful on how you enter the expressions.  There are two function indicators, one to the left and one to the right of the number to guide you.

The EC-4041 is similar to the Sharp EL-506G.  A review of the EL-506G can be found here:  http://edspi31415.blogspot.com/2017/09/retro-review-sharp-el-506g.html

Radio Shack:  A Casio in Disguise

Looking at the Radio Shack EC-4041, it is in a style of a Casio scientific calculator.  In fact, the Radio Shack EC-4041 is has the same keyboard the Casio fx-115S.  Casio Ledudu's fx-115S is shown here:  https://casio.ledudu.com/pockets.asp?type=369&lg=eng

An Update of the 1980s Casio fx-115D



The Radio Shack EC-4041 and the Casio fx-115S is an update of the fx-115D.  The features are:

*  1 Variable Statistics
*  Linear Regression
*  Base Conversions (Decimal, Binary, Octal, Hexadecimal) with Boolean Algebra (not, and, or, xor, xnor, neg)
*  Complex Numbers (arithmetic, argument, absolute value, rectangular form only)
*  Fractions (auto-simplification)
*  Sexadecimal calculations with conversions
*  Seven memory registers (fx-115S/EC-4041 has A, B, C, D, E, F, M;  fx-115D has Kin/Kout registers 1, 2, 3, 4, 5, 6, with M)

I wish the EC-4014 kept the menu structure with the fx-115D instead having the MODE system it has.  Not a deal breaker.

Verdict

Similar to the Sharp EL-506G, I like this calculator and the features are just fine.  The challenge is that you have one line to work with and it takes a bit getting used to when most one line calculators that operate in the classic way.


Sources:
"Casio fx-115S"  Casio Ledudu.  https://casio.ledudu.com/pockets.asp?type=369&lg=eng  Retrieved April 5, 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, May 9, 2020

TI 84 Plus CE and Casio fx-CG 50: Distribution Regression

TI 84 Plus CE and Casio fx-CG 50: Distribution Regression

Introduction: Distribution Regression




The program DISTREG attempts to fit a curve to the form:

y = B * e^(A * x^2)

This is based off the normal distribution curve:  y = 1 / √(2 * π) * e^(-x^2 / 2)

It is required that all the y data is positive (y > 0).

Setting Up the Equation

y = B * e^(A * x^2)

Let B = e^b and A = a.  Then:

y = e^b * e^(a * x^2)
y = e^(b + a*x^2)
ln y = b + a*x^2

This is in the form of linear regression where:

x' = x^2
y' = ln y

The program will perform executes the required transformations.

TI-84 Plus CE Program:  DISTREG

"2020-03-31 EWS"
ClrHome
Disp "DISTRIBUTION",
"REGRESSION",
"Y=B*e^(-A*X²)"
Input "X DATA: ",L₁
Input "Y DATA: ",L₂
L₁² → L₃
ln(L₂) → L₄
LinReg(ax+b) L₃,L₄
-a → A
e^(b) → B
Disp "Y=B*e^(-A*X²)"
Disp "A: ", A, "B: ", B
Pause
"B*e^(-A*X²)" → Y₁
Disp "EQN IN Y₁"

Download the program here:  https://drive.google.com/open?id=13EDowrH2NdTSuEm8M_68mu1oxRtDvZwv

Casio fx-CG 50 Program: DISTREG

"2020-03-31 EWS"
ClrText
"DISTRIBUTION"
"REGRESSION"
"X DATA"? → List 1
"Y DATA"? → List 2
List 1^2 → List 3
ln List 2 → List 4
LinearReg(ax+b) List 3, List 4
-a → A
e^b → B
ClrText
Locate 1, 4, "Y=Be^(-Ax²)"
Locate 1, 5, "A: "
Locate 4, 5, A
Locate 1, 6, "B: "
Locate 4, 6, B ◢
"Be^(-Ax²)" → Y1
"EQN IN Y1"

Download the program here:  https://drive.google.com/open?id=1pXzj_Qp1D-mUgR2-Mht-IR03fNvFPGHk

Example

Data (x, y):
(0, 2)
(1.5, 0.8253)
(3, 0.0555)
(4.5, 6.186*10^-4)
(6, 1.14*10^-6)

Results:
A =  0.3995755227
B =  2.016036126

Equation:  y = 2.016036126 * e^(-0.3995755227x^2)

r^2 = 0.999991936 (can be recalled from the Vars menu)

See the above picture for a graph of the example. 

Enjoy everyone, please stay healthy, safe, and sane!

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, May 3, 2020

Construction Master 5: Area of Regular Polygons

Construction Master 5: Area of Regular Polygons



Introduction:  Area of a Regular Polygon



The area of a regular polygon is:

Area = 1/2 * P * A

where:
P = perimeter = n * S 
n = number of sides
S = side length
A = apothem length

Divided the regular polygon from drawing lines from the center to each of the polygon's vertices.  Triangles about the center are formed with a central angle, 360° ÷ n. 

The apothem bisects each of the triangles, with the angle nearest to the center of 180° ÷ n.   A right angle is formed between the side and apothem.   The small triangle formed has the base of the s ÷ 2 (since the apothem bisects the side) and A.  The triangle has angles half-central angle (HCA), 90°, and 180° - 90° - HCA.  I will refer to the third angle as the Pitch angle (see the diagram above). 

The trigonometric relationships are:

tan( Pitch ) = A / ( s / 2 )

A = s / 2 * tan(Pitch)

s = 2 * A / tan(Pitch)

It is possible to determine the area of regular polygon knowing the number of sides and either the side length or the apothem.

The Calculated Industries Construction Master 5 does not have trigonometric keys.  However, the Construction Master 5 has four keys that deal with right triangles:

[ Pitch ]:  angle in degrees.  Enter the angle as a unit-less measure.  For example, to enter 60°, press 60 [ Pitch ].  The angle considers the rise of the opposite side, and run the adjacent side.

[ Rise ]:  rise - opposite side.  The Rise is considered the apothem of length A.  You can enter either unit-less or measured amounts (feet/inches/yards/m). 

[ Run ]:  run - adjacent side.  You can enter either unit-less or measured amounts (feet/inches/yards/m).  This represents the side or half-side.

[ Diag ]:  hypotenuse.  The algorithms will not use this key in this blog. 

Known:  Number of Sides and Side Length

The Math:

Area

= 1/2 * P * A
= 1/2 * n * s * (s/2 * tan(Pitch))
= 1/4 * n *  (s * tan(Pitch))

Keystrokes:

180 [ ÷ ] n [ Conv ] (+/-) [ + ] 90 [ Pitch ]
s [ Run ]
[ Rise ] [ × ] [ Rcl ] [ Run ] [ × ] n [ ÷ ] 4 [ = ]

Example:
s = 40 ft, n = 6

180 [ ÷ ] 6 [ Conv ] (+/-) [ + ] 90 [ Pitch ]    (Display:  PTCH 60.00°)
40 [ Feet ] [ Run ]
[ Rise ] [ × ] [ Rcl ] [ Run ] [ × ] 6 [ ÷ ] 4 [ = ]   (Display:  4156.922 SQ FEET)

Area ≈ 4156.922 ft^2

Known:  Number of Sides and Apothem

The Math

Area

= 1/2 * P * A
= 1/2 * (n * s) * A
= 1/2 * n * (2 * A) / tan(Pitch) * A
= n * A  * (A / tan(Pitch))

Keystrokes:

180 [ ÷ ] n [ Conv ] (+/-) [ + ] 90 [ Pitch ]
s [ Rise ]
[ Run ] [ × ] [ Rcl ] [ Rise ] [ × ] n [ = ]

Example:
A = 40 ft, n = 6

180 [ ÷ ] 6 [ Conv ] (+/-) [ + ] 90 [ Pitch ]   (Display:  PTCH 60.00°)
40 [ Feet ] [ Rise ]
[ Run ] [ × ] [ Rcl ] [ Rise ] [ × ] 6 [ = ]   (Display:  5542.563 SQ FEET)

Area ≈ 5542.563 ft^2

And that is how to find the area of a regular polygon using the Construction Master 5.

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, May 2, 2020

Comparison: Casio fx-991EX Classwiz Vs Sharp EL-W516T

Comparison:  Casio fx-991EX Classwiz Vs Sharp EL-W516T

Reviews

Casio fx-991EX Classwiz (November 1, 2015):
http://edspi31415.blogspot.com/2015/11/casio-fx-991ex-classwiz-review.html


Sharp EL-W516T (July 14, 2017):
http://edspi31415.blogspot.com/2017/07/review-sharp-el-w516t.html

Pictures

Sharp EL-W516T on the left, Casio fx-991EX Classwiz on the right





Comparison Table

Per suggestion from one of my readers of my blog, I am doing a comparison of the two calculators and giving you my thoughts. I am thankful for the suggestion.


  





Remarks

Sharp EL-W516T: Calculations are kept in history when the calculator is turned off, as long as you don't leave the Normal (Home) Mode.

Casio fx-991EX: You can plot graphs with the CASIO EDU+ app with the QR feature when a table or statistics table are generated. This is just the surface of what the QR can do.

A nice feature of the EL-W516T is the recurring decimal feature. For example, calculate 8/11 and press the [CHANGE] button. One of the representations is the 0.72 with the bar above 72 to represent 0.7272727272727272... . You can have the recurring decimal representation turned on or off.

My personal preference is to have the hyperbolic functions on the keyboard and not buried in the menu. The EL-W516T has the [hyp] key, while the fx-991EX has the hyperbolic functions stored in a menu ([OPTN], 1).

On the other hand, the fx-991EX has angle symbols ( ° for degrees, r for radians, g for grads) that allow you to enter angles in any measure without having to change angle mode. ([OPTN], 2).

I tend to trust the Casio fx-991EX when it comes to complex calculus calculations. If there are long calculations, it's a good idea to break it down into steps and check the answers along the way.

Even when the Spreadsheet does not have labels, it is useful for calculations. I find it to be a plus that the fx-991EX offers. Don't the spreadsheet to replace Excel, LibreOffice Calc, or even the Spreadsheet of the fx-9860gii or fx-CG 50, though.

The Sharp EL-W16T has a larger font when entering matrices and equation prompts. The trade off is that the EL-W516T has a lower resolution screen, while the fx-991EX has a sharper resolution, with a wider range of contrasts settings.

The EL-W516T has three keys to store functions and commands. I wish they kept the function memory as Sharp had with its previous incarnations. Still a nice thing to have.

The EL-W516T wins in keyboard and font contrast. The base conversations (blue), the imaginary label (purple), and the alpha markings (red) on the fx-991EX can be hard to read in some lighting conditions. The EL-W516T has better contrast in font colors: green, gray, gold, and white. Even though I kind of like the design of the fx-991EX's plate (with it's texture), the EL-W516T's plate is solid and makes it for a cleaner experience.


Personally, I find myself using the fx-991EX more, but I consider using the EL-W516T more. When it comes down to features, both calculators are solid choices.  

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.