Thursday, June 30, 2016

Fun With the HP 71B III

Fun With the HP 71B III


3x3 Matrices: Determinant, Inverse, 3x3 Linear Systems
EWS 6/29/2016

The program MATX3 calculates:

1. The determinant and (if possible), the inverse of a 3x3 matrix M.
2. The solution to a 3x3 linear system: Mq=D. The determinant of M will also be displayed.

If det(M) = 0, then the matrix is singular and execution stops.

The matrix M is broken into three columns (3x1 arrays): [ M ] = [ A | B | C ].

Hence M = [[ A1 B1 C1 ] [ A2 B2 C2 ] [ A3 B3 C3 ]]

Other variables used:
E = det(M)
I = M^-1. Unlike M, I will be a 3 x 3 array.
R, K, S, H: other variables used

Program MATX3 (767 bytes)
10 DESTROY A,B,I,C,R,K,S,H,D,Q
11 DISP “1. DET/INV  2. 3x3” @ WAIT 2
12 INPUT “1. D/I 2. SYS:”; H
13 DIM A(3),B(3),C(3),I(3,3),D(3)
14 OPTION BASE 1
20 FOR K=1 TO 3
21 DISP “ROW “;K @ WAIT 1
22 INPUT “A:”; A(K)
24 INPUT “B:”; B(K)
26 INPUT “C:”; C(K)
28 IF H=2 THEN INPUT “D:”; D(K)
30 NEXT K
40 DEF FND(X,Y,Z,T)=X*T-Y*Z
42 E=A(1)*FND(B(2),C(2),B(3),C(3))
44 E=E-B(1)*FND(A(2),C(2),A(3),C(3))
46 E=E+C(1)*FND(A(2),B(2),A(3),B(3))
50 DISP “DET:”; E
52 IF E=0 THEN STOP
60 I(1,1)=FND(B(2),B(3),C(2),C(3))/E
62 I(1,2)=-FND(B(1),B(3),C(1),C(3))/E
64 I(1,3)=FND(B(1),B(2),C(1),C(2))/E
66 I(2,1)=-FND(A(2),A(3),C(2),C(3))/E
68 I(2,2)=FND(A(1),A(3),C(1),C(3))/E
70 I(2,3)=-FND(A(1),A(2),C(1),C(2))/E
72 I(3,1)=FND(A(2),A(3),B(2),B(3))/E
74 I(3,2)=-FND(A(1),A(3),B(1),B(3))/E
76 I(3,3)=FND(A(1),A(2),B(1),B(2))/E
78 IF H=2 THEN 100
80 FOR R=1 TO 3
82 FOR S=1 TO 3
84 DISP “I(“; R; “,”; S; “):”; I(R,S)
86 PAUSE
88 NEXT S
90 NEXT R
92 STOP
100 DIM Q(3)
102 FOR K=1 TO 3
104 Q(K)= I(K,1)*D(1) + I(K,2)*D(2) + I(K,3)*D(3)
106 DISP “Q”; K; “:”; Q(K) @ PAUSE
108 NEXT K

Example:

M = [[ 1, 2, -8 ] [ 0, -2, 9.5 ] [ 3.2, 2.7, -1 ]]
D = [[ 0.5 ] [ 1.5 ] [ 2.5 ]]

DET = -14.05
I ≈ [[ 1.6833, 1.3950, -0.2135 ] [ -2.1637, -1.7509, 0.6762 ] [ -0.4555, -0.2633, 0.1423 ]]

Solutions:
Q ≈ [[ 2.4004 ] [ -2.0178 ] [ -0.2669 ]]

Days From January 1, Days Between Dates
HP 71B – Day Counts

Number of Days from January 1

D = Day
M = Month
L = Leap Year indicator (1 if the year is a leap year, 0 if it is not)

Program DAYJAN1 (183 bytes)
10 DESTROY D,M,L,N
12 INPUT “MONTH:”; M
14 INPUT “DAY:”; D
16 INPUT “LEAP? (Y=1,N=0):”; L
20 IF M>2 THEN 28
21 REM M<=2
22 N=IP(30.6*(M+13))+D-429
24 GOTO 32
27 REM M>2
28 N=IP(30.6*(M+1))+D+L-64
32 DISP “# DAYS:”; N

