Showing posts with label air pressure. Show all posts
Showing posts with label air pressure. Show all posts

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.


Saturday, June 8, 2024

Casio fx-4000P - The Programs I took on Vacation

 Casio fx-4000P - The Programs I took on Vacation


I was on vacation in Atascadero last May 2024 at a car conference with my partner. I may not have classic cars, but I do have classic calculators. Here the programs I took with me in Casio fx-4000P.
I also took my HP 45 with me as well.


Total: 448 bytes out of 550 bytes ( ^ => x^y)


Prog 0: Quadratic Equation: Po Shen way: x^2 + B * x + C = 0, built for real roots (39 steps)


“ B “ : ? → B : “C” : ? → C : B² ÷ 4 – C → W ◢ -B ÷ 2 - √W ◢ Ans + 2 × √W


Prog 1: Law of Cosines - Side Z (45 steps)


Deg : “X” : ? → X : “Y” : ? → Y : “C” : ? → C : X² + Y² – 2 × X × Y × cos C : √Ans → Z


Prog 2: Law of Cosines - Angle C (49 steps)


Deg : “X” : ? → X : “Y” : ? → Y : “Z” : ? → Z : ( X² + Y² – Z² ) ÷ ( 2 × X × Y ) : cos^-1 Ans → C


Prog 3: Area of Triangle – Heron’s Formula (55 steps)


X” : ?→X : “Y” : ?→Y : “Z” : ?→Z : (X + Y + Z) ÷ 2→S : √( S×(S – X)×(S – Y)×(S – Z))


Prog 4: Speed of Sound in Dry Air (53 steps)

All constants, γ, R, M are taken care of in the formula, T = temp in °F

Conversions: 1 m/s = 2.236936 mph, 20.04503702 * 2.236936 = 44.83946493


T “ : ?→T : 5÷9 × (T – 32) + 273.15 : 20.04503702 * √Ans : 2.236936 * Ans → S


Prog 5: Horizontal Curve Analysis Given Central Angle and Radius (52 steps)

I = central angle, R = radius, L = arc length, C = chord length


Deg : “I” : ?→I : “R” : ?→R : “L=” ◢ π×R×I ÷ 180 → L ◢ “C=” ◢ 2×R× sin(I ÷ 2) → C


Prog 6: D = Displacement of a Cylinder (in) (36 steps)

B = bore (in), S = stroke (in), N = number of cylinders


“B” : ? → B : “S” : ? → S : “N” : ? → N : π × B² × S × N ÷ 4 → D


Prog 7: Tire Size (in) (36 steps)

S = section width (mm), A = aspect ratio, R = rim diameter (S, A, R → )


“S” : ? → S : “A” : ? → A : “R” : ? → R : S × A ÷ 1270 + R → T


Prog 8: Air Pressure for height up to 36,089 ft above sea level (inHg) (45 steps)

This is with constants already completed (g, M, R, etc.)


H” : ?→H : 29.92126 × (1 - 6.875 × 10^-6 × H) x^y 5.255876329 → P


Prog 9: Breaking Distance in Feet Given the Car’s Velocity in Miles Per Hour (35 steps)


V” : ? → V : V × 22 ÷ 15 : Ans × 1.5 + Ans² ÷ 45.04367 → D


Source:

“Breaking Distance” Wikipedia. Last Edited March 30, 2024. Accessed April 29, 2024.

https://en.wikipedia.org/wiki/Braking_distance


Hagberg Media AB. “Stopping distance = reca2tion distance + breaking distance” 2024.

Accessed April 29, 2024. https://korkortonline.se/en/theory/reaction-braking-stopping/


Just for fun,

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, October 8, 2023

TI-84 Plus CE: Using Matrices for "Tax Table" Calculations

TI-84 Plus CE:   Using Matrices for "Tax Table" Calculations


How The Matrix is Set Up


Each row represents a tier or a bracket.  


First column:  Lower Limit.  This is the test variable.  The first tier often will have the lower tier of 0.


Second and subsequent columns:    Variables that are associated with that tier.


Let's demonstrate this with an example.




Example Tax Bracket






This matrix has four brackets (four rows).  The algorithm starts with the last (bottom) row and tests whether the input is greater or equal to the test variable.  


According to the table, the tax rate changes at income level at $30,000, $90,000, and $270,000, with the top tax rate of 9% effective for all income excess of $270,000.


If the income is $29,999.99, the first tier of 3% is used.  If the income goes to $30,000.00, the next tier is activated.


The program ITAX, which uses this type of setup, goes "backwards".  It tests from the highest tier down.  


For example:  Income = $50,000


Start at tier 4 (bottom row). 

Is 50,000 > 270,000?  No, go to tier 3. (move one row up)

