October 02, 2022, 02:59:56 AM
Forum Rules: Read This Before Posting


Topic: Ammonium Chloride to Ammonia + HCl  (Read 15470 times)

0 Members and 1 Guest are viewing this topic.

Offline Enthalpy

  • Chemist
  • Sr. Member
  • *
  • Posts: 3822
  • Mole Snacks: +300/-59
Re: Ammonium Chloride to Ammonia + HCl
« Reply #15 on: May 03, 2015, 05:30:32 PM »
I too would enjoy recommendations about an equilibrium software. No idea what already exists. Did I see one for aqueous electrolytes?

Problem is: at moderate temperature, >>billions of different compounds are possible, and the final one depends on the synthesis path, not just the reactants' elements, so a software can't decide autonomously what product shall appear. Many different approaches are possible:
  • The user types every compound, inputs their thermodynamic properties. The software gives an equilibrium at a given T and P. About the complexity of a spreadsheet.
  • Slightly better: the software equilibrates the reactions and converts the units.
  • The soft knows hundred compounds: CO, CO2, H2O, NO, H3O+... including their change of state maybe. The user types the others. Still accessible to a university project.
  • The soft knows all compounds in the Crc Handbook or a database, possibly a set of solvents.

Offline curiouscat

  • Chemist
  • Sr. Member
  • *
  • Posts: 3005
  • Mole Snacks: +121/-35
Re: Ammonium Chloride to Ammonia + HCl
« Reply #16 on: May 03, 2015, 09:57:19 PM »
Your standards are too high.  ;D

Personally I'd be happy enough with a code that reliably computed equilibria for species & reactions I chose.

Offline curiouscat

  • Chemist
  • Sr. Member
  • *
  • Posts: 3005
  • Mole Snacks: +121/-35
Re: Ammonium Chloride to Ammonia + HCl
« Reply #17 on: May 03, 2015, 09:59:20 PM »

Problem is: at moderate temperature, >>billions of different compounds are possible, and the final one depends on the synthesis path, not just the reactants' elements, so a software can't decide autonomously what product shall appear.


Can you clarify what you mean by this? I always thought equilibrium was independent of the nature / number / difficulty of connecting synthetic paths.

Offline Enthalpy

  • Chemist
  • Sr. Member
  • *
  • Posts: 3822
  • Mole Snacks: +300/-59
Re: Ammonium Chloride to Ammonia + HCl
« Reply #18 on: May 05, 2015, 01:14:42 PM »
Can you clarify what you mean by this? [Enthalpy's: "the final one depends on the synthesis path"] I always thought equilibrium was independent of the nature / number / difficulty of connecting synthetic paths.

Often, the user wants to compute an equilibrium among a limited set of possible species, which may not include the all-best equilibriium species because these are out of reach for the conditions. For instance, to evaluate the acidity of aqueous NaClO3, you suppose it doesn't decompose into the more favourable NaCl and O2. I could have put it clearer from the beginning.

For these useful purposes, the user has to specify what products must be equilibrated by the software. It is a difference with Propep, which knows a set (200? 500?) of potential products and choses amont them according to the propellants' elements and according to the combustion conditions, without user intervention.

Though, it doesn't look more complicated at all for the software, rather easier, changed my mind. Just different programming.

Offline Enthalpy

  • Chemist
  • Sr. Member
  • *
  • Posts: 3822
  • Mole Snacks: +300/-59
Re: Ammonium Chloride to Ammonia + HCl
« Reply #19 on: May 05, 2015, 01:37:52 PM »
Your standards are too high.  ;D
Personally I'd be happy enough with a code that reliably computed equilibria for species & reactions I chose.

For each possible species, you would have to type the formation enthalpy, entropy or Gibbs, heat capacity (possibly a polynom of the temperature). Then, such a software is but more than a spreadsheet. I bet it exists for Mathcad/Maple/Mathematica/Matlab/etc.

But...

Wouldn't you expect the software to equilibrate all the reactions? This would avoid mistakes and save time. Between just two reactants and three products, there are already many reactions and error sources.

You'd get tired very soon (or at least I would) to type thermo data again and again at every use, every equilibrium. The very minimum I expect from such a software is that is knows the thermo data for all usual small molecules like H20, CO, CO2... there must be 100 to 1000 of them.

As well, the software better knows the phase changes for common compounds, in order to avoid elementary mistakes.

And so on and so forth... My bet is that, as soon as someone has a little software that works in one particular case (say, only aqueous ions) he will immediately want to make it more general.

The best strategy looks like:
(1) Find a software that already exists, or
(2) Let a university develop it for free, then put your company's name on it and sell;
(3) Make the soft very general from the beginning, but start small. It looks like a many-years project.

Offline Enthalpy

  • Chemist
  • Sr. Member
  • *
  • Posts: 3822
  • Mole Snacks: +300/-59
Re: Ammonium Chloride to Ammonia + HCl
« Reply #20 on: May 05, 2015, 04:37:49 PM »
I've just tried a short Google search, and no obvious equilibrium software popped up.

A dozen exist for flames. A few ones for aqueous ions.

Well, if no software exists outside these two narrow cases, it's time to make one. Take several years at a chemistry university, helped by many students.

Make the software very general and flexible right from the beginning, as it will evolve and expand a lot. Use abstract programming techniques, maybe a Lisp programme or a symbol-manipulation overlay on a procedural language; just object-oriented looks too restrictive and clumsy. The flexibility to add data and methods suggests data-driven programming, expert systems, A-lists and the like.

Offline curiouscat

  • Chemist
  • Sr. Member
  • *
  • Posts: 3005
  • Mole Snacks: +121/-35
Re: Ammonium Chloride to Ammonia + HCl
« Reply #21 on: May 06, 2015, 01:27:07 AM »

Well, if no software exists outside these two narrow cases, it's time to make one. Take several years at a chemistry university, helped by many students.


Who's gonna bell the cat? :)

Offline Enthalpy

  • Chemist
  • Sr. Member
  • *
  • Posts: 3822
  • Mole Snacks: +300/-59
Re: Ammonium Chloride to Ammonia + HCl
« Reply #22 on: May 07, 2015, 06:54:10 AM »
Who's gonna bell the cat? :)

I won't. I thought you would.  ;D

Look, I've already drawn a mockup of the software. I helps figure out the users' needs and the project's complexity. Not as complicated and abstract as I had feared, it can be programmed in standard style, but from that simple example:
  • The algorithm knows phase changes and runs stably nevertheless, hum. Includes dissolution by reaction.
  • The algorithm must live with incomplete data like solubilities.
  • Automatic balance of reactions already seems necessary.
  • I wouldn't bear more than one unknown compound per reaction, whose data is input manually. One-shot data can mean just H, S, Cp but reusable data includes Mp, Antoine, Van der Waals or better, Hm, Hv, plus the ionic and non-ionic species with dH and S in varied solvents. Ouch.
  • When dissolution is a reaction, the compounds data base must link to the solvent and solute, seemingly.
  • The compounds data base must have a simple format (txt, maybe xml) so users can edit it and share species, possibly centralized at the software's site.
  • Some nasty details should be foreseen even if not treated immediately. Say, the change in P and mp when a solvent absorbs a compound.
  • Drawing curves as a function of P, T, composition seems necessary.
My feeling is that this software can't start much simpler. If phase changes are excluded, it's limited to reactions strictly within a solvent or completely in gas phase, and then you miss the dissolution of produced NH3 in H2O or the precipitation of NaCl in acetone. Adding such features later would be more complicated than at least foreseeing them from the beginning.

The algorithm and the user's interface are more or less the maximum achievable by a single person (though I've seen bigger ones); it's slightly worse than Rpa for instance (Rocket Propellant Analysis). The data base is beyond one person's reach, but if users find the soft good, they will contribute.

