Showing posts with label PrgCalcPro. Show all posts
Showing posts with label PrgCalcPro. Show all posts

Wednesday, March 23, 2016

PrgCalcPro: One Variable Statistics

PrgCalcPro: One Variable Statistics

Instructions:

Initialize the parameters: [JUMP] 31 [RUN]
Enter the data:  X [RET] [RUN]
Analyze: [JUMP] 14 [RUN], μ on the x stack, sx on the y stack 

Registers:
1: n
2: Σx
3: Σx^2
4: Mean (μ)
5: Standard Deviation (sx)

Program:
0: 62  ;  R2
   1: 14  ;  XY // swap
   2: 10  ;  +
   3: 42  ;  M2
   4: 0F  ;  BX // last x
   5: 22  ;  X^2
   6: 63  ;  R3
   7: 10  ;  +
   8: 43  ;  M3
   9: 61  ;  R1 // determine n
  10: 01  ;  1
  11: 10  ;  +
  12: 41  ;  M1
  13: 50  ;  STOP
  14: 62  ;  R2 // calculate mean 
  15: 61  ;  R1
  16: 13  ;  /
  17: 44  ;  M4
  18: 63  ;  R3 // calculate standard deviation 
  19: 64  ;  R4
  20: 62  ;  R2
  21: 12  ;  *
  22: 11  ;  -
  23: 61  ;  R1
  24: 01  ;  1
  25: 11  ;  -
  26: 13  ;  /
  27: 21  ;  sqr // √ 
  28: 45  ;  M5
  29: 64  ;  R4
  30: 50  ;  STOP
  31: 00  ;  0 // clear variables
  32: 41  ;  M1
  33: 42  ;  M2
  34: 43  ;  M3
  35: 44  ;  M4
  36: 45  ;  M5
  37: 50  ;  STOP

Example:   Data set: {2, 3.4, 3.41, 7, 11, 23}

JUMP 31 RUN

2 RET RUN
3.4 RET RUN
3.41 RET RUN
7 RET RUN
11 RET RUN
23 RET RUN

JUMP 14 RUN

Mean = 8.301667
Std. Dev = 7.907997
N = 6
ΣX = 49.81
ΣX^2 = 726.1981


Source for formulas:   HP - 21 Applications Book: Hewlett Packard.  1975

This blog is property of Edward Shore, 2016. 

Sunday, March 20, 2016

PrgCalcPro: Great Circle: Distance Between 2 Places on Earth in kilometers

PrgCalcPro: Great Circle: Distance Between 2 Places on Earth in kilometers

Important: Switch the calculator to Degrees mode before calculation! 

Formula:

E = acos( sin N1 sin N2 + cos N1 cos N2 cos (E1 - E2) )
Distance = 6371 * E * π / 180

Store the following values in decimal degrees:
A = N1 (longitude 1), B = E1 (latitude 1)
C = N2 (longitude 2), D = E2 (latitude 2)
Use [ K ] [ swap ] ( ° ' > to convert from H.M to Decimal degrees if needed)

Program:
   0: 6A  ;  RA
   1: 1C  ;  sin
   2: 6C  ;  RC
   3: 1C  ;  sin
   4: 12  ;  *
   5: 6A  ;  RA
   6: 1D  ;  cos
   7: 6C  ;  RC
   8: 1D  ;  cos
   9: 12  ;  *
  10: 6B  ;  RB
  11: 6D  ;  RD
  12: 11  ;  -
  13: 1D  ;  cos
  14: 12  ;  *
  15: 10  ;  +
  16: 1A  ;  acos
  17: 06  ;  6
  18: 03  ;  3
  19: 07  ;  7
  20: 01  ;  1
  21: 12  ;  *
  22: 20  ;  Pi
  23: 12  ;  *
  24: 01  ;  1
  25: 08  ;  8
  26: 00  ;  0
  27: 13  ;  /
  28: 50  ;  STOP

Example:
Los Angeles (N = 34.05°, E =-118.25°)
Moscow (N = 55.783333°, E = 37.616666°)
Approximate distance: 9,766.5757 km

This blog is property of Edward Shore, 2016. 

PrgCalcPro: Fibonacci Number

PrgCalcPro: Fibonacci Number 

F_n = F_n-1 + F_n-2 via formula ((1+√5)^n) - (1-√5)^n)/(2^n * √5)

Sequence where F0 = 0, F1= 1, F2 = 2, etc.  

Note:  PrgCalcPro, like the MK-61 calculator, has the power function x^y.  That is, x has the base and y is the exponent.   On the ProCalcPro, then the power function is executed, the exponent remains on the y stack and not "consumed".  

Example:
Y: 5
X: 2

Executing x^y leaves 
Y: 5
X: 32 (2^5)


Program:

