Showing posts with label engineering. Show all posts
Showing posts with label engineering. Show all posts

Monday, January 5, 2026

Casio fx-CG 100 Python: Clothoid Curve Analysis

Casio fx-CG 100 Python: Clothoid Curve Analysis



Introduction



The clothoid is a mathematical curve where its curvature is in proportion to the distance traveled from the origin. This property allows the curve to serve many applications including connecting railways, designing roller coasters, and traffic distribution.







Let:

L: arc length of the curve traveled

R: radius from the center of the clothoid to the point on the curve

(x, y): point on the clothoid curve with curve length L and radius R

A: parameter, where A = √(R * L)

Θ: angle between the radius and line of the center point and a point on the x-axis, where Θ = L^2 ÷ (2 * A^2)



The point on the curve is determined by a variation of the Fresnel Integrals:

x = A * √2 * ∫( cos(u^2) du, u = 0 to u = t)

y = A * √2 * ∫( sin(u^2) du, u = 0 to u = t)



The Python program uses infinite series to calculate the point (x, y).



The Clothoid curve is also known as the Cornu spiral or the Euler spiral.


Casio fx-CG 100 Program: clothoid.py


# Clothoid Curve Analysis

# template of infinite series

# Eddie W. Shore, 11/23/2025


from math import *


# factorial function

def fact(n):

  f=1

  if n<=1:

    return 1

  else:

    for i in range(2,n+1):

      f*=i

    return f


# main program

print("Clothiod Analysis\nCornu Spiral")

r=eval(input("radius: "))

l=eval(input("arc length: "))

a=sqrt(r*l)

t=l**2/(2*a**2)


# c: cosine, s=sine

c=0

s=0

# set term artificially high

w=100

# set counter at beginning

n=0

# series loop

while abs(w)>=1e-20:

  cc=(-1)**n*t**(4*n+1)/(fact(2*n)*(4*n+1))

  ss=(-1)**n*t**(4*n+3)/(fact(2*n+1)*(4*n+3))

  w=max(cc,ss)

  c+=cc

  s+=ss

  n+=1

# answer

x=a*sqrt(2)*c

y=a*sqrt(2)*s

print("constant: {0:.12f}".format(a))

print("angle: {0:.12f}".format(t))

print("x: {0:.12f}".format(x))

print("y: {0:.12f}".format(y))


Example


Input:

Radius: r = 1.75

Arc Length: l = 4.00


Results:

constant (a): 2.645751311065

angle (degrees): 1.142857142857°

x: 3.602081584381

y: 1.646831998544



Sources


Autodesk, Inc. “About Spiral Definitions” Autodesk Civil 3D Help. https://help.autodesk.com/view/CIV3D/2025/ENU/?guid=GUID-DD7C0EA1-8465-45BA-9A39-FC05106FD822. 2025. Retrieved November 19, 2025.


Constantin. “The Clothoid” A railway track blog. https://railwaytrackblog.com/2016/07/03/the-clothoid/comment-page-1/ March 7, 2016. Retrieved November 19, 2025.


Gombáu, Alberto. “The clothoid: geometry that unites mathematics, engineer and design”. https://medium.com/@gombau/the-clothoid-geometry-that-unites-mathematics-engineering-and-design-6323de37e979. April 11, 2025. Retrieved November 19, 2025.



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.

Thursday, October 30, 2025

HP 67 Programs… Almost 50 Years Later

 HP 67 Programs… Almost 50 Years Later


Both downloads are in PDF format. This is for use for the HP 67 and its emulators, or really almost any RPN scientific calculator. Enjoy!



Volume 1:


https://drive.google.com/file/d/114H4D0hcOjxDj_MHQNvwDBUJV3chlpdC/view?usp=sharing


Countdown of HP 67 "seconds"

Random Numbers

Snell's Law

Circle: Area and Circumference

Sphere: Surface Area and Volume

Angle Between 2 Lines with Slopes x and y

Sum of Powers

Adding Complex Numbers

Multiplying Complex Numbers

Complex Number to a Real Power

Permutation

Combination (with duplicating X and Y stack values)

Speed of Sound Approximation (in meters per second)

Finance: Present Value Annuity Factor (including setting N and I% with monthly payments)

Distance Between Two Points (x,y) and (z,t)

Horizontal Curve


