Friday, April 19, 2019

TI-74: Five Stencil Derivative, Vertical Height on a Hill, Solving Cubic Equations

TI-74:  Five Stencil Derivative, Vertical Height on a Hill, Solving Cubic Equations

TI-74 Program: Five Stencil Derivative

This program estimates the numerical derivative of f(x) at x0 by the formula:

f'(x0) ≈ ( -f(x0+2h) + 8*f(x0+h) - 8*f(x0-h) + f(x0-2h) )/(12h)

Source:  "Five Stencil Method"  Wikipedia.  Page last edited November 8, 2018.  https://en.wikipedia.org/wiki/Five-point_stencil  Retrieved April 14, 2019

Note:  comments (after !) are for notes, and do not need to be typed. 


500 PRINT "F(X) IS ON LINE 550.": PAUSE 1: RAD  ! RAD sets radians mode
502 INPU T "X: ";A
504 INPUT "H: ";H
506 D=0: X=A+2*H: GOSUB 550
508 D=-F: X =A+H: GOSUB 550
510 D=8*F+D: X=A-H: GOSUB 550
512 D=D-8*F: X=A-2*H: GOSUB 550
514 D=(D+F)/(12*H)
516 PRINT "DF/DX =";D: PAUSE 
518 END
550 F=5.2^X  ! Insert F(X) here
552 END

Examples:

550  F=5.2^X
x0 = 1.2, h = 0.001, Result:  11.92160564

550 F=EXP(X)*SIN(X)
x0 = PI/3, h = PI/24, Result: 3.892851849

TI-74 Program:  Vertical Height on a Hill

Variables:
H = height of the observer
L = horizontal length
V = vertical angle (entered in degrees-minutes-seconds, DD.MMSSSS)
G = ground slope (entered in degrees-minutes-seconds, DD.MMSSSS)

If G>0, the hill is at an elevation.  If G<), the hill is at an depression.

T = total height = vertical difference + observer's height
T = L * (tan V - tan G) + H

Since there is no DMS to decimal conversion function in TI-74's basic, a conversion is necessary. The following is sample code where A is DMS format needed to be converted:

T = ABS(A)
D = INT(T)
M = INT((T-D)*100)
S = ((T-D)*100-M)*100
A = (D+M/60+S/3600)*SGN(A)

The program code is shown below:

600 INPUT "LENGTH: ";L
602 INPUT "OBSERVER'S HEIGHT: ";H   ! ' is SHIFT + SPACE

604 DEG: PRINT "ANGELS IN DD.MMSSSS": PAUSE 1.5
606 INPUT "VERTICAL ANGLE: ";V: A=ABS(V)
608 D=INT(A): M=INT((A-D)*100): S=((A-D)*100-M)*100
612  V=(D+M/60+S/3600)*SGN(V)

614 INPUT "GROUND SLOPE: ";G: A=ABS(G)
616 D=INT(A): M=INT((A-D)*100): S=((A-D)*100-M)*100
618 G=(D+M/60+S/3600)*SGN(G)

620 T=L*(TAN(V)-TAN(G))+H
622 PRINT "TOTAL HEIGHT =";T: PAUSE
624 END

Examples:

Input:  L: 10 m, V: 30°14'33", G: 10°30'00", H = 1.7780 m
Result:  T = 5.754638129 m

Input:  L: 10 m, V: 30°14'33", G: -10°30'00", H = 1.7780 m
Result:  T = 9.461464028 m

Source: 

F.A. Shepherd "Engineering Surveying: Problems and Solutions" 2nd Edition  Edward Arnold Publishers Ltd.  London, UK  1983 ISBN 0-7131-3478-X

TI-74 Program:  Solving Cubic Equations

This program solves the cubic equation:

A*X^3 + B*X^2 + C*X + D = 0

This program uses Newton's method to get the first root, then divides the polynomial by (x - root).  Finally the quadratic formula is used to find the other two roots.  This program assumes the coefficients A, B, C, and D are real.  An initial guess of 1 is used (can be changed, see line 710).

700 PRINT "A*X^3+B*X^2+C*X+D=0, REAL COEFS.": PAUSE 1.5
702 INPUT "A: ";A
704 INPUT "B: ";B
706 INPUT "C: ";C
708 INPUT "D: ";D

710 X=1
712 XN=X-(A*X^3+B*X^2+C*X+D)/(3*A*X^2+2*B*X+C)
714 IF ABS(XN-N)<1e-9 718="" font="" then="">
716 X=XN: GOTO 712

718 X1=XN
720 PRINT "X1 =";X1: PAUSE
722 J=-(A*X1+B)
724 K=(A*X1+B)^2-4*A*(A*X1^2+B*X1+C)
726 IF K<0 750="" font="" then="">
728 X2=(J+SQR(K))/(2*A): X3=(J-SQR(K))/(2*A)
730 PRINT "X2 =";X2: PAUSE
732 PRINT "X3 =";X3: PAUSE
734 END

750 XR=J/(2*A): XI=SQR(ABS(K))/(2*A)
752 PRINT XR;"+- ";XI;"I": PAUSE
754 END

Example:
A: 1, B: 1, C: -9, D: -9
Roots: -3, 3, 1
Eddie

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

TI-74: Lottery, Solving Linear Equation Script, Escape Velocity Solver

TI-74:  Lottery, Solving Linear Equation Script, Escape Velocity Solver

TI-74 Program:  Lottery

This program collects six random digits from 1 to 63.  The results are stored in an array N.  The dimension pointers of the TI-74 are from 0 to n-1. 

To execute:  RUN 200

Note:  comments (after !) are for notes, and do not need to be typed. 

200 DIM N(5)
202 INPUT "SEED: ";S
204 RANDOMIZE S
210 FOR I=0 TO 5    ! choose random numbers
212 R=INT(RND*63+1)
220 FOR J=0 TO 5   ! check to see if the random number is unique
222 IF R=N(J) THEN 212
224 NEXT J
230 N(I) = R
232 K=K+1
234 PRINT "# "&STR$(K)$": "&STR$(N(I))
236 PAUSE 1.5
240 NEXT I
242 END

TI-74 Program:  Solving Linear Equation Script

This program uses READ and DATA to execute a teaching script.

