Thursday, February 15, 2018

Retro Review: Texas Instruments TI-60

Retro Review:  Texas Instruments TI-60





General Information

Company:  Texas Instruments
Type:  Programmable Scientific
Memory:  84 steps or 12 memory registers
Battery:  2 * Duracell MS76, Panasonic WL-14, Eveready 376 or 303, AG-13, SR44
Years:  1986 – 1991
Editions:  2:  1986 (Advanced Scientific), 1990 (Programmable Scientific)
Original Cost: $50

Features

The TI-60 is a scientific keystroke programmable calculator, largely based off of the original TI-55 (1977).  The features of the TI-60:

Operating System:  AOS (Algebraic Operating System)  (like the TI-30Xa)
Programming:  Up to 56 program steps
Statistics:  Linear Regression
Conversions:  °F/°C, DMS/DD, in/cm, lb/kg, gal/L
Base Conversions:  Octal and Hexadecimal, has 2’s complement
Memory Registers: Up to 8, competed with both statistics and programming
Other Functions:  Percent Change, Absolute Value, Signum, Integer Part, Fractional Part
Integration
Shift Keys: 2nd, hyp, INV
Storage Arithmetic:  +, -, *, ÷, ^, roots, percent change

Percent Key (Δ%) 

I think the percent works backwards than modern calculators.   Press the new value first, then [2nd] [ . ] ( Δ% ), then old value, [ = ].

Example:  Percent change from 32 to 56:  56 [2nd] [ . ] (Δ%) 32 [ = ] 75  (75% increase)

Combinations and Permutations

Like the TI-55 III, the arguments for combination and permutation functions take one argument in the form of nnn.rrr.  

Example:

Combination where n = 25, r = 5 is entered as 25.005 [2nd] [ + ] (nCr)  
(Result: 53,130)

Permutation where n = 25, r = 5 is entered as 25.005 [2nd] [ = ] (nPr)  
(Result:  6,375,600)

Rectangular/Polar Conversion

[2nd] [x<>y] (P-R):  to Rectangular.  Input:  r [x<>y] θ [2nd] [x<>y] (P-R).  Result: y [x<>y] x.

[INV] [2nd] [x<>y] (P-R):  to Polar.   Input x [x<>y] y [INV] [2nd] [x<>y] (P-R).  Result:  θ [x<>y] r.

Linear Regression

The TI-60 has the parts labeled Intcp (y-intercept) and Slope. Running the statistics mode reduced the maximum number of steps to 20 until the statistics registers were cleared.

TI-60 vs TI-55 III



