Showing posts with label free fall. Show all posts
Showing posts with label free fall. Show all posts

Sunday, September 17, 2023

Filling the Memory of a Casio fx-4000P

Filling the Memory of a Casio fx-4000P





How many programs does it take to fill the 550 step memory?   Here are six programs that pretty much does the job.   I purposely aimed for descriptive prompts and messages. 


Spaces are added for readability.  


Here's are the six programs:


Prg 1:  Approximating the cumulative distribution function of the Normal Curve - to 3 decimal places


Mode +:  COMP,  Number of Steps: 82


"Z≥0" : ?→Z : Fix 3 : 1 - ((1+.196854 Z +.115194 Z² + .000344 Z^3 + .019527 Z^4)^ -4) ÷ 2 : Rnd : Norm : "AREA=" ◢ Ans → A


Source:  Abramowitz and Stegun, Handbook of Mathematical Functions. 1972.


Examples:


Z = 1.6

Results:  AREA = 0.945


Z = 1

Results:  AREA = 0.841


For best results, enter a positive Z.  



Prg 2:  Binomial Distribution PDF with Mean and Variance 


Mode +: COMP, Number of Steps: 86


"P(WIN)" : ?→P : "TRIALS" : ?→T : "WINS" : ?→N : "PDF=" ◢ T nCr N × P x^y N × (1-p) x^y (T-N) ◢ "MU=" ◢ T P  ◢ "VAR=" ◢ Ans (1 - P)


Note:  The combination function, nCr, is shown on the screen as a lone solid C.  I have the nCr for clarification.  


P(WIN):  probability of a successful event

TRIALS:  number of events

WINS:  number of successful events

PDF:  probability of we get the number of successful events

MU:  expected value, mean - depending on P(WIN) and TRIALS

VAR:  variance - depending on P(WIN) and TRIALS


Example:


P(WIN) = 0.7,  TRIALS = 25, WINS = 10

Results:  PDF = 1.324897424 x 10^-3, MU= 17.5, VAR= 5.25   



Prg 3:  Angles of a triangle given 3 side lengths in Degrees - Solve a SSS (side-side-side) Triangle


Mode +: COMP,  Number of Steps: 86


Deg : "A" : ?→A : "B" : ?→B : "C" : ?→C : "<A=" ◢ cos^-1 ((A² + B² - C²) ÷ (-2 B C))  → D ◢ "<B=" ◢ sin^-1(B sin D ÷ A) → E ◢ "<C=" ◢ 180-D-E→F 


Angle <A  (stored in D) is opposite of side with length A

Angle <B (stored in E) is opposite of side with length B

Angle <C (stored in F) is opposite of side with length C


Degrees mode is set in the program.  


Example:

Triangle with lengths A = 24, B = 60, C = 44

Results:  <A = 20.04997572,  <B = 58.99241697, <C = 100.9576073



Prg 4:   Free Fall with Air Resistance (from Ke!san)  

Assume coefficient is standard at k = 0.24 kg/m

(angle is not needed, hyperbolic trig does not depend on angle unit)


Site:  https://keisan.casio.com/exec/system/1231475371

(last retrieved:  February 27, 2023)


Mode +:  COMP,  Number of Steps:  88


.24 → K : 9.80665 → G : "MASS" : ?→M : "DIST" : ?→D : √(M ÷ G ÷ K) → X : "TIME=" ◢ 

X cosh^-1 (e(D K ÷ M)) → T ◢ "VEL=" ◢ X G tanh(T ÷ X) → V


SI units are assumed.


Example:

MASS = 68 kg, DIST (free fall distance) = 1874 m

Results:  TIME = 39.27745305 s, VEL (velocity at free fall) = 52.71191359 m/s



Prg 5:  Sums of 1 to n for k, k^2, k^3, and K^4


Mode +:  COMP, Number of Steps:  83


"1 TO..." : ?→N : "K =" ◢ N (N+1) ÷ 2 → S ◢ "K²=" ◢ S (2 N + 1) ÷ 3 → T ◢ 

"K◢3=" ◢ S² → U ◢ "K◢4=" ◢ T (3 N² + 3 N - 1) ÷ 5 → V 



The power character, x^y can not be used in a string or an error occurs.  The stop character, ◢, can be used.  


K:   Σ (K from K = 1 to K = N)

K²:  Σ (K^2 from K = 1 to K = N)

