The love formula

$$\huge x^2+(\frac{5y}{4} -\sqrt {|x|})^2=1$$ Just playing around, off course any non graphics calculator cannot render the graph. But its a cute equation.

Solving linear equations with two points using the DM15L with STO and RCL

 The DM15L makes it very easy to solve a linear equations programmatically. A stored program makes it possible to calculate the slope and y intercept of many linear equations without re-entering all the calculation steps. A small easy program saves time and reduces the chance of calculation errors.  

The standard form form for a linear equation is:
$$ y=ax+c$$

If we have two points of the data set, the angle of the line can be calculated as:
$$ a= \frac {y_2-y_1}{x_2-x_1}$$

When the slope of the graph is known, we can determine the y intersect c:
$$ c= y_2-x_2a$$

That is all that is needed to solve the equation.

Since the keystroke program will use STO and RCL, we must use registers 6-9 (R6-R9) for the variables and output. The following registers will be used for the various variables.

R7: y2
R8: y1
R4: x2
R5: x1
R9: a
R6: c

Enter the following keystroke program:

Keystrokes    Comment
[f][PRRM]    Sets the program memory to line 000.
[G][P/R]    Sets the DM15L to Program Mode to accept keystrokes.
[F][LBL][2]    Assigns this program to the R2 register or number 2 key.
[R/S]    Run stop command, the DM15L waits for input from the user
[STO][7]    Stores the value of y2 you entered into key 7 for later use
[R/S]    

[STO][8]    Stores the value of y1 you entered into key 8 for later use
[R/S]    

[STO][4]    Stores the value of x2 you entered into key 4 for later use
[R/S]    

[STO][5]    Stores the value of x1 you entered into key 5 for later use
[RCL][7]    Recall y2 from memory and place it in the stack for calculation
[RCL][8]    Recall y1 from memory and place it in the stack for calculation
[-]    Subtract y2 from y1
[RCL][4]    Recall x2 from memory and place it in the stack for calculation
[RCL][5]    Recall x1 from memory and place it in the stack for calculation
[-]    Subtract x2 from x1
[÷]    Since y2-y1 is in the Y stack and x2-x1 is now in the X stack, we can divide
[STO][9]    The slope is stored in the R9 register or key 9
[RCL][4]    Recall x2
[RCL][9]    Recall the slope a from the R9 register or key 9
[x]    Multiply the x2 value with a or the slope
[CHS]    We have to change the sign to comply with the formula calculating the y intersect
[RCL][7]    recall the y2 value
[+]    Add the product of (x2 x a) to y2. Remember c=y2-x2a (9-(10x1.5))
[STO][6]    Store the y intersect, c, in register R6 or key 6 for later access.
[G][RTN]    Ends the Program and returns to line 000
[G][P/R]    Exists Program Mode

If we are given the following two sets of points of the graph:

(x1,y1) & (x2,y2)

(4,14) & (10,23)

The slope is calculated as:

$$ a= \frac {y_2-y_1}{x_2-x_1}$$
$$ a= \frac {23-14}{10-4}$$
$$ a= \frac {9}{6}$$
$$ a= 1.5$$

The y intersection is calculated as:

$$ c= y_2-x_2a$$
$$ c= 23-10 \times 1.5$$
$$ c= 23-15$$
$$ c=8$$

To run the program and enter the various variables is quite simple:

Keystrokes    Comment
[GSB][2]    Sets the program memory to line 000 of the program stored in key 2.
[2][3][R/S]    Enter the value for y2 and press [R/S] Run Stop for the next value
[1][4][R/S]    Enter the value for y1 and press [R/S] Run Stop for the next value
[1][0][R/S]    Enter the value for x2 and press [R/S] Run Stop for the next value
[4][R/S]    Enter the value for x1 and press [R/S] Run Stop to finish processing

That is all that is needed for the linear equation. The slope of the graph is stored in R9 and can be found by pressing [RCL][9] and the y axis intersection is stored in R6 and is recalled by pressing [RCL][6].

The final values are R9 = a = 1.5 and the y intersection R6 = c = 8.
$$ y=1.5x+8$$

You can now enter any (x1,y1) & (x2,y2) points to calculate the slop and y-intersect. The answer will always be stored in the registers R9 and R6 or key 9 and key 6.

I wrote a similar program for the HP Prime and it looks completely different:

EXPORT FXX(x2, y2, x1, y1)
BEGIN
M:=(y2-y1)/(x2-x1);
B:=y2-(x2*M);
PRINT()
PRINT("y2 = "+y2);
PRINT("y1 = "+y1);
PRINT("x2 = "+x2);
PRINT("x1 = "+x1);
PRINT("Slope m = "+M);
PRINT("b = "+B);
PRINT("f(x) = "+M+"x + ("+B+")");
END;

Comments

Popular posts from this blog

Creative Cloud update failed error code 183 - My Solution

Merrell hiking shoes showing cracks in quality

The first Wordpress plugins you should install