Solved

Simultaneous equations

Posted on 2004-09-16
8
920 Views
Last Modified: 2008-02-01
What is the concept behind solving simultaneous equations in visual basic?  I want to make a prgram to balance chemical equations, and this is part of it.  the maximum unknowns will probably be 5.  but i am not sure how to do it.  please help.

also, is there any good way of making this balancer?  any suggestions are welcomed.  thanks.
0
Comment
Question by:djiangr
8 Comments
 
LVL 5

Expert Comment

by:tzxie2000
ID: 12075152
I suggest you to use matlab
It will be more fit to balance chemical equations
0
 
LVL 3

Accepted Solution

by:
KeithWatson earned 25 total points
ID: 12076353
I don't know if there's anything off the shelf to do this; however, solving simultaneous equations using computers is typically done using a technique called Gaussian elimination, which is programmable as compared with the intuitive method that's taught in school.

Here's a link to a page describing the technique:

http://mathworld.wolfram.com/GaussianElimination.html
0
 
LVL 16

Expert Comment

by:OliWarner
ID: 12076554
yarr, it may call the technique of solving them: matricies

Its a pretty similar idea apart from matricies go on a lot further as to solving more unknowns... its a big thing we did in a maths unit for degree level Computer Science
0
 
LVL 37

Assisted Solution

by:Harisha M G
Harisha M G earned 25 total points
ID: 12078155
There are many ways to solve simultaneous equations.

1) Matrix method
2) Determinant method (Cramer's rule)
3) By direct solving (As we do for 2 unknowns)

Among these most effecient method is 2).
But it is unfortunate that you should use a good algorithm to get the determinant of the matrices of any order. Because you have stated that the number of unknowns may be upto 5.

If you succeed in getting the Determinant then your problem is solved. Determinant can be found by using Recursion Technique.

For ex:
ax + by + cz = p
dx + ey + fz = q
gx + hy + iz = r

can be solved as
x = Δ1/Δ
y = Δ2/Δ
z = Δ3/Δ

where
      | a b c |          | p b c |         | a p c |           | a b p |
Δ = | d e f |  Δ1 = | q e f |  Δ2 = | d q f |  Δ3 =  | d e q |
      | g h i |           | r h i |          | g r i |            | g h r |

Good Luck!
0
 
LVL 6

Assisted Solution

by:DominicCronin
DominicCronin earned 25 total points
ID: 12092929
The dotnet framework even has a Matrix class. Unfortunately it's only a 3 x 3 (it's intended for use in graphics processing) so it's not a solution for your problem, but worth a look just for interest's sake.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/_gdiplus_matrix_representation_of_transformations_about.asp

Also interesting:

http://www.euclideanspace.com/maths/algebra/matrix/

0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
zeroFront challenge 7 71
wordsWithout 49 79
Specific format 21 140
wordmultiple challenge 12 89
Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now