Thursday, October 23, 2014

Fun with the HP 12C


I used the classic HP 12C, with the 99 step capacity.  Even without the trig functions, we can do a lot.

Eddie
 

Calculating f(x) = p * ∑(a^k, k=1 to n) using the TVM Keys

 
Input:
[ n ] = n
R0 = a
R1 = p

Program:

STEP
KEY
CODE
01
BEGIN
43 7
02
RCL 0
45 0
03
1
1
04
-
30
05
EEX
26
06
2
2
07
*
20
08
[i]
12
09
RCL 1
45 1
10
CHS
16
11
[PMT]
14
12
[FV]
15
13
END
43 8
14
GTO 00
43 33 00

 

Examples:

n = 60, R0 = 1.01, R1 = 350.  Result:  28,870.2283

n = 5, R0 = 2, R1 = 10.05.   Result:  623.1

 

Heron’s Formula

Area of a Triangle with side lengths a, b, and c.

Area = √(s*(s-a)*(s-b)*(s-c)) where s = (a+b+c)/2

Input:
R1 = a
R2 = b
R3 = c


Program:

STEP
KEY
CODE
01
RCL 1
45 1
02
RCL 2
45 2
03
+
40
04
RCL 3
45 3
05
+
40
06
2
2
07
÷
10
08
STO 4
44 4
09
RCL 4
45 4
10
RCL 1
45 1
11
-
30
12
RCL 4
45 4
13
RCL 2
45 2
14
-
30
15
*
20
16
RCL 4
45 4
17
RCL 3
45 3
18
-
30
19
*
20
20
RCL 4
45 4
21
*
20
22
√
43 21
23
GTO 00
43

 

Example:   a = 5, b = 5, c = 6.  Result:  12

Projectile Motion without Air Resistance:  With the projectile being launched at 45° at velocity V.  The maximum distance will be achieved at these conditions.


Theoretical Maximum Distance:
R_max = v^2/g (in feet)

Theoretical Height of the Projectile (at x = R_max/2)
H = v^2/(4g)  (in feet)

Where g = 32.17404 ft/s^2

If you desire meters, substitute g = 9.80665 m/s^2 instead.

Run the program with V in the display.  The velocity is assumed to be feet/second.  The maximum distance is calculated, then the projectile’s theoretical height.

Program:

STEP
KEY
CODE
01
2
2
02
Y^X
21
03
3
3
04
2
2
05
.
48
06
1
1
07
7
7
08
4
4
09
0
0
10
4
4
11
÷
40
12
R/S
31  (display R)
13
4
4
14
÷
40
15
GTO 00
43 33 00 (display H)

 Example:  V = 40  ft/s
Results:  R = 49.7295 ft,  H = 12.4324 ft
 
Factorials of Large Integers

N! =  N * (N-1) * (N-2) * … * 1

**For large n, this program will take time if you have an HP 12C that was manufactured in the 1980s.


Input n, press R/S. 
The mantissa is displayed.  Press R/S
The exponent is displayed (10^exponent).

 Program:

STEP
KEY
CODE
01
STO 0
44 0
02
0
0
03
STO 1
44 1
04
RCL 0
45 0
05
LN
43 23   // loop begins
06
STO+ 1
44 40 1
07
1
1
08
STO- 0
44 30 0
09
RCL 0
45 0
10
1
1
11
-
30
12
X=0
43 35
13
GTO 15
43 33 15   // end of loop
14
GTO 04
43 33 04
15
RCL 1
45 1
16
1
1
17
0
0
18
LN
43 23
19
÷
10
20
STO 1
44 1
21
ENTER
36
22
FRAC
43 24
23
1
1
24
0
0
25
X<>Y
34
26
Y^X
21
27
R/S
31  // mantissa
28
X<>Y
34
29
INTG
43 25 // exponent
30
GTO 00
43 33 00

 
Example: 

50! » 3.0414 * 10^64
50 R/S
Result:  3.0414 R/S 64