0: 40  ;  M0
   1: 01  ;  1
   2: 0E  ;  ^ // E^
   3: 05  ;  5
   4: 21  ;  sqr // √ 
   5: 10  ;  +
   6: 24  ;  X^Y
   7: 14  ;  XY // swap
   8: 01  ;  1
   9: 0E  ;  ^ // E^
  10: 05  ;  5
  11: 21  ;  sqr // √ 
  12: 11  ;  -
  13: 24  ;  X^Y
  14: 14  ;  XY // swap
  15: 25  ;  REV // roll down
  16: 11  ;  -
  17: 60  ;  R0
  18: 02  ;  2
  19: 24  ;  X^Y
  20: 14  ;  XY // swap
  21: 25  ;  REV // roll down
  22: 05  ;  5
  23: 21  ;  sqr // √ 
  24: 12  ;  *
  25: 13  ;  /
  26: 50  ;  STOP


This blog is property of Edward Shore,  2016. 

PrgCalcPro: Third Law of Kepler

PrgCalcPro:  Third Law of Kepler: Approximate Time of Orbit in Years




Formula:   
P = √((4*π^2*a^3)/(G*(m1+m2))
P is then divided by 3.15576*10^7 (number of seconds in a Julian year)

Where G = 6.67384*10^-11 m^3/(kg*s^2)

SI units are used

Store in the following registers:
Memory 0 = mass of the sun or star (kg)
Memory 1 = mass of the planet or other astronomical object (kg)
Memory 2 = average distance or semi-major axis (m)

Program:

0: 03  ;  3
   1: 62  ;  R2
   2: 24  ;  X^Y // power function has x as the base, y the exponent
   3: 04  ;  4
   4: 12  ;  *
   5: 20  ;  Pi
   6: 22  ;  X^2
   7: 12  ;  *
   8: 60  ;  R0
   9: 61  ;  R1
  10: 10  ;  +
  11: 06  ;  6
  12: 0A  ;  .
  13: 06  ;  6
  14: 07  ;  7
  15: 03  ;  3
  16: 08  ;  8
  17: 04  ;  4
  18: 0C  ;  E // press the [EXT] key
  19: 01  ;  1
  20: 01  ;  1
  21: 0B  ;  +- // CHS
  22: 12  ;  *
  23: 13  ;  /
  24: 21  ;  sqr // √ 
  25: 03  ;  3
  26: 0A  ;  .
  27: 01  ;  1
  28: 05  ;  5
  29: 05  ;  5
  30: 07  ;  7
  31: 06  ;  6
  32: 0C  ;  E // [EXT] key
  33: 07  ;  7
  34: 13  ;  /
  35: 50  ;  STOP


Examples:

Sun, mass = 1.988435*10^30 kg
Earth, mass = 5.972190*10^24 kg
Avg Distance = 1.4959787*10^11 m (1 AU)
Period ≈ 1.000455 years

Sun, mass = 1.988435*10^30 kg
Mars, mass = 6.3902433*10^23 kg
Avg Distance = 2.2798715*10^11 m (1.524 AU)
Period ≈ 1.8814721 years 

This blog is property of Edward Shore, 2016.  



PrgCalcPro: Summation

PrgCalcPro: Summation

Summation

This program uses a loop to determine Σ f(X) from a to b.   The function f(X) starts on Line 22.  Use Memory Register a as X and finish the function with RET.   The sum is stored in Memory 0. 

The listing here uses f(X) = X^2 + 1.  

To run: enter a, press [ E up-arrow ], b, [RET], [RUN]

0: 4B  ;  MB
   1: 14  ;  XY // X<>Y
   2: 4A  ;  MA
   3: 00  ;  0 // clear memory 0
   4: 40  ;  M0
   5: 53  ;  SUB // determine f(X), loop starts here
   6: 22
   7: 60  ;  R0
   8: 10  ;  +
   9: 40  ;  M0
  10: 6A  ;  RA // add 1 to a, prepare for next loop
  11: 01  ;  1
  12: 10  ;  +
  13: 4A  ;  MA
  14: 6B  ;  RB
  15: 11  ;  -
  16: 01  ;  1
  17: 11  ;  -
  18: 59  ;  X>=0 // is a - (b+1) ≥ 0?
  19: 05 // if not repeat the loop
  20: 60  ;  R0
  21: 50  ;  STOP // terminate
  22: 6A  ;  RA // this is where f(X) starts
  23: 22  ;  X^2
  24: 01  ;  1
  25: 10  ;  +
  26: 52  ;  RET // don't forget to include RET at the end

Example:

Σ x^2 + 1 from x=0 to x=5.   Result: 61. 

This blog is property of Edward Shore,   2016.  

Programming with the PrgCalcPro iOS App




App Creator: SekApps
Price: I paid $0.99
Platform: iOS
Memory: 1,000 steps with 100 registers 

The PrgCalcPro is based on the Russian scientific calculator Elektronika MK-61.  The MK-61 was in production from 1981 to 1993.  Originally the MK-61 had 15 memory registers and 105 steps.  There are Boolean operations but no built in statistics mode.   

The PrgCalcPro and MK-61 operated by Reverse Polish Notation (RPN), like the Hewlett Packard calculators.  The calculator has 4 stacks. 

The PrgCalcPro has more English key labels instead of Russian.  You can find notes of the MK-61 here:

http://www.thimet.de/CalcCollection/Calculators/Elektronika-MK-61/CmdRef.html


Programming Notes:

M is STO, R is RCL.  There are 15 readily accessible memory registers available from the keyboard:  0-9, a, b, c, d, and e. 

Angle mode is determined by a manual switch.  Unfortunately it can't be programmed (I don't think).  

