The Algebraic-Calculator-For-Two-Unknowns

This website provides free calculation devices in the online JavaScript

and spreadsheet formats for solving two linear equations, for two unknowns,

and 6280 words of useful information for math students and mathematicians.

To contact the author use the above email address, or

Left click on these words for a website communication form.

Below this brief introduction is an online JavaScript calculation device (Algebraic Calculator) for solving two linear equations, for two unknowns, X and Y.  If you want the Algebraic Calculator in the spreadsheet format, (Microsoft Excel, or OpenOffice.Cal) or additional information, scroll all the way down, beneath the online Calculator.  Alternatively, you can use the hyperlink table of contents of this website, which is located just below the online calculator.

^Topic^

Brief Instructions

^Subtopic^

The Algebraic Calculator solves equations similar to AX+BY=V and KX+DY=W.  If the equations you want to solve do not look like this, try to rearrange or simplify them to make them similar to the above.

If one or both of the equations you want to solve has less terms than the above, and looks like this: BY=V, or this KX=W, enter a zero in the input box that corresponds to the missing coefficient.  With the first example, A=0, and with the second example D=0.

When there are no apparent coefficients multiplying a variable, such as X+Y=V, you must enter 1 in the related input box.  With the above example, A=1, and B=1.

Below, is the online version of the Algebraic Calculator, embedded in this webpage.  Note, if you print your calculated results from this Calculator all of the text on this website will be printed.  If you do not want to print the entire website with your results use the printer friendly version of the Algebraic Calculator by left clicking on these words.

The Online Version of the Algebraic Calculator

Embedded in this Webpage

 This calculator solves for two unknowns, for equations similar to: AX+BY=V and KX+DY=W Delete the numbers in the following six white input boxes, and enter your own numbers. For calculated results, left click with the mouse on the calculation button, or on the background. Input boxes for AX+BY=V If numbers entered for A & B or K & D are single-digit numbers, (when decimal places are removed) the equation is displayed in the gray box below. (Decimals are not shown in the gray box) However, if the numbers for A & B or K & D involve more than one digit, (excluding decimals), the equation is displayed in the larger green box, which is situated just below the gray box. A= B= V= Input boxes for KX+DY=W K= D= W= Equations are displayed in this box, in a vertical format, IF: A & B, or K & D have more than one digit. AX+BY=V KX+DY=W AX KX + + BY DY Calculated Results for X and Y Are: X= Y= Calculated results for X and Y are rounded to decimal places. This can be changed by deleting the number in the small tan box, and entering the number of decimal places you prefer. Below, calculated values of X and Y are checked for accuracy V= Calculation error is AX+BY= W= Calculation error is KX+DY= The above numbers in this box are rounded to decimal places. This can be changed by deleting the number in the small yellow box, and entering the number of decimal places you prefer. If the numbers in the pink box have more digits than is necessary for your calculations, you might get rounding errors, displayed in the pink box. However, the settings in the pink box do not affect calculated results for X and Y. Similarly, the number of decimal places that X and Y are rounded to, do not affect the calculations in the pink box. Certain combinations of numbers will not satisfy the two equations perfectly, and this can result in an error message, or calculated results that are not perfectly accurate. If calculated results show an error of about 5%, an error message will be displayed. The relative degree of error is shown in the two green boxes inside of the larger pink box. When numbers are entered that can satisfy both equations perfectly, and are in the range of the calculator, the green boxes will display 0.000000000000. Actually, the numbers displayed in the upper green box is the difference between the value entered for V and the calculated value for V, based on the equation AX+BY=V, with the calculated values for X. and Y. Similarly, the lower green box is for the KX+DY=W. That is, the number in the upper green box is the value of V-AX+BY and the lower green box the value of W-KX+DY.

Left click with the mouse, on the UPPER PORTION of the blue words that relate to the topic or subtopic you are interested in.

The Top of the Webpage. 2

Instructions, and the Algebraic Calculator 2

^Topic^. 2

Brief Instructions. 2

^Subtopic^. 2

The Online Version of the Algebraic Calculator 3

Embedded in this Webpage 3

^Topic^. 13

System Requirements: 13

^Subtopic^. 13

Microsoft Excel, OpenOffice Cal, And Javascript Formats. 14

^Subtopic^. 14

Number Handling Capacity and Error Messages of 15