TI-60
TI-55 III
84 maximum steps or 12 memory registers
56 maximum steps or 8 memory registers
Clear programs outside of Learn mode
Clear programs inside of Learn mode
Each step you keyed is displayed in a PC(step #)  OP(key code #) format
After each step, display is advanced to next available step, have to press BST to view what you just did, like the TI-58 series
Base Mode:  Octal and Hexadecimal
No base mode
The RST (reset) instruction loops to Step 00
The RST (reset) instruction stops execution, directs program to Step 00

Verdict

I wish TI had implemented this keystroke system earlier.  I like the fact that the RST instruction allowed for loops.  I like that the user can see what was pressed after each step. 

The TI-60 came at the tail end of the keystroke programmable calculators for Texas Instruments.  The keys are a pleasure a press, the contrast of the fonts is for the most part, excellent, except for the gray 1/x and 2nd functions on a gray background.

For the keystroke calculators from Texas Instruments, the TI-60 one of my favorite, second to the TI-58C. 

Eddie


This blog is property of Edward Shore, 2018.

Wednesday, February 14, 2018

HP Prime and TI-84 Plus CE: Graduated Mortgage Payments

HP Prime and TI-84 Plus CE:  Graduated Mortgage Payments

Introduction

The program GRADMORT calculates the payment schedule of a graduated mortgage.  A graduated payment mortgage (GPM) is a mortgage option that allows home buyers, particularly young, first-time home buyers, to purchase a home.  The payments increase by a set percentage of at annual rate for several years until it reaches a plateau. 

According to Daniel T. Winkler’s and G. Donald Jud’s article, “The Graduated-Payment Mortgage: Solving the Initial Payment Enigma” (see Source at the end of the blog entry), the HUD (United States Department of Housing and Urban Development), offers five graduated payment schedule plans, known as Section 245 loans. 

In the article Winkler and Jud derive a formula for solving for the first tier payment.  The article states the solution for a two-tier case and a general case.  The program GRADMORT covers the general case.

Variables:

A = amount of the mortgage (PV).

I = periodic monthly interest of the mortgage, I%YR/1200.

T = Number of years the payment increases.  For example, if T = 5, then the payment would increase 5 times, once a year, until it reaches the final constant payment on year 6

C = The payment’s annual percent increase, C%/100.

N = The term of the mortgage, in years.

P = The initial payment (PMT).  To calculate the payments for subsequent years, multiply the last result by (1 + C).  (hence, add C% every year for each tier)

The general formula:

P = A / ( (1 + Σ((1 + C)^(k)/(1 + I)^(12*k), k, 1, N-1) * ( 1/I * (1 + I)^(-12) )
+  (1 + C)^N/(1 + I)^(12*N) * (1/I * (1 – (1 + I)^-(12*T – 12*N) )

The program breaks the formula into smaller parts for calculation purposes.

GRADMORT returns a two column matrix, the first column is the year and the second column is the payment.  The last row shows the payment when it stabilizes (stops increasing).

Monthly payments and end of period payments (end of month) are assumed.  Property taxes and interest are not calculated in this program.

HP Prime Program GRADMORT

EXPORT GRADMORT()
BEGIN
// Graduated Mortgage
// Winkler, Jud
// 2018-02-11 EWS

LOCAL A,I,N,C,T,mat;
LOCAL P,X,Y;

INPUT({A,I,N,C,T},"Graduated
Mortgage",{"Loan Amount:",
"Loan Rate: ","# Tiers: ",
"% Increase: ","Term (yrs): "});

I:=I/1200;
C:=C/100;

X:=Σ((1+C)^K/(1+I)^(12*K),K,0,N-1);
X:=X/I*(1-(1+I)^(−12));
Y:=(1+C)^N/(1+I)^(12*N);
Y:=Y/I*(1-(1+I)^−(12*T-12*N));
P:=A/(X+Y);

mat:=[[1,P]];
LOCAL k;
FOR k FROM 1 TO N DO
mat:=ADDROW(mat,
[k+1,mat[k,2]*(1+C)],k+1);
END;

RETURN mat;

END;

TI-84 Plus CE Program GRADMORT

"GRADUATED MORTGAGE"
"WINKLER/JUD"
"EWS 2018-02-11"
Input "LOAN AMT: ",A
Input "LOAN RATE: ",I
I/1200→I
Input "NO. TIERS: ",N
Input "INCREASE: ",C
C/100→C
Input "LOAN TERM (YRS): ",T

Σ((1+C)^K/(1+I)^(12*K),K,0,N-1)→X
X/I*(1-(1+I)^(­12))→X

(1+C)^N/(1+I)^(12*N)→Y
Y/I*(1-(1+I)^­(12T-12N))→Y

A/(X+Y)→P
{1}→L1
{P}→L2
For(K,1,N)
augment(L1,{K+1})→L1
augment(L2,{L2(K)*(1+C)})→L2
End
List→matr(L1,L2,[A])
Disp [A]

Example

A young couple, who just graduated from college and starting on their careers, have qualified to participate in a GPM.  They will finance a $200,000 mortgage at a fixed annual interest of 4.4%.  Payments increase 2.1% for the first five years of the 35 year mortgage. 

Variables (the program will prompt you for the amounts):

Loan Amount:  200000
Loan Rate:  4.4
# Tiers:  5
% Increase: 2.1
Term (yrs): 35

Results:

Matrix:
[ [1, 855.231019434]
[2, 873.190870842]
[3, 891.52787913]
[4, 910.249964592]
[5, 929.365213848]
[6, 948.881883339] ]

Year 1:  $855.23
Year 2:  $873.19
Year 3:  $891.53
Year 4:  $910.25
Year 5:  $929.37
Year 6 (years 6 – 35):  $948.88

Source 

Winkler, D.T. an G.D. Jud.  “The Graduated Payment Mortgage:  Sovling the Initial Payment Enigma”  Journal of Real Estate Practice and Education, vol. 1, 1998, pp 67-79.  Retrieved February 10, 2018.  Link:  https://libres.uncg.edu/ir/uncg/f/D_Winkler_Graduated_1998(MULTI%20UNCG%20AUTHORS).pdf

Eddie


This blog is property of Edward Shore, 2018.

Tuesday, February 13, 2018

HP Prime: TrigPlot App (HP Prime Custom app Tutorial)

HP Prime: TrigPlot App  (HP Prime Custom app Tutorial)

Introduction

Here is another example custom app, the TrigPlot, which plots the following equation:

y = A * sin(Bx + C) + D * cos(Ex + F) + G * sin(Hx + I)^2 + J * cos(Kx + L)^2

where all angles are in radians.  The app uses the global variables A through L. 

Keys

[ Num ]:  The user enters values for A – L.  They must be real (not complex or have a (-1) component)

[ Plot ]:  Enter plot parameters and choose the color of the plot (purple, blue, green, gold, red).  The plot is against a black background.

[ View ], Erase A-L:  Sets the variables A through L to 0 (zero).

[ Info ]:  Displays information about the app

Notes



The Info section introduces the user to the app’s concept:

Info()
BEGIN
// This is when the user presses
// Shift+Apps (Info), use Print
// commands

PRINT();

PRINT("TrigPlot App");
PRINT("------------");
PRINT("By Edward Shore");
PRINT("------------");
PRINT("This app plots the equation");
PRINT("Y = A*SIN(B*X+C) + D*COS(E*X+F) +");
PRINT("G*SIN(H*X+I)^2 + J*COS(K*X+L)^2");
PRINT("------------");
PRINT("February 2018");

END;


To ensure the app always runs in Radians mode, I store the value 1 to AAngle during startup (START).  In addition, I added the Info(); to show the Info screen.

START()
BEGIN
// This happens when the app is started.

// Set the app to radians angle mode.
AAngle:=1;
// This is a specific app mode setting
// unlike HAngle

// Also run the Info screen
Info();

END;

The Plot portion of app is based on the Pixel Plot program (see http://edspi31415.blogspot.com/2018/02/hp-prime-pixel-plot-how-to-change.html ) where pixels are plotted.

HP Prime Program:  TrigPlot (in app TrigPlot)

#pragma mode( separator(.,;) integer(h32) )

//Symb()
//BEGIN
// MSGBOX("Symb");
//END;

Plot()
BEGIN
// runs the Plot routine
// set color scheme
LOCAL col1;
col1:={#BF00FFh,#7DF9FFh,
#00FF00h,#D4AF37h,#FF0000h};

// Radians
HAngle:=0;

// localize variables
LOCAL xm,xn,ym,yn;
LOCAL xs,ys,xp,yp;
LOCAL x,y,ch;

// input screen
INPUT({
xm,xn,ym,yn,
{ch,
{"Purple","Blue","Green",
"Gold","Red"}}},
"TrigPlot Setup: Plot",
{"x-min: ","x-max: ",
"y-min: ","y-max: ",
"Color: "});

// set black background
RECT_P(0);

// calulate the scale
xs:=(xn-xm)/320;
ys:=(yn-ym)/−220;

// drawing

// color choice
LOCAL c1:=col1[ch];

// axis information
LOCAL st1,st2;
st1:="x:["+xm+","+xn+"]";
st2:="y:["+ym+","+yn+"]";
TEXTOUT_P(st1,0,0,2,#C0C0C0h);
TEXTOUT_P(st2,0,20,2,#C0C0C0h);

// function
FOR x FROM xm TO xn STEP xs DO

// function
y:=A*SIN(B*x+C)+D*COS(E*x+F)+
G*SIN(H*x+I)^2+J*COS(K*x+L)^2;

// point→pixel, plot
xp:=(x-xm)/xs;
yp:=(y-yn)/ys;
PIXON_P(xp,yp,c1);

END;
// freeze screen
FREEZE;

END;

Num()
BEGIN
// This is where all the variables are
// entered, in one easy spot. A-L are
// global in this application.
INPUT({A,B,C,D,E,F,G,H,I,J,K,L},
"TrigPlot Variables");
END;

//SymbSetup()
//BEGIN
// MSGBOX("SymbSetup");
//END;

//PlotSetup()
//BEGIN
// MSGBOX("PlotSetup");
//END;

//NumSetup()
//BEGIN
// MSGBOX("NumSetup");
//END;

Info()
BEGIN
// This is when the user presses
// Shift+Apps (Info), use Print
// commands

PRINT();

PRINT("TrigPlot App");
PRINT("------------");
PRINT("By Edward Shore");
PRINT("------------");
PRINT("This app plots the equation");
PRINT("Y = A*SIN(B*X+C) + D*COS(E*X+F) +");
PRINT("G*SIN(H*X+I)^2 + J*COS(K*X+L)^2");
PRINT("------------");
PRINT("February 2018");

END;

START()
BEGIN
// This happens when the app is started.

// Set the app to radians angle mode.
AAngle:=1;
// This is a specific app mode setting
// unlike HAngle

// Also run the Info screen
Info();

END;

//RESET()
//BEGIN
//MSGBOX("RESET");
//END;

//VIEW "Views", Views()
//BEGIN
// MSGBOX("Views");
//END;

VIEW "Erase A-L", ERASEAL()
BEGIN
A:=0; B:=0; C:=0; D:=0; E:=0; F:=0;
G:=0; H:=0; I:=0; J:=0; K:=0; L:=0;
END;

Examples

Example 1:  y = 2 sin(x + 2) – 3 cos x
A = 2, B = 1, C = 2, D = -3, E = 1 (the rest are zero)



Example 2:  y = 2 cos(2x) + 1.5 * cos^2 x
D = 2, E = 2, J = 1.5, K = 1 (the rest are zero)



Eddie


This blog is property of Edward Shore, 2018.

Saturday, February 10, 2018

HP Prime Custom App: GeomCalc

HP Prime Custom App: GeomCalc

Introduction

The app GeomCalc is an example of a custom HP App for the HP Prime.  For general information, please visit this blog entry:  http://edspi31415.blogspot.com/2018/02/hp-prime-intro-to-blank-custom-apps.html

Let’s get start with this example app.

START - The Initial Conditions

Here I set the app’s angle to degrees mode.  Note that I use the variable AAngle instead of the global variable HAngle.  The values for AAngle are slightly different than HAngle:

0:  use the angle setting from Home Settings
1:  Radians
2:  Degrees
3:  Gradians

I want the app to operate with angles in degrees, so I set AAngle to 1.

The last command is a message box containing the word Ready, to let the user know that the app is all set to go. 

START()
BEGIN
// Set app angle to degrees
AAngle:=2;
MSGBOX("Ready.");
END;

Info – Title and Introduction

I want to leave some basic information about this app.  I recommend that you use the PRINT command rather than the TEXTOUT/WAIT/FREEZE.  Alternatively, you can store a string in ANote. 

I prefer using PRINT because I can print multiple lines with appropriate line breaks.

Info()
BEGIN
PRINT();
PRINT("GeomCalc");
PRINT("---------");
PRINT("EWS 2018-02-07");
PRINT("---------");
PRINT("Geometry areas and volumes");
END;



The Symb section – selecting the calculation

In this section, I set the variable I to a choice of one of ten options.  The variable I is a global variable, so I can use determine calculations.  The INPUT command uses a dropdown box.  The general format for a single dropdown box is:

INPUT( { { var, {“choice 1”, “choice 2”, … }}}, … (other parameters)  )

The message box at the end let’s the user know that the choice has been set, and can now proceed to the calculation by pressing [Num]. 

Symb()
BEGIN
// Choose the calculation
// Global vars are used
INPUT({{I,{"Area: Circle",
"Area: Ellipse",
"Area: Trapezoid",
"Area: Circular Sector",
"Area: Regular Polygon",
"Volume: Sphere",
"Volume: Cylinder",
"Volume: Cone",
"Volume: Box",
"Volume: Ellipsoid"}}},
"Select Your Calculation");
MSGBOX("It's set!");
END;



The Num section – doing the calculation

When the [Num] is pressed, the user as asked to enter the arguments.  The final result is displayed on the terminal.  Since global variables (including A-Z) is used, values are permanently stored until changed.  In this app, I store the area in the variable E and the volume in V.

There is no default selection, so I use ten IF-THEN structures than a CASE structure.

Num()
BEGIN

IF I==1 THEN
INPUT(R,"Area: Circle","Radius: ");
E:=π*R^2;
PRINT();
PRINT("Area: "+E);
END;

IF I==2 THEN
INPUT({A,B},"Area: Ellipse",
{"A: ","B: "});
E:=π*A*B;
PRINT();
PRINT("Area: "+E);
END;

IF I==3 THEN
INPUT({A,B,H},"Area: Trapezoid",
{"A: ","B: ","H: "});
E:=0.5*H*(A+B);
PRINT();
PRINT("Area: "+E);
END;

IF I==4 THEN
INPUT({θ,R},"Area: Circular
Sector",{"Angle (°): ",
"Radius: "});
E:=θ*π*R^2/360;
PRINT();
PRINT("Area: "+E);
END;

IF I==5 THEN
INPUT({N,S},"Area: Regular
Polygon",{"# sides: ",
"Length: "});
E:=N*S^2/(4*TAN(180/N));
PRINT();
PRINT("Area: "+E);
END;

IF I==6 THEN
INPUT(R,"Volume: Sphere","Radius: ");
V:=4/3*π*R^3;
PRINT();
PRINT("Volume: "+V);
END;

IF I==7 THEN
INPUT({R,H},"Volume: Cylinder",
{"Radius: ","Height: "});
V:=π*R^2*H;
PRINT();
PRINT("Volume: "+V);
END;

IF I==8 THEN
INPUT({R,H},"Volume: Cone",
{"Radius: ","Height: "});
V:=π*R^2*H/3;
PRINT();
PRINT("Volume: "+V);
END;

IF I==9 THEN
INPUT({A,B,C},"Volume: Box",
{"A: ","B: ","C: "});
V:=A*B*C;
PRINT();
PRINT("Volume: "+V);
END;

IF I==10 THEN
INPUT({A,B,C},"Volume: Ellipsoid",
{"A: ","B: ","C: "});
V:=4/3*π*A*B*C;
PRINT();
PRINT("Volume: "+V);
END;

END;




Putting It All Together 

#pragma mode( separator(.,;) integer(h32) )

Symb()
BEGIN
// Choose the calculation
// Global vars are used
INPUT({{I,{"Area: Circle",
"Area: Ellipse",
"Area: Trapezoid",
"Area: Circular Sector",
"Area: Regular Polygon",
"Volume: Sphere",
"Volume: Cylinder",
"Volume: Cone",
"Volume: Box",
"Volume: Ellipsoid"}}},
"Select Your Calculation");
MSGBOX("It's set!");
END;

//Plot()
//BEGIN
// MSGBOX("Plot");
//END;

Num()
BEGIN

IF I==1 THEN
INPUT(R,"Area: Circle","Radius: ");
E:=π*R^2;
PRINT();
PRINT("Area: "+E);
END;

IF I==2 THEN
INPUT({A,B},"Area: Ellipse",
{"A: ","B: "});
E:=π*A*B;
PRINT();
PRINT("Area: "+E);
END;

IF I==3 THEN
INPUT({A,B,H},"Area: Trapezoid",
{"A: ","B: ","H: "});
E:=0.5*H*(A+B);
PRINT();
PRINT("Area: "+E);
END;

IF I==4 THEN
INPUT({θ,R},"Area: Circular
Sector",{"Angle (°): ",
"Radius: "});
E:=θ*π*R^2/360;
PRINT();
PRINT("Area: "+E);
END;

IF I==5 THEN
INPUT({N,S},"Area: Regular
Polygon",{"# sides: ",
"Length: "});
E:=N*S^2/(4*TAN(180/N));
PRINT();
PRINT("Area: "+E);
END;

IF I==6 THEN
INPUT(R,"Volume: Sphere","Radius: ");
V:=4/3*π*R^3;
PRINT();
PRINT("Volume: "+V);
END;

IF I==7 THEN
INPUT({R,H},"Volume: Cylinder",
{"Radius: ","Height: "});
V:=π*R^2*H;
PRINT();
PRINT("Volume: "+V);
END;

IF I==8 THEN
INPUT({R,H},"Volume: Cone",
{"Radius: ","Height: "});
V:=π*R^2*H/3;
PRINT();
PRINT("Volume: "+V);
END;

IF I==9 THEN
INPUT({A,B,C},"Volume: Box",
{"A: ","B: ","C: "});
V:=A*B*C;
PRINT();
PRINT("Volume: "+V);
END;

IF I==10 THEN
INPUT({A,B,C},"Volume: Ellipsoid",
{"A: ","B: ","C: "});
V:=4/3*π*A*B*C;
PRINT();
PRINT("Volume: "+V);
END;

END;

//SymbSetup()
//BEGIN
// MSGBOX("SymbSetup");
//END;

//PlotSetup()
//BEGIN
// MSGBOX("PlotSetup");
//END;

//NumSetup()
//BEGIN
// MSGBOX("NumSetup");
//END;

Info()
BEGIN
PRINT();
PRINT("GeomCalc");
PRINT("---------");
PRINT("EWS 2018-02-07");
PRINT("---------");
PRINT("Geometry areas and volumes");
END;

START()
BEGIN
// Set app angle to degrees
AAngle:=2;
MSGBOX("Ready.");
END;

//RESET()
//BEGIN
// MSGBOX("RESET");
//END;

//VIEW "Views", Views()
//BEGIN
// MSGBOX("Views");
//END;

Examples

Example 1:  Area of a Polygon



Example 2:  Volume of a Cone



I plan to post another example by next week, that one will involve plotting.


Eddie


This blog is property of Edward Shore, 2018

Retro Review: Texas Instruments TI-60

Retro Review:  Texas Instruments TI-60 General Information Company:  Texas Instruments Type:  Programmable Scient...