Volume 2:

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

Sigmoid Function

Logit Function

Solving Linear Equations

Solving Monic Quadratic Polynomials (real roots only)

Intensity of a Spherical Light Source

Determinant of a 2 x 2 Matrix

Air Density of Dry Air

Time Dilation Factor

Simple Interest

Calculus: Area Under the Curve of a Linear Function

Horizontal Curve Solution given Radius and Central Angle

Freezing Altitude Levels: Dry and Wet

HP 67 Solvers:

Temperature Conversions

Cost-Sell-Margin

Decibel Gain/Loss




Eddie


All original content copyright, © 2011-2025. 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, February 11, 2024

Spotlight: Casio CFX-9850GB Plus

Spotlight:   Casio CFX-9850GB Plus 

(Retro Review)







Quick Facts


Model:  CFX-9850GB Plus

Company:  Casio

Timeline:  late 1990s (circa 1997) to 2008

Type:   Graphing, Algebraic, floating decimal with fractions

Number of Digits:  10

Power:  4 AAA batteries plus CR 2032 backup

Colors:  orange, blue, green

Screen Size:  128 x 64 pixels


There are two versions of the CFX-9850GB Plus:  


*  First edition (1997 - 2002):  Black case, black slide cover, about 32,000 bytes of memory.   


*  Second edition (2002 - 2008):  White case, green cover, about 64,000 bytes of memory.


I have the first edition.   Even though this calculator is no longer in production, the CFX-9850G series is still available through online sites such as eBay and thrift stores.  I purchased mine on eBay from Petchiart Shop.  



Graphing in Color


The CFX-9850G series is the first series of calculators to include a multicolored display.   Graphs, tables, statistical plots, and sequences can be displayed in up to three colors:  blue, green, and orange.  


How were the colors accomplished?  Colors are determined by the contrast of the pixels.  Pixels with the lightest contrast are displayed as orange.  Pixels with a medium contrast are displayed as blue.  Pixels with the darkest contrast are displayed as green.  


Text and regular calculations are shown in blue.  We can change the color of the text to green or orange through [OPTN], [F6] (>), [F1] (COLR).   Blue text is the default.  



Calculator Modes


1  Run:  Main Calculator

2  Statistics:  Statistics. Regressions include linear, med-med, quadratic, cubic, quartic, logarithmic, exponential, power, sinusoidal, and logistic.

3  Matrices:  Matrix editing and manipulation mode

4  Lists:  List editing and manipulation mode.  Up to six lists can be stored (List 1 - List 6)

5  Graphing:  Functions with and without shading (Y(X)), Polar (r(Θ)), Parametric (X(T), Y(T)), Horizontal Lines (x=c) 

6  Dynamic Graphing:  Leave one variable to change during graphing

7  Tables

8  Recursion:  graphing recursion sequences

9  Conics:  graphing conics using templates

A  Equation:  Simultaneous linear systems to the order of 6 equations, quadratic polynomials, cubic polynomials, general solver

B  Program:  Programs can be write-protected with a password if desired. 

C  TVM:  Finance including simple interest, compound interest, amortization, cost/sell/margin, date addition, days between dates

D  Link

E  Contrast menu

F  Memory Manager



Also included through the [OPTN] key:


Complex numbers:  arithmetic, parts (real, imaginary, absolute value, argument/angle), conjugate


Hyperbolic functions


Probability functions


Numeric function including fractional and integer parts, rounding function (internally round the number to fix settings).


Angle:  Angle units including decimal degrees/degree-minute-second conversions


Logic:  AND, OR, NOT.   The calculator has integer modes (decimal, octal, hexadecimal, binary).  


Function Memory:  store up to 6 functions for recall.   


ESYM:  engineering suffixes (mega, micro, etc)



The calculator is run in LineIO format (linear).  There is no textbook mode or an exact function when it comes to terms of pi (π) or square roots (√).



Peripherals


To transfer files between the calculator and a computer, the CFX-9850GB Plus uses an FA-123 connection cable.  If this calculator is not purchased new or like new, the cable will have to be a separate purchase, which may not be an easy find.   I believe the FA-123 is a USB cable.   


There is a SB-62 cable which connects the calculator to a class of Casio label printers, such as the Casio KL-2000 Printer.   



Built-In Library