The Algebraic-Calculator-For-Two-Unknowns. 15

^Topic^. 15

The Algebraic-Calculator Can Handle. 15

Very Large and Very Small Numbers, 15

With OVER 250 Digits. 15

^Subtopic^. 16

General Error Messages Displayed by the Algebraic Calculator 16

^Subtopic^. 16

How the Algebraic Calculator Was Created. 17

^Topic^. 17

Introductory Note About The General Utility of the. 17

Methods and Concepts Presented on this Website. 17

^Subtopic^. 18

You Can Use Formulas From This Website for Your Own Needs. 18

^Subtopic^. 18

Creating the Javascript Version of the Algebraic Calculator 19

^Subtopic^. 19

Creating the Calculation Mechanism.. 19

For the Algebraic Calculator 19

^Subtopic^. 19

To Use a Conventional Formula in a Spreadsheet 20

By Substituting Cell Designations for the Variables. 20

^Subtopic^. 20

An Alternative Method for Using. 22

Involves Defining the Variables in Terms of Cell Designations. 22

^Subtopic^. 22

Symbols Used in a Spreadsheet for Multiplication, 24

Division, Addition, Subtraction, Square Roots, Cube Roots, Etc. 24

^Subtopic^. 24

Creating the Two Display Boxes. 26

In the Algebraic Calculator 26

^Topic^. 26

The Small Gray, and Large Green Display Boxes: A Challenge. 26

^Subtopic^. 27

Strings of Computer Code. 29

For The Display Boxes: Display Formulas  29

^Subtopic^. 29

Simplified English Interpretations of the  30

Computer Code Comprising the Display Formulas. 30

^Subtopic^. 30

Formulas that Control the Display of AX+BY=V. 31

In the Small Gray Display Box. 31

^Subtopic^. 31

Formulas For The Display Of KX+DY=W, 34

In The Small Gray Display Box. 34

^Subtopic^. 34

Formulas for the Display of AX+BY=V. 36

In the Large Green Display Box. 36

^Subtopic^. 37

Formulas for the Display of KX+DY=W.. 39

In the Large Green Display Box. 39

^Subtopic^. 39

Computer Code in the Form of Spreadsheet Formulas. 41

for Rounding Functions, and Error Checking. 41

^Topic^. 41

A User Controllable Rounding Mechanism   41

^Subtopic^. 41

Computer Code in the Form of 45

Spreadsheet Formulas For Error Checking  45

^Subtopic^. 45

Services Offered by the Author 49

^Topic^. 49

^Subtopic^. 49

Services Offered by the Author David@TechForText.com.. 51

^Subtopic^. 51

^Topic^

^Subtopic^

The spreadsheet versions of the Algebraic Calculator require either Microsoft Excel, or the OpenOffice.org software package.  In addition, Microsoft Windows is required for the spreadsheet versions.

The JavaScript version of the Algebraic Calculator can run on any operating system that has JavaScript support, but I only tested it with Microsoft Windows.  In addition, the JavaScript version requires a browser that supports JavaScript.  Almost all modern operating systems and browsers support JavaScript.

Microsoft Excel, OpenOffice Cal, And Javascript Formats

^Subtopic^

If you want the Algebraic Calculator in the Microsoft Excel format, left click on these words.

If you want the Algebraic Calculator in the newer 2007 Microsoft Excel format, left click on these words.  Note, this requires Microsoft Excel 2007 or newer additions of Excel.

If you want the Algebraic Calculator in the OpenOffice Calc format left click on these words.  This requires the free OpenOffice.org software package.

If you want the Algebraic Calculator in a printer friendly JavaScript format, left click on these words.

If you want the spreadsheet version of the algebraic calculator that was used to create the JavaScript version left click on these words.  (This is in Microsoft Excel format.)

If you want the Algebraic Calculator in all of the above formats, in a zip folder, left click on these words.

Number Handling Capacity and Error Messages of

The Algebraic-Calculator-For-Two-Unknowns

The Algebraic-Calculator Can Handle

Very Large and Very Small Numbers,

With OVER 250 Digits

The Algebraic Calculator can handle very large and very small numbers with well OVER 250 digits.  However, when approximately 14 digits are involved, the numbers are displayed in scientific notation.  An uppercase E is used in the spreadsheet version to indicate scientific notation, and the online JavaScript version uses a lowercase e.

