Showing posts with label chemistry. Show all posts
Showing posts with label chemistry. Show all posts

Sunday, January 9, 2022

Fun With The HP 27S

Fun With The HP 27S


Notes:


*  The HP 27S is set to FIX 4


*  Since none of the formulas have trigonometric functions, they can also be programmed on the HP 17B and HP 17BII+


Partial Fraction Decomposition


(A ∙ x + B)÷((x + C) ∙ (x + D)) = R÷(x + C) + S÷(x + D)


Inputs:  A, B, C, D

Outputs:  R, S


Formula:


PARTFRAC2:(A+B+C+D)×0=IF(S(R):(B-C×A)÷(D-C)-R:(B-D×A)÷(C-D)-S)


Example:  (4 ∙ x + 3) ÷ ((x - 5) ∙ (x + 1))

A = 4, B = 3, C = -5, D = 1

Results:  R = 3.8333, S = 0.1667


Use that the 0×(var1+var2+...) to set an order of variables in the solver.  


2 x 2 Simultaneous Equations


A ∙ x + B ∙ y = C

D ∙ x + E ∙ y = F


The solutions are:


x = (C ∙ E - B ∙ F) ÷ (A ∙ E - B ∙ D)

y = (A ∙ F - C ∙ D) ÷ (A ∙ E - B ∙ D)


Formula:


SIM2X2:0×(A+B+C+D+E+F+L(M:A×E-B×D))=IF(S(X):(C×E-B×F)÷G(M)-X:(A×F-C×D)÷G(M)-Y)


Example:  2x + 3y =5, -3x + 8y = -8

A = 2, B = 3, C = 5, D = -3, E = 5, F = -8

Results:  X = 2.5789, Y = -0.0526


Floor Function


floor(x):  the greatest integer less than or equal to x


floor(x):

If frac(x) = 0 Then return x

 Else If x≥0, then return intg(x) else return intg(x)-1


Formula:


FLOOR=IF(FP(X)=0:X:IF(X>=0:IP(X):IP(X)-1))


Examples:

X = 2.38, FLOOR = 2.0000

X = -9.21, FLOOR = -10.0000


Ceiling Function


ceil(x):  the least integer greater than or equal to x


ceil(x):

If frac(x) = 0 Then return x

  Else If x≥0, then intg(x)+1 else return intg(x)


Formula:


CEIL=IF(FP(X)=0:X:IF(X>=0:IP(X)+1:IP(X)))


Examples:

X = 2.38, CEIL = 3.0000

X = -9.21, CEIL = -9.0000


Rydberg Formula


The Rydberg formula measures the light's wavelength when an electron moves between energy quantum numbers (from higher to lower levels).  The Rydberg formula is to be used for simple atoms only, and is most used for hydrogen atoms.


1/λ = R ∙ Z^2 ∙ (1/n1^2 - 1/n2^2)


R = Rydberg's Constant ≈ 1.097373157 × 10^7 m^(-1)

Z = atomic number, 1 for hydrogen

n1, n2:  energy levels


Formula:


RYDBERG:INV(L)=1.09737316E7×SQ(Z)×(INV(SQ(N1))-INV(SQ(N2)))


N2 > N1


Example:

The energy of an hydrogen election from level 4 to level 2.  Z = 1

Z =1,  N1 = 2, N2 = 4

Result:  L = 4.8601E-7


Source:

Helmenstine, Todd. "What Is the Rydberg Formula and How Does It Work?" ThoughtCo, Aug. 28, 2020, https://www.thoughtco.com/what-is-the-rydberg-formula-604285   Retrieved November 4, 2021



Moment of Inertia - Circular Ring


D$OUT:  outside diameter

D$IN:  insider diameter.  For a circle, set D$IN = 0

I: moment of inertia


Formula:


I=PI×(D$OUT^4-D$IN^4)÷64


Examples:


Circular Ring:

D$OUT = 6.2, D$IN = 1.9;  I = 71.8935


Circle:

D$OUT = 6.2, D$IN = 0; i = 72.5332


Source:

"Properties Of Annual Sections" HP-19C/HP-29C Solutions: Civil Engineering  Hewlett-Packard.  1977



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. 


Friday, May 25, 2018

TI-84 Plus CE Programs from Casio FX-702P


TI-84 Plus CE Programs from Casio FX-702P

Notes

Here are several programs from the “Bilbliotheque De Programmes” for the Casio FX-702P translated for the Texas Instruments TI-84 Plus CE.  I understand that there is an English version of the book, but I have yet to find it online.  I am thankful to Google Translate since I am not fluent in French. 

I named each of the programs FX702P##, starting with 02.  Of course, use the program name that fits. 