Test 1: January 1 to May 29, non-leap year (L=0). Result: 148
Test 2: January 1 to May 29, leap year (L=1). Result: 149

Days between Dates

M, D, Y: Month, Day, four-digit year

Program DDAYS (299 bytes)
10 DESTROY M1, M2, D1, D2, Y1, Y2, F1, F2
11 DESTROY F,M,D,Y,N,X,Z
12 INPUT “1: M,D,Y:”; M1, D1, Y1
13 INPUT “2: M,D,Y:”; M2, D2, Y2
15 M=M1 @ D=D1 @ Y=Y1
17 GOSUB 40
19 F1=F
21 M=M2 @ D=D2 @ Y=Y2
23 GOSUB 40
25 F2=F
27 N=F2-F1
29 DISP “# DAYS:”; N
31 STOP
40 IF M>2 THEN X=IP(.4*M+2.3) ELSE X=0
42 IF M>2 THEN Z=Y ELSE Z=Y-1
44 F=365*Y+31*(M-1)+D+IP(Z/4)-X
46 RETURN

Test 1: January 2, 2015 to March 17, 2016 (1,2,2015 to 3,17,2016). Result: 440
Test 2: March 14, 1977 to June 29, 2016 (3,14,1977 to 6,29,2016). Result: 14352

Great Circle Distance

N: Longitude
E: Latitude

Separate Degrees (H), Minutes (M), and Seconds (S) during input
Program GRCIC (367 bytes)
10 DESTROY D,M,H,S
11 DESTROY N1,N2,E1,E2,G
12 DEGREES
14 DISP “N: LATITUDE” @ WAIT 1
16 DISP “E: LONGITUDE” @ WAIT 1
20 INPUT “N1: D,M,S:”; H,M,S
21 GOSUB 50
22 N1=D
25 INPUT “E1: D,M,S:”; H,M,S
26 GOSUB 50
27 E1=D
30 INPUT “N2: D,M,S:”; H,M,S
31 GOSUB 50
32 N2=D
35 INPUT “E2: D,M,S:”; H,M,S
36 GOSUB 50
37 E2=D
40 REM CALCULATION
41 G=SIN(N1)*SIN(N2)+COS(N1)*COS(N2)*COS(E1-E2)
42 G=ACOS(G)*3959*PI/180
44 DISP “DIST: “; G; “ MI”
46 STOP
50 D=SGN(H)*(ABS(H)+M/60+S/3600)
52 RETURN

Test:
Los Angeles, N = 34°13’0” and E = -118°15’0”
San Francisco, N = 37°47’0” and E = -112°25’0”
Distance ≈ 408.5961 mi

Euclid Division – Finding the GCD

Finds the GCD (greatest common divisor) between integers M and N.  The program displays a “calculating” screen while the calculation is in process.

Program EUCLID (143 bytes)
10 DESTROY M,N,A,B,C
15 INPUT “M,N:”; M,N
20 IF M>N THEN A=M  @ B=N
22 IF M<N THEN A=N @ B=M
30 C= A – IP(A/B)*B
35 DISP C;B;A   // this is the “busy” indicator
40 IF C=0 THEN 50
45 A=B @ B=C @ GOTO 30
50 DISP “GCD:”; B

Test 1:  M=144, N=14;  Result: 2
Test 2:  N=14, M=144;  Result: 2

Fractions:  Addition and Multiplication

Adds or multiplies two fractions W/X and Y/Z.  Gives the result in the simplest form.  Proper or improper fractions only.

Separate each part with a comma (W,X,Y,Z) as prompted.

Program FRAC (380 bytes)
10 DESTROY W,X,Y,Z,N,D,H,A,B,C
20 INPUT “1. + 2. *:”,H
24 ON H GOTO 41,51
41 REM ADD
42 INPUT “W/X+Y/Z:”; W,X,Y,Z
44 N=W*Z+X*Y @ D=X*Y
46 GOSUB 61
48 DISP “=”; N; “/”; D @ STOP
51 REM MULT
52 INPUT “W/X*Y/Z:”; W
54 N=W*Y @ D=X*Z
56 GOSUB 61
58 DISP “=”; N; “/”; D @ STOP
61 REM SIMPLIFY
62 IF N>D THEN A=N @ B=D
64 IF D>N THEN A=D @ B=N
66 IF D=N THEN N=1 @ D=1 @ RETURN
68 C= A – IP(A/B)*B
69 DISP C;B;A
70 IF C=0 THEN 74
72 A=B @ B=C @ GOTO 68
74 N=N/B @ D=D/B @ RETURN