Offline curiouscat

  • Chemist
  • Sr. Member
  • *
  • Posts: 3005
  • Mole Snacks: +121/-35
Re: Ammonium Chloride to Ammonia + HCl
« Reply #23 on: May 07, 2015, 07:44:37 AM »
That mockup looks very nice. What did you use to make it?

Offline curiouscat

  • Chemist
  • Sr. Member
  • *
  • Posts: 3005
  • Mole Snacks: +121/-35
Re: Ammonium Chloride to Ammonia + HCl
« Reply #24 on: May 07, 2015, 07:45:44 AM »
Quote
I won't. I thought you would.  ;D

Waaaay to difficult for my skills. :)

Offline Enthalpy

  • Chemist
  • Sr. Member
  • *
  • Posts: 3822
  • Mole Snacks: +300/-59
Re: Ammonium Chloride to Ammonia + HCl
« Reply #25 on: May 11, 2015, 04:49:07 AM »
Glad that you like the mockup... I used a stone-old bitmap drawing soft to adapt a screenshot, but a programming environment to design Gui software would have been better.

A picture has much convincing power, and in this case, it shows what the software should do and how to use it. Since putting it on Chemicalforums, I feel many people get interested, so maybe the software will exist some day.

Chemical equilibria are difficult to program properly, with an algorithm running smoothly despite the liquid <-> solid transitions. It takes a workable understanding of both thermodynamics and numerical analysis. If Alexander Ponomarenko programmed himself the solver of his Rocket Propulsion Analysis
http://www.propulsion-analysis.com/
then he'd be able to do this one as well.

A big difficulty is the size of the compounds base. 1000 compounds with all properties for gases, solids, liquids, solutions in water, heptane... are already too much for a single author, but the users would soon bang against the limits. This base will obviously grow very much over a long time. Two methods then:
  • Make it a free cooperative project. Maybe one PhD thesis to write the solver and some graphical interface. Then, users will happily contribute the database.
  • Make it commercial from the beginning - but then, pay enough people and data sources, initially and over time, to provide the compounds base to the customers. It does demand capital.

Offline curiouscat

  • Chemist
  • Sr. Member
  • *
  • Posts: 3005
  • Mole Snacks: +121/-35
Re: Ammonium Chloride to Ammonia + HCl
« Reply #26 on: May 11, 2015, 12:41:59 PM »

A picture has much convincing power, and in this case, it shows what the software should do and how to use it. Since putting it on Chemicalforums, I feel many people get interested, so maybe the software will exist some day.


Here's to hoping! It would be very nice to have it for sure.

Quote
Make it commercial from the beginning - but then, pay enough people and data sources, initially and over time, to provide the compounds base to the customers. It does demand capital.

Have you looked at professional Process Simulators? e.g. Aspen / Hysis / Pro2 etc.? My impression is that they can already do a fair bit of equilibrium analysis.

Sponsored Links