A85: Algorithm


[Prev][Next][Index][Thread]

A85: Algorithm




I have decided against using the algorithm of assigning each coefficient
a variable title.  It would be very difficult to have the calculator
interpret equations and then solve them for variables.  I know the TI-89
does a very good job of that, but unfortunately, the TI-85 does not. 
Below is an example of the method I plan on using.  Please make any
comments or suggestions as you see fit.

H2 + O2 -> H2O                            check H: 2H = 2H; check O: 2O >
O

Since there is a discrepancy, we multiply the coefficients:

H2 + O2 -> 2H2O                          check H: 2H < 4H (H<2H)

Multiply the coefficients after each is divided by the greatest common
factor:

2H2 + O2 - > 2H2O                      check O: 2O = 2O

Another example:

Fe2O3 + Al -> Fe + Al2O3                      Fe2[O3] > Fe

Fe2O3 + Al -> 2Fe + Al2O3                    Al < Al2[O3]

Fe2O3 + 2Al -> 2Fe + Al2O3


CO + O2 -> CO2                                       [C]O + O2 > [C]O2

CO + O2 -> 2CO2                                     C[O] <2C[O2]

2CO + O2 -> 2CO2


This might not be the most efficient method possible, but so far it
works, and it won't take too much code to implement.  When there are
multiple substances on one side of the equation containing commom
elements, you work with the substance with the least amount of the one
element.  At least this is how I have done it so far, and it has worked.

C6H12O6 + O2 -> CO2 + H2O               6C[H12O6] > C[O2]

C6H12O6 + O2 -> 6CO2 + H20              [C6]12H[O6] > H2[O] (6H > H)

C6H12O6 + O2 -> 6CO2 + 6H20           [C6H12]O6 + O2 > 6[C]O2 + 6[H2]O
less O in O2

                                                                     
(18-6)/2 + coefficient for O2

C6H12O6 + 6O2 -> 6CO2 + 6H20

Justin Bosch
justin-b@juno.com

___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]