CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2009
    Posts
    6

    Question Stoichiometry Program

    Hi there. I recently had an assignment to develop a program of my own choosing and came across the idea of creating one to balance chemical equations. However, I could not find any useful information or tutorials through searching the web and thought someone here might be able to help me out. So far, all I know is that you need to use matrices for the coefficients.

    Any help is appreciated, thanks!

  2. #2
    Join Date
    Jun 2009
    Location
    Israel
    Posts
    126

    Re: Stoichiometry Program

    What you ask here is very general. What exactly do you need help with?
    Designing the program? Writing the program? The chemistry issue itself?

  3. #3
    Join Date
    Dec 2009
    Posts
    6

    Re: Stoichiometry Program

    I guess I'm missing the conceptual and implementation parts, ie- where are the matrices/equations derived from and how does that translate into the code. I picked up a lot from http://www.personal.psu.edu/jzl157/balance.htm and it seems that you just add the subscripts from either side, and perform the balancing operations from there but I still can't seem to get a good grasp of it.

    Sorry if this is confusing as I'm still pretty confused myself.. =s

  4. #4
    Join Date
    Jun 2009
    Location
    Israel
    Posts
    126

    Re: Stoichiometry Program

    Still, you are asking very general questions. I can't understand which help exactly do you need.
    Consider the follwing question that may guide you:

    Which kind of equation do you want to balance?

    Which programming language do you want to use? (I guess Java because you are writing in this forum)

    What is the input and output of your program will look like?

    Which data are you going to hold and in which data structures?

    What is the scheme (algorithm) of balancing a given equation?

    First, try to answer those questions, and by this way, all the design and implementation issues will be much clearer. Of course you are welcome to consult here with any issue comes on your mind.

  5. #5
    Join Date
    Dec 2009
    Posts
    6

    Re: Stoichiometry Program

    If you ever get this working I'd love to have a look at it, I've been wondering about this for a while.

    Sorry I can't be of any assistance, I'm a total noob.

  6. #6
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: Stoichiometry Program

    Quote Originally Posted by -tr View Post
    I guess I'm missing the conceptual and implementation parts, ie- where are the matrices/equations derived from and how does that translate into the code.
    First you have to find the algorithm for the task. This is not a Java problem. Once you have the algorithm, you need to figure out how to apply it in the abstract (e.g. on paper) in a stepwise way. This isn't a Java problem either. When you have worked out exactly the steps needed to execute the algorithm, and what data items you need to keep track of values, then you can translate it into a programming language, e.g. Java. When you're starting out, it's worth trying to write some pseudo-code first, to knock the thing into shape, so you don't get distracted by syntactic technicalities.

    Trying to do more than one of these phases at the same time will probably be far slower and more frustrating than doing each phase separately.

    The hardest part of the software task is arriving at a complete and consistent specification, and much of the essence of building a program is in fact the debugging of the specification...
    F. Brooks
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

  7. #7
    Join Date
    Dec 2009
    Posts
    6

    Re: Stoichiometry Program

    Yeah, I suppose this program might be a little out of my scope for a bit. It's been far too long since I've done any math like that.

    But, if anybody has any links/whatever to help me get started I'd be glad to look at it. =)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured