Hi.
Can you help me how to balance a chemical equation using linear algebra. I know how to do it on a piece of paper using the usual method of balancing. I just don't get the principle how to do it on the other method.

Please give me a step by step procedure on how to do it, the basic ones.

This is how far I have gone.
Ex: Fe + Cl2 = FeCl3

Set a variable for each
[A]Fe + Cl2 = [C] FeCl3

Count the number of coefficients
Fe: A = C
Cl: 2B = 3C

And I'm stuck with here. I don't know how will I get 2Fe + 3Cl2 = 2FeCl3 (the correct answer)

If you have a better/easy one, can you please post it here. I need to create a program that will balance a given equation. I don't have a problem anymore on extracting the values, chemical symbols, and coefficients. My professor gave me until May 10 to do this so I need a quick response.

Hoping you could help me,
Michael

So, show how you solve this on paper. Then we can probably help you reflect that algorithm as pseudo code that you can fairly easily implement in a number of programming languages.

I will use the example above, Fe + Cl2 = FeCl3

Fe on left hand side has 1 atom, same with the right hand side so they are equal.
Cl on left hand side has 2 atoms, and 3 atoms on the right hand side.
To make Cl equal, I am adding 3 more Cl on left hand, and 2 on the right hand so that makes Fe + 3Cl2 = 2FeCl3.
They aren't balance yet since Fe on the left hand side has only 1 atom while Fe on the right hand side has 2 atoms. Now to make it balance, I am adding another two on the left, so that makes 2Fe + 3Cl2 = 2FeCl3

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.