To execute:  RUN 300

300 FOR I=1 TO 5
302 READ S$  ! string variables have the dollars sign after the name
304 PRINT S$: PAUSE
306 NEXT
310 DATA "To Solve: a*x + b = c"
312 DATA "a*x + b - b = c - b"
314 DATA "a*x = c - b"
316 DATA "(a*x)/a = (c-b)/a"
318 DATA "x = (c-b)/a"
320 END

TI-74 Program:  Escape Velocity Solver

This program is in two stages:
1.  Enter data.  Use M, R, or V to enter data.  When done, press C to solve.
2.  Choose which variable to solve for. 

M = mass of the planet in kg
R = radius of the planet in km
V = escape velocity in km/s

G = Universal Gravitational Constant
= 6.672E-11 m^3/(kg*s^2) = 6.672E-20 km^3/(kg*s^2)

Equation:  V = √(2 * G * M/R)

To execute:  RUN 400

400 M=0:R=0:V=0:G=6.674E-20
402 PRINT "M MASS, R RADIUS, V VEL, CALC":K$=KEY$
406 IF K$="M" THEN 420
408 IF K$="R" THEN 430
410 IF K$="V" THEN 440
412 IF K$ = "C" THEN 450
414 GOTO 402   ! repeats loop if any other key is pressed

420 INPUT "MASS (KG): ";M
422 GOTO 402
430 INPUT "RADIUS (KM): ";R
432 GOTO 402
440 INPUT "VELOCITY (KM/S): ";V
442 GOTO 402
450 PRINT "SOLVER: M,R,V": K$=KEY$

452 IF K$="M" THEN 460
454 IF K$="R" THEN 470
456 IF K$="V" THEN 480
458 GOTO 450

460 M=V^2*R/(2*G)
462 PRINT "MASS =";M;" KG": PAUSE
464 GOTO 490
470 R=2*G*M/V^2
472 PRINT "RADIUS =";R;" KM": PAUSE
474 GOTO 490
480 V=SQR(2*G*M/R)   ! SQR is √
482 PRINT "VELOCITY =";V;" KM/S": PAUSE
484 GOTO 490

490 PRINT "AGAIN? Y/N": K$=KEY$
492 IF K$="Y" THEN 402
494 IF K$="N" THEN END
496 GOTO 490

Examples: 

Solve for V:   M: 5.9724E24 kg, R:  6374 km,  Result: V ≈ 11.178 KM/S
*Escape Velocity for Earth

Solve for M:  R: 5800 km, V: 16 km/s,  Result:  M ≈ 1.112E25 kg

Solve for R:  M: 3.8E24 kg, V: 22 km/s, Result:  R ≈ 1048.0148 km

Eddie

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

Tuesday, April 16, 2019

My Blog Turns 8!

My Blog Turns 8!



It turns out last year I was a bit early on declaring my blog's birthday.  My first blog was not on April 11, 2011 but on April 16, 2011.  Here it is:

https://edspi31415.blogspot.com/2011/04/hi-everyone-this-is-my-very-first-blog.html

Not too exciting, I know.  The first mathematical topic I did was reviewing the HP 10BII+ financial calculator:

A first look on April 18, 2011:

https://edspi31415.blogspot.com/2011/04/hp-10bii-first-look.html

And here was my review of it on April 20, 2011:

https://edspi31415.blogspot.com/2011/04/10bii-review.html

What followed is a popular review of my blog, the review of the Texas Instruments TI-36X Pro, which was posted on April 27, 2011:

https://edspi31415.blogspot.com/2011/04/ti-36-pro-review.html

I just want to give a big shout out and thanks to each and every one of you.  I am happy and fortunate to share my love of mathematics and calculators with all of you.  Here's to many more years, readers!

Eddie Shore

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

Quickie RPN Routines: HP 42S, DM42, Free 42

Quickie RPN Routines: HP 42S, DM42, Free 42

X, Y refer to their respective stacks and their values

1 + 1 /( 3^(2*X)) + 1/(5^(2*X))

Routine A:
(Labels are omitted for these exercises)

2
*
ENTER
ENTER
3
X <> Y
Y  ↑X
1 / X
X <> Y

X <> Y
Y ↑ X
1 / X
+
1
+
END

Routine B:

2
*
+ / -
3
X <> Y
Y ↑ X
LAST X
5
X <> Y
Y ↑ X
+
1
+
END

Examples:
X:  2.0000,  Result: 1.0139
X:  3.1666,  Result: 1.0010


(X + Y)*(X^2 + Y^2)

Routine A:

ENTER 
X ↑ 2
R ↓
X <> Y
+
LAST X
X ↑ 2
R ↑

*
END

Routine B:

STO ST Z
X ↑ 2
X <> Y
STO + ST Z
X ↑ 2
+
*
END

Examples:
X:  4.0000, Y: 3.0000, Result: 175.0000
X:  2.7000, Y: 3.6000, Result: 127.5750

√(1 + X^2) / √(1 - X^2)

Routine A:

X ↑ 2
1
X <> Y

LAST X
1
+
X <> Y
÷
SQRT
END

Routine B:

X ↑ 2
ENTER
ENTER
1
STO + ST Z
STO - ST Y
R ↓
+ / -
÷
SQRT
END

Examples:
X: 0.5556, Result: 1.3759
X: 0.7278, Result: 1.8035

X / √(X^2 + Y^2)

Routine: 

X ↑ 2 
X <> Y
STO ST Z
X ↑ 2
+
SQRT
÷
END

Examples:
X:  0.5000, Y:  0.7500, Result: 0.5547
X:  1.8080, Y:  1.0220, Result: 0.8705

(X + Y) / (X * Y)

Routine  A:

STO ST Z
X <> Y
STO + ST Z
*
÷
END

Routine B:

ENTER 
R ↓
X <> Y
+
LAST X
R ↑

÷
END

Examples:
X:  5.0000, Y: 4.0000, Result:  0.4500
X:  2.9505, Y: 3.8181, Result:  0.6008

X^Y + Y^X

Routine A:

ENTER
R ↓
X <> Y
Y ↑ X
LAST X
R ↑
Y ↑ X
+
END

Routine B:

ENTER 
R ↓
X <> Y
Y ↑ X
LAST X
R ↑
Y ↑ X
+
END