Basic doesn’t translate directly to the TI-84 Plus programming language.  First of all, there are no line numbers for the TI-84 Plus, separate labels had to be created.  I added more descriptive lines to prompts and results strings because (1) the TI-84 Plus CE has a lot more programming space than the 1,680 bytes the Casio FX-702P offered, and (2) it helped me understand what the programs were. 

The reference page ties to the page in the document, not the PDF page. 

TI-84 Plus CE Program FX702P02  (ref. page 85)
Geometric Mean:  Enter 0 to stop data entry

"GEOMETRIC MEAN (85)"
"2018-05-20"
1→A:1→B
Lbl 20
Disp "X-",A
Input X
If X=0:Goto 60
A+1→A:B*X→B
Goto 20
Lbl 60
Disp "G=",B^(1/(A-1))

TI-84 Plus CE Program FX702P03 (ref. page 117)
Chemistry:  Analysis of an Acid

"ACID PRGM, 2018-05-20"
"(117)"
For(J,1,10)
Input "T= (0:END)",T
If T=0:Stop
37-T→T
Input "P*=",A
Input "PH=",P
Input "H=",H
.019T→B:A*10^(B)→A
Disp "P*=",A
P-.0146T→P:Disp "PH=",P
.0307A→C:C*10^(P-6.11)→D
Disp "(HC03­)=",D:Pause
D-(9.5+1.63H)(7.4-P)-24→C
(1-.0143H)C→B
Disp "BE=",B
(1+10^(P-6.11))→I:.0307AI→I
Disp "I=",I:Pause
End


TI-84 Plus CE Program FX702P04  (ref. page 131)
Accounting:  Calculate Accounts Receivable on outstanding invoices

"BILL REDUCTION (131)"
"2018-05-20 EWS"
1→Z:0→E:0→F
Lbl IN
"AMT: A"+toString(Z)+":"→Str1
Input Str1,A
"PERCENT: B"+toString(Z)+":"→Str1
Input Str1,B
"DAYS: C"+toString(Z)+":"→Str1
Input Str1,C
int(A*B/100*C/365+.5)→D
E+A→E:F+D→F
"AMT: D"+toString(Z)+":"→Str1:Disp Str1,D
Pause
Z+1→Z
Menu("MORE DATA?","YES",IN,"NO",NO)
Lbl NO
ClrHome
Disp "TOTAL INVOICES:",E
Disp "TOTAL INTEREST:",F
Input "COMMISSION:",X
E-F-X→N
Disp "NET RECIEVABLE:",N


TI-84 Plus CE Program FX702P05 (ref. page 73)
Thermal Stress

Disp "THERMAL STRESS"
"2018-05-22 EWS"
Disp "LINEAR EXPANSION","COEFFICIENT"
Input "L1:",L
Input "L2:",M
Disp "ELASTIC","COEFFICIENT"
Input "E1:",E
Input "E2:",F
Disp "CROSS SECTION"
Input "A1:",A
Input "A2:",B
Input "T:",T
EF(L-M)T→C
C/(EA+FB)→C
­(BC)→R:AC→S
ClrHome
Disp "THERMAL STRESS","A:","B:"
Output(2,5,R)
Output(3,5,S)


TI-84 Plus CE Program FX702P06  (ref. page 206)
Construction:  Concentrated Load on a Beam

Disp "BEAM FIXED AT","BOTH ENDS UNDER","CONCENTRATED LOAD"
"(63) 2018-05-22 EWS"
Degree
Input "YOUNG MOD (KG/MM^4):",E
Input "INERTIA (MM^4):",I
Input "LENGTH (MM):",L
Input "SUPPORT-LOAD DIST:",A
Input "LOAD (KG):",P
E*I→B
Input "INTEREST POINT:",X
If X≤A
Then:A→Y:X→Z
Else:L-A→Y:L-X→Z
End
Z(L+2Y)→C:P(L-Y)^2/L^3→D
D*Z*Z/6/B*(C-3*Y*L)→F
tan^-1(D*Z/2/B*(C-2*Y*L))→S
D*(C-Y*L)→M
D*C/Z→W
ClrHome:Fix 4
Disp "FLEXION (MM):"," ANGLE:"," TORQUE:","SHELL LOAD:"
Output(1,14,F)
Output(2,14,S)
Output(3,14,M)
Output(4,14,W)
Float

TI-84 Plus CE Program FX702P07 (ref. page 41)
Electronics:  Active Low-Pass Filter

Disp "ACTIVE LOW-PASS FILTER"
"(41) 2018-05-22 EWS"
Input "FREQ (HZ):",F
Input "AF:",A
Input "C1 (MICRO-F):",C
C/1E6→C
√(2)/(4*A*π*F*C)→R
A*R→S
S/(A+1)→T
2*(A+1)*C*1E6→U
ClrHome
Disp "R1:","R2:","R3:",C2:"
Output(1,5,R)
Output(2,5,S)
Output(3,5,T)
Output(4,5,U)


