Tuesday, December 6, 2016

TI-84 Plus and Casio Prizm: Area between Polynomials p(x) and q(x)

TI-84 Plus and Casio Prizm:  Area between Polynomials p(x) and q(x)




The program POLYSURF calculates the area of a surfaces with:

* Side borders are straight vertical lines.  The left border line begins at x = 0
* The top and the bottom are defined polynomials: p(x) for the top and q(x) for the bottom.
* There are n partitions in the shape, for all partition points, p(x) > q(x).

The program also draws the shape.  If the number of partitions are 4 or less, an exact area is calculated.  Otherwise, p(x) and q(x) are approximated by a quartic polynomial and an approximated area is calculated.

TI-84 Plus Program POLYSURF

"EWS 2016-12-06"
Disp "P(X) > Q(X)"
FnOff
PlotsOff
{0}→L
Input "P(0)=",P
{P}→L
Input "Q(0)=",Q
{Q}→L
Input "NO. OF PARTITIONS:",N
For(I,1,N)
ClrHome
Output(7,1,"POINT")
Output(7,8,I)
Output(8,1,"P(X)>Q(X)")
Input "X:",X
Input "P(X):",P
Input "Q(X):",Q
augment(L,{X})→L
augment(L,{P})→L
augment(L,{Q})→L
End
L(dim(L))→L
If N=1
Then
LinReg(ax+b) L,L,Y
LinReg(ax+b) L,L,Y
End
If N=2
Then
QuadReg L,L,Y
QuadReg L,L,Y
End
If N=3
Then
CubicReg L,L,Y
CubicReg L,L,Y
End
If N≥4
Then
QuartReg L,L,Y
QuartReg L,L,Y
End
FnOn 1,2
fnInt(Y-Y,X,0,L)→S
Disp "AREA=",S
Pause
ClrDraw
­.5→Xmin
L+.5→Xmax
min(L)-.5→Ymin
max(L)+.5→Ymax
Shade(Y,Y,0,L)

Casio Prizm Program:  POLYSURF

The character # can be found by exiting to the “main” program menu (TOP, BOTTOM, etc).  Press F6 for CHAR, select #, and press [EXE].

Get the regressions by pressing [F4] (MENU), [F1] (STAT), [F6] twice (CALC, >) and selecting the regression.  The statistic variables a, b, c, d, and e are calculated after regression calculation.

“EWS 2016-12-06”
“P(x)>Q(x)”
{0} → List 1
“P(0)=”? → P
{P} → List 2
“Q(0)=”? → Q
{Q} → List 3
“# PARTITIONS:”? → N
For 1 → I To N
“POINT”
I
“X:”? → X
“P(X):”? → P
“Q(X):”? → Q
Augment(List 1, {X}) → List 1
Augment(List 2, {P}) → List 2
Augment(List 3, {Q}) → List 3
Next
If N = 1
Then
LinearReg (ax+b) List 1, List 2
a → A
b → B
“Ax+B” → Y1
LinearReg (ax+b) List 1, List 3
a → F
b → G
“Fx+G” → Y2
IfEnd
If N = 2
Then
QuadReg List 1, List 2
a → A
b → B
c → C
“Ax^2+Bx+C” → Y1
QuadReg List 1, List 3
a → F
b → G
c → H
“Fx^2+Gx+H” → Y2
IfEnd
If N = 3
Then
CubicReg List 1, List 2
a → A
b → B
c → C
d → D
“Ax^3+Bx^2+Cx+D” → Y1
CubicReg List 1, List 3
a → F
b → G
c → H
d → I
“Fx^3+Gx^2+Hx+I” → Y2
IfEnd
If N ≥ 4
Then
QuartReg List 1, List 2
a → A
b → B
c → C
d → D
e → E
“Ax^4+Bx^3+Cx^2+Dx+E” → Y1
CubicReg List 1, List 3
a → F
b → G
c → H
d → I
e → J
“Fx^4+Gx^3+Hx^2+Ix+J” → Y2
IfEnd
List 1[Dim List 1] → L
∫(Y1-Y2, 0, L) → S
“AREA=”
S
ClrGraph
ViewWindow -.5, L+.5, 1, Min(List 3)-.5, Max(List 2)+.5, 1
F-Line 0, List 2[1], 0, List 1[3]
Dim List 1 → Z
F-line List 1[Z], List 2[Z], List 1[Z], List 3[Z]
DrawGraph

Examples

Example 1



Data:
n
x
p(x)
q(x)
0
0
2
-2
1
1
5
-2
2
2
2
-2

Number of partitions, n = 2
Area = 12

Example 2



Data:
n
x
p(x)
q(x)
0
0.0
0.00
0.00
1
1.5
5.62
-0.64
2
2.5
3.83
1.38
3
3.5
1.25
0.76

Number of Partitions, n = 3
Area ≈ 13.16619792

Example 3