K◢3:  Σ (K^3 from K = 1 to K = N)

K◢4:  Σ (K^4 from K = 1 to K = N)


Example:  

N = 9

Results:

K:  45

K²:  285

K◢3:  2025

K◢4:  15333



Prg 6:  Simple Ohm's Law Wheel/Volts, Current, Resistance:  "PIE" chart


Mode +:  COMP, Number of Steps: 121


Lbl 0 : "ENT 0 TO SLV" ◢ "I" ◢ ?→I : "V" ◢ ?→ V : "R" ◢ ?→R : I=0 ⇒ Goto 1 : V=0 ⇒ Goto 2:  R=0 ⇒ Goto 3: Goto 0:  Lbl 1:  "I="  ◢ V ÷ R → I ◢ Goto 4: Lbl 2: "V=" ◢ I R → V ◢ Goto 4: Lbl 3: "R=" ◢ V ÷ I → R ◢ Lbl 4: "END"


I:  current (amps, A)

V: voltage (volts, V)

R:  resistance (ohms, Ω)


The inputs will be in this order.  Enter a zero for the variable you want to solve for.  


Examples:


Solve for I:  I = 0, V = 12, R = 3

Result:  I = 4


Solve for V:  I = 20, V = 0, R = 30

Result:  V = 600


Solve for R:  I = 17, V = 120, R = 0

Result:  R ≈ 7.05






Total Number of Programs: 6

Total Steps Used: 121 (I only have 4 left)


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, December 31, 2022

HP Prime: Free Fall with Air Friction

HP Prime:   Free Fall with Air Friction 



Introduction


The program FALLS will calculate the position and velocity of an object falling with friction proportional to square of the object's speed.   The program is aimed towards large objects in free fall.  The half-increment method is used.


With the initial conditions:


y = 0  (initial position, assumed to be at zero)

g = gravitational constant

α = f/m  (force-mass ratio)

dy/dt = 0 (velocity, assume to be at rest from the beginning)


With Δt with the change of time:


dy/dt_1/2 = dy/dt_0 + C * Δt/2  where C = g - α * (dy/dt_0)^2


dy/dt_(i+1/2) = dy/dt_(i-1/2) + C * Δt where C =   g - α * (dy/dt_(i-1/2))^2


y_i+1 = y_i + dy/dt_(i+1/2) * Δt



HP Prime Program: FALLS


EXPORT FALLS()

BEGIN

// EWS 2022-11-03


HFormat:=1;

HDigits:=4; 


LOCAL t,g,a,n;

LOCAL i,d,c,y,m;

LOCAL l0,l1,l2;

LOCAL l3,l4,m0;

 

INPUT({t,g,a,n},"Fall-Air Resistance",

{"Δt =","g =","α =","n ="},

{"charge in time","gravity",

"force/mass","number of steps"});


l0:={m};

l1:={d};

l2:={y};


// for section here

FOR i FROM 1 TO n DO

c:=g-a*d^2;

IF t==0 THEN

c:=c/2;

END;

d:=d+c*t;

m:=m+t;

y:=y+d*t;

l0:=CONCAT(l0,{m});

l1:=CONCAT(l1,{d});

l2:=CONCAT(l2,{y});  

END;


l3:=CONCAT(l0,l1);

l4:=CONCAT(l3,l2);

m0:=list2mat(l4,SIZE(l0));

m0:=TRN(m0);

RETURN m0;

 

END;


The result is a matrix wit the columns:


Column 1:  time  (t = m)

Column 2:  velocity  (dy/dt = d)

Column 3:  position (y)


The program assumes that the object or person being dropped is well above the ground or floor.  




Example


Go 10 steps with Δ = 0.25 sec, g = 9.80665 m/s^2, and α = 0.028




Velocity ≈ 18.6716 m/s

Position ≈ 76.1314 m


The program assumes that the object or person being dropped is well above the ground or floor.  



Source


Eisberg, Robert M.  Applied Mathematical Physics with Programmable Pocket Calculators  McGraw-Hill Book Company:  New York  1976.   ISBN 0-07-019109-3




I want to wish you a Happy New Year. May you have a healthy, prosperous, and happy 2023!


Note:  For January and February 2023, my posting schedule will be on Saturdays only, starting January 7.  This doesn't include any firmware updates or reviews, they will be on Mondays should they occur.    One of my resolutions for 2023 is to catch up on my reading of math books and articles.


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. 


