Sunday, June 29, 2014
Bow Ties and Cylindrical Hourglasses
Solving y = a*x^2 + b*x + c for x whether y is zero or not.
Monday, June 23, 2014
HP Prime and HP 50g: Moments of Inertia
Source:
Browne, Michael E. Ph. D "Schaum's Outlines: Physics for Engineering and Science" 2nd. Ed McGraw Hill: New York. 2010.
HP Prime: INERTIA
This program demonstrates the use of CHOOSE and CASE
EXPORT INERTIA( )
BEGIN
// EWS 2014-06-24
LOCAL c,a,b,m,r;
CHOOSE(c, "Moment of Inertia",
{"Square", "Rectangle", "Cylinder", "Sphere", "Hoop"});
CASE
IF c==1 THEN INPUT({m,a});
RETURN m*a^2/6; END;
IF c==2 THEN INPUT({m,a,b});
RETURN m*(a^2+b^2)/12; END;
IF c==3 THEN INPUT({m,r});
RETURN m*r^2/2; END;
IF c==4 THEN INPUT({m,r});
RETURN 2*m*r^2/5; END;
IF c==5 THEN INPUT({m,r});
RETURN m*r^2; END;
DEFAULT KILL; END;
END;
HP 50g: INERTIA
6/23/2014
<< 1 1 1 1 1
→ c a b m r
<< "Moment of Inertia"
{ { "Square" 1 }
{ "Rectangle" 2 }
{ "Cylinder" 3 }
{ "Sphere" 4 }
{ "Hoop" 5 } }
1 CHOOSE
IF 0 == THEN KILL END
'c' STO
CASE c 1 == THEN
"m" PROMPT "a" PROMPT
SQ * 6 / END
c 2 == THEN
"m" PROMPT "a" PROMPT SQ
"b" PROMPT SQ + * 12 / END
c 3 == THEN
"m" PROMPT "r" PROMPT SQ *
2 / END
c 4 == THEN
"m" PROMPT "r" PROMPT SQ * 2 *
5 / END
c 5 == THEN
"m" PROMPT "r" PROMPT SQ *
END
END >> >>
Notes:
* I just stored a value in the variables c, a, b, m, and r, and used the right arrow ( → ) to make the variables local.
* The IF 0 == THEN KILL END sequence handles the case the user chooses CANCEL over its options.
* The consecutive PROMPT commands saved space instead of using INFORM.
* INERTIA demonstrates the CASE structure
Eddie
This blog is property of Edward Shore. 2014
Sunday, June 15, 2014
HP 15C: Area by Verticies With Curve Segments (with Jason Foose)
On June 6, 2014, I posted a revised program for the HP 15C to find the area of a polygon by given the coordinates of each vertex. You can see this post here:
http://edspi31415.blogspot.com/2014/06/hp-15c-area-of-polygon-by-vertices.html
Jason Foose, County Surveyor at Mohave County Public Works in Kingman, AZ contributed an addendum to the program: this allows you to enter curve segments and calculate the total area based on vertices and the curve segments. Jason Foose can be found on Google+ and on Linkedin.
General Instructions
The idea is to first enter all the coordinates of the vertices and calculate the area, then enter the curve segments and recalculate the area. Start at one at one point and work in either the clockwise or the counterclockwise motion.
Hence:
1. Enter initial coordinates (x0, y0): y0 ENTER x0 LBL A
2. Enter additional coordinates: y ENTER x LBL B
3. Calculate area with coordinates: LBL C
4. Enter radius and central angle, in HMS format: radius ENTER angle LBL D
5. Calculate final area: LBL E
When entering the radius and central angles, use positive values for radius for "outies", chord lines that add to the area. Use negative values for "innies", or chords that cut across the area. The 15C should be in Degrees mode.
The Expanded Program
Here is the program in full. Instructions in bold red are contributed by Jason Foose.
Memory registers used:
R0 = area
R1 = x_i
R2 = y_i
R3 = x_i+1
R4 = y_i+1
R5 = Σ (x_i * y_i+1) // ( i=1...n and cycle back to 1)
R6 = Σ (x_i+1 * y_i)
R7 = x_1
R8 = y_1
Program:
001 42, 21, 11 LBL A // enter initial vertex
002 0 0
003 44 5 STO 5
004 44 6 STO 6
005 33 R down // R↓
006 44 1 STO 1
007 44 7 STO 7
008 33 R down
009 44 2 STO 2
010 44 8 STO 8
011 43 32 RTN
012 42, 21, 12 LBL B // step 12 - add verticies
013 43 3 STO 3
014 45, 20, 2 RCL× 2
015 44, 40, 6 STO+ 6
016 33 R down
017 44 4 STO 4
018 45, 20, 1 RCL× 1
019 44, 40, 5 STO+ 5
020 45 4 RCL 4
021 44 2 STO 2
022 45 3 RCL 3
023 44 1 STO 1
024 43 32 RTN
025 42, 21, 13 LBL C // step 25 - calculate area with vertices
026 45 7 RCL 7
027 45, 20, 2 RCL× 2
028 44, 40, 6 STO+ 6
029 45 8 RCL 8
030 45, 20, 1 RCL× 1
031 44, 40, 5 STO+ 5
032 45, 5 RCL 5
033 45, 30, 6 RCL- 6
034 43 16 ABS
035 2 2
036 10 ÷
037 44 0 STO 0
Keystrokes:
Starting at Point (100, 100)
Coordinates:
100 ENTER 100 LBL A
100 ENTER 400 LBL B
200 ENTER 500 LBL B
300 ENTER 500 LBL B
300 ENTER 225 LBL B
425 ENTER 100 LBL B
LBL C \\ Area: 1.9011 acres
Add segments:
100 ENTER 90 LBL D \\ "outie" angle = 90
125 ENTER 90 CHS LBL D \\ "innie" angle = -90
LBL E \\ Area: 1.8643 acres
Special thanks to Jason Foose for the great addendum to the area by vertices program.
Eddie
Saturday, June 14, 2014
HP Prime: Equations of Motion Under Constant Power
Considering Power
The Program CARFORCE
BEGIN
// 2014-07-25 EWS
. use decimal conversions
I:=22/15*I; // mph to ft/s
M:=M/32.1740485564;
L0:={Z,A*15/22,V*15/22,X};
Symmetric Quartic Equation - Python
Symmetric Quartic Equation - Python Note: The code is programmed with a TI-84 Evo. No modules are used, so the scripts should be adopt...
