November 30, 2022, 01:16:35 PM
Forum Rules: Read This Before Posting

### Topic: Math approach for the general mixture problem.  (Read 1978 times)

0 Members and 1 Guest are viewing this topic.

#### javhert

• Regular Member
• Posts: 18
• Mole Snacks: +1/-0
##### Math approach for the general mixture problem.
« 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:
• For lack of better terms to me, it seems that elements aren't entirely "free" or independent of one another even if they can come from multiple salts since I get many compositions without a solution.
• Sometimes I get negative quantities of starting salts but that is obviously out of the question. Is there a theorem that could help me see if all roots of a system of equations can be positive assuming all coeficients are positive?
• I can make some of the elements in the composition "free to vary" (for example, sodium isn't a part of the specification all the time), but even then sometimes answers are odd.

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.

#### Enthalpy

• Chemist
• Sr. Member
• Posts: 3856
• Mole Snacks: +300/-59
##### Re: Math approach for the general mixture problem.
« Reply #1 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.