Test 1:  4/7 + 3/13;   Input:  4,7,3,13.  Result:  73/91
Test 2: 4/7 * 3/13; Input: 4,7,3,13.  Result:  12/91

Statistics: Regression

The program CURVEFIT fits data to one of five regression models:

1.  Linear Regression:  y = a + bx
2.  Exponential Regression:  y = a * e^(b*x)
3.  Logarithm Regression: y = a + b * ln x
4.  Power Regression:  y = a * x^b
5.  Inverse Regression:  y = a + b/x

On the HP 71, the ln function is represented by LOG.

The program will allow different calculations with the same data set.

Program CURVEFIT (622 bytes)
10 DESTROY H,S,D,X,Y,A,B,E
12 STAT S(2) @ CLSTAT
20 REM CHOOSE REG
22 DISP “1. LIN 2. EXP 3. LOG” @ WAIT 1.5
24 DISP “4. POW 5. INV” @ WAIT 1.5
28 INPUT “CHOICE #:”; H
29 IF E=1 THEN 60
30 REM INPUT PROCESS
32 INPUT “X,Y:”; X,Y
34 ON H GOTO 36,38,40,42,44
36 ADD X,Y @ GOTO 46
38 ADD X,LOG(Y) @ GOTO 46
40 ADD LOG(X),Y @ GOTO 46
42 ADD LOG(X),LOG(Y) @ GOTO 46
44 ADD 1/X,Y @ GOTO 46
46 INPUT “DONE? (Y=1,N=0):”; D
48 IF D=0 THEN 32
60 LR 2,1,A,B
62 IF H=2 OR H=4 THEN A=EXP(A)
64 ON H GOTO 70,72,74,76,78
70 DISP A; “+”; B; “x” @ GOTO 80
72 DISP A; “*EXP(“; B; “x)” @ GOTO 80
74 DISP A; “+”; B; “*LOG(x)” @ GOTO 80
76 DISP A; “x^”; B @ GOTO 80
78 DISP A; “+”; B; “/x” @ GOTO 80
80 PAUSE
84 DISP “ANOTHER ANALYSIS?” @ WAIT 1.5
86 INPUT “Y=1,N=0:”; E
88 IF E=1 THEN 20
90 DISP “DONE”


 Have fun!  See you in the second half of 2016!  

Eddie

This blog is property of Edward Shore, 2016

Sunday, June 26, 2016

Fun with the HP 71B II

Fun with the HP 71B II

Four years ago, I had fun with the HP 71B programming:



That has been too long ago.  Time to pull out the 71B again.



Digital Root of an Integers

Add all the numbers of an integer and repeat until you have a single digit (1-9).

Program DROOT (52 bytes)

10 DESTROY N
20 INPUT “INTEGER:”;N
22 N=IP(N)
30 D=1+MOD(N-1,9)
40 DISP D

Easy Traverse Calculation

Calculates the new point knowing the original coordinates, direction, and angle of travel.  The angle 0° comes from due east and rotates counterclockwise (see diagram below). 



Program TRAVEZ (216 bytes)


15 DEGREES
20 INPUT “INIT. EASTING:”;E
25 INPUT “INIT. NORHTING:”;N
30 D=0
40 INPUT “DISTANCE:”;I
45 INPUT “ANGLE:”;A
50 E=I*COS(A)+E
55 N=I*SIN(A)+N
57 D=D+I
60 DISP N;’,’;E
65 PAUSE
70 INPUT “DONE? (Y=1,N=0)”;X
75 IF X=0 THEN 40
90 DISP “TOTAL DIST:”;D

Integral Using Simpson’s Rule

∫ FNF(X) dX from X = a to X = b

Line 10 is where you have to define your function (of X). 

Program SIMPSON  (200+ bytes)

10 DEF FNF(X)=insert function of X here
30 INPUT “LOWER:”;A
32 INPUT “UPPER:”;B
34 INPUT “# PART’NS (EVEN):”;N
36 RADIANS
38 T=FNF(A)+FNF(B)
40 H=(B-A)/N
50 FOR I=1 TO N-1
52 IF FP(I/2)=0 THEN 54 ELSE 56
54 T=2*FNF(A+I*H)+T @ GOTO 58
56 T=4*FNF(A+I*H)+T
58 NEXT I
60 T=T*H/3
62 DISP “INTEGRAL:”;T