Sunday, November 27, 2016

TI-84 Plus and HP Prime: Differential Equations and Half-Increment Solution, Numerical Methods

TI-84 Plus and HP Prime:  Differential Equations and Half-Increment Solution, Numerical Methods

Introduction

The program HALFSTEP solves the numerical differential equation

d^2y/dt^2 = f(dy/dt, y, t)  given the initial conditions y(t0) = y0 and dy/dt (t0) = dy0

In this notation, y is the independent variable and t is the dependent variable.

The Method

Let C = f(dy/dt, y, t).  Give the change of t as Δt.

First Step:

With t = t0:
h_1/2 = dy0 + C * Δt/2
y1 = y0 + dy0 * Δt

Loop:

t = t0 + Δt
h_I+1/2 = h_I-1/2 + C * Δt
y_I+1 = y_I +h_I+1/2 * Δt

Repeat as many steps as desired.

This method was presented by Robert M. Eisberg in his 1976 calculator programming book (see source below).

Variables

The program uses the following variables:

C:  d^2y/dt^2.   Represent dy/dt as the variable A, y as the variable Y, and t as the variable T.

The program will always designate Y as the independent variable and T as the dependent variable.

Examples:

Application
C
C for HALFSTEP
Free-Fall
d^2y/dt^2 = g
“9.80665” (SI) or “32.1740468” (US)
Free-Fall with Friction
d^2y/dt^2 = g - α (dy/dt)^2
(α = F/m)
“g - α * A^2”
(sub numeric values for g, α)
Spring
d^2x/dt = -k/m * x
“-k/m * T”
(sub numeric values for k, m)
Pendulum
d^2θ/dt = -α*sin(θ)
(α = -g/l)
“-α * sin(Y)”
(sub numeric values for α)
Damped, Driven Oscillations
d^2x/dt = -α*x – β*dx/dt + γ * sin(ω*t)
“-α*Y-β*A+γ*sin(ω*T)”
(sub numeric values for α, β, γ)


HP Prime Program HALFSTEP

Input:  C.  Use single quotes to enclose d^2y/dt^2.  Represent dy/dt as A, y as Y, and t as T. 

Output:  A matrix of two columns, t and y.

EXPORT HALFSTEP(c,A,Y,D,tmax)
BEGIN
// d^2y/dt^2=C,dy0,y0,Δt,tmax
// EWS 2016-11-17
// C use single quotes
// 'dy=A, y=Y, t=T'

// Radian mode
HAngle:=0;

LOCAL mat:=[[0,Y]],T,H;
LOCAL K:=3,I;

T:=D;
H:=A+EVAL(c)*D/2;
Y:=Y+H*D;
mat:=ADDROW(mat,[D,Y],2);

FOR I FROM 2*D TO tmax STEP D DO
T:=I; A:=H;
H:=H+EVAL(c)*D;
Y:=Y+H*D;
mat:=ADDROW(mat,[I,Y],K);
K:=K+1;
END;

RETURN mat;

END;

TI-84 Plus Program HALFSTEP

Input:  For C, use enclose d^2y/dt^2 in quotes.  Represent dy/dt as A, y as Y, and t as T. 

Output:  A matrix of two columns, t and y.

"EWS 2016-11-27"
Func
Radian
Disp "D²Y/DT²=C"
Disp "USE A=DY/DT,Y,T"
Input "C, USE A STRING:",Y1
Input "DY0:",A
Input "Y0:",Y
Input "DELTA TIME:",D
Input "TIME MAX:",N
[[0][Y]]→[A]
D→T
A+Y1*D/2→H
Y+H*D→Y
augment([A],[[D][Y]])→[A]
For(I,2D,N,D)
I→T:H→A
H+Y1*D→H
Y+H*D→Y
augment([A],[[I][Y]])→[A]
End
[A]^T→[A]

Examples:

Please see the screen shots below.  Both are screen shots from the TI-84 Plus.







Source:  Eiseberg, Robert M.  Applied Mathematical Physics with Programmable Pocket Calculators  McGraw-Hill, Inc:  New York.  1976.  ISBN 0-07-019109-3


This blog is property of Edward Shore, 2016.

Trigonometry Reduction Formula and Solving Simple Arcsine and Arccosine Equations

Trigonometry Reduction Formula and Solving Simple Arcsine and Arccosine Equations Some Background and Periodic Reduction Formulas ...