Is 50,000 > 90,000?  No, go to tier 2.  (move one row up) 

Is 50,000 > 30,000?  Yes, use the variables from tier 2.


Tax:  (50,000 - 30,000) × 5% + 900 = 20,000 × 5% + 900 = 1,900


Matrix wise:   (income - M[2,1]) * M[2,2] ÷ 100 + M[2,3]



Programs



There are two programs that illustrate this method:  


ITAX:  Income Tax Bracket.  Bracket is stored in Matrix [ A ] and has three columns:


Column 1:  lower limit of each bracket

Column 2:  tax rate for that bracket

Column 3:  additional "minimum" tax.   



BAROMET:  Calculates the air pressure and density based on height.  Scientific information is stored in Matrix [ J ].  


Column 1:  height in meters

Column 2:  mass density in kg/m^3

Column 3:  standard temperature in K

Column 4:  static pressure in Pa


If you are working in US Units, the height is converted to meters first.  After the calculation, the results are converted back into US units. 



You can download both programs here (zip file):  

https://drive.google.com/file/d/1ZCtMcJgZDLUGnrAHE6cPAkWBQQj1aHKc/view?usp=sharing



Source


"Barometric formula."  Wikipedia.  Last edited July 13, 2023.  Retrieved July 16, 2023.   https://en.wikipedia.org/wiki/Barometric_formula



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. 


Wednesday, May 4, 2022

HP 32S and HP 32SII Week: Total Drag

HP 32S and HP 32SII Week:  Total Drag





Introduction


The following equation calculates the total drag force applied to parallel to an area in the opposite direction of the object's motion.  


Fd = 1/2 * ρ * v^2 * Cd * A,   ρ = P / (R * T)


ρ = air pressure 

P = absolute pressure (101,325 Pa, 14.696 psi, 2116.224 lb/ft^2)

R = specific gas constant (287.03 J/(kg k), 53.3533 (ft lbf/lb °R))

T = temperature (K = °C + 273.15, °R = °F + 459.67)


A = cross area that the drag force is applied (m^2, ft^2)

V = velocity of the object (m/s, ft/s)

Cd = drag coefficient (unitless)


The program gives outputs:


ρ = air pressure (kg/m^3, lb/ft^3)

Fd = total drag (kg*m/s^2, lb*ft/s^2)


HP 32S/32SII Program:  Total Drag, SI Units

Size: 55.5 bytes


F01 LBL F

F02 INPUT C

F03 INPUT A

F04 INPUT V

F05 INPUT T

F06 273.15

F07 +

F08 287.03

F09 ×

F10 1/x

F11 101,325

F12 ×

F13 STOP

F14 RCL× C

F15 RCL× A

F16 RCL V

F17 x^2

F18 ×

F19 2

F20 ÷

F21 STOP


Example:

C = drag coefficient = 0.31

A = area =7.0686 m^2

T = temperature = 18.8 °C

V = velocity = 3 m/s


Results:

ρ = 1.20915184207 kg/m^3

Fd = 11.9230799416 kg*m/s^2


HP 32S/32SII Program:  Total Drag, US Units

Size: 55.5 bytes


F01 LBL F

F02 INPUT C

F03 INPUT A

F04 INPUT V

F05 INPUT T

F06 459.67

F07 +

F08 53.3533

F09 ×

F10 1/x

F11 2116.224

F12 ×

F13 STOP

F14 RCL× C

F15 RCL× A

F16 RCL V

F17 x^2

F18 ×

F19 2

F20 ÷

F21 STOP


Example:

C = drag coefficient = 0.31

A = area =76.0868 ft^2

T = temperature = 65.84 °F

V = velocity = 9.84252 ft/s


Results:

ρ = 7.54778228E-2 lb/ft^3

Fd = 86.232900381 lb*ft/s^2



Source:


Lindeburg, Michael R. PE   Civil Engineering Reference Manual for the PE Exam 14th Edition  Professional Publications, Inc:  Belmont, CA.  pp. 17-41 and 17-42


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

HP Prime and TI-84+: Saturation Vapor Pressure, Dew Point, Density Altitude (US Units)

HP Prime and TI-84+:  Saturation Vapor Pressure, Dew Point, Density Altitude (US Units)


The Program AIRUS uses US units as the inputs and outputs:

Input:
T = Temperature in Fahrenheit (°F)
B = Air Pressure in inHg (inches of Mercury)
H = Relative Humidity (%)

You can find these measurements on various weather websites.  Such websites are Accuweather (www.accuweather.com) and Weather Underground (www.wunderunderground.com). 

Output:
S = Saturated Water Vapor (psi)
A = Approximate Actual Density Altitude (DSI) (feet)*
X = Dew Point (°F)