Data:
n
x
p(x)
q(x)
0
0.00
3.00
-3.00
1
0.50
2.54
-2.84
2
1.25
2.01
-3.00
3
1.60
2.36
-3.55
4
2.00
2.76
-1.98

Number of Partitions, n = 4
 Area ≈ 10.77281698

This blog is property of Edward Shore, 2016


Sunday, December 4, 2016

TI-84 Plus: Staircases

TI-84 Plus:  Staircases
  
Given the rise (height from lower floor to upper floor), run (length of the staircase), and desired riser height (how high each stair is), the program STAIRS calculates the number risers needed, along with the width of each stair, the incline, and finally illustrates the staircase. STAIRS is designed with inches and feet (US units) in mind. 



Formulas

Given:  Rise, Run, Desired Rise Height (DRH)

Number of Risers:
n = rise/DRH, rounded to the nearest integer

Tread width:
TW = run/(n – 1)

Adjusted Riser Height (ARH)
ARH = rise/n, rounded to the nearest 1/16th

One way to approach this: 
ARH = round(16*frac(rise/n),0)*16 + int(rise/n)

Incline:
θ = atan(RH/TW)

Other Calculations:

Stringer:
S = (n – 1)*√(ARH^2 + TW^2)

Number of Stairs:
N_stairs = n - 1


TI-84 Plus Program: STAIRS

Input:  Rise, Run, Desired Riser Height.  Keep the units consistent.  (12 inches = 1 foot)

Output:  Number of Risers (R), Tread width of each stair (T), Adjusted Riser Height (H), Angle of Incline (θ)

* Adjusted Riser Height is rounded to the nearest 1/16th (of an inch).  This is accomplished by the line iPart(H)+round(16*fPart(H),0)/16

The graph screen shows the staircase.  A stat plot shows where each stair ends with X (L1) representing the position and Y representing the height (L2). 

The program sets the TI-84 Plus to Degrees mode.

"EWS 2016-12-03"
Degree
Input "RISE:",B
Input "RUN:",A
Input "DESIRED RISER HEIGHT:",H
round(B/H,0)→N
A/(N-1)→T
B/N→H
"ROUND H TO 1/16"
iPart(H)+round(16*fPart(H),0)/16→H
tan^-1(H/T)→θ
√(H²+T²)*(N-1)→S
Disp "NUMBER OF RISERS:",N
Disp "TREAD WIDTH:",T
Pause
Disp "ADJ. RISER HEIGHT:",H
Disp "ANGLE:",θ
Pause
{0}→L:{0}→L
­.5→Xmin:A+.5→Xmax
­.5→Ymin:B+.5→Ymax
ClrDraw
For(I,1,N-1)
augment(L,{I*T})→L
augment(L,{I*H})→L
End
PlotsOff
PlotsOn 1
Plot1(xyLine,L,L)
Line(0,0,A,0)
Line(A,0,A,B)
For(I,0,N-1)
Line(T*I,H*I,T*I,H*(I+1))
Line(T*I,H*(I+1),T*(I+1),H*(I+1))
End
DispGraph




Examples

All amounts are in inches.

Example 1:  Rise = 35 in, Run = 84 in, Desired Riser Height = 7 in
Results:  Number of Risers: 5, Tread width: 21 in, Adjusted Riser Height:  7 in, θ ≈ 18.43495°

Example 1 is shown in the screen shots above.

Example 2:  Rise = 40 in, Run = 90 in, Desired Riser Height = 7 in
Results:  Number of Risers: 6, Tread width: 18 in, Adjusted Riser Height:  6.6875 in,
θ ≈ 20.38143°

Example 3:  Rise = 56 in, Run = 50 in, Desired Riser Height = 6.5 in
Results:  Number of Risers: 9, Tread width: 6.25 in, Adjusted Riser Height:  6.25 in,
θ ≈ 45°

This program was inspired by the Calculated Industries Construction Master 5 calculator

Eddie


This blog is property of Edward Shore, 2016

Saturday, December 3, 2016

TI-84 Plus: Intersection of two lines – program by Jack Kesler

TI-84 Plus:  Intersection of two lines – program by Jack Kesler

Special thanks to Jack Kessler for providing the program CPXINT.  CPXINT uses complex numbers to determine:

* The equation of a line between two points.  CPXINT uses two lines:

            y = Ax + B for coordinates N1, E1 and N2, E2.
            y = Cx + D for coordinates N3, E3 and N4, E4

* The intersection of the two lines, labeled by point N5, E5.

Keep in mind N is for North (y axis) and E is for East (x axis).




TI-84 Plus Program CPXINT – Jack Kesler

Note:  Initialize all the variables by choosing option 1, SETUP.  Choose 2 for input, 3 for equations of the lines, and 4 for intersection.

