Showing posts with label economic ordering quantity. Show all posts
Showing posts with label economic ordering quantity. Show all posts

Saturday, June 24, 2023

Casio fx-3650P Program Bank

Casio fx-3650P Program Bank



Economic Order Quantity


The program calculates three business parameters:


*  EOQ:  Economic Order Quantity: this is the optimum number of units to order in a single of order of items to be sold.  Each single inventory item has its on economic order quantity.   The calculation assumes every order will be available when needed.  This number of units is theoretical.  The calculation takes the estimated annual sales of units into account.  


*  The estimated amount of orders needed in a year.


*  The estimated annual cost of inventory.


Note that no amounts are rounded in this algorithm, all results are based on the theoretical values.


Formulas:


EOQ = √(2 × A × B ÷ (C% × D))


where:

A = cost to  place an order

B = annual sales of units

C = holding costs percentage 

D = cost per unit

EOQ is stored in X.


Orders per Year = B ÷ EOQ

The result is stored in Y. 


Estimated Annual Cost = A × amount of orders per year

Estimated annual cost is stored in M.



Program Code:  (47 steps)

(spaces are included for clarity)


Fix 2 : ? → A : ? → B : ? → C : ? → D : 

√ ( 2 A B ÷ 100(^-1) C × D → X ◢

B ÷ X → Y ◢

A Y → M ◢

Norm 1



Example:


Inputs:

A = cost to  place an order = $ 79.36

B = annual sales of units = 100,000

C = holding costs percentage = 24%

D = cost per unit = $ 1.20


Outputs:

X = EOQ ≈ 7,423.69

Y = Orders per Year ≈ 13.47

M = Estimated annual cost ≈ $1,069.01


Source:


Hewlett Packard.   Step-by-Step Solutions For Your HP Calculator: Marketing and Sales:  HP-17B, HP-19B, HP-27S.   Hewlett Packard.  Edition 1.  January 1988. 



Banker's Rounding


We will focus on rounding positive numbers to integers.   


Banker's rounding is similar to regular rounding except, when the number has a fraction part of 0.5, the number is rounded to the nearest even integer.


For example:  both 17.5 and 18.5 would be rounded to 18.  


We can accomplish Banker's rounding by these algorithms, assuming x is a positive number (x>0):


If abs(frac(x)) = 0.5 

Then round(x ÷ 2, 0) × 2

Else round(x, 0) 

IfEnd


If mod(x,1) = 0.5

Then round(x ÷ 2, 0) × 2

Else round(x, 0) 

IfEnd


The fx-3650P does not have a modulus or absolute value function.   We can accomplish absolute value by using √(x^2).


Program Code:  (46 steps)

(spaces are included for clarity)


? → A : Fix 0 : Rnd : Ans → B :

√ ( ( A - B ) ² ) ≠ 0.5 ⇒ Goto 1 :

A ÷ 2 : Rnd : 2 Ans → B :

Lbl 1 : Norm 1: B


Examples:


A = 36.3,  result = 36

A = 36.5,  result = 36

A = 37.5,  result = 38

A = 40.5,  result = 40

A = 41.2,  result = 41



Birthday Probably Function


What are odds that A people/objects do not a share a characteristic in C categories?   


Famously stated:  what are odds that N people do not share a birthday in a 365-day year?  


The probability is calculated as:


p = Π(1 - m ÷ C, m = 1, N - 1) = nPr(C, N) ÷ C^N



Program Code:  (19 steps)

(spaces are included for clarity)


? → A : ? → C :

C [nPr] A ÷ ( C ^ A ) → B


nPr appears as a bold P.


Example:


Probability that 24 people do not share a birthday:

A = 24, C = 365,  result = 0.461655742


Probability that 40 students who do not share a college class, if the college offers 300 classes:

A = 40, C = 300, result = 0.065725193



Voltage Drop of a Copper Wire


The program calculates the voltage drop of a copper wire (conductivity of 12.9).  The wire is assumed to be insulated at 75°C. 


Formula:


1 Phase: (domestic and office appliances)

VD = 2 × 12.9 × B × D ÷ C


3 Phase: (large electronic equipment)

VD = √3 × 12.9 × B × D ÷ C = 1-Phase-VD × √3 ÷ 2


B = current (amps)

C = circular mils* (see below)

D = length of the wire (feet)


C:  

Enter the wire cross area in circular mils.  However, the code allows for three common wire types:


C = 10  (AWG 10):  10,380

C = 12  (AWG 12):  6,530

C = 14  (AWG 14):  4,110


The voltage drop for both 1 phase (stored in X), followed by 3 phase circuits (stored in Y) are displayed.  


Program Code:  (72 steps)

(spaces are included for clarity)


? → B :

? → C :

C = 10 ⇒ 10380 → C :

C = 12 ⇒ 6530 → C :

C = 14 ⇒ 4110 → C :

? → D :

2 × 12.9 × B × D ÷ C → X ◢

X × √3 ÷ 2 → Y


Examples:


Input:

B = Current = 300 A

C = 10  for a #10 AWG wire

D = Length = 24 ft


1 phase voltage drop:  17.89595376

3 phase voltage drop:  15.49835058



Input:

B = Current = 320 A

C = 14  for a #14 AWG wire

D = Length = 30 ft


1 phase voltage drop:  60.26277372

3 phase voltage drop:  52.18909295



Eddie


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

HP 12C Using TVM variables as Registers

 HP 12C Using TVM variables as Registers



Special Thanks

Regarding the HP 12C Tips talk I gave on HHC 2017, I received this tip from an email from   SergioSamy.   Appreciation and gratitude.  


To watch my HP 12C tip presentation, click here:

https://www.youtube.com/watch?v=Q54UbDzpAIw




Why Use TVM Variables?


Normally, we use the variables n, i, PV, PMT, and FV for time value of money, cash flow, and depreciation calculations.  They can be used for variables for non-finance or other business calculations as well.


When we program on the Classic HP 12C, we have 99 steps.  If the program memory is clear, we have 20 registers from R.9  (register dot-nine) to R0 (register zero).   For every eight steps, a memory register is lost.   


At full capacity of the Classic HP 12C, we only have seven registers left (R0 through R6).  


The moment that we use press the [ Σ+ ] button and use statistics, the registers R1 and R6 get occupied, possibly leaving R0 to use for other purposes:


R1 = n

R2 = Σx

R3 = Σx^2

R4 = Σy

R5 = Σy^2

R6 = Σxy


However, the TVM registers: n, i, PV, PMT, and FV, are permanent memory registers for use.   Today's programs will illustrate this use.   


Note:  Pressing the TVM keys once after a number (key word: after) stores the number in a variable.   If you don't key a number first, then the program solves for the a variable.  Let's look at a couple of examples.



Economic Ordering Quantity


Formula:


EOQ = √(2 * CPO * SLS ÷ (CPU * HOLD%))


CPO = fixed order cost

SLS = number of project sales units

CPU = variable cost per unit

HOLD% = projected cost of holding inventory

EOQ = economic ordering quantity, in units


TVM variables used:


[ n ]:  EOQ, computed

[ i ]: HOLD%,  entered

[ PV ]:  CPU, entered

[ PMT ]:  CPO, entered

[ FV ]:  SLS, entered



Program Code:


Line Number:  Key Code;  Key


01:  45, 14;  RCL PMT

02:  45, 15;  RCL FV

03:  20;  ×

04:  2;  2

05:  20;  ×

06:  45, 13;  RCL PV

07:  45, 12;  RCL i

08:  25;  %

09:  34;  x<>y

10:  33;  R↓

11:  10;  ÷

12:  43, 21;  √

13:  44, 11;  STO n

14:  43,33,00;  GTO 00



Example


CPO = 40.95

SLS = 8,000

CPU = 5.50

HOLD% = 10%


10 [ i ]

5.50 [ PV ]

40.95  [ PMT ]

8000 [ FV ]

[ R/S ].  Result:  1091.45


Source


HP-17B, HP-19B, HP-27S  Step-by-Step Solutions For Your HP Calculator.  Marketing and Sales.   Hewlett Packard.  Edition 1.  January 1988



Quadratic Equation


Instructions:


Find the roots of a*x^2 + b*x + c = 0


The program ends with the discriminant stored in R0. 


D = b^2 - 4*a*c


If D<0, the roots are complex in the form of s ± ti:

s:  real part, stored in PMT

t:  imaginary part, stored in FV


If D≥0, the roots are real and:

Root 1 is stored in PMT

Root 2 is stored in FV


Store a in [ n ], b in [ i ], and c [ PV ].  Then run the program. 


Note:  to get the absolute value, square then take the square root of the number.  This is why I have two square root commands in a row: one is to make the absolute value; the second to take the square root of D. 


Program Code:


Line Number:  Key Code;  Key


01:  45,12;  RCL I

02:  2;  2

03:  21;  y^x

04:  45, 13;  RCL PV

05:  45, 11;  RCL n

06:  20;  ×

07:  4;  4

08:  20;  ×

09:  30;  -

10:  44, 0;  STO 0

11:  45, 12;  RCL i

12:  16;  CHS

13:  2;  2

14:  10;  ÷

15:  45, 11;  RCL n

16:  10;  ÷

17:  44, 14;  STO PMT

18:  45, 0;  RCL 0

19:  2;  2

20:  21;  y^x

21:  43, 21;  √

22:  43, 21;  √

23:  2;  2

24:  10;  ÷

25:  45, 11;  RCL n

26:  10;  ÷

27:  44, 15;  STO FV

28:  0;  0

29:  45, 0;  RCL 0

30:  43, 34;  x≤y

31:  43,33,00;  GTO 00

32:  45,14;  RCL PMT

33:  36;  ENTER

34:  36;  ENTER

35:  45, 15;  RCL FV

36:  30;  -

37:  44, 15; RCL FV

38:  33; R↓

39:  43, 36;  LSTx

40:  40;  +

41:  44,14; STO PMT

42:  45, 0;  RCL 0

43:  43,33,00;  GTO 00


Examples


2*x^2 - 3*x + 6 = 0


2 [ n ]

-3 [ i ] 

6 [ PV ]

[ R/S ]


Results:

D = -39.00   (complex roots)

[ RCL ] [ PMT ]:  Real part:  0.75

[ RCL ] [ FV ]:  Imaginary part:  1.56

0.75 ± 1.56i


x^2 + 8*x - 4 = 0


1 [ n ]

8 [ i ] 

-4 [ PV ]

[ R/S ]


Results:

D = 80

[ RCL ] [ PMT ]:  Root 1:  0.47

[ RCL ] [ FV ]:  Root 2:  -8.47

0.47, -8.47



Hope you find this tip helpful,


Eddie 



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

HP 12C: Economic Ordering Quantity

HP 12C: Economic Ordering Quantity

Introduction

In inventory control, a business may try to determine the optimum level of inventory, which is known as the economic ordering quantity.  There are several ways to calculate the economic ordering quantity, each with various approaches of what variables and factors to use.  This blog entry will explore two approaches, as described by the HP Step by Step Solutions For Your HP Calculator book for marketing and sales.  (see source)

Economic Ordering Quantity Knowing Costs and Sales

A simple approach to determining economic ordering quantity is by use of the following formula:

EOQ = √(2 * CPO * SALES / ( UNIT_COST * HOLD%) )

where:
EOQ = economic ordering quantity
CPO = the cost of place an order
SALES = the company's annual sales
UNIT_COST = cost per unit of inventory
HOLD% = holding cost as a rate of inventory costs

HP 12C Program:

Step;  Key Code;  Key
01;   2 ;  2
02;  45, 1; RCL 1
03;  20;  *
04;  45, 2;  RCL 2
05;  20;  *
06;  45, 3;  RCL 3
07;  45, 4;  RCL 4
08;  25;  %
09;  34;  x<>y
10;  35;  R↓
11;  10; ÷
12;  43, 21;  √
13;  44, 0;  STO 0
14;  43,33,00;  GTO 00

Instructions:

Store the following values:
R1 = CPO 
R2 = SALES
R3 = HOLD%
R4 = UNIT_COST

Press R/S to calculate EOQ, which is stored in R0.

Example:

R1 = CPO = $35.00
R2 = SALES = 10,000 units
R3 = HOLD% = 20% of inventory value
R4 = UNIT_COST = $4.73 cost per inventory unit

Result:
CPO = 860.21

Economic Ordering Quantity Factoring Discounts and Taxes

This next calculation adds discounts rates, units used, and income taxes. 

EOQ = √(( 2 * (1 - TAX%) * CPO * UNITS_USED)
/ ( (1 - TAX%) * HOLD% * UNIT_COST + DISCOUNT% * UNIT_COST))

where:
EOQ = economic ordering quantity
TAX% = income tax rate
CPO = the cost of place an order
UNITS_USED = inventory units used in a year
UNIT_COST = cost per unit of inventory
HOLD% = holding cost as a rate of inventory costs
DISCOUNT% = discount rate

HP 12C Program:

Step;  Key Code;  Key
01;  1 ; 1
02;  45, 1; RCL 1
03;  25 ;  %
04;  30 ;  -
05; 44,1;  STO 1
06;  2  ;  2
07;  20 ;  *
08;  45, 2 ;  RCL 2
09;  20 ;  *
10;  45, 3 ;  RCL 3
11;  20 ;  *
12;  44, 0 ; STO 0
13;  45, 5 ; RCL 5
14;  45, 4 ; RCL 4
15;  25 ;  %
16;  45, 1 ; RCL 1
17;  20 ;  *
18;  45, 5 ; RCL 5
19;  45, 6 ; RCL 6
20;  25 ;  %
21;  34 ;  X<>Y
22;  33;  R↓
23;  40;  +
24; 45, 0 ; RCL 0
25; 34 ;  X<>Y
26;  10 ;  ÷
27;  43, 21 ;  √
28;  44, 0 ; STO 0
29;  43, 33, 00 ;  GTO 00

Instructions:

Store the following values:
R1 = TAX% = income tax* 
R2 = CPO
R3 = UNITS_USED
R4 = HOLD%
R5 = UNIT_COST
R6 = DISCOUNT%

R1 gets recalculated as  (1 - TAX%)

Press R/S to calculate EOQ, which is stored in R0.

Example:

R1 = TAX% = 22%
R2 = $150.00
R3 = 24,000 units
R4 = 5.1% holding cost
R5 = $8.00 per unit
R6 = 2% discount

Results:
CPO = 3,426.81

Source:
"HP Step By Step Solutions For Your HP Calculator:  Marketing and Sales:  HP-17B, HP-19B, HP-27S"  Hewlett Packard.  January 1988.  Edition 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.

Earth's Radius by Latitude

Earth's Radius by Latitude Introduction: Calculating the Earth’s Radius In quick, general calculations, we assume that the...