76! » 1.8855 * 10^111
76 R/S
Result:  1.8855 R/S 111

Degrees Minutes Seconds to Decimal Degrees

2°51’32.4” -> 2.859

Type input as DD.MMSSSS (degrees, minutes, seconds). For our example, the input would be 2.51324.

 Program:

STEP
KEY
CODE
01
STO 0
44 0
02
INTG
43 25
03
STO 1
44 1
04
RCL 0
45 0
05
FRAC
43 24
06
EEX
26
07
2
2
08
*
20
09
INTG
43 25
10
6
6
11
0
0
12
÷
10
13
STO+ 1
44 40 1
14
RCL 0
45 0
15
EEX
26
16
2
2
17
*
20
18
FRAC
43 24
19
3
3
20
6
6
21
÷
10
22
STO+ 1
44 40 1
23
RCL 1
45 1
24
GTO 00
43 33 00

Decimal Degrees to Degrees Minutes Seconds

 2.859 -> 2°51’32.4”

Answer displayed as DD.MMSSSS (degrees minutes seconds)

Program:

01
STO 0
44 0
02
INTG
43 25
03
STO 1
44 1
04
RCL 0
45 0
05
FRAC
43 24
06
6
6
07
0
0
08
*
20
09
ENTER
36
10
INTG
43 25
11
EEX
26
12
2
2
13
÷
10
14
STO+ 1
44 40 1
15
R-Down
33
16
FRAC
43 24
17
6
6
18
0
0
19
*
20
20
EEX
26
21
4
4
22
÷
10
23
STO+ 1
44 40 1
24
RCL 1
45 1
25
GTO 00
43 33 00

 
This blog is property of Edward Shore - 2014

 

 

Monday, October 20, 2014

Quick Approximation: Declination and Right Ascension of the Sun

CAUTION:  The formulas presented provide a quick, but crude approximation of the position of our sun.  Search for astronomical algorithms if you want more accurate formulas and algorithms. 

I thought it would be fun if I could try to use the curve fitting features of a calculator to obtain an approximate formula of the position of the sun.  Like longitude and latitude on Earth, the celestial objects (planets, stars, comets, asteroids, etc...) are mapped using a system of coordinates:

Right Ascension - measured in hours-minutes-seconds (0:00:00 to 23:59:59.99)
Declination - measured in degrees-minutes-seconds (0° to 359°59'59.99")

I used an HP Prime to take a sample of points and used the curve-fitting features in the Statistics 2Var app. 

 The sources are:

Right Ascension:

Right Ascension Table - 2014. Data calculated by Kevin Krisciunas - Texas A&M University.  Webpage retrieved October 15, 2014. 

Link:  http://people.physics.tamu.edu/krisciunas/ra_dec_sun_2014.html

For the approximation formula, I chose 100 random points.

Declination:

"Table of the Declination of the Sun.   Mean Value for the Four Years of a Leap-Year Cycle"
Data compiled by Walter Sanford.  Webpage retrieved October 16, 2014.

Link:  http://www.wsanford.com/~wsanford/exo/sundials/DEC_Sun.html

For the approximation formula, I chose 120 random points.

These formulas are based on the 365-day calendar, where x is the number of days from March 21.  Use radians mode:

Right Ascension (100 random points):
a = 0.0659021173575*x - 0.0873505413785

Declination (120 random points):
d = 23.2834823404 * sin(0.0171866755814*x - 0.0283271293265) + 0.391501633262


This blog is property of Edward Shore.  2014











 

Friday, October 17, 2014

sin(atan x), sin(acos x), cos(asin x), cos(atan x), tan(asin x), tan(acos x)

Deriving trig functions where the angle is an inverse trig function. Example: sin(acos x).

Inverse Functions

sin(asin t) = t
cos(acos t) = t
tan(atan t) = t

Other such calculations can be derived from the three Pythagorean trig identities:

sin^2 x + cos^2 x = 1
sec^2 = 1 + tan^2 x
1 + cot^2 x = csc^2 x

sin^2 x + cos^2 x = 1

Also known as (sin x)^2 + (cos x)^2 = 1

Let x = asin t where -1 ≤ t ≤ 1
(sin(asin t))^2 + (cos(asin t))^2 = 1
t^2 + (cos(asin t))^2 = 1
(cos(asin t))^2 = 1 - t^2
cos(asin t) = √(1 - t^2)

Let x = acos t, -1 ≤ t ≤ 1
(sin(acos t))^2 + (cos(acos t))^2 = 1
(sin(acos t))^2 = 1 - (cos(acos t))^2
(sin(acos t))^2 = 1 - t^2
sin(acos t) = √(1 - t^2)

sec^2 x = 1 + tan^2 x

sec^2 x = 1 + tan^2 x
1/cos^2 x = 1 + tan^2 x

Let x = atan t, -1 ≤ t ≤ 1

1/(cos(atan t))^2 = 1 + (tan(atan t))^2
1/((cos(atan t))^2 = 1 + t^2
(cos(atan t))^2 = 1/(1 + t^2)
cos(atan t) = √(1/(1 + t^2))

Let x = acos t, -1 ≤ t ≤ 1

1/(cos(acos t))^2 = 1 + (tan(acos t))^2
1/t^2 = 1 + (tan(acos t))^2
(tan(acos t))^2 = 1/t^2 - 1
(tan(acos t))^2 = (1 - t^2)/t^2
(tan(acos t)) = √(1 - t^2)/t

1 + cot^2 x = csc^2 x

1 + cot^2 x = csc^2 x
1 + 1/tan^2 x = 1/sin^2 x

Let x = asin t, -1 ≤ t ≤ 1

1 + 1/(tan(asin t))^2 = 1/(sin(asin t))^2
1/(tan(asin t))^2 = 1/t^2 - 1
1/(tan(asin t))^2 = (1 - t^2)/t^2
(tan(asin t))^2 = t^2/(1 - t^2)
tan(asin t) = t/√(1 - t^2)

Let x = atan t, -1 ≤ t ≤ 1

1 + 1/(tan(atan t))^2 = 1/(sin(atan t))^2
1 + 1/t^2 = 1/(sin(atan t))^2
(t^2 + 1)/t^2 = 1/(sin(atan t))^2
(sin(atan t))^2 = t^2/(t^2 + 1)
sin(atan t) = t/√(t^2 +1)

Summary:



cos(asin t) = √(1 - t^2)
sin(acos t) = √(1 - t^2)
cos(atan t) = √(1/(1 + t^2))
tan(acos t) = √(1 - t^2)/t
tan(asin t) = t/√(1 - t^2)
sin(atan t) = t/√(t^2 +1)


This blog is property of Edward Shore. 2014

Sunday, October 12, 2014

New Video: Four-Function Calculator Tricks

With a four-function calculator you can:

* add fractions
* square numbers
* find the area of a circle
* solve quadratic equations
* solve 2 x 2 linear systems


and more!


http://youtu.be/PgjDZ-yi1_Y

Enjoy!  Eddie


This blog is property of Edward Shore - 2014.

 

Saturday, October 11, 2014

My Day at JPL Open House in Pasadena, CA

An appropriate calculator to take to JPL, since the HP 41C was involved in space travel. 

If you get a chance, you are in the Los Angeles area, and the topics of astronomy, geology, and engineering interest you; I recommend that you visit the Jet Propulsion Laboratory in Pasadena, CA.  JPL is having an open house this weekend (October 11 and 12, 2014), from 9:00 AM to 4:00 PM Pacific time.  

Link to directions is here:  http://www.jpl.nasa.gov/events/open-house.php 


I would like to share some of the fascinating things I learned about in today's trip.  Even though I may not present much mathematics today, I promise mathematics is involved.

  • The atmosphere of the planet Venus is so toxic, even lead melts on Venus.


  • The LDSD, Low-Density Supersonic Decelerator, is currently being developed and in the testing stage.  The aim is for the LSDS to able to transfer large payloads, allowing for developing large parachutes and drag devices to one day transfer large facilities and human beings to the planet Mars.  Testing will continue through 2015.


  • We will need to be 30 miles in the air from Earth to match the air density of Mars.  At the surface, the air density of Mars is about 1% of Earth's air density.


  • Currently, it takes about 9 months for spacecraft to travel from Earth to Mars.  


  • The speed of sound in dry air on a 68°F (20°C) day is about 342.604 m/s, or about 766.383 mph.  The true speed depends on air density and temperature.  According to NASA, a simple formula to approximate the speed of sound in air is:  



McMurdo Crater, Mars (3D Picture)


  • The above picture of a panorama of the McMurdo Crater on the planet Mars (we needed 3D glasses to see it properly) was made possible because a rover named Spirit could not get enough solar energy to move, instead what little energy it could get was spent taking a picture of the surrounding area.  A long winter in 2006 (on Mars) caused this.  



A Model of Dawn


  • Dawn, a space probe launched in 2007, which runs on ion propulsion explores two of the prominent objects in the solar system's asteroid belt:  the asteroid Vesta and dwarf planet Ceres.  The gas used for ion propulsion is xenon (atomic number 54), which occurs in our atmosphere.  The ion propulsion allows Dawn to achieve incredible speed and efficiency.  However, ion propulsion will probably not be present in automobiles because in order for the propulsion to work properly, friction cannot be present.


  • Encleadus (pronounced en-sell-ah-dus), a moon of Saturn, jets of ice water that sprays through the surface.  However, don't expect humans to live there because average temperature is -330°F (yes, it's that cold!).


  • Europa, a moon of Jupiter, is covered has an ice surface that covers a layer of liquid water.  Scientists theorize that there may be extraterrestrial life in the underground ocean.  


  • The spacecraft Cassini has been exploring Saturn for 10 years.  Since then, we discovered 7 moons of Saturn.  Cassini's final destiny, estimated to be in 2017, is to head into Saturn's atmosphere.

A model of the CG comet  (67P/Churymov-Gerasimenko) - Rosetta is scheduled to land on it November 12, 2014

  • The Rosetta satellite will be the first satellite to attempt to land on a comet.  Specifically, the CG comet, formally known as the 67P/Churyumov-Gerasimenko.  Landing is scheduled to be on November 12, 2014, 5:30 to 9:30 AM, Pacific Time. ( http://rosetta.jpl.nasa.gov/news/rosetta-deploy-lander-november-12  ) No word on whether we will be learning a new language.  

NASA has several spacecraft that focuses on our place in the Universe, the planet Earth.  Some are:

  • AirMOSS (Airborne Microwave Observatory of Subcanopy and Subsurface) measures soil moisture of North America over nine different climate areas.  The primary mission of AirMOSS to measure the health of Earth's vegetation and calculate the net ecosystem exchange (how much carbon enters and exit our ecosystem).


  • UAVSAR (Uninhibited Aerial Vehicle System Aperture Radar) measures how earthquakes, volcanoes, and other similar events affect Earth.  UAVSAR has been used in measuring the effects of the June 2010 Gulf of Mexico Oil Spill and the August 24, 2014 Napa Valley earthquake.


Measuring the salt content of the Earth's oceans with Aquarius


  • The primary objective of the NASA Aquarius mission (Aquarius is shown above) is to measure the salinity of Earth's oceans and any changes that occur.  Because salt adds mass to water, fresh water floats on top of salty, ocean water.   Astrologers will probably be disappointed because this satellite will not calculate natal charts of babies born in the future.  


Screenshot of the EYES on the Solar System software

  • There is an online 3D interactive software that allow you to explore the Solar System and travel of NASA's space probes.  You can even see the action happen against the background of constellations.  The software is free, and it is at:  http://eyes.nasa.gov/download.html.   There was a demo of it in the Solar System Exploration exhibit and it looked super impressive.  Right now, there is only a PC version, but Android and iOS versions are in the works.  The software requires that you are connected to the internet.  


There is so much more to explore.  I didn't get to the exhibits where spacecraft and robotic technology are assembled and fabricated.  If you go, go early, as lines can grow very long as the day passes by.

I hope you find this enjoyable. If you get a chance, go; October 12 (Sunday) is the last day of the open house.   

Take care everyone,

Eddie


This blog is property of Edward Shore.  2014



Thursday, October 9, 2014

What I'm Doing- and HP35S Complex Number Extraction

Here is what I am working on:

* A program that simulate RPN keystroke programming for the HP Prime.  It is in its testing stage right now, but the idea is that the keystroke programming simulation will have two programs.  One is where the macro is created, you use the keyboard.  The result is list of strings that symbolizes commands, which can be saved.  The other program runs those macros.

*  I want to do a video on several calculator tricks for the basic, four function calculator for my YouTube channel.  In October 2012, I posted a five part series on basic calculator tricks.  The link to Part 1 is here:  http://edspi31415.blogspot.com/2012/10/calculator-tricks-part-1.html  

What is the timeline for these two?  I hope to have the first version of the macro program out by December 2014.  As far as the video is concerned, I have no definite date, but hopefully sooner rather than later.  

I will be going to the NASA JPL (Jet Propulsion Laboratories) Open House in Pasadena, California this Saturday.  I plan to be meeting several good friends there, including my friend from college, Jon Neal.  Here is some information on the Open House that will take place this weekend:  http://www.jpl.nasa.gov/events/open-house.php

In the meantime, here are three utilities you may find useful for the HP35S:

Extract the real part of a complex number:
The complex number is on the X stack.
A001 LBL A
A002 ENTER
A003 ABS
A004 x<>y
A005 ARG
A006 COS
A007 x
A008 RTN

Extract the imaginary part of a complex number:
The complex number is on the X stack.
B001 LBL B
B002 ENTER
B003 ABS
B004 x<>y
B005 ARG
B006 SIN
B007 x
B008 RTN

Polar to Rectangular Conversion:
Calculate a+bi, given:
*  angle (argument) stored in X and,
*  modulus (absolute value) Y:
C001 LBL C
C002 RCL X
C003 COS
C004 RCLx Y
C005 RCL X
C006 SIN
C007 RCLx Y
C008 i
C009 x
C010 +
C011 RTN

Talk to you soon!

Eddie



This blog of property of Edward Shore, 2014


Thursday, October 2, 2014

PCalc 3.3: Some of the new features

One of my favorite iOS calcualtor apps is PCalc by James Thompson. Recently, PCalc received an update to Version 3.3. Here are some of the new features:


If you Handoff, the PCalc will allow you to start calculations on one iOS device and transfer it to another. You will need Bluetooth and a cloud account.

Another new feature is the ability to turn operator precedence off. Do that and the PCalc operates like a basic four function calculator, with scientific functions. In this mode, be careful what order of keys you press as every operation affects the number in the display. The option of turning operator precedence is available when RPN mode is turned off.

And now for my favorite new feature: customizable keyboards. Each of the keyboards, one that shown when the iOS device is in portrait orientation and one that is shown in landscape orientation, can be individually customized. Each key can activate functions, user created programs, and access to option menus. The keyboard has two planes: one for "first" functions and one for functions that are acessed by press on the 2nd key. If you want keys to have two functions, then you will need to create a key for each plane. You can also change the size of each key, give the key a custom name, and change the font size of each key. Colors of the keys themselves are still determined by the theme you select in the app's options.

Additional new features include widget notification and an expanded list of Bluetooth keyboard shortcuts. PCalc is currently sold for $9.99 in the App Store.


Eddie

This blog is property of Edward Shore. 2014


Python: Drawing a Ring of Circles

Python: Drawing a Ring of Circles The goal: Draw a number of circles that revolve around the origin (0,0). The center of each circle i...