An example, of a large number is 10000000000000000000, and it is displayed by the Algebraic Calculator, in scientific notation, in this format: 1.00E+19.  An example of a very small number is 0.0000000000000000001, and it is displayed by the Calculator in scientific notation in this format: 1.00E-19.  (Note: sometimes numbers that are extremely small are rounded down to zero, by the Calculator.)

General Error Messages Displayed by the Algebraic Calculator

^Subtopic^

This calculator shows an error message when there are no solutions for the numbers that were entered.  For example, if both equations have the same slope, (when graphed the lines from the equations are parallel), there will be no solution.  A good example is for AX+BY=V, A=500, B=600, V=1100, and for KX+DY=W, K=5, D=6, W=11.  Another example, is when a sub-calculation involves division by zero.  This happens if B=0, or if (KB-DA))=0.

The calculator also shows an error message if a sub-calculation or the values of X or Y exceed 307 digits.  This can happen, when entered numbers have great differences in magnitude, and they are involved in a sub-calculation that involves division.

How the Algebraic Calculator Was Created

^Topic^

Introductory Note About The General Utility of the

Methods and Concepts Presented on this Website

^Subtopic^

The concepts and techniques used to create the Algebraic Calculator have general utility.  They are useful for creating calculation devices in a number of formats, including JavaScript and spreadsheet formats.  They can also increase the versatility of spreadsheet software.

Spreadsheet software, generally have a limited set of built-in formulas, which are sometimes called functions.  These functions number in the hundreds, but there are millions of formulas in mathematics, science, and industry.  With the techniques discussed in this section, most if not all of these formulas can be used in a spreadsheet, or to create dedicated calculation devices.

You Can Use Formulas From This Website for Your Own Needs

^Subtopic^

Note: The Algebraic Calculator contains over 30 formulas, which are presented in the following paragraphs.  You can use any of the formulas on this website, but you will probably have to modify them to meet your specific needs.  You can use the Windows copy and paste mechanism to transfer complex formulas to your spreadsheet.

Creating the Javascript Version of the Algebraic Calculator

^Subtopic^

The JavaScript version of the algebraic calculator was created from the spreadsheet version.  This involves specialized software to convert Microsoft Excel to the JavaScript format.  Thus, almost all of the following material on this website applies to both spreadsheet and JavaScript versions.

Creating the Calculation Mechanism

For the Algebraic Calculator

^Subtopic^

The first step for the creation of a calculation device is to find or create the formulas needed to perform the required calculations.  For the Algebraic Calculator, I created the formulas, by simply solving the equations: AX+BY=V and KX+DY=W for X and Y.  This resulted in the two formulas presented below:

X=(WB-DV)/(KB-DA), and Y=(V-AX)/B

However, the computer cannot read the above formulas.  The meaning of the letters and implied mathematical instructions in the formulas had to be translated into a form (or language) that the software would understand.  With the software I was using, Microsoft Excel, there are two ways that letters from formulas can be translated for the computer.  These methods are discussed below, and they are also available in OpenOffice Calc, and other spreadsheet software.

To Use a Conventional Formula in a Spreadsheet

^Subtopic^

The method that I often use to convert formulas for used with spreadsheet software, involves replacing each letter in a formula with specific cell references, which serve as inputs cells.  After this, the rewritten formula is placed in any convenient cell, which will display the calculated results, when numbers are entered into the input cells.

For example, the formula: G+H=U can be converted for spreadsheet use, by replacing the letters with any convenient cell designations, such as cells A1, and B1.  With the cell references, the G+H is translated to A1+B1.  This translation is placed in any convenient cell with an equal sign on the left, as such =A1+B1.  We will assume that =A1+B1 has been entered into cell D3.  When numbers are entered into cells A1 and B1, cell D3 will display the calculated results, with this example.  Cell D3 represents the U from the original formula, G+H=U.

The method discussed above, rewriting formulas in terms of cell references, can result in errors, and it can be tedious when a formula has many terms.  It is also difficult to explain a formula written in terms of cell references to others, because each term has a letter and number.  For example, 2+X, can be rewritten for a spreadsheet as 2+ B5, and it can be misinterpreted by a person as 2 +5 times B.  There is another method of converting formulas for spreadsheet use, which avoids all of the difficulties mentioned above.