*This is an approximation of density altitude, is an equivalent elevation where the standard atmosphere is met.  (per ICAO, 29.921 inHg, 59°F, 0% humidity).  Let me stress, the density altitude is an approximation.

A list consisting of temperature, air pressure, relative humidity, saturated water vapor, approximate DSI, and dew point is also returned to the home screen.

Equations Used:

Convert Temperature from Fahrenheit to Celsius:
C = (T-32)*5/9

Saturation Vapor Pressure (psi):
S=(610.78*10^((7.5*C)/(C+237.3)))/ 6894.757292318

Dew Point (°C):
W=237.3*V/(1-V) where:

V=(LN(H/100)+((17.27*C)/(237.3+C)))/17.27

Convert from Celsius to Fahrenheit:
X = W*9/5 + 32

Density Altitude (feet):
A=145442.1563*(1-((17.326*B)/(1.8*Z))^.235) where:

Z=(C+273.15)/(1-.378*Y/(33.8639*B))
Y=6.1078*10^((7.5*W)/(237.3+W))

  
HP Prime: AIRUS

EXPORT AIRUS()
BEGIN
// 2015-02-28 EWS
// U.S. Units

LOCAL t,b,h;
LOCAL c,s,d,p,a,v,w;
LOCAL x,y,z;

// Data
INPUT({t,b,h},
"Weather Data",
{"t :","b :","h :"},
{"Temperature (°F)",
"Pressure (inHg)",
"% Relative Humidity"});

// t to Celcius
c:=(t-32)*5/9;

// Saturation Vapor Pressure (Pa)
// wikipedia
s:=610.78*ALOG((7.5*c)/(c+237.3));
// to psi
s:=s/6894.757292318;


// Dew Point (°F)
// ag.arizona.edu
v:=(LN(h/100)+((17.27*c)/(237.3+c)))/17.27;
w:=237.3*v/(1-v);

// w to °F
x:=w*9/5+32;

// Density Altitude
// www.srh.noaa.gov
y:=6.1078*ALOG((7.5*w)/(237.3+w));
z:=(c+273.15)/(1-.378*y/(33.8639*b));
a:=145442.1563*(1-((17.326*b)/
(z*1.8))^.235);


// Output
PRINT();
PRINT("Input:");
PRINT(t+"°F, "+b+"inHg, "+h+"%");
PRINT("Output:");
PRINT("Sat. Water Vapor (psi): "+s);
PRINT("Approx. DSA (ft): "+a);
PRINT("Dew Point (°F): "+x);
RETURN {t,b,h,s,a,x};
END;


TI-84+ AIRUS:

Disp “T: TEMP °F”
Disp “B: PRESSURE (INHG)”
Disp “H: REL. HUMIDITY”
Prompt T,B,H
(T-32)*5/9→C
610.78*10^((7.5C)/(C+237.3))→S
S/6894.757292318→S
(ln(H/100)+((17.27C)/(237.3+C)))/17.27→V
237.3V/(1-V)→W
9W/5+32→X
6.1078*10^((7.5W)/(237.3+W))→Y
(C+273.15)/(1-.378Y/(33.8639B))→Z
145442.1563*(1-((17.326B)/(1.8Z))^.235)→A
Disp “SAT. WATER VAPOR (°F)”
Pause S
Disp “APPROX DSA (FT)”
Pause A
Disp “DEW POINT (°F)”
Pause X
Disp {T,B,H,S,A,X}


Example:

Input:
T = 68°F
B = 29.94 inHg (inches of Mercury)
H = 70%

Output:
S = 0.339111794 psi
A = 790.3879774 feet
W = 57.85583006 °F


Sources:

“Density Altitude” National Weather Resource: Southern Region Headquarters  URL:  http://www.srh.noaa.gov/images/epz/wxcalc/densityAltitude.pdf   Retrieved February 28, 2015

“Density of Air” and “Density Altitude” Wikipedia.  URL:  http://en.wikipedia.org/wiki/Density_of_air , http://en.wikipedia.org/wiki/Density_altitude  Retrieved February 26, 2015

“Dewpoint Formulas” University of Arizona.  URL: http://ag.arizona.edu/azmet/dewpoint.html  Retrieved February 28, 2015

Glover, Thomas J.  “Pocket Ref”  4th Editiion.  Sequoia Publishing, Inc.:  Littleton, CO.  2012  Print
  

This blog is property of Edward Shore - 2015




RPN HP 12C: Fibonacci and Lucas Sequences

  RPN HP 12C: Fibonacci and Lucas Sequences Golden Ratio, Formulas, and Sequences Let φ be the Golden Ratio: φ = (1 + √5) ÷ 2...