Showing posts with label HP 22S. Show all posts
Showing posts with label HP 22S. Show all posts

Saturday, May 23, 2026

HP 12C Platinum: Present Value of a Fractional Year

 HP 12C Platinum: Present Value of a Fractional Year



This blog features the HP 12C Platinum, HP 10BII+, and HP 22S calculators.



Short Term Transactions


Here is the scenario: A bank offers a short term bond, which last less than one year, which pays $100.00 at maturity date. The interest rate stated is an annual interest rate. While determining a pricing schedule, one banker uses an HP 12C Platinum calculator while another uses the HP 10BII+ calculator. They both use the TVM (time value of money) keys. A 365-day year is used.


FV = -100, I% (see table), N (see table), PMT = 0, Solve for PV, P/Y = 1


Term (days)

N = term ÷ 365

(to five decimal places) (for reference)

I%

HP 12C Platinum (to 5 decimal places)

HP 10BII+ (to 5 decimal places)

89

0.24384

5

98.79551

98.81737

141

0.38630

5

97.99973

98.02800

181

0.49589

5

97.58054

97.60958

365

1

5

95.23810

95.23810

89

0.24384

8

98.08664

98.14091

141

0.38630

8

96.83753

96.90714

181

0.49589

8

96.18425

96.25548

365

1

8

92.59259

92.59259


As you can see, the results are different! Why?


According to HP-12C Solutions Handbook (see the Source section), when it comes to fractional periods, simple interest is used instead of compound interest in the TVM solver. Most financial calculators, such as HP 10BII+ always uses compound interest.


Cash flow convention states that:

1. Cash inflows, such as deposits, are positive.

2. Cash outflows, such as payments, are negative.

3. In most problems, the present value and future value have opposite signs.


Respecting cash flow convention, the formulas for present value are:


Simple Interest:

P = -F ÷ (1 + D ÷ 365 × I ÷ 100)


Compound Interest:

P = -F ÷ (1 + I ÷ 100) ^ (D ÷ 365)


where:

P = present value (PV)

F = future value (FV)

I = annual interest rate

D = number of days


If leap years, substitute 366 for 365. If we are working with 30/360 day years, substitute 360 for 365.


These formulas are set up to be entered in calculators with equation solvers such as the HP 22S. I have used the HP 22S to verify each of the results above.


Now why is the results the say when the term exactly 365? It’s pretty simple to prove:


Simple Interest:

P_simple = -F ÷ (1 + 365 ÷ 365 × I ÷ 100) = -F ÷ (1 + I ÷ 100)

Compound Interest:

P_compound = -F ÷ (1 + I ÷ 100) ^ (365 ÷ 365) = -F ÷ (1 + I ÷ 100) = P_simple



When the Term Exceeds One Year


Let’s say the $100.00 bond lasts for 545 days, about one year and a half. This time the interest rate is 7%.


On the HP 12C, any fractional period is treated with simple interest. The HP 12C’s TVM solver (and the HP 12C Platinum) treats the timeline as such.


365 days: full period, compound interest

180 days: partial year, simple interest

PV

FV = -$100.00




To break it down, the HP 12C starts determining the value after 365 days.

N = 180 ÷ 365

I = 7

FV = -100

PV ≈ 96.66314

P = -(-100) ÷ (1 + 180 ÷ 365 × 7 ÷ 100) ≈ 96.66314


365 days: full period, compound interest

180 days: partial year, simple interest

PV

FV = -$100.00


96.66314


From here, the HP 12C uses that value to calculate final present value. Since we are now working with a full period (one year in this case), compound interest is used with n = 1:

N = 1

I = 7

FV ≈ -96.66314 (treated as an outflow and becoming the acting future value)

