I am working on computing phase diagrams for alloys. These are blueprints for a material that show what phase, or combination of phases, a material will exist in for a range of concentrations and temperatures (see this pdf presentation).
The crucial step in drawing the boundaries that separate one phase from another on these diagrams involves minimizing a free energy function subject to basic physical conservation constraints. I am going to leave out the chemistry/physics and hope that we can move forward with the minimization using Lagrange multipliers.
The free energy that is to be minimized is this:
$\widetilde{G}(x_1, x_2) = f^{(1)}G_{1}(x_1) + f^{(2)}G_{2}(x_2),$
subject to:
$f^{(1)}x_1 + f^{(2)}x_2 = c_1,$
$f^{(1)} + f^{(2)} = 1. $
(and also that the $x_{i} > 0$ and $f^{(i)} > 0$, for $i=1,2$.)
The Lagrange formulation is:
$L(x_1,x_2,f^{(1)},f^{(2)},\lambda_1, \lambda_2, \lambda_3) = f^{(1)}G_{1}(x_1) + f^{(2)}G_{2}(x_2)$
$- \lambda_{1}(f^{(1)}x_1 + f^{(2)}x_2 - c_1)$
$- \lambda_{2}(f^{(1)} + f^{(2)} - 1) $
The minimization of $\widetilde{G}$ follows from finding the $x_{i}$'s that satisfy $\nabla L = 0:$
$\frac{\partial L}{\partial x_{1}} = f^{(1)}G_{1}'(x_1) - \lambda_{1}f^{(1)} = 0$
$\frac{\partial L}{\partial x_2} = f^{(2)}G_{2}'(x_2) - \lambda_{1}f^{(2)} = 0$
$\frac{\partial L}{\partial f^{(1)}} = G_{1}(x_1) - \lambda_{1}x_{1} - \lambda_2 = 0$
$\frac{\partial L}{\partial f^{(2)}} = G_{2}(x_2) - \lambda_{1}x_{2} - \lambda_2 = 0$
which yields:
$(*) f^{(1)}\left[G_{1}'(x_1) - \lambda_1 \right] = 0$
$(**) f^{(2)}\left[G_{2}'(x_2) - \lambda_1 \right]= 0 $
$(\***) G_{1}(x_1) - G_{2}(x_2) = \lambda_1 \left[ x_1 - x_2\right]$
Because $f^{(1)}$ and $f^{(2)}$ are not to be zero, from (*) and (**) we have that
$G_{1}'(x_1) = G_{2}'(x_2) = \lambda_{1}.$
And, a manipulation of equation (***) looks like
$\frac{G_{1}(x_1) -G_{2}(x_2)}{x_1 - x_2} = \lambda_{1}.$
Now, think of $G_{i}$ as an even degree polynomial (which it isn't, but it's graph sometimes resembles one) in the plane. Let the points $x_1$ and $x_2$ be locations along the x-axis that lie roughly below the minima of this curve. The constraints (*),(**), and (***) describe the condition that the line drawn between $(x_1,G_{1}(x_1))$ and $(x_2,G_{2}(x_2))$ form a common tangent to the "wells" of the curve. It is these points $x_1$ and $x_2$, which represent concentrations of pure components in our alloy, that become mapped onto a phase diagram. It is essentially by repeating this procedure for many temperatures that we can trace out the boundaries in the desired phase diagram.
The question is: Looking at this from a purely analytic geometry perspective, how would one derive the "variational" approach to find a common tangent line that we seem to have found using the above Lagrangian? (warning: I don't really know how to model things using variational methods.)
And, secondly: I have presented a model of a binary alloy, meaning two variables to keep track of representing concentrations. I have been working on ternary alloys, where this free energy $\widetilde{G}$ is a function of three variables (two independent: $x_1,x_2,x_3$, where $x_3 = 1- x_1 - x_2$) and is therefore a surface over a Gibbs triangle. Then $\nabla L = 0$ produces partial derivatives that no longer "speak geometry" to me, although the solution is a common tangent plane. (I have attempted to characterize a common tangent plane based purely in analytic geometry - completely disregarding the Lagrangian - and have come up with several relations between directional derivatives... How might directional derivatives relate to the optimality conditions set forth by the Lagrangian?)
EDIT: Thank you Greg Graviton for wading through this sub-optimal notation and pointing out several mistakes in the statement of the problem. (Also, thank you for the excellent discussion below.)