Expanding the Binomial (ax+b)^n

BINOMEXP gives the coefficients of the expansion of (ax+b)^n. 

Program BINOMEXP (about 189 bytes)

10 DESTROY A,B,N,L,I,C
12 OPTION BASE 0
14 DISP ‘exapand(Ax+B)^N’ @ WAIT 1
16 INPUT “A,B,N”;A,B,N
18 DIM L(N)
20 FOR I=0 TO N
22 C=FACT(N)/(FACT(I)*FACT(N-I))  \\ FACT is the factorial function
24 L(I)=C*A^(N-I)*B^I
26 DISP “L(“; I; ”):”; L(I); “x^”; N-I  @ PAUSE
28 NEXT I
40 DISP “DONE, CHECK L.”

Synthetic Division

Divide the polynomial p(x) by (x-R).  P is the array of p(x), Q is the array representing the quotient q(x), and E is the remainder.  Hence:  P(x)/(x-R) = Q(x) + E/(x-R)

Program SYNTH (304 bytes)

10 DESTROY P,I,Q,R,E
12 OPTION BASE 0
14 DIPS “P(X)/(X-R)” @ WAIT 1
16 INPUT “DEGREE OF P(X):”;N
18 DIM P(N),Q(N)
20 FOR I=0 TO N
22 DISP “COEF OF x^”;N-1 @ PAUSE
24 INPUT P(I) @ P(I)=Q(I)
26 NEXT I
30 INPUT “R:’;R
40 FOR I=0 TO N-1
42 Q(I+1)=R*Q(I)+P(I+1)
44 NEXT I
50 E=Q(N)
60 DIM Q(N-1)
70 DISP “COEF OF Q(X)”
72 FOR I=0 TO N-1
74 DISP Q(I); “x^”; N-I-1 @ PAUSE
76 NEXT I
80 DISP “REMAIN:”; E; “/(x-“; R; “)”

Dew Point Measurement (in °F)


Program DEWPOINT (159 bytes)

10 DESTROY T,H,V,W,C,D
20 INPUT “TEMP °F”;T
22 C=(T-32)*5/9
26 INPUT “REL HUMIDITY (%):”;H
30 V=(LOG(H%1)+17.27*C/(237.3+C))/17.27
32 W=237.3*V/(1-V)
40 D=9/5*W+32
42 DISP “DEW POINT °F:”;D

// Degree symbol:  [ g ] [RUN] (CTRL) [ A ]

 This blog is property of Edward Shore, 2016


Thursday, June 23, 2016

Programming with the Radio Shack EC-4004

Programming with the Radio Shack EC-4004