PV ≈ -(-96.6314 ÷ (1 + 7 ÷ 100) ^ (1) ≈ 90.33938


The final present value (and price) of this bond is 90.33938.


If we enter following the HP 12C Platinum:

N: 545 [ ENTER ] 365 [ ÷ ] [ N ] (≈ 1.49315)

I: 7 [ i ]

FV: 100 [ CHS ] [ FV ]

PMT: 0 [ PMT ]

[ PV ] → PV ≈ 90.33938


Enter the same problem on most other financial calculators, like the HP 10BII+, will result in a final present value of 90.39108. (P/Y = 1) This is because compounding interest is used for the entire time:


P = -(-100) ÷ (1 + 7 ÷ 100) ^ (545 ÷ 365) ≈ 90.39108


HP 12C Program: Present Value Using Compounding Interest Including Fractional Periods


The program calculates present value given the future value, interest, and the number of days using compounding interest for the entire period. A 365 day year is assumed.



Code: Key; Key Code

ENTER; 36

3; 3

6; 6

5; 5

÷; 10

1; 1

RCL i; 45, 12

%; 25

+; 40

x<>y; 34

y^x; 21

RCL FV; 45, 15

x<>y; 34

÷; 10

CHS; 16

GTO 000; 43,33,000 (GTO 00; 43, 33,00 for HP 12C Classic)


Future value is stored in FV and interest rate is stored in i. The number of days is on the X stack.



Source


Hewlett Packard. HP-12C Solutions Handbook. 2004. pg. 45 https://literature.hpcalc.org/official/hp12c-sh-en.pdf




Eddie


All original content copyright, © 2011-2026. 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, August 10, 2024

Some Equations for the HP 22S

 Some Equations for the HP 22S




The [ 2 ] key has the letter X.  


These equations should work for the HP 27S, HP 32S/DM32, or Plus42.


Equations


Answers are shown to five decimal places.


Snell’s Law


Equation: Set Degrees Mode

N × SIN(T) = M × SIN(I)


T, I: reflection angles

N, M: refractive indices (1 for air, about 1.33 for water, etc.)


Examples:

Inputs: N = 1, T = 30°, I = 60°, Result: M ≈ 0.57735

Inputs: N = 1, M = 1.3333, I = 35.4°, Result: T ≈ 50.56589°

Inputs: N = 1, M = 1.3333, T = 100°, Result: I ≈ 47.61436°



Gudermannian and Inverse Gudermannian Functions


Equation: Set Radians Mode

G = 2 × ATAN( TANH( X ÷ 2 ) )


G = gd(X)

X = gd^-1(G)


Examples:

Input: X = 0.5, Result: G ≈ 0.48038

Input: X = 2.3, Result: G ≈ 1.37095

Input: G = -0.1, Result: X ≈ -0.10017

Input: G = 1, Result: X ≈ 1.22619



AC Current Equation


Equation: Set Radians Mode

I = P × SIN( W × T + H )


I = current at time T seconds in amps

P = peak current in amps

W = radian frequency = 2 * π * f

H = phase angle in radians


Examples:

Inputs: P = 10, W = 0.8, H = 0, T = 10, Result: I ≈ 9.89358

Inputs: P = 10, W = 2 * Ï€ * 60, H = 0.7, T = 10, Result: I ≈ 6.44218

Inputs: I = 15, W = 2 * Ï€ * 60, H = 0.6, T = 10, Result: P ≈ 26.56548



Air Pressure Up to 36,089 Feet


Equation:

P = 29.92126 × (1 – 6.875E-6 × H) ^ 5.255876329


H = height in feet

P = standard pressure in inHg (inches of Mercury)

The equation is giving with all the constants calculated.


(see https://edspi31415.blogspot.com/2024/06/casio-fx-4000p-programs-i-took-on.html , Prog 8)


Inputs: H = 1347, Result: P ≈ 28.49332

Inputs: H = 4126, Result: P ≈ 25.72143

Inputs: P = 22, Result: H ≈ 8266.49833




Law of Cosines





SQ(Z) = SQ(X) + SQ(Y) – 2 × X × Y × COS( C )


SQ: square function (x^2)

X, Y, Z = sides

C = angle that correspond to side Z


Examples:

Inputs: X = 10, Y = 12, C = 30°

Result: Z ≈ 6.01281 or Z ≈ 14.38679 (depending on the initial guess for Z)


Inputs: X = 55.44, Y = 37.85, Z = 62.17

Result: C ≈ 81.21305°



Ellipse Equation


The center of the ellipse is set at (0, 0).





Equation:

SQ(X ÷ A) + SQ(Y ÷ B) = 1


If A = B, we are working with a circle.


Examples:

Inputs: A = 5, B = 5, X = 4.9,

Result: Y ≈ 0.99499 (1 as a guess)

or Y gives a no solution error (0 as a guess)

(Your mileage may vary)


Inputs: A = 10, X = 8, Y = 12, Result: B = 20


Inputs: A = 10, X = -4, Y = 6

Result: B ≈ 6.54654 (10 as a guess)

but returns a divide by zero error for other guesses (20)


To store an initial guess on the HP 22S, be out of equation mode and store the guess in the variable you are trying to solve for.


Eddie


All original content copyright, © 2011-2024. 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, July 16, 2017

Retro Review: HP 22S

Retro Review:  HP 22S

HP 22S



Pioneers:  10B, 10bII+ (updated), 14B, 17bII+ (updated), 20S, 21S, 22S, 27S, 32SII, 42S


Essentials

Company:  Hewlett Packard
Years:  1988 - 1991
Type:  Scientific, Formula Programming
Memory:  371
Operating System: Algebraic
Memory Registers: 26 (A-Z)
Number of Built In Equations: 16

Batteries:  3 LR44, 3 A76, 3 357

Features

The HP 22S is an algebraic calculator that shares the similar style with the HP 20S, 21S, 32S, and 42S.  The top row of keys ([ √x ], [ e^x ], [ LN ], [ y^x ], [ 1/x ], [ Σ+ ]) act not only as function keys but soft menu keys. 

The standard variety of functions are present:

* Trigonometric, hyperbolic, exponential, and logarithmic functions
* Conversions:  kg/lb, °C/°F, cm/in, ltr/gal, H/HMS, DEG/RAD
* Probability:  nCr, nPr, n!  (the factorial function only accepts integer)
* Integer part, fractional part, absolute value, round to fix setting
* Statistics:  1 Variable and Linear Regression (y = mx + b)
* Storage arithmetic
* Base conversions: Binary, Decimal, Octal, Hexadecimal.  Decimal mode is floating decimal mode.
* This is really cool:  the rectangular (x-COORD, y-COORD) and polar (RADIUS, ANGLE) conversions get their own keys (well, shifted functions of [ 1 ], [ 2 ], [ 3 ], and [ - ], respectively)
* Percent Change:  old [INPUT] new [(shift)] [1/x] (%CHG)  (nPr and nCr work the same way)

Overall the keys are really easy to work with and the calculator is a pleasure to use.  I like the crisp display.  Plus, if blue is your favorite color like me, the light blue font against the dark background is a plus. 

There are two manuals with the HP 22S:  the User Manual, and the excellent Science Student Applications for the HP 22S. 

Equations

You can either use one of the 14 built-in equations (listed below) or create your own.  While you are creating your own, you can use either the [STO] or [RCL] keys to call up a letter.  All variables are one letter and global. Equations that are longer than the 12 character display can be scrolled by the [ √x ] and [ Σ+ ] keys.

Equations can be evaluated (evaluate the right side of the equation) or solved (a menu will show the variables to be solved for).  Equations are solved in a reasonably amount of time.


The 16 built in equations, which are displayed by the equations themselves (no titles):
(Source: HP 22S manual)

Title
Equation
Length of a Line/Vector
R=SQRT(X^2+Y^2+Z^2)
Roots of a Quadratic Equation
X=(-B+J*SQRT(B^2-4*A*C))÷2÷A
Real roots only, J = -1 or 1
Equation of Motion (Position)
X=S+V*T+.5*A*T^2
X = position, V = velocity, A = acceleration
Equation of Motion (Final Velocity)
F=V+A*T
Kinetic Energy
E=.5*M*V^2
Force Between Two Objects (Physics or Electric Force)
F=K*A*B÷R^2
K = 6.67408E-11 m^3 kg^-1 s^-2 (gravitational force)
K = 1.602176621E-19 J (electron charge)
Joule’s Law
P=I^2*R
Ideal Gas Law
P*V=N*R*T
Gibb’s Free Energy
G=H-T*S
Pressure of a Fluid
P=I+D*G*H
G = 9.80665 m/s^2
Radioactive Decay
-K*T=LN(N÷I)
Thin Lens Equation
O*F+I*F=O*I
Diffraction
A=ASIN(M*L÷D)
Exponential Growth and Decay
Y=F+(I-F)*EXP(K*T)
Root Mean Square
R=SQRT(Σx^2÷n)
Σx^2 and n come from statistical data
Time Value of Money
(End of Period payments/periods assumed)
(P*100÷I-F)*(1+I÷100)^-N-P*100÷I=B
N = number of payments/periods
B = present value
I = periodic interest rate
P = payment
F = future value

Final Verdict

The HP 22S is a great calculator to own.  I love the rectangular/polar conversion set up.  The display is great.

My only criticism is that I wish the 22S had more memory.  371 bytes can store a handful equations, but data points that are used in the statistical calculations and storing values in the variables A-Z eat up the memory as well.    

4 out of 5 stars.

Eddie

This blog is property of Edward Shore, 2017

Coming soon (tentative):  a review of a favorite Texas Instruments calculator, TI-68.


First Look: HP 16C Collector's Edition

 First Look: HP 16C Collector's Edition I just got the HP 16C Collector's Edition.   This is the famous HP 16C that specializes in c...