What separates the CFX-9850GB PLUS (and the CFX-9950GB PLUS) from the rest of the series is the inclusion of a built in software library which can be loaded into the calculator's memory at any time.   All of the library's programs are write-protected and require a password to edit.  I don't know the password, sorry.


The software library includes programs that used the EA-100 data analyzer,  differential equations, drawing Mandelbrot sets, geometry, amortization, complex number powers and roots, double and triple integrals, and slope filed graphs.  (not an all-inclusive list).


I want to try them all.



Comparison of the Color Calculators  (vs. fx-CG 50)


I want to close out this spotlight by comparing the CFX-9850 PLUS with its LCD contrast pixels versus the current Casio fx-CG 50, a full-color graphing calculator.  


In the following pictures, the fx-CG50 is on the left, the CFX-9850GB PLUS is on the right. 








Sources


"CFX-9850G PLUS"   Casio Ledudu.  2022.   Accessed January 9, 2024.  https://casio.ledudu.com/pockets.asp?type=280&lg=eng

(this link includes the main manual)


"Casio 9850 series"  Wikipedia.  Last Edited May 14, 2023.  Accessed December 30, 2023.  https://en.wikipedia.org/wiki/Casio_9850_series


Casio.   Casio CFX9850GB Plus Software Library.  https://support.casio.com/en/manual/manualfile.php?cid=004013009

Accessed December 30, 2023. 


Vis, Peter. "Casio Serial Cable Compatibility"   The Quantum Archive.   Accessed January 9, 2024.  https://www.petervis.com/electronics%20guides/Casio%20Serial%20Cables/Casio%20Serial%20Cable%20Compatibility.html




I am always impressed with Casio graphing calculators.   Often, they give the most functions and capability for the least money.  Money well spent.  


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, May 20, 2023

Casio Classpad fx-CP400: Solving a System of Linear Differential Equations Using Laplace Transforms

Casio Classpad fx-CP400: Solving a System of Linear Differential Equations Using Laplace Transforms



Introduction


The following procedure should work with the Casio Classpad family of calculators (300, 330, fx-CP400, fx-CP500). 


An attempt to use the Casio Classpad to solve the system of differential equations:


dxf/dt = A * xf(t) + B * yf(t) + g1(t)

dyf/dt = C * xf(t) + D * yf(t) + g2(t)


Initial conditions:  xf(0) = xf0,   yf(0) = yf0



The independent variable in all the functions is t.  The Casio Classpad's CAS functions laplace and invLaplace are used to accomplish this task.



Syntax


Laplace Transform of f(t):


laplace(f(t), t, s)


Laplace Transform of a Differential Equation:


laplace(diff eq, independent variable, dependent variable, s)


Inverse Laplace Transformation:


invLaplace(ℒ(s), s, t)


t:  parameter of the original function f(t)

s:  parameter of the transformed function ℒ(s)


The definition of a Laplace Transformation:


ℒ(f(t))(s) = ∫( f(t) * e^(-s*t) dt, t = 0 to ∞)


Now, even though we are working a system of differential equations, the laplace and invLapace commands can only work on function at a time.  Any other variable will be treated as a constant, even it was meant to represent another functions.  The substitution steps will account for this.  


The variables used to respect the Classpad's system variables.  


Here are the steps I used to solve:


dxf/dt = A * xf(t) + B * yf(t) + g1(t)

dyf/dt = C * xf(t) + D * yf(t) + g2(t)


Initial conditions:  xf(0) = xf0,   yf(0) = yf0


Spaces are added to readability.  



1.  Store dxf/dt in the variable f1.   Use xf' to represent dxf/dt.  


2.  Store dyf/dt in the variable f2.   Use yf' to represent dyf/dt.


3.  Execute the following and substitutions:


laplace( f1, t, xf, s ) ⇒ g1

g1 | xf(0) = xf0 and  yf / s = Mp ⇒ g1


4.  Execute the following and substitutions:


laplace( f2, t, yf, s ) ⇒ g2

g2 | yf(0) = yf0 and Lp = Mp ⇒ g2

g2 | xf /s = Lp ⇒ g2


Note Lp = ℒ( xf(t) ) and Mp = ℒ( yf(t) )


5.  Now solve the system of transformed equations: 


solve( {g1, g2}, {Lp, Mp} ) ⇒ lists