ClrHome
Disp "LINE INT"
Disp "USNG CPX"
Disp "VER. 1.0"
Pause
ClrHome
Lbl 50
Menu("CPXINT","SETUP",89,"INP PTS",90,"COMP LINS",91,"COMP INT",92,"EXIT",93)
End
Lbl 89
ClrHome
ClrAllLists
11→dim(L)
{2,2}→dim([A])
{2,1}→dim([B])
Goto 50
Lbl 90
ClrHome
Disp "INP CRDS:"
Input "N1= ",T
T→L(1)
Input "E1= ",T
T→L(2)
Input "N2= ",T
T→L(3)
Input "E2= ",T
T→L(4)
Input "N3= ",T
T→L(5)
Input "E3= ",T
T→L(6)
Input "N4= ",T
T→L(7)
Input "E4= ",T
T→L(8)
ClrHome
Goto 50
Lbl 91
ClrHome
a+bi
L(2)+L(1)i→I
L(4)+L(3)i→J
angle(J-I)→θ
If θ=90 or θ=­90
Then
real(I)→B
0→[A](1,1)
1→[A](1,2)
B→[B](1,1)
0→A
Else
tan(θ)→A
imag(I)-A*real(I)→B
1→[A](1,1)
­A→[A](1,2)
B→[B](1,1)
End
Disp "Y=A*X+B"
Disp "A= ",A
Disp "B= ",B
Pause
ClrHome
L(6)+L(5)i→I
L(8)+L(7)i→J
angle(J-I)→θ
If θ=90 or θ=­90
Then
real(I)→D
0→[A](2,1)
1→[A](2,2)
D→[B](2,1)
0→C
Else
tan(θ)→C
imag(I)-C*real(I)→D
1→[A](2,1)
­C→[A](2,2)
D→[B](2,1)
End
Disp "Y=C*X+D"
Disp "C= ",C
Disp "D= ",D
Pause
ClrHome
Real
Goto 50
Lbl 92
ClrHome
If A=C
Then
Disp "PARLLEL LINES"
Disp "NO SOLUTION"
Pause
ClrHome
Goto 50
End
[A]^-1*[B]→[D]
Disp "N5= ",[D](1,1)
[D](1,1)→L(9)
Disp "E5= ",[D](2,1)
[D](2,1)→L(10)
Pause
ClrHome
Goto 50
Lbl 93
ClrHome
Stop

Example:

Line 1:  N1 = 0, E1 = 1, N2 = 7, E2 = 2. 
Line 2:  N3 = 4, E3 = 3,  N4 = 4, E3 = -3

Results:
Y = AX + B:  A = 0,  B =  4
Y = CX + D:  C = 7,  D = -7
Intersection:  N5 = 4,  E5 = 1.571428571


Thank you Jack! 

Eddie


This blog is property of Edward Shore, 2016

TI-84 Plus: Rake Wall

TI-84 Plus:  Rake Wall

The program RAKEWALL calculates:

*  The positions and lengths of studs on a rake wall
*  Angle of the incline

Adding Illustration

I wanted to do something different and present an illustration rather than just text answers.  What is nice of the TI-84 Plus (and really the TI-8x family extending back to the TI-81) is that the programming language allowing for easy transition between modes (home, graphing, matrix editing, table, etc.).  With RAKEWALL, I not only display text answers, but a visual of how the rake wall is laid out. 

Sometimes the best way to present information is through visuals, not just text.  I want to further explore this whenever it is warranted.

TI-84 Plus Program RAKEWALL



Input:  Rise, Run, O.C. (on center spacing).   RAKEWALL does not specify units, keep that in mind.  Use consistent units.  As a reminder, 12 inches is 1 foot.

Output:  Angle (in Degrees), stud spacing stored in list L1, stud lengths stored in list L2.  The program ends on the graph screen.  Press [ trace ] to see the values.  X is the length from the where the incline and base meet to the stud, Y is the stud length.

Please note that results are exact and not rounded (i.e. to the nearest 1/16th).

Program:
"EWS 2016-12-01"
ClrDraw
Degree
Input "RUN:",L
Input "O.C. SPACING:",S
Input "BASE:",B
Input "RISE:",R

seq(X,X,L,0,­S)→L
tan^-1(R/L)→θ

L*tan(θ)+B→L
augment(L,{0})→L
augment(L,{B})→L

Disp "ANGLE:",θ
Disp "NUMBER OF STUDS:",dim(L)-2
Disp "(L: DIST. FROM SHORT PT."
Disp "L: STUD LENGTH)"
Pause

PlotsOff
PlotsOn 1
Plot1(xyLine,L,L)

­0.5→Ymin
B+R+.5→Ymax
­.5→Xmin
L+.5→Xmax

For(I,1,dim(L))
Line(L(I),0,L(I),L(I))
End
Line(0,0,L,0)
Line(L,0,L,B)

DispGraph

Example:

Run:  6 feet
O.C.:  1 foot 6 inches, or 16/12 inches
Base:  6 feet
Rise:  5 feet



This program was inspired by the Calculated Industries Construction Master 5 calculator.  I am thinking about purchasing their Construction Pro calculator (most likely the app). 

Happy December!

Eddie

This blog is property of Edward Shore, 2016.