(Another milestone: this is blog #600! I can't thank you all enough!) 

To see my retro review of this calculator I did two years ago, click here:




The Radio Shack EC-4004 calculator’s programming mode is AOS (algebraic operating system).  Rarely you see a calculator with AOS any more (think the Casio fx-260 and Texas Instruments TI-30A), but it used to be prominent operating system with RPN.   In AOS, the uniary functions (trigonometric, logarithmic, factorial, for example) are entered after you enter the number.  Hence:  14 [ln] calculates ln(14) ≈ 2.639057329.

The storage of the EC-4004 is a mere 38 steps which can be distributed into two program slots.  That is not a lot.  Furthermore, if you enter numeric constants, each digit counts a step.  Remember, the display does NOT display the key, so be careful when entering programs.  There are a few program commands:

RTN ([INV] [ 9 ]):  Returns program control the first step (beginning). 

X ≤ M ([INV] [ 8 ]):  If the display is less than or equal to M, return to the first step.  Otherwise, go to the next step.

X > 0 ([INV] [ 7 ]): If the display is greater than 0, return to the first step.  Otherwise, go to the next step.

ENT ([RUN] in learn mode):  Prompt for a number.  The next step is to put a “placeholder” number as long as it will be valid in calculations.  Since each digit counts as a step, try to use placeholder numbers like 0, 1, or 2.  I’m not sure if the placeholder number is merged with ENT.  You can instead, use Kin or Min to store the entry in memory.

HLT ([INV] [RUN]): Halts the program to display immediate results.  Think of it as the PAUSE command.

X<>K ([INV] [Kout]): Exchange with a memory register.  The EC-4004 has six memory registers, plus one additional independent memory register (M).

[Kin] and [Kout] is your store and recall, respectively.

On to the list of sample programs!  Anything after double slashes (\\) is a comment. The hashtag (#) stands for placeholder number.

Area of a Regular Polygon

Formula:  (n*s^2)/(4*tan(180°/n)), n = number of sides, s = side length

MODE,  4 \\ sets Degree mode
ENT \\ prompt for n
#  \\ enter a placeholder number
Min \\ store in M
*
ENT \\ prompt for s
#  \\ placeholder number
X^2
÷
(
4
*
(
180
÷
MR \\ recall n
)
TAN
)
=

Test 1:  n = 6, s = 2.6,  result 17.56299519
Test 2:  n = 10, s = 3.87, result 115.2353964

 Sum of f(x)

In particular, Σ x^2 + 1 from x = 1 to M.  M is the upper limit.  You can adapt this to include any f(x), but remember you’ll only have 26 steps to work with for f(x).  Your variable for f(x) is register 1 (use [Kout], 1)

Before running, store the upper limit minus 1 in M, 0 in both registers 1 and 2.  (0, [ Kin ], 1; [ Kin ], 2).  Register 1 is your counter, register 2 is your sum.   In Summary:

M = upper limit – 1, Register 1 = 0, Register 2 = 0

Kout 1  \\ recall register 1 and add one
+
1
=
Kin 1
X^2 \\ f(x) starts here
+
1
=   \\ end f(x) with equals
+   \\ add result to register 2
Kout 2
=
Kin 2
Kout 1 \\ put register 1 in the display
X≤M   \\ is X≤M? If so, go to the beginning
Kout 2 \\ display sum

Test 1:  If the upper limit is 5, store 4 in M.  Result:  60
Test 2:  If the upper limit is 8, store 7 in M.  Result:  212

Payment of a Loan (with no balloon)

Formula:  PMT = PV / ((1 – (1 + r)^-n)/r)

Store the following amounts before running:
K1 = PV, present value or loan amount
K2 = n, number of payments.  Example: For 30 years for monthly payments, store 360 in K2.
K3 = r, periodic interest rate as a decimal.  Example: For 6% compounded monthly, enter 0.06/12 in K3.


Kout 1 \\ recall PV
÷
(
(   
1
-
(
1
+
Kout 3  \\ recall r
)
X^Y
Kout 2 \\ recall n
+/-
)
÷
Kout 3
)
=


Test 1:  K1 = 200,000, K2 = 360, K3 = 0.055/12.  Result:  1,135.58
Test 2:  K1 = 234,000, K2 = 360, K3 = 0.038/12.  Result:  1,090.34

Easy Traverse Calculation

Calculates the new point knowing the original coordinates, direction, and angle of travel.  The angle 0° comes from due east and rotates counterclockwise (see diagram below). 



Store before hand:
K1 = original coordinate easting (E, x)
K2 = original coordinate northing (N, y)

Distance is stored in K3 and angle is stored K4.  At the completion of the program, the new coordinates are stored in K1 and K2, respectively, to allow chain calculations.

MODE 4 \\ degrees mode
Kout 1
+
ENT \\ prompt for distance
# \\ placeholder number
Kin 3
*
ENT \\ prompt for angle
# \\ placeholder number
Kin 4
COS
=
Kin 1
HLT \\ display new easting coordinate
Kout 2
+
Kout 3
*
Kout 4
SIN
=
Kin 2 \\ display new northing coordinate


Test:  E0 = 10,000,  N0 = 10,000
Given distance = 110, angle = 126°,  E1 ≈ 9,935.343, N1 ≈ 10,088.992
Continuing,
Given distance = 150, angle = 30°, E2 ≈ 10,065.247, N2 ≈ 10,163.992

Measuring Dew Point (in degrees Celsuis)

W = 237.3 * V/(1 – V)
V = (ln H + (17.27*C)/(237.3+C))/17.27

Where:
H = relative humidity, store as a decimal (Example:  for 55.8% store 0.558 in K1)
C = temperature in degrees Celsius

Store before hand:  H in register 1 (K1), C in register 2 (K2). 

This program illustrates a perfect example of the effect of the limited programming space.  During the calculation, 17.27 and 237.3 are stored in K3 and K4, respectively to save program space.  And believe me, we’ll need every bit of it.

Kout 1 \\ H
LN
+
17.27
Kin 3
*
Kout 2 \\ C
÷
(
237.3
Kin 4
+
Kout 2
)
=
÷
Kout 3
Min // store V in M
*
Kout 4
÷
(
1
-
MR
)
=

Remember K1 = H, K2 = C
Test 1:  H = 51% (0.51), C = 27°C, Result ≈ 16.0003°C
Test 2:  H = 46% (0.46), C = 85°F = 29.44444444°C, Result ≈ 16.6110°C

Chebyshev Polynomial of the First Kind, for -1<x<1

Formula for -1<x<1:  T_n(x) = cos(n * acos x)   (source: Wolfram, http://mathworld.wolfram.com/ChebyshevPolynomialoftheFirstKind.html, see line 44)

ENT \\ prompt for x
#  \\ placeholder number
COSˉ¹
*
ENT \\ prompt for n
#  \\ placeholder number
=
COS

Test 1:  T_2(0.25) = -0.875  (x = 0.25, n = 2)
Test 2:  T_3(-0.68) = 0.782272  (x = -0.68, n = 3)

That is a small collection of programs for the EC-4004.  If you want me to do more, let me know.  Until then, have a great day everyone and stay safe!

Eddie

This blog is property of Edward Shore, 2016



Saturday, June 18, 2016

HP 50G vs. HP Prime

HP 50G vs. HP Prime

Jason Foose has challenged me determine which of the two calculators, the HP 50g or the HP Prime is the best.  To help me, I will determine which of the features one calculator has over the other.  Here we go:


HP 50g over the HP Prime
HP Prime over the HP 50g
RPN mode is complete, can do everything with ease

Can use SD cards as a source of outside storage options

App specific commands don’t need an “app.” Suffix

3D Graphing without the need to download anything extra

Easier transition from the HP 48S/HP 48G/HP 49g+ family

No need to have separate modes for Home and CAS

Keyboard:  good contrast between the keyboard (black) and its labels (white, yellow, orange) (black HP 50g). 

Can make noise/music with the BEEP command. (tone in HZ, seconds, BEEP)

No need to enter a separate program mode, just need the ≪ ≫ brackets

You can plot more than 10 separate functions f(x) on a single graph (never done it myself)

Built in Equation Library without need to download anything extra



Screen is in color – easier to differentiate graphs and geometric models

Advanced Graphing App (implicit graphing) without the need to download anything extra

Memory: Over 32MB RAM

In addition to the Gamma and Psi functions: Beta, Zeta, Error (erf), Error Compliment (erfc), Ei, Ci, Si

Online help is for every command, not just for the CAS commands on the 50g

Better integrated Equation writer, more intuitive to move around the equation

Faster Processor:  400 MHz opposed to 75 MHz (both have ARM 9 chips)

Literally draw a function and the Prime (usually) figures an appropriate equation (Ver. 10077)

Software for transferring programs and screen shots for the Prime is better integrated than the 50G

Rechargeable Battery

Easy way to write comments inside of a program (//)

More Curve fitting options: Polynomial, Trigonometric
Total Pros: 11
Total Pros: 12


At the end of the day, the HP Prime and HP 50g are both great calculators.  Please let me know if I forgot something. 

Eddie

This blog is property of Edward Shore, 2016


Thursday, June 16, 2016

MaximaOnAndroid: A Short Pictorial Essay

App:  MaximaOnAndroid
Cost: Free
Author: Yasuaki Honda

MaximaOnAndroid is a Common Lisp based CAS mathematical program.  The latest version I am posting on today was 2.8 (6/13/2015).  Rather than talk about how awesome this app is, I would like to show you.  This app was recommended by Bill Zimmerly.  Thank you Bill!

Note: The app takes a lot of memory, I would advise to store the additional space on the SD card on your device if you are using a phone.


Prime factorization of 13!, 23!, 33!, and 43!



Expanding, Factoring, and Integration


Distributive Multiplication and Proper Fraction




3D Plot of sin(y^2 +x^2)/(3*cos(y^2-x^2)) 


Matrices





 Solving Equations, Finding the Numerical Approximation



 Julia Set About 1.1 + 3.1i



So that is a short demonstration of MaximaOnAndroid.  Check it out!   Eddie


This blog is property of Edward Shore, 2016


Casio Classpad Functions: Coordinate, Bearing, Slope, Triangle Area, Electric Oscillation, RLC Impedance

Casio Classpad Functions:  Coordinate, Bearing, Slope, Triangle Area,  Electric Oscillation, RLC Impedance 


Nothing like doing some programming while on vacation. :)

Civil Engineering/Geometry:  tcoordin, bearing, cslope, aritri

For the following, enter coordinates in complex number format:  (east coordinate) + (north coordinate)*I  (x + y*i).  For example, enter the coordinate (3, 6) as 3+6i.

Coordinate Calculation - tcoordin



Inputs:  pt, len, ang
pt = point 0, enter as a complex number
len = length of travel
ang = bearing angle (treated as degrees)

Output:
Point 1 (as a complex number)

Function:
approx(pt+compToRect(∠(len,ang°)))

Example:
tcoordin(4 + 5*i, 24.2, -10) returns 27.83234762+0.7977141005*i

Bearing Angle (from East) – bearing

Inputs: pt1, pt2
pt1 = point 1, enter as a complex number (start)
pt2 = point 2, enter as a complex number (end)

Output:
A list of two elements:  length, bearing from point 1 (depending on setting)

Function:
approx({abs(pt2-pt1),arg(pt2-pt1)})

Example:
bearing(-2.2+3i, 4+2i) returns {6.280127387, -9.162347046} (degree mode)

Slope Between two Points (extra) – cslope

Inputs: pt1, pt2
pt1 = point 1, enter as a complex number (start)
pt2 = point 2, enter as a complex number (end)

Output:  Slope from point 1 to point 2.

Function:
approx(im(pt2-pt1)/re(pt2-pt1))

Example:
cslope( 7+7i, 2+16i ) returns -1.8

Area of a Triangle knowing the Vertex Points – aritri



Inputs: pt1, pt2, pt3
pt1 = point 1, enter as a complex number
pt2 = point 2, enter as a complex number
pt3 = point 3, enter as a complex number

Output:  area of the triangle

Function:
approx(abs(.5*(re(p1-p2)*im(p3-p1)+re(p1-p3)*im(p1-p2))))

Example:
aritri(0, 4+7i, 2+5i) returns 3
0 = 0 + 0i


Electrical Functions:  rlcserim, rlcparim, freqosc

Functions for RLC posted are now corrected - EWS 6/26/2016

Impedance of an RLC Series Circuit:  rlcserim



Inputs:
r = resistance (in Ohms)
c = capacitance (in Farads)
l = inductance (in Henrys)
f = frequency (in Hertz)

Output:
z = impedance (in Ohms)

Function:
approx(√(r^2+(2*Ï€*f*l-1/(2*Ï€*f*c))^2))

Example:
rlcserim(10, 500E-6, 2E-3, 2000) returns 26.90130131 ohms

Impedance of an RLC Parallel Circuit:  rlcparim
  
Inputs:
r = resistance (in Ohms)
c = capacitance (in Farads)
l = inductance (in Henrys)
f = frequency (in Hertz)

Output:
z = impedance (in Ohms)

Function:
approx(1/√((1/r)^2+(2*Ï€*f*c-1/(2*Ï€*f*l))^2))

Example:

rlcparim(40, 550E-6, 2E-3, 1000) returns 0.2961851056

Frequency of Electric Oscillation – freqosc

Inputs:
l = coil self-inductance (in Henrys)
c = capacitance (in Farads)

Output:
f = frequency (in Hertz)

Function:
approx(1/(2*Ï€*√(l*c)))

Example:
freqosc(550E-6, 2E-3) returns 151.7482841

Sources:

Casio.  “fx-FD10 Pro User’s Guide” and “fx-50F Plus User’s Guide”.  2014 and 2006, respectively

This blog is property of Edward Shore, 2016.



Casio fx-9750GIII and fx-CG 50: Playing Games with the Probability Simulation Mode

Casio fx-9750GIII and fx-CG 50: Playing Games with the Probability Simulation Mode The Probability Simulation add-in has six type...