Chemical Forums

General Forums => Generic Discussion => Topic started by: javhert on November 09, 2018, 05:43:52 PM

Title: Math approach for the general mixture problem.
Post by: javhert on November 09, 2018, 05:43:52 PM
I'm having to deal with the kind of "here's the target composition of the product, get the adequate amounts of starting materials which contains the given percentages of each element" problem. This can be solved via trial and error once but since I'm probably having to do it several times and I want optimized answers, I want to use general system of equations / linear algebra approach.

I need to deal with like 6 - 8 elements and 5 - 6 starting salts problem, so the usual two variable problems that come as examples on the web don't cut it. Although I already made the equations for the mass balance of each element, I'm coming into trouble after solving the systems using Gauss-Jordan elimination:

Anyone knows of resources about this problem? Seems to me like something that should be solved and known by now, but rigorous math approaches to chemistry problems doesn't seem to be easy to search.

RELATED: Anyone who knows about a rigorous approach to the systems of polynomial equations that appear in equilibria problem please provide a link.
Title: Re: Math approach for the general mixture problem.
Post by: Enthalpy on November 29, 2018, 07:08:01 AM
Positive solutions are wanted in many problems, including some I learned in a classroom, and I've never seen any theorem about their existence, especially with sets of linear equations. Maybe there is no theorem?

In operational research, where an optimum is sought rather than an exact solution, the algorithm is to follow the slope along the constraint boundaries, especially the constraint of positive solutions. This lets me suppose that no better theory is known.

That you can't obtain any mixture composition from a given set of ingredients is clear. Conversely, attempting to obtain some mixture compositions will lead to mathematical solutions impossible to implement.

Maybe no general theorem, but for a given set of ingredients, you can determine a hypervolume of the possible mixture compositions. You know that its boundaries are hyperplanes due to the linear nature of mixture equations. With 6 starting salts, it looks unmanageable by hand, so write a software if it's worth it. You know that the hyperplanes pass by some points of simple composition, like 0% and 100% of each ingredient, and vary linearly in between. Something like a vector product gives a direction of the hyperplane, and a mixed product (scalar product with the vector product) tells on which side of one hyperplane the point of a desired composition is. The composition must be on the >=0% side of the corresponding hyperplanes and on the <=100% side of the others.

To increase your chances, you need ingredients whose compositions are as varied as possible.