Examples:
X:  3.9050, Y: 2.7006, Result:  88.0041
X:  4.2650, Y: 4.8750, Result:  2036.6461

Have fun!  See you all next week! 

Eddie

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

Wednesday, April 10, 2019

Casio MS-80 Series and HP 17BII+: Using Exchange Rates for US/SI Conversions

Casio MS-80 Series and HP 17BII+:  Using Exchange Rates for US/SI Conversions

Casio MS-80 Series



I am demonstrating this technique on a Casio MS-80TV, however, this can apply to any desktop calculator which exchange rate functions are offered.  This includes the Casio MS-6CO (where the keys are labeled METRIC|CONV) and Casio MS-80B.

To set the rate:

1.  Set the calculator to Exchange Mode.  Press [MODE M/EX] until EXCH appears in the display. 
2.  Press [ AC ] then hold [ % ] until the display refreshes.  The display will then say SET.
3.  Select the exchange memory rate you want to set.  C2, C3, some models have C4. 
4.  Enter the conversion rate.  You can include up to six significant digits. 
5.  Press [ % ]. 
6.  Press [ AC ] to clear the calculator.

Multiply by the rate:  n [C1] [C2]*

Divide by the rate:  n [C2]* [C1]

* can be C3 or C4

Example: 1  US mile = 1.609344 km

We'll use the approximation 1 mi ≈ 1.60934 km

Keystrokes:
(in EXCH mode): 
[AC] hold [  % ]
(SET is displayed)
[C2] 1.60934 [ % ]
[AC]

Convert 20 mi to km:  20 [C1] [C2]  (Result:  32.1868)
Convert 50 km to mi:  50 [C2] [C1]  (Result:  31.068636)

Hewlett Packard HP 17BII+



This applies to the revised HP 17BII+ series, not the original. 

To set the rate:

1.  From the main menu, select (CURRX) (currency conversion mode).
2.  Press (SELCT).  At the prompt "SELECT CURRENCY 1", choose a currency name.  I suggest A [ ( MORE) (MORE) ( A )].
3.  Press (SELCT).  At the prompt "SELECT CURRENCY 2", choose a currency name.  I suggest B [ ( MORE) (MORE) ( B )].
4.  Enter your conversion rate.  Unlike the Casio MS-80 series, there is no limit to the number of significant digits you can enter.  Press (RATE).  If your labels (currencies) have already been set, you can skip steps 2 and 3 and instead, enter the conversion rate and press (RATE).

Multiply by the rate*:  n ( A ) ( B )

Divide by the rate*:  n ( B ) ( A )

* or whatever the labels you designate.  ( A ) is on the left, ( B ) is on the right.

Going back to our example:  1  US mile = 1.609344 km

Keystrokes (ALL display format is selected for this example):
(in CURRX mode)
(SELCT) (MORE) (MORE) ( A )*
(SELCT) (MORE) (MORE) ( B )*
1.609344 (RATE)

Convert 20 mi to km:  20 ( A ) ( B )  (Result:  32.18688)
Convert 50 km to mi:  50 ( B ) ( A ) (Result:  31.0685596119)

Eddie

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

HP Prime and TI-84 Plus CE: Drawing Angles

HP Prime and TI-84 Plus CE:  Drawing Angles

Introduction

The program DRAWANG draws an angle.  You give the starting line from coordinates (0,0) to (A,B).  The origin is given automatically.  The calculator will then a draw a line that results from the given angle θ from the origin to a calculated point. 

The calculator will work in the angle mode your calculator mode is currently set.

For clockwise angles, enter θ as negative.

For counterclockwise angles, enter θ as positive.

HP Prime Program DRAWANG