Involves Defining the Variables in Terms of Cell Designations

This method involves interpreting (or defining) the meaning of each letter in a formula for the software, in terms of specific input cells.  This can be done with the name mechanism in Microsoft Excel, or OpenOffice Calc.  With this method the letters from the original formula remain the same in the spreadsheet version.

For example, by using the name mechanism, G+H=U can be converted for spreadsheet use, by defining G as cell A1, and defining H as cell B1.  Then the spreadsheet formula is =G+H.  This looks similar to the original formula, except it has an equal sign on the left.  This formula =G+H can be placed in any convenient cell, which we will assume to be cell D3.  Cell D3 represents the U from the original formula D3=U: G+H=U.  With this example, when numbers are entered in cells A1 and B1, cell D3 will display the calculated results.

For additional information on using the name mechanism in Microsoft Excel see the following websites, which can be done by left clicking on the web addresses.

Words on website:”Define and use names in formulas” http://office.microsoft.com/en-us/excel/HA101471201033.aspx#backtotop

Words on website: “Introduction To Defined Names”

http://www.cpearson.com/excel/DefinedNames.aspx

Symbols Used in a Spreadsheet for Multiplication,

Division, Addition, Subtraction, Square Roots, Cube Roots, Etc.

^Subtopic^

The methods described above interpret the meaning of letters in a formula, in terms of specific cells on the spreadsheet.  However, the spreadsheet software still will not be able to understand the mathematical instructions implied by a conventional formula.  The software does not understand the human conventions for multiplication, square roots, cube roots, and many other mathematical operations.  This necessitates the following conversions for Microsoft Excel, OpenOffice Calc, and other spreadsheets software:

Multiplication requires an asterisk ( *)  XY must be converted to =X*Y, and B(X+Y) must be converted to =B*(X+Y)

Division requires a slash ( / ) such as X divided by Y is =X/Y.  This also applies to fractions, such as one fifth is written as 1/5.  Fractions can also be written as decimals.

Squares, square roots, cube roots, etc, requires a carrot sign (^).  For spreadsheets xn  is  =X^n.  Examples,  4^(1/2)=2,  4^(0.5)=2,  -9^2=81.  An alternative method involves the function: =POWER(X, n)

The above (=X^n) and =POWER(X, n) also applies to negative exponents, such as when n=-2:  10^-2=0.01,  4^-2=0.0625.

The plus (+) and minus sign (-) are recognized by spreadsheet software, without any modification.

When adding a series of numbers the word =SUM and () is used. For example, for adding vertically in a column =SUM(B6:B12) and for adding horizontally in a row =SUM(A6:E6)

(BASED ON THE ABOVE PRINCIPLES) To create the algebraic calculator the formulas, X=(WB-DV)/(KB-DA), and Y=(V-AX)/B had to be modified as follows:

=(W*B-D*V)/(K*B-D*A) and =(V-A*H2)/B

These formulas were placed in two cells on the spreadsheet.  They solve the equations that were presented in the beginning of this section, which are AX+BY=V and KX+DY=W.  The calculated values for X and Y are displayed in the cells that the formulas =(W*B-D*V)/(K*B-D*A) and =(V-A*H2)/B have been placed in.

In the Algebraic Calculator

^Topic^

The Small Gray, and Large Green Display Boxes: A Challenge

^Subtopic^

A more challenging task, then creating the calculation mechanism of the Algebraic Calculator, was to create the two display boxes.  The reason for this will become apparent in the following paragraphs.

The smaller display box is gray, and it displays equations (AX+BY=V and KX+DY=W) when they have single-digit numbers for A and B, or K and D, excluding decimals.  All the numbers represented by the A, B, V, K, D, and W are rounded to remove all decimal places when they are displayed in the gray box.  This does not affect calculated results, because the numbers rounded for this relatively small display box are not used for calculations.

The larger display box is green, and the software presents equations in this box when the A and B, or K and D have more than one digit, (excluding decimals).  The smaller gray box displays equations in the conventional format.  The larger green box displays equations in a vertical format, which can accommodate equations that have numbers with many digits.  For example, the conventional format is obviously AX+BY=V.  What I mean by the vertical format is as follows:

+

BY

=V

An example, with numbers using the vertical format is presented below, and the X and Y variables are on the left, and there is plenty of room for many digits.