Certain symbols are used:
[x] Integer Part
{x} Fractional Part
MAX. The maximum of y and x. 
SIG.  Sign of x
Bx. Last X recall. 
lg Common logarithm (base 10, LOG)
tg Tangent function (TAN)
A small recycling symbol ([ F ], [ . ]) represents the Roll Down function. 
<--> represents the exchange function (X<>Y)
x^y: Power function where the base is on the x stack and the exponent is on the y stack.  The exponent remains of the y stack upon calculation and is not "consumed".  

This blog entry will have basic programs, and additional programs will follow on the next few blog entries.  


Eccentricity of an Ellipse
a ≥ b, b is entered first

0: 13  ;  /
   1: 22  ;  X^2
   2: 0B  ;  +/-
   3: 01  ;  1
   4: 10  ;  +
   5: 21  ;  sqr \\ √ 
   6: 50  ;  STOP


The Average of Non-Zero Numbers

Keep entering numbers using n, [RUN].  When you are done, enter 0, [RUN].  The display will show sum (memory 0), press [RUN] to get the number of points (memory 1), and finally press [RUN] to get the average.  

Notes:
The tests for the ProCalcPro (and the MK-61) work slightly differently from Hewlett Packard RPN programming calculators.  

Format:
Test ( x<0, x=0, x≥0, x≠0)
Code Number (00-99), or label
Do this next command instead of test is true 

Example:
x≠0
15
R, 0
+

If the number in the display is non-zero (test is true), then recall memory register 0 and add the number to it.  If the number is zero (test is false), skip to line 15.  

Thanks to thimet.net.  http://www.thimet.de/CalcCollection/Calculators/Elektronika-MK-61/CmdRef.html

Program:   
0: 40  ;  M0
   1: 01  ;  1
   2: 41  ;  M1
   3: 50  ;  STOP
   4: 57  ;  X!=0 \\ X≠0
   5: 15 \\ Goto line 15 if X is zero
   6: 60  ;  R0
   7: 10  ;  +
   8: 40  ;  M0
   9: 61  ;  R1
  10: 01  ;  1
  11: 10  ;  +
  12: 41  ;  M1
  13: 51  ;  JMP \\ Goto line 03 (the next code is a step code number)
  14: 03
  15: 60  ;  R0
  16: 50  ;  STOP
  17: 61  ;  R1
  18: 50  ;  STOP
  19: 13  ;  /
  20: 50  ;  STOP

Quadratic Formula

Equation: Ax^2 + Bx + C = 0
Determinant: D = B^2 - 4AC
Roots:  -B/(2A) ± √(D)/(2A)

Store A, B, and C in the a, b, and c registers respectively.  
Register a: [ . ]
Register b: [ +/- ]
Register c: [ EXT ]

Output Registers:
D = determinant
Memory 0 = root 1 if D ≥0, real part if D < 0
Memory 1 = root 2 if D ≥ 0, imaginary part if D < 0
Complex Roots Format: M0 ± i*M1

   0: 6B  ;  RB // RCL B
   1: 22  ;  X^2
   2: 04  ;  4
   3: 6A  ;  RA
   4: 12  ;  *
   5: 6C  ;  RC
   6: 12  ;  *
   7: 11  ;  -
   8: 4D  ;  MD // STO D
   9: 50  ;  STOP // determinant
  10: 59  ;  X>=0 // if X≥0 Goto line 12, else Goto line 28
  11: 28
  12: 21  ;  sqr // finding the real roots, sqr = √ 
  13: 0E  ;  ^
  14: 6B  ;  RB
  15: 11  ;  -
  16: 53  ;  SUB // execute subroutine located at line 41
  17: 41
  18: 40  ;  M0
  19: 50  ;  STOP
  20: 14  ;  XY
  21: 0B  ;  +- // CHS
  22: 6B  ;  RB
  23: 11  ;  -
  24: 53  ;  SUB
  25: 41
  26: 41  ;  M1
  27: 50  ;  STOP
  28: 31  ;  abs // complex roots
  29: 21  ;  sqr
  30: 6B  ;  RB
  31: 0B  ;  +-
  32: 53  ;  SUB
  33: 41
  34: 40  ;  M0
  35: 50  ;  STOP
  36: 14  ;  XY
  37: 53  ;  SUB
  38: 41
  39: 41  ;  M1
  40: 50  ;  STOP
  41: 6A  ;  RA // subroutine 
  42: 02  ;  2
  43: 12  ;  *
  44: 13  ;  /
  45: 52  ;  RET // return 


This blog is properly of Edward Shore.  2016. 



Spotlight: Casio fx-451 Calculator

Spotlight: Casio fx-451 Calculator Quick Facts Model: fx-451 Company: Casio Type: Solar Scientific Algebraic Memory: 1 (...