EXPORT DRAWANG()
BEGIN
// 2019-04-04 EWS
STARTAPP("Function");
Xmin:=−11; Xmax:=11;
Ymin:=−11; Ymax:=11;
LOCAL A,B,C,D,R,θ,Z;
INPUT({A,B,θ},"Begin Point (A,B)
; Angle θ",{"A:","B:","θ:"},
{"−10≤A≤10","−10≤B≤10","Angle"});
R:=√(A^2+B^2);
Z:=θ+ARG(A+B*i);
C:=R*COS(Z); D:=R*SIN(Z);
RECT();
// Axes
LINE(−11,0,11,0,#D0D0D0h);
LINE(0,−11,0,11,#D0D0D0h);

// Angle
LINE(0,0,A,B,#FF0000h);
LINE(0,0,C,D,#0000FFh);
TEXTOUT("Angle: "+STRING(θ),
−11,11,3,#006000h);
WAIT(0);
END;

(Alternatively, with HComplex set to 1  (allow complex numbers from real input, and display them as a+bi):

EXPORT DRAWANG()
BEGIN
// 2019-04-04 EWS
HComplex:=1;
STARTAPP("Function");
Xmin:=−11; Xmax:=11;
Ymin:=−11; Ymax:=11;
LOCAL A,B,C,D,R,θ,Z;
INPUT({A,B,θ},"Begin Point (A,B)
; Angle θ",{"A:","B:","θ:"},
{"−10≤A≤10","−10≤B≤10","Angle"});
R:=√(A^2+B^2);
Z:=θ+ARG(A+B*√(-1));
C:=R*COS(Z); D:=R*SIN(Z);
RECT();
// Axes
LINE(−11,0,11,0,#D0D0D0h);
LINE(0,−11,0,11,#D0D0D0h);

// Angle
LINE(0,0,A,B,#FF0000h);
LINE(0,0,C,D,#0000FFh);
TEXTOUT("Angle: "+STRING(θ),
−11,11,3,#006000h);
WAIT(0);
END;

The latter program can be copied straight from the blog as text.  The former will be needed to type in manually. 


TI-84 Plus CE Program DRAWANG

"2019-04-04 EWS"
Func
ZStandard
PlotsOff 
FnOff 
ClrDraw
AxesOn 
Disp "BGN POINT (A,B)","­10≤A≤10,­10≤B≤10","θ: ANGLE"
Prompt A,B,θ
√(A²+B²)→R
θ+R▶ Pθ(A,B)→Z
R*cos(Z)→C
R*sin(Z)→D
Line(0,0,A,B,RED)
Line(0,0,C,D,BLUE)
TextColor(GREEN)
Text(0,0,"ANGLE: "+toString(θ))
DispGraph



Eddie

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

TI 84 Plus CE: Linear Equation Algebra Drill

TI 84 Plus CE: Linear Equation Algebra Drill





Note:  This program is recommended for the TI-84 Plus CE with OS 5.2 or later.

The program ALGDRILL has the user answer ten questions to solve for x in the following linear equation:

A * X + B = C

The values of A, B, and C are randomly selected from -10 to 10. Note that A ≠ 0.

TI-84 Plus CE Program ALGDRILL

"EWS 2019-04-07"
0→S

For(K,1,10)
0→A:0→B

Repeat A≠0 and B≠0
randInt(­10,10)→A
randInt(­10,10)→B
End

randInt(­10,10)→C
(C-B)/A→X
ClrHome
Disp toString(K)+". : "+toString(A)+"X + "+toString(B)+" = "+toString(C)
Input Y

If Y=X
Then
Disp "CORRECT :)",X ▶Frac
S+1→S
Else
Disp "INCORRECT.","ANSWER: ",X▶Frac
End
Pause

End
ClrHome
Disp "SCORE: "+toString(S)+"/10"
If S≥8
Disp "WELL DONE!"

Download the program here:  https://drive.google.com/file/d/13udTfPgG_qqEry1ILBD1UjvJ1JWi-mz7/view?usp=sharing

Eddie


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

Tuesday, April 2, 2019

HP Prime and TI-84 Plus CE: Percent Change on Paired Data

HP Prime and TI-84 Plus CE:  Percent Change on Paired Data

Introduction

Given a two column matrix, the programs here calculate the percent difference on each row.  The first column is the old value while the second column is the new value.

HP Prime Program %CHGPAIRED

EXPORT %CHGPAIRED(m0)
BEGIN
// Δ% on a 2 column matrix
// 2019-03-31 EWS
LOCAL k,s:=SIZE(m0);
LOCAL n:=s(1);
LOCAL m1:=MAKEMAT(0,n,1);
FOR k FROM 1 TO n DO
m1(k,1):=%CHANGE(m0(k,1),m0(k,2));
END;
RETURN m1;
END;

TI-84 Plus Program CHGPAIR

"2019-03-31 EWS"
Disp "PCHG PAIRED DATA"
Input [J]
dim([J])→L₆
L₆(1)→N
{N,1}→dim([I])
For(K,1,N)
([J](K,2)-[J](K,1))/[J](K,1)*100→[I](K,1)
End
Pause [I]

Example

M =
[[ 1, 6 ], [ 4, 2 ], [ 3, 7 ], [ 6, 5 ], [ 4, 11 ]]

Result:
[[ 500 ], [ -50 ], [ 133.3333333 ], [ -16.6666667 ]]

[picture]

Source:  "Probability and Statistics:  Step by Step Solutions for Your HP-28S or HP-28S Calculator"  Hewlett Packard.  November 1987.

Eddie


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

HP 17BII: Normal Distribution and Random Number Generators

HP 17BII:  Normal Distribution and Random Number Generators

Normal Distribution

The following solver approximates the area of a normal distribution.  The following equation uses L (Let) and G (Get), so this can be used for the classic HP 17BII and the silver HP 17BII+.

NORM: CDF=1-EXP(-X^2÷2)÷SQRT(2*PI)*(.4361836*
L(T:INV(1+.33267*X))-.1201676*G(T)^2+.9372980*G(T)^3)

Instructions:

For x ≥ 0, enter x in ( X ) and then press (CDF) to solve. 

For x < 0, enter abs(x) in ( X ), press (CDF) to solve, negate the result and add 1. 

The area will be calculated from 0 (the center) to x. 

Example 1:  x = 2.5

2.5 (X), (CDF):  Result:  0.99

Example 2:  x = 1

1 (X), (CDF):  Result: 0.84

Example 3:  x = -1.5

(Algebric Mode)

1.5 (X), (CDF) [+/-] [ + ] 1 [ = ]:  Result:  0.07

Source:

"Handbook of Mathematical, Scientific, and Engineering Formulas, Tables, Functions, Graphics, Transforms"  Research & Education Association.  1984  ISBN 0-87891-521-4

Random Numbers




The HP 17B series does not have a random number function.  We can use the solver to generate random numbers.  Random numbers between 0 to 1 are generator. 

The format to use will depend on the version of HP 17B you are working with.

The code used will use pseudo-random generator:

r_i+1 = frac( ( π + r_i)^5 )

Classic HP 17B and HP 17BII:

We can use Let and Get to generate random numbers, they are used to generate in recurring sequences. 

R#=FP((PI+G(R#))^5)

Instructions:

Enter a starting seed, press (R#).
For future random numbers, keep on pressing (R#).

Brown and Silver HP 17BII+:

We'll use the two variables.  Despite the fact that Let and Get are available on the silver HP 17BII+, they cannot be used in recurring sequences. 

R2#=FP((PI+R1#)^5)

Instructions: 
Enter a starting seed, press (R1#).
For the first random number, press (R2#).
For future random numbers, press [ STO ] (R1#), then (R2#).

Other pseudo-random number generators to try:

r_i+1 = frac( 997 * r_i )

r_i+1 = frac( 147 * r_i )

Eddie


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

Tuesday, March 26, 2019

HP 17BII and HP 27S: Quadratic Formula

HP 17BII and HP 27S:  Quadratic Formula



The following solver equations solve the quadratic equation

A*x^2 + B*x + C = 0

by the famous Quadratic Formula

x = (-B ± √(B^2 - 4*A*C) ) / (2*A)

Define D as the discriminant:  D = B^2 - 4*A*C

If A, B, and C are real numbers and:

D<0 are="" complex="" conjugates="" p="" roots="" the="">
D≥0, the roots are real roots

Quadratic Equation:  Real Roots Only

QUAD:X=INV(2*A)*(-B+SQRT(B^2-4*A*C)*SGN(R#))

Input Variables:
A:  coefficient of X^2
B:  coefficient of X
C:  constant
R#:  -1 or 1

Output Varibles:
X:  root

Example:  2X^2 + 3X - 5 = 0

Input:
A: 2
B: 3
C: -5
R#: 1 (or any positive number)

Output:
X = 1

Input:
R#: -1

Output:
X = -2.5

Quadratic Equation:  Real or Complex Roots

(Let (L) and Get (G) functions required)

QUAD:0*(A+B+C+L(D:B^2-4*A*C)+L(E:2*A))
+IF(S(X1):IF(D<0:-b font="">
+IF(S(X2):IF(D<0:sqrt font="">

 Input Variables:
A:  coefficient of X^2
B:  coefficient of X
C:  constant

Output Variables:
D:  Discriminant
If D<0: imaginary="" nbsp="" p="" part="" real="" x1:="" x2:="">If D≥0:  X1:  real root 1, X2:  real root 2

Example 1:  -3*X^2 + 8*X - 1= 0

Input:
A: -3
B: 8
C: -1

Output:
D = 52
X1 = 0.1315
X2 = 2.5352

Roots:  x = 0.1315, x = 2.5352

Example 2:  3*X^2 + 5*X + 3 = 0

Input:
A: 3
B: 5
C: 3

Output:
D = -11
X1 = -0.8333
X2 = 0.5528

Roots:  x = -0.8333 ± 0.5528i

Eddie

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

HP 17BII and HP 17BII+: Finance Solver Equations

HP 17BII and HP 17BII+:  Sales Tax, Substantial Presence Test, Automobile Purchase, Principal Interest Property Tax & Insurance (PITI), Retirement Accounts

Note:  Some equations have the L (Let) and G (Get) functions, which are not available on the brown keyboard of the 17BII+ (around 2003). 

Sales Tax:  Determine the total amount of taxable items and non-taxable items.

AMT=NTAX+TXBL*(1+R%÷100)

AMT:  Total Amount
NTAX:  Items not subject to sales tax
TXBL:  Items subject to sales tax
R%:  sales tax rate

Example 1:  A company purchases equipment which costs $99.99, which was subject to 9.5% sales tax, which includes $139.99 of services.  The services are not subject to sales tax.  What is the total invoice? 

Input:
NTAX:  139.99
TXBL: 99.99
R%:  9.5(%)

Output:
AMT = 249.48

The total of the invoice is $249.48.

Example 2:  During an audit, a company finds an invoice with the total of $236.40 (amount), and the invoice listed non-taxable services of $146.50.  The company lives in a county where the sales tax is 8.75%.  What is the amount of taxable items? 

Input:
NTAX:  146.50
R%:  8.75(%)
AMT:  236.40

Output:
TXBL = 82.67

The amount of taxable items on the invoice is $82.67.

Substantial Presence Test

For more information about the substantial presence test, please click here:  http://edspi31415.blogspot.com/search?q=substantial+presence+

This equation uses Let and Get. 

SPT=IF(L(X:DDAYS(D:12.31+FP(100*D)÷100:1)>183:DATE(D:183):DATE(1.01+(FP(100*D)+.0001)÷100:IP(183-G(X)÷3)))

STP:  Number of days calculated for the Substantial Presence Test
D:  Date (in the format DD.MMYYYY)

Example 1:

D:  1.052019 (1/5/2019),  SPT = 7.072019 (7/7/2019)

Example 2:

D:  6.182008 (6/18/2008), SPT = 12.182008 (12/18/2008)

Example 3:

D:  9.262018 (9/26/2018), SPT = 6.012019 (6/1/2019)

Example 4:

D:  7.102017 (7/10/2017), SPT = 5.062018 (5/6/2018)

Financing the Purchase of an Automobile

This equation deals with the purchase of an automobile. 

AUTO:PRICE*(1-DISC%*.01)*(1+STAX%*.01)-DOWN=PMT*USPV(I%÷12:YRS*12)

PRICE: Sticker price of the automobile
DISC%:  Discount percent
STAX%: Sales tax rate
DOWN:  Down payment (amount)
PMT:  Payment of the loan
I%:  Interest rate of the loan
YRS: Number of years of the loan

Example 1:  The sticker price of a car is $28,000.00.  A discount of 15% is offered.  The car is subject to 10% sales tax.  The dealer offers a 6-year loan at 4.5%.  With $2,000, what is the monthly payment?

Input: 
PRICE: 28000.00
DISC%: 15
STAX%:  10
DOWN: 2000
I%:  4.5
YRS: 6

Output:
PMT = 383.83

The monthly payment is $383.83. 

Example 2:  Assuming the same facts from Example 1, expect the buyer wants to pay no more than $350.00 a month.  What is the required down payment?

Input: 
PRICE: 28000.00
DISC%: 15
STAX%:  10
I%:  4.5
YRS: 6
PMT: 350.00

Output:
DOWN = 4131.42

The down payment needs to be $4,131.42.

Real Estate:  Principal Interest Property Tax & Insurance (PITI)

Determine the total payment of mortgage when considering property tax and property insurance. 

PITI=MORT÷USPV(I%÷12:YRS*12)+(PROP$+INS$)÷12

PITI:  Payment including principal, interest, property tax, and insurance
MORT:  Mortgage amount, price of the property
I%:  Annual interest rate
YRS: Number of the years of the mortgage
PROP$:  Annual property tax
INS$:  Annual property insurance

Example:  A buyer purchases a home with a price of $200,000.00.  The amount is to be financed.  The loan lasts for 30 years and 5% interest rate.  There is annual property tax of $1,200.00 with insurance of $395.95.  What is the buyer's PITI?

Input:
MORT: 200000.00
I%:  5
YRS: 30
PROP$:  1200.00
INS$:  395.95

Output:
PITI = 1206.64

The buyer's PITI is $1,206.64. 

Retirement Accounts:  Future Value and Earned Untaxed Dividends

Determine the future value and untaxed dividends of tax-free retirement accounts (IRS/Keogh).

There are two versions, the second uses Let (L) and Get (G) functions.

Version 1:
IRA: VAL*0+DIV*0+IF(S(VAL):USFV(I%:YRS)*PMT*(1+I%÷100)-VAL:0)+IF(S(DIV):(USFV(I%:YRS)*(1+I%÷100)-YRS)*PMT-DIV:0)

Version 2:
IRA:(VAL+DIV+L(X:USFV(i%:YRS)*(1+I%÷100)))*0+IF(S(VAL):G(X)*PMT-VAL:(G(X)-YRS)*PMT-DIV)

Input Variables:
I%:  Annual Interest Rate
YRS:  Number of Years
PMT:  Annual Payment

Output Variables:
VAL:  Tax Free Value of the Retirement Account
DIV:  Total Untaxed Dividends Earned

Remember, these are untaxed amounts.

Example:
I%:  6.88
PMT:  1000.00
YRS: 40

Output (Results):
VAL = 206811.01
DIV = 166881.01

Source:
Tony Hutchins, Luiz Vieria, and Gene Wright "HP 12C Platinum Solutions Handbook"  Hewlett Packard.  Revised 03.04  2004

Eddie

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

Friday, March 22, 2019

HP Prime: Two Port Network Transistor Configuration Conversions (h-Parameter Conversions)

HP Prime: Two Port Network Transistor Configuration Conversions (h-Parameter Conversions)

Introduction

The program TRCONV converts h-parameter matrices for the following configurations of two-port networks:

*  Common Base Transistor Configuration (CB)
*  Common Emitter Transistor Configuration (CE)
*  Common Collector Transistor Configuration (CC)

The h-parameter matrix, also known as a hybrid parameter, is a 2 x 2 matrix representation of a two port network. 



H = [ [ h11,  h12 ] , [ h21, h22 ] ] where:

[ [ V1 ], [ I2 ] ] = = [ [ h11,  h12 ] , [ h21, h22 ] ] * [ [ I1 ], [ V2 ] ]

The h-parameter matrix takes into account the short circuit condition (h11, h22) and the open circuit condition (h12, h21) in the two port network. 

The dimensions of the entries are:

h11:  input impedance, in ohms (Ω)
h12:  reverse voltage gain, dimensionless
h21:  forward current gain, dimensionless
h22:  output admittance, in seimens or mhos (1/Ω)

The resulting matrix from TRCONV is known as a y-parameter matrix. 

HP Prime Program TRCONV

EXPORT TRCONV()
BEGIN
// 2019-03-10
// HP 67
LOCAL h11,h12,h21,h22;
LOCAL y11,y12,y21,y22;
LOCAL w1,w2,w3,w4,w5;
LOCAL t,l;

l:={"CE→CB","CB→CE","CC→CB",
"CB→CC","CC→CE","CE→CC"};

INPUT(
{{h11,[[0],[3]]},
{h12,[[0],[3]]},
{h21,[[0],[3]]},
{h22,[[0],[3]]},
{t,l}},
"TRANSISTOR CONVERSION",
{"h11: ","h12: ","h21: ",
"h22: ","Type:"}
);

y11:=1/h11;
y12:=−h12/h11;
y21:=h21/h11;
y22:=(h11*h22-h12*h21)/h11;

MSGBOX([[y11,y12],[y21,y22]]);

w1:=y11+y12+y21+y22;
w2:=−(y12+y22);
w3:=−(y21+y22);
w4:=−(y11+y12);
w5:=−(y11+y21);

IF t==1 OR t==2 THEN
RETURN [[w1,w2],[w3,y11]];
END;

IF t==3 THEN
RETURN [[y22,w3],[w2,w1]];
END;

IF t==4 THEN
RETURN [[w1,w5],[w4,y11]];
END;

IF t==5 OR t==6 THEN
RETURN [[y11,w4],[w5,w1]];
END;

END;

Example:

H = [ [ 150, 0.003 ], [ 68, 0.007 ] ]

CE → CB:  [ [ 0.46562, -0.00562 ], [ -0.458973333333, 6.666666667E-3 ] ]

CC → CE: [ [ 6.666666667E-3, -6.646666667E-3 ], [ -0.46, 0.46562 ] ]



Source

"5. Transistors Configuration Conversion"  HP 67-97 E.E. Pac I.  Hewlett Packard.  1976

"h Parameter or Hybrid Parameter of Two Port Network" Electrical Concepts.  2019  https://electricalbaba.com/h-parameter-hybrid-parameter-two-port-network/  Retrieved March 21, 2019


Eddie

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

DM 41L: A Song of Irrational Numbers

Tones of the first ten digits of the constants π, √2, Zeta(2), Phi (Golden Ratio constant), and e (Euclidean constant) using the Swiss Micros DM 41L


Eddie

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

Tuesday, March 19, 2019

Algebra: Solving Simple Non-Linear Systems

Algebra: Solving Simple Non-Linear Systems




System I:  

x + y = a
x^2 + y = b

Solving for y:
x + y = a
y = a - x

Subtracting the two equations from the system:
x + y = a
- [x^2 + y] = -[ b ]

x - x^2 = a - b
x^2 - x = b - a
x^2 - x - (b - a) = 0

Solving for x:
x = ( 1 ± √(1 - 4*(b - a) ) / 2

Summary for System I:
x = ( 1 ± √(1 - 4*(b - a) ) / 2
y = a - x

If a and b are real numbers, then 1 - 4*(b - a) ≥ 0, and
1 ≥ 4*(b - a)

System II:

x + y = a
x + y^2 = b

Solving for x:
x + y = a
x  = a - y

Subtracting the two equations from the system:
x + y = a
- [ x + y^2 ] = -[ b ]

y - y^2 = a - b
y^2 - y = b - a
y^2 - y - (b - a) = 0

Solving for y:
y = ( 1 ± √(1 - 4*(b - a) )/2

Summary for System II:
x  = a - y
y = ( 1 ± √(1 - 4*(b - a) )/2

System III:

x + y = a
x^2 + y^2 = b

Solving for y:
y = a - x

Solving for x:
x^2 + (a - x)^2 = b
x^2 + a^2 - 2*a*x + x^2 = b
2*x^2 - 2*a*x + (a^2 - b) = 0

x = ( 2*a ± √(4*a^2 - 4*2*(a^2 - b) ) / 4
x = ( 2*a ± √(4*a^2 - 8*(a^2 - b) ) / 4
x = ( 2*a ± √(4*a^2 - 8*a^2 + 8*b) ) / 4
x = ( 2*a ± √(8*b - 4*a^2) ) / 4
x = ( a ± √(2*b - a^2) ) / 2

Summary for System III:
x = ( a ± √(2*b - a^2) ) / 2
y = a - x

System IV:

x^2 + y^2 = a
x * y = b

Solving for y:
y = b / x 

I'm assuming that x ≠0 and y ≠0.

x^2 + y^2 = a
x^2 + (b / x)^2 = a
x^4 + b^2 = a * x^2
x^2 - a * x^2 + b^2 = 0

Let w = x^2, then w^2 = x^4

Then:
w^2 - a*w + b^2 = 0

Then:
w = (a ± √(a^2 - 4 * b^2) )/ 2

And:
x = ± √( (a ± √(a^2 - 4 * b^2) )/ 2 )

We have four answers to the system.

Summary for System IV:
x = ± √( (a ± √(a^2 - 4 * b^2) )/ 2 )
y = b / x 

A lot of fun,

Eddie

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

Birthday Blog: Fun Facts About Me

Fun Facts About, me, Eddie Shore, the author of Eddie's Math and Calculator Blog:





1.  I have a Bachelor's Degree in Accounting and a Master's Degree in Mathematics, both from Cal Poly Pomona.

2.  I don't have a favorite sport.

3. My favorite video games are Super Mario Maker, Super Mario Brothers, Mario Kart, Millipede, and Joust.

4. My favorite colors are sky blue, denim blue, forest green, and gold.

5. For you zodiac fans, my zodiac sign is Pisces.  Both of my parents are Geminis, and most of my closest friends are Scorpios.

6. Chocolate chip cookies are my weakness.

7. My four favorite go-to music artists are Earth, Wind & Fire, Stevie Wonder, Janet Jackson, and Sheryl Crow.

8. At home, I have two dogs and three cats. 

9.  I'm Irish and Mexican.

10.  Every morning I write what I want to accomplish for the day.  I go through a lot of Post-Its.

11. The beach is my sanctuary.

12. The mathematics section of university library is to me what Disneyland is to most people, only I don't have to pay $60 for an admission ticket. ;)  My favorite library is the Honnold Mudd Library in Claremont (Claremont Colleges).

13. I can't live without music.  Or calculators.

14. My dream car is a Ferrari. 

15. I prefer tea over coffee.

16. My turn ons are honesty, warmth, kindness, intelligence, and a love for life.

17. My turn offs are dishonesty, arrogance, racism, sexism, and ageism.

18. My bucket list grows by the day.

19. I am very close to my family. 

20. My favorite vacation spot so far is Maui.

21. My favorite number is pi (π), partly because my birthday is March 14 (the day that this blog is posted).

22. I want to go to Greece, Italy, Ireland, and New Zealand.  I'd probably wouldn't return home. 

23. My guilty pleasure is the Real Housewives of New Jersey.  #TeamMargaretJosephs

24. I'm nearsighted and prefer glasses to contacts.

25. I prefer wine over beer, but I do enjoy a good ale.  My favorite shot is Fireball.

26. My newest favorite YouTube channel is Doctor Mike. Favorite of all time is both Cinemasins and Music Video Sins.

27. My favorite calculators are the HP Prime, HP 42S, HP 12C, TI-84 Plus CE and Casio fx-991EX.

28. I am a Press Your Luck addict. Big Bucks, no whammies!

29. I have two dogs and three cats.

30. My music tastes are kind of eccentric, but I learn towards rock, alternative, and some R & B.  I do have a Spotify account. 

31.  My favorite fruits of cherries, applies, and strawberries.

32.  My favorite holiday used to be Christmas, now it's Halloween.

33.  A hobby I like but don't do enough of is art.  I'm drawn to glass art, mythological art, and fantasy art. 

34.  My favorite movie is Ghostbusters - the 1984 original one.

35.  My favorite pie is apple. 

36.  My favorite fonts are Arial, Courier, Futura, and Banschrift.

37.  I lived in Southern California all my life.

38.  Starting and writing on this blog is one of the most fun things I am very fortunate to do, and I thank you for reading and supporting this blog. 






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




Wednesday, March 13, 2019

TI-84 Plus: Greenwich Mean Sidereal Time Estimate

TI-84 Plus:  Greenwich Mean Sidereal Time Estimate

Introduction

The program GMST calculates and estimates the Greenwich Mean Sidereal Time for any dates between January 1, 1900 and December 31, 2099.

For any date between 1900 and 2099, the date number is calculated as:

number of days since January 1 + (year - 1900) * 365 + int((1900 - year)/4) + 0.5 + hour/24

Please keep in mind, the formula in this program is from 1978 (see source).

For the hour, a 2400 hour clock format is used.  For example, 1 AM = 1, 1 PM = 13. 

This program does not take the location of the observer into account.

TI-84 Plus Program: GMST

"2019-03-08 EWS"
Disp "1900-2099"
Input "MONTH: ",M
Input "DAY: ",D
Input "YEAR: ",Y
Input "HOUR: ",H
If fPart(Y/4)=0 and Y≠1900
Then
1→L
Else
0→L
End

If M≥3
Then
int(30.6*M+1.6)+D-35+L→T
Else
int(30.6*M+368.8)+D-400→T
End

T+(Y-1900)*365+iPart((Y-1900)/4)+.5+H/4Z
Z/36525→Z
6°38'45.836"+2400.051262*Z+0°0'0.0929"*Z²→E
24*fPart(E/24)→E
Disp "GMST: ",E>DMS


Example:

Example 1: 

January 1, 1978, Midnight (Hour = 0):  6°41'9.836"

Example 2:

March 13, 2011, 7:00 PM (H = 19): 11°23'54.646"

Source:

Jones, Aubrey  Mathematical Astronomy With a Pocket Calculator  Halsted Press:  John Wiley & Sons, New York.  1978.  ISBN 0 470 26552 3

Eddie


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

TI-84 Plus and HP 41C: Number of Days After January 1

TI-84 Plus and HP 41C:  Number of Days After January 1

Introduction

The program DATENO calculates the number of days from January 1.  The program prompts whether we are working in a leap year or not. 

With D = Day and M = Month, the days between January 1 and any other date within the calendar year is:

If M = 1 and M = 2 Then
DATE# = int(30.6 * M + 368.8) + D - 400

Otherwise,
DATE# = int(30.6 * M + 1.6) +D - 35  (non-leap year)
DATE# = int(30.6 * M + 1.6) + D - 34  (leap year)

TI-84 Plus Program: DATENO

"DAYS AFTER JANUARY 1"
"2019-03-07 EWS"
Input "MONTH: ",M
Input "DAY: ",D
Disp "0:NO, 1:YES"
Input "LEAP YEAR? ",L
If M≥3
Then
int(30.6*M+1.6)+D-35+L→T
Else
int(30.6*M+368.8)+D-400→T
End
Disp T

HP 41C/DM 41L Program:  DATENO

(^T:  beginning of an alpha string)

01 LBL^T DATENO
02 ^T MONTH
03 PROMPT
04 STO 01
05 ^T DAY?
06 PROMPT
07 STO 02
08 ^T LEAP? N=0,L=1
09 PROMPT
10 STO 03
11 RCL 01
12 3
13 X<=Y?
14 GTO 00
15 30.6
16 RCL 01
17 *
18 368.8
19 +
20 INT
21 RCL 02
22 +
23 400
24 -
25 GTO 01
26 LBL 00
27 RCL 01
28 30.6
29 *
30 1.6
31 +
32 INT
33 RCL 02
34 + 
35 35
36 - 
37 RCL 03
38 + 
39 LBL 01
40 STO 04
41 END

Examples

Days between January 1 and February 16  (M = 2, D = 16):  46

Days between January 1 and October 1 (M = 10, D = 1):
(Non-leap year):  273
(Leap year): 274

Eddie

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

Google Celebrates Olga Ladyzhenskaya

Google Celebrates Olga Ladyzhenskaya 



Today, March 7, 2019, Google honored the Russian mathematician Olga Ladyzhenskaya.  Ladyzhenskaya was born on March 7, 1922 (passed away on January 12, 2004).  She is known for her work in partial differential equations, particularly providing a rigorous proof of the finite difference method for the Navier-Strokes equations. 

Happy Birthday Olga! And thank you for your contributions to mathematics and science.

Wikipedia articles:

Bio on Olga Ladyzhenskaya
https://en.wikipedia.org/wiki/Olga_Ladyzhenskaya

Navier-Strokes Equations
https://en.wikipedia.org/wiki/Navier%E2%80%93Stokes_equations

Finite Difference Method
https://en.wikipedia.org/wiki/Finite_difference_method

Eddie

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



Wednesday, March 6, 2019

HP 12C and HP 11C: Loan Amount Using the Annual Loan Constant

HP 12C and HP 11C:  Loan Amount Using the Annual Loan Constant

Introduction

The program calculates the theoretical loan amount using the following factors:

*  NOI:  Net Operating Income. The estimated net operating income the property is expected to earn annually.  An average is usually used.

*  DCR:  Debt Coverage Ratio.  The ratio of net operating income to annual debt service, describing a company's ability to pay its debts.  Generally, the larger the DCR, the better.  We really don't want DCR to be below 1.

*  Number of payments per year, number of years, and annual interest rate of the potential loan. 

The ALC, or the annual loan constant is calculated by:

*  Either divided the annual debt service by the loan amount (when the amount is known), or

*  Determining the periodic payment to amortize a $100 loan given number of payments and interest rate.

Set up:
Number of payments -> N
Interest Rate -> I%YR  (or periodic interest rate -> i)
-100 -> PV
0 -> FV
Solve for PMT

The ALC is expressed as a percentage. 

The theoretical loan amount is calculated by:

Loan = NOI / (DCR * ALC%)

HP 12C Program: Loan Amount Using the Annual Loan Constant

Instructions:
Store the following:
NOI in R1
DCR in R2
Number of payments per year in R3
Number of periods in [ n ]
Periodic Interest rate in [ i ]

Program:
Step;  Key;  Code
01;  1;  1
02;  0;  0
03;  0;  0
04;  CHS;  16
05;  PV;  13
06;  0;  0
07;  FV;  15
08;  PMT;  14
09;  RCL 3;  45, 3
10;  *;  20
11;  RCL 2; 45, 2
12;  x<>y;  34
13;  %;  25
14;  RCL 1; 45, 1
15;  x<>y;  34
16;  ÷;  10
17;  GTO 00;  43, 33, 00

(* HP 12C Platinum, step 17:  GTO  000; 43, 33, 000)

HP 11C Program:    Loan Amount Using the Annual Loan Constant

Instructions:
Store the following:
NOI in R1
DCR in R2
Number of payments per year in R3
Number of periods in R4
Periodic Interest rate in R5

Program:
Step; Key; Code
001;  LBL A; 42, 21, 11
002;  1;  1
003;  ENTER; 36
004;  ENTER; 36
005;  RCL 5;  45, 5
006; %;  43, 14
007;  +;  40
008;  RCL 4;  45, 4
009;  CHS;  16
010;  y^x; 14
011;  *;  30
012;  1;  1
013;  RCL 5; 45, 5
014;  %;  43, 14
015;  x<>y;  34
016;  R↓;  33
017;  ÷;  10
018;  1;  1
019;  0;  0
020;  0;  0
021;  x<>y; 34
022;  ÷;  10
023;  RCL 3; 45, 3
024;  *;  20
025;  RCL 2; 45, 2
026;  x<>y; 34
027;  %;  43, 14
028;  RCL 1; 45, 1
029;  x<>y;  34
030;  ÷; 10
031;  RTN; 43, 32

Examples

Example 1: 

NOI:  $58,000.00
DCR:  1.25
P/Y:  12
Number of Years: 30
Annual Interest Rate:  5%

Loan Amount:  $720,288.92

Example 2:

NOI:  $40,000.00
DCR:  1.35
P/Y:  12
Number of Years: 20
Annual Interest Rate:  6.8%

Loan Amount: $323,464.95

Source: 

Goldman, Mark H. and Stephen D. Messner "HP 12C Real Estate Applications Handbook"  Hewlett Packard Rev. B. March 1984

Eddie

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

TI-74: Five Stencil Derivative, Vertical Height on a Hill, Solving Cubic Equations

TI-74:  Five Stencil Derivative, Vertical Height on a Hill, Solving Cubic Equations TI-74 Program: Five Stencil Derivative This program...