12346678789900467899055555551133.9876X

+

23434544444444442123999223456331.0899Y

= 234656678798990

Note, I do not know if anyone else has used a vertical format, or something similar to it.  However, I found it to be quite practical when dealing with equations that have coefficients with many digits, or equations that have many variables.

Strings of Computer Code

For The Display Boxes: Display Formulas

^Subtopic^

The challenge with creating the display boxes was not simply related to the conventional of vertical format, discussed above.  The display boxes required formulas (strings of computer code) that would evaluate the number of digits in the values for A, B, K, and D, and to determine if an equation should be displayed in the small gray box or large green box.  I am calling these formulas display formulas.  (The number of digits for V and W is not a problem in both boxes, because there is enough room to display many digits on the right side of the equations: AX+BY=V, and KX+DY=W.

Two display formulas were needed, for each symbol, in the equations AX+BY=V, and KX+DY=W.  There are seven symbols in each equation, including the plus sign (+) and equal sign (=).  Thus, I had to create 28 formulas.  These formulas were not the same for each symbol.  For example, the formula for the plus sign in the small gray box needed the capability of presenting a negative sign, when the value of B or D is negative.

I created all of the required formulas using all of the following: The If Function, the Or Function, the ROUND Function, the ABS (absolute value function) and  * +, =>, <, TRUE, ( ), “”, and the comma ( ,).  These formulas are essentially a form of computer code, or computer language, and they are listed below with simplified English interpretations.

111111111111111

Simplified English Interpretations of the

^Subtopic^

Note: The interpretations of the Computer Code Comprising the Display Formulas (for the display boxes) are more detailed for the formulas in the beginning of this discussion.  I assumed that less detail would be needed after reading the translations in the beginning of this subsection, because there is some similarity between many of these formulas.

All of the following formulas display symbols in the cell that the formula has been placed in.  For example, if a formula has been placed in the upper portion of the gray box, in cell F9, the formula will conceal or display a symbol in cell F9.

Formulas that Control the Display of AX+BY=V

In the Small Gray Display Box

^Subtopic^

Notes:

The following formulas are for the gray display box, and they are highlighted in gray.

The locations indicated in the following interpretations are determined by the location of the cell that the formula was placed in

=IF((OR( ABS(A)>9, ABS(B)>9, ))=TRUE, "",ROUND(A, 0 )  If the absolute value of A or B, is greater than 9, (=TRUE) then do not display the values of A or B, but if this is not the case, (absolute values of A and B are less than or equal to 9) round down the value for A to zero decimal places, and display it in the upper portion of the gray box.

=IF((OR(ABS(A)>9,ABS(B)>9,))=TRUE,"","X")  If the absolute values of A or B is greater than 9, do not display anything, but if this is not the case, (the absolute values of A and B are less than or equal to 9) then display the X term in the upper portion of the gray box.

=IF((OR(ABS(A)>9, ABS(B)>9, ))=TRUE, "", IF(B<0, "-", "+"))  If the absolute value of A or B is greater than 9, do not display anything, but if this is not the case, display the plus or minus sign, in the upper portion of the gray box.  If B is less than zero display the minus sign, in the upper portion of the gray box, if this is not the case, (B is greater than zero) display the plus sign, in the upper portion of the gray box.

=IF((OR(ABS(A)>9, ABS(B)>9, )0)=TRUE, "",ROUND(ABS(B), 0 ))

If the absolute value of A or B is greater than 9, display nothing, if this is not the case, (absolute values of A and B is less than or equal to 9) round down the absolute value of B to zero decimal places, and display B, in the upper portion of the gray box.  (The absolute value of B is displayed because, the plus or minus sign is produced by the formula above this one.)

=IF((OR(ABS(A)>9, ABS(B)>9,))=TRUE,"","Y")  If the absolute value of A or B is greater than 9, display nothing, if this is not the case, (absolute values of A and B are less than or equal to 9) display Y, in the upper portion of the gray box.

=IF((OR(ABS(A)>9, ABS(B)>9,))=TRUE,"","=")  If the absolute value of A or B is greater than 9, display nothing, if this is not the case, (absolute values of A and B are less than or equal to 9) display the equal sign in the upper portion of the gray box.

=IF((OR(ABS(A)>9, ABS(B)>9, ))=TRUE, "",ROUND(V, 0 ))  If the absolute value of A or B is greater than 9, display nothing, but if this is not the case, (absolute values of A and B are less than or equal to 9) round the value of V to zero decimal places, and display it.

Formulas For The Display Of KX+DY=W,

In The Small Gray Display Box

^Subtopic^

Notes:

Code for the gray display box is highlighted in gray.

The locations indicated in the following interpretations are determined by the location of the cell that the formula was placed in

=IF((OR( ABS(K)>9, ABS(D)>9, ))=TRUE, "",ROUND(K, 0 )) If the absolute value of K or D is greater than 9, display nothing, but if this is not the case, display the value of K, rounded to zero decimal places, in the lower portion of the gray box.

=IF((OR(ABS(K)>9, ABS(D)>9,))=TRUE,"","X"  If the absolute value of K or D is greater than 9, display nothing, but if this is not the case display X, in the lower portion of the gray display box.

=IF((OR(ABS(K)>9, ABS(D)>9, ))=TRUE, "", IF(D<0, "-", "+"))  If the absolute value of K or D is greater than 9 display nothing, but if this is not the case, display in the lower portion of the gray box: the minus sign if D is less than zero, but if D is equal to or greater than 0, display the plus sign.

=IF((OR( ABS(K)>9, ABS(D)>9, ))=TRUE,  “”, “D")  If the absolute value of K or D is greater than 9 display nothing, but if this is not the case, display D, in the lower portion of the gray box.

=IF((OR(K>ABS(9), ABS(D)>9,))=TRUE,"","Y")  If the absolute value of K. or D is greater than 9, display nothing, but if this is not the case display Y.

=IF((OR(ABS(K)>9,ABS(D)>9,))=TRUE,"","=")  If the absolute value of K or D is greater than 9, display nothing, but if this is not the case display the equal sign in the lower portion of the gray box.

=IF((OR(ABS(K)>9, ABS(D)>9, ))=TRUE, "",ROUND(W, 0 ))  If the absolute value of K or D is greater than 9, display nothing, but if this is not the case, display in the lower portion of the gray box, the value of W, rounded to zero decimal places.

Formulas for the Display of AX+BY=V

In the Large Green Display Box

^Subtopic^

Notes:

The following formulas are for the green display box, and they are highlighted in green.

The locations indicated in the following interpretations are determined by the location of the cell that the formula was placed in

=IF((OR( ABS(A)>9, ABS(B)>9, ))=TRUE, A, "")  If the absolute value of A or B is greater than 9, display A, in the left section of the green box, but if this is not the case display nothing.

=IF((OR( ABS(A)>9, ABS(B)>9, ))=TRUE, "X", "")  If the absolute value of A or B is greater than 9, display X, in the left section of the green box, but if this is not the case display nothing.

=IF((OR( ABS(A)>9, ABS(B)>9, ))=TRUE, "+", "")  If the absolute value of A or B is greater than 9, display the plus sign, in the left section of the green box, but if this is not the case display nothing.

=IF((OR( ABS(A)>9, ABS(B)>9, ))=TRUE, B, "")  If the absolute value of A or B is greater than 9, display B, in the left section of the green box, but if this is not the case, display nothing.

=IF((OR( ABS(A)>9, ABS(B)>9, ))=TRUE, "Y", "")  If the absolute value of A or B is greater than 9, display Y in the left section of the green box, but if this is not the case display nothing.

=IF((OR( ABS(A)>9, ABS(B)>9, ))=TRUE, "=", "")  If the absolute value of A or B is greater than 9, display the equals sign, in the left section of the green box, but if this is not the case display nothing.

=IF((OR( ABS(A)>9, ABS(B)>9, ))=TRUE, V, "")  If the absolute value of A or B is greater than 9, display V in the left section of the green box, but if this is not the case display nothing.

Formulas for the Display of KX+DY=W

In the Large Green Display Box

^Subtopic^

Notes:

Code for the green display box is highlighted in green.

The locations indicated in the following interpretations are determined by the location of the cell that the formula was placed in

=IF((OR( ABS(K)>9, ABS(D)>9, ))=TRUE, K, "")  If the absolute value of K or D is greater than 9, display K, in the right section of the green box, but if this is not the case display nothing.

=IF((OR( ABS(K)>9, ABS(D)>9, ))=TRUE, "X", "")  If the absolute value of K or D is greater than 9, display X, in the right section of the green box, but if this is not the case display nothing.

=IF((OR( ABS(K)>9, ABS(D)>9, ))=TRUE, "+", "") If the absolute value of K or D is greater than 9, display the plus sign, in the right section of the green box, but if this is not the case display nothing.

IF((OR( ABS(K)>9, ABS(D)>9, ))=TRUE, D, "")  If the absolute value of K or D is greater than 9, display D, in the right section of the green box, but if this is not the case display nothing.

=IF((OR( ABS(K)>9, ABS(D)>9, ))=TRUE, "Y", "")  If the absolute value of K or D is greater than 9, display Y, in the right section of the green box, but if this is not the case display nothing.

=IF((OR( ABS(K)>9, ABS(D)>9, ))=TRUE, "=”,"")  If the absolute value of K or D is greater than 9, display the equal sign, in the right section of the green box, but if this is not the case display nothing.

=IF((OR( ABS(K)>9, ABS(D)>9, ))=TRUE, W, "") If the absolute value of K or D is greater than 9, display W, in the right section of the green box, but if this is not the case display nothing.

Computer Code in the Form of Spreadsheet Formulas

^Topic^

A User Controllable Rounding Mechanism

In general, it is often necessary to round down numbers to a specific number of decimal places, especially when the numbers are calculated results.  Very often, the last few decimal places of a calculation are not needed, or not mathematically significant.  This can happen when the calculations are based on measurements that are less precise than the calculated results.

Rounding down the number of decimal places can also prevent confusing rounding errors.  That is computers often make slight calculation errors when converting to binary and back to the decimal system.  This often involves a whole number, followed by a decimal point, and a series of nines.  For example, when the correct calculation should result in 2, the computer calculates 1.999999999999.

Calculation devices often have built-in mechanisms to round down calculated results to a predetermined number of decimal places, such as six decimal places.  The Algebraic Calculator has such a mechanism, but it is controllable by the user.  That is the user can enter a number in an input box to delineate the number of decimal places needed for a calculation, with the Algebraic Calculator.  This can be done before the calculations are started, or after the calculated results have been obtained.

Interestingly, the number in the input boxes, to control the number of decimal places, can be equal to or less than zero.  That is the number of decimal places can be rounded down to a negative number.  To explain this I will use the number 1234.123 as an example.  When this number is rounded to one decimal place it is 1234.1.  When it is rounded to zero decimal places it is 1234, -1 decimal places it is 1230, -2 decimal places it is 1200, and -3 decimal places it is 1000.

I created the rounding mechanism described above, with the input boxes, for the user to control the number of decimal places.  I did this by modifying the conventional Microsoft Excel formula, for rounding numbers.  The conventional formula is as follows: .  My modification involved entering a cell designation instead of the number of decimal places in the formula.  For example, if X is the number, and 28E is a cell designation, then the modified formula is =ROUND(X, 28E).  With this example, cell E28 is an input box.  That is the number of decimal places of the calculation is determined by the number entered in cell 28E, with this example.

A generalized version of the above formula is:

=ROUND(number, cell designation).  This formula will also function in OpenOffice Calc, and probably in a number of other brands of spreadsheet software.  The formula and the related concept have potential utility with many types of calculation devices.  The general concept, (input boxes to allow users to control the number of decimal places of calculated results) can be incorporated into the design of any type of calculation device.  However, the configuration of the formula as presented above only applies to spreadsheets, or any format that was created by converting a spreadsheet, such as JavaScript.

The Algebraic Calculator has two input boxes to control the number of decimal places, one is for the calculated results of X and Y, and the other is involved with error checking.  Both of these boxes are set at six decimal places, which can be increased or decreased, as explained above.

^Subtopic^

The algebraic calculator has a built-in checking mechanism to determine if the numbers the user entered are valid for both equations AX+BY=V and KX+DY=W.  This mechanism also checks for other types of errors, such as numbers that are out of range of the calculator, rounding errors, and errors that result from certain types of malfunctioning hardware and software.

Note: For most numbers entered into the algebraic calculator, with less than six digits the error will be zero.  Errors are most likely to happen when numbers involve many digits, especially if some of the numbers are very small and others are extremely large.  As will be explained later, the degree of error is calculated and displayed.

The algebraic calculator checking mechanism functions the same way that a human would check an algebraic calculation, which is by substituting the calculated results into the equations AX+BY=V and KX+DY=W.  When this is done, if the substituted values for X and Y equals V for the first equation, and W for the second equation the calculated results are confirmed.

For example, a human would carry out the following to check the calculated results of X=10 and Y=-3 for the equations: 7X+8Y=46 and 6X+8Y=36:

To check the first equation:

7(X=10)+8(Y=-3)=46

7(10)+8(-3)=46

70-24=46.  This result, of 46,

confirms the validity of the calculations.

To check the second equation:

6(X=10)+8(Y=-3)=36

6(10)+8(-3)=36

60-24=36  This result, of 36,

confirms the validity of the calculations.

The Algebraic Calculator checks the calculated results for X and Y in a way that looks somewhat complex, but it is based on the method described above.  However, when software and computers perform even relatively simple processes, computer code is required.  In this case the computer code is in the form of spreadsheet formulas, which are presented below with interpretations:

For AX+BY=V the following formulas are used (XR=X and YR=Y):

=ROUND((A*XR+B*YR), E28)

=ROUND(V, E28)

=IF((ABS(D24-D25))>(5/100), "NOT VALID", (D24-D25))

A simplified English translation of the above is: The computer substitutes the calculated values for X and Y into the equation AX+BY=V to determine the calculated value of V, which I will call Vcalculated.  Then the computer rounds the value for Vcalculated to the number of decimal places indicated in cell 28.  When this has been completed, a formula in another cell, obtain the value that the user entered for V, which I will call Vuser.  Then, Vuser is rounded down to the number of decimal places indicated in cell 28.  In still another cell, the degree of error is calculated by subtracting the above results, which are:  Vuser - Vcalculated=ERROR.  If the absolute value of the ERROR is greater then 5/100, the computer display the words: NOT VALID, but if this is not the case, the computer display the degree of the calculated ERROR.

For KX+DY=W the following formulas are used (XR=X and YR=Y):

=ROUND((K*XR+D*YR), E28)

=ROUND(W, E28)

=IF((ABS(D26-D27))>(5/100), "NOT VALID", (D26-D27))

An English translation of this code is the same as above, except it is based on this formula: KX+DY=W, and the value the user entered for W and the calculated value for W.

Note that the error checking mechanism I created for the algebraic calculator has a controllable rounding mechanism, as described previously.  This allows the user to control the number of decimal places involved with the error checking.  This is necessary to prevent confusing rounding errors.  For example, if the user entered 6 for W, and the correction mechanism calculated 5.99999999999 for W, which might give the false impression of a significant error, to some people.  By rounding down the above to ten decimal places, or less, the rounding error is eliminated, and the number becomes 6.

Services Offered by the Author

^Topic^

^Subtopic^

Note: The material on this website is technical, and to understand every detail requires slow and careful reading.  In addition, knowledge of mathematics and some familiarity with spreadsheets and computer technology is also needed for maximum comprehension.  However, portions of the material, excluding the precise details, can be understood by almost anyone.

Services Offered by the Author David@TechForText.com

^Subtopic^

I design and build user-friendly software based calculation devices for arithmetic, accounting, currency exchange rates, algebra, trigonometry, correlations, calculus, and databases with built-in calculation devices.  I also create attractive online calculation devices for websites.  I generally make these devices in the Microsoft Excel, OpenOffice.org, and the JavaScript formats, but I can work with other spreadsheet formats besides the above.

I can create web communication forms for your website, such as the form on the top of this page.  This can also include forms with built-in calculation devices.

I write instructions for the devices I build.  I can also write instructions for software and computer devices created by others.  In addition, I can write advertising for your websites, products and services.

For a list of all the services I offer see www.TechForText.com

For a list of all my websites see www.David100.com

My resume is online at: www.David100.com/R

I can provide the services mentioned above on a fee-for-service basis, or possibly based on temporary or permanent employment.  If you are interested in my services, and want additional contact information or more data on the services I offer, you can email me at David@TechForText.com or use the website communication form, by left clicking on these words.

I am located in the USA.  If you are a great distance from my locality or are in another country, this is not important.  I can provide these services worldwide, because the software and websites I make can be delivered through the Internet to any locality, providing there are no governmental restrictions.

To return to the top of this website left click on these words