Sunday, August 13, 2017

HP 32SII: Tracing the Orbit Coordinates

HP 32SII:  Tracing the Orbit Coordinates

The following program tracks the position (x,y) of a satellite in orbit by solving the pair of second-order differential equations:

d^2 x/dt^2 = -α * x * (x^2 + y^2)^-1.5

d^2 y/dt^2 = -α * y * (x^2 + y^2)^-1.5

For planetary orbits, α = G * M

Variables and Labels

Labels Used:  4 (A, B, C, D)

Variables Used:
Pre stored variables:
X = x0, initial x position
U = dx/dt, velocity of x coordinate
Y = y0, initial y position
V = dy/dt, velocity of y coordinate
C = Δt, desired time increment
A = α, gravitational force factor

If you are analyzing planetary orbits, then α = G * M where M is the mass of the center object and G is the Universal gravitational constant, G = 6.67384 * 10^-11 (m^3)/(s^2 * kg). 

Other:
T = t

This program is based off of the HP 25S and program authored Robert M. Eisberg. (see the source below)

HP 32SII Program (87.5 bytes)

A01 LBL A   // start of program
A02 0
A03 STO T   // initialize time variable
C01 LBL C
C02 RCL Y
C03 RCL Y
C04 x^2
C05 RCL X
C06 x^2
C07 +
C08 -1.5
C09 y^x
C10 RCL A
C11 *
C12 *       // calculate –α*y*(x^2 + y^2)^-1.5
C13 LASTx 
C14 RCL X
C15 *      // calculate –α*x*(x^2 + y^2)^-1.5
C16 RCL T
C17 x=0?
C18 GTO B
C19 R↓
D01 LBL D
D02 RCL C
D03 *
D04 STO- U
D05 R↓
D06 RCL C
D07 *
D08 STO- V
D09 RCL C
D10 STO+ T
D11 RCL U
D12 *
D13 STO+ X
D14 RCL X
D15 STOP       // view X
D16 RCL C
D17 RCL V
D18 *
D19 STO+ Y
D20 RCL Y
D21 STOP       // view Y
D22 GTO C      // start a new loop
B01 LBL B
B02 R↓
B03 2
B04 ÷
B05 x<>y
B06 2
B07 ÷
B08 x<>y
B09 GTO D

During execution, recall T for the time variable.  Run by XEQ A.

Example

Pre stored variables:
X = 1.5
U = 0.18
Y = 1.5
V = 0.23
C = 1
A = α = 1

Table:
T =
X =
Y =
0   (initial)
1.5
1.5
1
1.6014
1.6514
2
1.5713
1.6672
3
1.4105
1.5443
4
1.0956
1.2527
5
0.5429
0.6892
6
-0.8138
-0.8949

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

Eddie


This blog is property of Edward Shore, 2017.

Saturday, August 12, 2017

Geometry: The Intersection Point of a Quadrilateral

Geometry: The Intersection Point of a Quadrilateral




The Setup

We are given four points, A, B, C, and D, as four Cartesian coordinates.  We connect the four points, starting with A, in a clockwise form to form a quadrilateral.  We will designate each points as the coordinates:

A:  (ax, ay)
B:  (bx, by)
C:  (cx, cy)
D:  (dx, dy)

Draw a line from one corner to the opposite corner.  This results in two lines: AC and DB.  The two lines (show above in lime green) meet at point P.  The goal is determine the coordinates of P.

Slope

We know the equation of the line is y = m*x + b, where m is the slope and b is the y-intercept. Note that:

y = m*x + b
y – m*x = b

In geometry, the slope of a line containing two points is generally defined as:

m = (change in y coordinates)/(change in x coordinates) = Δy/Δx = (y2 – y1)/(x2 – x1)

The slope of AC:   SAC = (cy – ay)/(cx – ax)

The slope of BD:  SBD = (dy – by)/(dx –bx)

The Intercept

We can easily deduce that solving the general equation of the line y = m*x + b for the intercept yields b = y – m*x.  If follows that:

The intercept of AC:  IAC = cy – SAC * cx = ay – SAC *ax

The intercept of BD:  IBD = by – SBD * bx = dy – IBD *dx

Finding the Intersection Point

Now that the slopes and intercepts are determined, we can form the following system of equations:

(I) y = SAC * x + IAC
(II) y = SBD * x + IBD

Solving for x and y will find our intersection point P (px, py).  Subtracting (II) from (I) (see above):

0 = (SAC – SBD) * x + (IAC – IBD)

We can solve for x.

-(IAC – IBD) = (SAC – SBD) * x
(-1*IAC - -1*IBD) = (SAC – SBD) * x
(-IAC + IBD) = (SAC – SBD) * x
(IBD – IAC) = (SAC – SBD) * x

Hence:

x = px = (IBD – IAC)/(SAC – SBD)

It follows that we determine y by either equation (I) or (II):

y = py = SAC * px + IAC = SBD * px + IBD


Our desired coordinates of point P are found.

Eddie

This blog is property of Edward Shore, 2017.
x

Thursday, August 10, 2017

Casio fx-3650p and HP 21S: Minimum Loss Matching

Casio fx-3650p and HP 21S: Minimum Loss Matching



This program takes the incoming impedances Z0 (from left) and Z1 (from right), and determines the resistance R1 and R2, with the corresponding minimum loss.  The program assumes that Z0 and Z1 are both positive and Z0 ≥ Z1. 

Formulas Used:

R1 = Z0 * √(1 – Z1/Z0)
R2 = Z1 / √(1 – Z1/Z0)
Minimum loss = 20 * log (√(Z1/Z0) + √(Z1/Z0 -1))

Casio fx-3650P

Input:  X = Z0, Y = Z1
Program (49 steps):

? → X : ? → Y : Y ÷ X → M :
X √ ( 1 – M → A ◢
Y √ ( 1 – M → B ◢
20 log ( √ M ^-1 + √ ( M ^-1 – 1 → C

HP 21S

Input:  Z0 gets stored in register 0, Z1 gets stored in register 1

Program (44 steps):

Step
Code
Key
Notes
01
61, 41, C
LBL C
Start the program
02
22, 1
RCL 1
Z1
03
45
÷

04
22, 0
RCL 0
Z0
05
74
=

06
21, 4
STO 4

07
33
(

08
1
1

09
65
-

10
22, 4
RCL 4

11
34
)

12
11
√

13
21, 5
STO 5

14
55
*

15
22, 0
RCL 0

16
74
=

17
21, 2
STO 2

18
26
R/S
Display R1
19
22, 1
RCL 1

20
45
÷

21
22, 5
RCL 5

22
74
=

23
21, 3
RCL 3

24
26
R/S
Display R2
25
33
(

26
22, 4
RCL 4

27
15
1/x

28
11
√

29
75
+

30
33
(

31
22, 4
RCL 4

32
15
1/x

33
65
-

34
1
1

35
34
)

36
11
√

37
34
)

38
51, 13
LOG

39
55
*

40
2
2

41
0
0

42
74
=

43
21, 5
STO 5
Display minimum loss (Z)
44
61, 26
RTN



Example:

Input:  Z0 = 50, Z1 = 45
Results: R1 = 15.8113883008, R2 = 142.302494708, Min Loss = 2.84419586692

Source:  Casio Scientific Formula 128 fx-1000F/fx-5000F owner’s manual, 1987

Eddie


This blog is property of Edward Shore, 2017

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