Source: Casio.  “Bibliotheque De Programmes FX-702P” (French document)  1985

You can find a PDF of the book in French on this page: http://casio.ledudu.com/pockets.asp?type=53&lg=eng .  Scroll down to the bottom of the page.  Also, shout out to the casio.ledudu.com page because it is an excellent site!


Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

Thursday, July 9, 2015

HP Prime: Diatomic Molecules

HP Prime: Diatomic Molecules

Diatomic Molecules

The program DIATOMIC will calculate:

*  Distance from the center of mass for each molecule
*  Inertia of the molecule
*  Rotational Energy at level j  (j = 0, 1, 2, 3…)
*  Vibrational Energy at level n  (n = 0, 1, 2, 3…)

A diatomic molecule is a molecule made of two atoms.  Examples are H2, O2, NaCl (sodium chloride), and CO (carbon monoxide). 

Input:

*  Mass of the two molecules, in atomic mass units (u).  The program will convert them to kilograms.  The conversion is 1 u ≈ 1.660538921 * 10^-27 kg
*  Distance of the “bar” between the two molecules.  Give this in ångströms, which an ångström is 10^-10 m. 
*  Rotational and Vibrational Energy levels.  They do not have to be the same.
*  Frequency of the diatomic molecule in 10^12 Hz.  Typically, molecules and atoms exhibit frequencies in the order of 10^13 Hz.


The formulas are derived from the use of the Schrödinger Equation.  While I won’t give much details, a derivation can be found in many resources, such as this link:  http://chemwiki.ucdavis.edu/Physical_Chemistry/Spectroscopy/Rotational_Spectroscopy/Rotational_Spectroscopy_of_Diatomic_Molecules. 

This program can be adopted to other graphing calculators, but here is a version for the HP Prime:

Program DIATOMIC

EXPORT DIATOMIC()
BEGIN
// EWS 2015-07-09
// Diatomic Molecule
LOCAL m1,m2,r,l1,l2,I;
LOCAL j,n,w;
LOCAL Er,Ev;

// Input
INPUT({m1,m2,r,j,n,w},
"Diatomic Molecule",
{"Mass 1:","Mass 2:",
"r:","J:","N:","freq:"},
{"Mass in atomic units",
"Mass in atomic units",
"Distance in Angstroms",
"Rotational energy level",
"Vibration energy level",
"Frequency (10^12 Hz)"});

// Integer Parts
n:=IP(n);
j:=IP(j);

// Convert to kg
m1:=m1*1.660538921ᴇ−27;
m2:=m2*1.660538921ᴇ−27;

// Convert Angstroms to m;
r:=r/1ᴇ10;

// Convert to Hz;
w:=w*1ᴇ12;

// Lengths
l1:=m2*r/(m1+m2);
l2:=m1*r/(m1+m2);

// Inertia:
I:=m1*l1^2+m2*l2^2;

// Rotational Energy:
Er:=1.054571726ᴇ−34^2/(2*I)*j*(j+1);

// Vibrational Energy:
Ev:=(n+1/2)*1.054571726ᴇ−34*w;

// Results
PRINT();
PRINT("Distance to Center (m):");
PRINT("From Mol. 1: "+STRING(l1));
PRINT("From Mol. 2: "+STRING(l2));
PRINT("Inertia:");
PRINT(STRING(I)+" kg m^2");
PRINT("Rotational Energy:");
PRINT(STRING(Er)+" J");
PRINT("Vibrational Energy:");
PRINT(STRING(Ev)+" J");

RETURN({l1,l2,I,Er,Ev});
  
END;
  
Example

Mass 1:  Hydrogen:  1.00794 u
Mass 2:  Chlorine:  35.4270 u
Distance:  6 ångströms
Frequency:  3.6 x 10^13 Hz


Input Screen:


Output Screen:


Energy:
Rotational:  approx. 1.90*10^-23 J
Vibration:  approx. 5.69*10^-21 J

Sources:

Strong, Benjamin.  “Rotational Spectroscopy of Diatomic Molecules”  http://chemwiki.ucdavis.edu/Physical_Chemistry/Spectroscopy/Rotational_Spectroscopy/Rotational_Spectroscopy_of_Diatomic_Molecules   March 26, 2015.   Retrieved July 5, 2015.

Wikipedia.  “Atom Vibrations”  https://en.wikipedia.org/wiki/Atom_vibrations  Retrieved July 9, 2015.

Young, Hugh D. & Roger A Freedman   “University Physics with Modern Physics”  11th Ed.  Pearson:  San Francisco.  2003
  
Eddie

This blog is property of Edward Shore.  2015.

HP 67 Collection: October 2026

HP 67 Collection: Oct ober 2026 All examples are done in FIX 4. (DSP 4) Earth's Gravity at a Specific Latitude The true ea...