6.  Take the inverse laplace transforms:


invLaplace( getRight( lists[1], s, t ) ) ⇒ h1

invLaplace( getRight( lists[2], s, t ) ) ⇒ h2


The solutions are:


xf(t) = h1

yf(t) = h2


The getRight command extracts the right side of an equation.



Examples


Example 1:


xf ' = -0.08 * xf + 0.02 * yf + 6

yf ' = 0.08 * xf - 0.08 * yf


Initial conditions:  xf(0) = 0, yf(0) = 150






Example 2:


xf ' = 2 * xf + yf + t^2

yf ' = -2 * xf + 5


Initial conditions:  xf(0) = 2, yf(0) = 5




Casio Classpad Program:  laplaced


Download here:  https://drive.google.com/file/d/1zxTEynCjXmBrPU9pYqmXo3kF_so7fiI-/view?usp=share_link


Code:


' setup

SetRadian


' local variables

Local str1, str2, f1, f2

Local g1, g2, lists, h1, h2

Local Mp, Lp, t, s, xval, yval


' main

ClrText

InputStr str1, "xf'(xf,yf,g1(t))="

InputStr str2, "yf'(xf,yf,g2(t))="

Input xval, "xf(0)? "

Input yval, "yf(0)? "


StrJoin "xf'=", str1, str1

StrJoin "yf'=", str2, str2

strToExp(str1) ⇒ f1

strToExp(str2) ⇒ f2


' transform and solve

laplace(f1, t, xf, s) ⇒ g1

g1 | xf(0) = xval and yf/s = Mp ⇒ g1


laplace(f2, t, yf, s) ⇒ g2

g2 | yf(0) = yval and Lp = Mp ⇒ g2

g2 | xf/s = Lp ⇒ g2


Print "Laplace Transforms:"

PrintNatural g1

Print g1

PrintNatural g2

Print g2


solve({g1, g2},{Lp, Mp})⇒lists

invLaplace(getRight(lists[1]),s,t) ⇒ h1

invLaplace(getRight(lists[2],s,t) ⇒ h2


Print "Solutions: "

Print "xf = "

PrintNatural h1

Print h1

Print "yf = "

PrintNatural h2

Print h2


Note:  PrintNatural displays the expression in textbook form in a popup box, but it does not add anything to the text output terminal.  This is why I included both PrintNatural and Print commands.  



Source


Kreyszig, Erwin.  Advanced Engineering Mathematics  8th Edition  John Wiley & Sons, Inc:  New York, NY.  1999.  ISBN 0-471-15496-2



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. 

Thursday, May 5, 2022

HP 32S and HP 32SII Week: Jurin's Law - Capillary Rise

HP 32S and HP 32SII Week:  Jurin's Law - Capillary Rise 





Capillary Motion 


Jurin's law describes the motion of liquid in small tubes, as the height is inversely proportional to the tube's diameter (and radius).  Factors include the contact angle and the density of the liquid.


The height of the liquid is determined by:


h = (2 * σ * cos θ) / (ρ * g * r)


σ = surface tension of the liquid (N/m)  (T)

θ = the angle of liquid in degrees, from adhesive (0° to 90°) to cohesive (90° to 180°) (B)

ρ = density of liquid (kg/m^3) (D)

r = radius of the tube (m) (R)


HP 32S and HP 32SII: Jurin's Law

Size:  33.5 bytes


J01 LBL J

J02 DEG

J03 INPUT T

J04 INPUT B

J05 INPUT D

J06 INPUT R

J07 2

J08 RCL× T

J09 RCL B

J10 COS

J11 ×

J12 RCL D

J13 RCL× R

J14 9.80665

J15 ×

J16 ÷

J17 STOP


Example:

Find the capillary rise of water in a tube with radius of 0.1 m.   

Data:  σ = 0.0728 N/m, θ = 0°, and ρ = 1000 kg/m^3


Inputs:

T = 0.0728

B = 0

D = 1000

R = 0.1


Result:  1.48470681E-4 m  (height)


Source:


"Jurin's law" Wikipedia.  Last updated February 11, 2022.  https://en.wikipedia.org/wiki/Jurin%27s_law  Last Accessed April 1, 2022.  


Lindeburg, Michael R. PE   Civil Engineering Reference Manual for the PE Exam 14th Edition  Professional Publications, Inc:  Belmont, CA.  pp. 14-11 to 14-13


Eddie


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. 


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, 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. 


Saturday, August 7, 2021

TI-95 ProCalc: Arithmetic and Geometric Series, Arithmetic-Geometric Mean

TI-95 ProCalc: Arithmetic and Geometric Series, Arithmetic-Geometric Mean




Welcome to TI-95 ProCalc month!  I think this is the first time I am going to post programs for this classic keystroke calculator.  


To see my review of the TI-95 ProCalc in 2020, click here:

http://edspi31415.blogspot.com/2020/07/retro-review-ti-95-procalc.html

Note, all programs on this series will use the one-letter variables A-Z, which can also be registers 000 - 025. 


Arithmetic Term and Sum


Arithmetic Series:

a + (a + d) + (a + 2d) + ...


Nth Term:

TERM = B = a + (n -1) * d


Sum of N Terms:

SUM = S = n / 2 * (2 * a + (n - 1) * d) = n / 2 * (a + TERM)


Alpha strings are enclosed in singular quotes (' ').


TI-95 ProCalc Program File ARI

Size: 72 bytes


'A+(A+D)+...'  BRK CLR


'A?' BRK STO A


+ ( 'N?' BRK STO N 


- 1 ) * 'D?' BRK = STO B


+ RCL A = * RCL N / 2 = STO S


'TERM=' COL 16 MRG B BRK 


CLR 'SUM=' COL 16 MRG S HLT


Examples

 

A = -1, D = 6, N = 20

Results:  TERM = 113, SUM = 1,120


A = 4.5, D = 1.8, N = 35

Results:  TERM = 65.7, SUM = 1,228.5



Geometric Series and Sum


Geometric Series:

a + a*r + a*r^2 + a*r^3 + ...


Nth Term:

TERM = B = a * r^(n-1)


Sum of N Terms:

SUM = S = (a * (1 - r^n)) / (1 - r) = ( -r * TERM + a ) / (1 - r )


TI-95 ProCalc Program File GMS

Size: 80 bytes


'A+A*R+A*R^2+...' BRK CLR


'A?' BRK STO A* 


'R?' BRK STO R y^x 


( 'N?' BRK - 1 ) = STO B

 

* RCL R +/- + RCL A = 


/ ( 1 - RCL R ) = STO S


'TERM=' COL 16 MRG B BRK


CLR 'SUM=' COL 16 MRG S HLT


Examples


A = 1,000, R = 1.36, N = 32

Results: TERM = 13,794,506.22, SUM = 52,109,801.29 


A = 1,000, R = 0.95, N = 26

Results: TERM = 277.3895731, SUM = 14,729.59811


Arithmetic-Geometric Mean


Given positive real numbers A and G, the follow algorithm repeats until A and G converge:


A_n+1 = (A_n + G_n) / 2

G_n+1 = √(A_n * G_n)


When convergence is satisfied to a set of decimal places, both A_final and G_final are calculated for comparison purposes.


TI-95 ProCalc Program File AGM

Size: 104 bytes


CLR 'ARITH/GEOM MEAN' PAU


CLR 'A?' BRK STO A


CLR 'G?' BRK STO G


CLR '# PLACES?' BRK +/- INV LOG STO T 


LBL 01 RCL A STO B RCL G STO H


( RCL B + RCL H ) / 2 = STO A


( RCL B * RCL H ) SQR = STO G


( RCL A - RCL G ) ABS = IF> T GTL 01 


RCL G x~t RCL A HLT


Examples


A = 2.4, G = 3.6, # PLACES = 6 (6 places)

Results:  2.969616524, 2.969616523


A = 105, G = 207, # PLACES = 6 (6 places)

Results:  151.6836959, 151.6836959


Source for Arithmetic and Geometric Term and Sum:


Lindeburg, Michael R. P.E.  Engineering Fundamentals: Quick Reference Cards Third Edition  Professional Publications, Inc.  Belmont, CA 1988 ISBN 0-932276-88-1


Commas added to the results for readability.  


Eddie


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


Casio fx-50F/Radio Shack EC-4024 Program Collection: October 2026

Casio fx-50F/Radio Shack EC-4024 Program Collection: October 2026 Notes: * The fx-50F/EC-4024 has a 29 step program space betwe...