# Solve Lagrange multipliers optimization problem

I have two nested solid figure, where $V(a,h,\tau)$ defines the volume and $A(a,h,t)$ defines the surface. The outer solid figure is parametrized in $a_s$,$h_s$ and $t_s$ (they share a common center). Now I raise the Volume of the inner by factor $\alpha$, so

$$V(a_s,h_s,t_s) = \alpha V(a,h,t)$$

The first constraint is that the surface $A$ of the inner raised solid figure is constant: $$A(a,h,t) = A(a_s,h_s,t_s)$$

The second constraint is that the enclosed volume of outer and inner solid figure is constant:

$$V(a_sl, h_s+d, ts) - V(a_s,h_s,t_s) = V(al, h+d, t) - V(a,h,t)$$

If $\alpha$ gets too big, the surface constraint can not be satisfied any more. So I want to maximize this with respect to $\alpha$. The target function has to be $\alpha V(a,h,t)$.

I'm taking the vector derivative in all my parameters (except for $al$, which is the function alipid) and try to solve it symbolically. This runs forever... (several hours by now). Can I check the "progress" somehow? Or is this simply an ill-posed system?

Perhaps I should try to optimize this numerically with some starting values for $a$, $h$ and $t$? Finding good starting values will be difficult, as the system has lots of solutions.

d = 0.1;
V[a_, h_, tau_] := (Sqrt[3]/2) h (Sqrt[3] a + h/3 tau)^2
A[a_, h_, tau_] :=  3 Sqrt[3] a^2 + 2 a h Sqrt[1 + tau^2] +
h (2 a + Sqrt[3]/3 h tau) Sqrt[4 + tau^2]

alipid[a_, h_, tau_, d_] := a + d Sqrt[3]/
6 ((1 + Sqrt[1 + tau^2] - tau )/(1 + Sqrt[1 + tau^2] + tau ) +
(2 + Sqrt[4 + tau^2] - tau)/(2 + Sqrt[4 + tau^2] + tau))

eqns := {α V[a, h, t] + λ1 (A[as, hs, ts] - A[a, h, t]) +
λ2 (V[alipid[as, hs + d, ts, d], hs + d, ts] - V[as, hs, ts] -
V[alipid[a, h + d, t, d], h + d, t] + V[a, h, t])}
deriv := D[eqns, {{α, as, hs, ts, λ1, λ2}}]
Solve[deriv == 0, {α, as, hs, ts, λ1, λ2}, Reals]

-
Might have better luck with NSolve. – Daniel Lichtblau Mar 22 '12 at 18:46
Seems unlikely to me. The equations involve radicals in a highly complicated way and have 6 unknowns. Solve is used with the domain Reals which I think will at some point call on CylindricalDecomposition or something of that kind. Besides there seems to be some mistake for when I evaluate Variables[deriv] I get a variable named "a" but the equation is solved for α. But I doubt that fixing that will help much. I don't want t be discouraging but that is exactly how I feel about it. – Andrzej Kozlowski Mar 22 '12 at 19:28
Just out of sheer curiosity, is it easy to visualize the problem? Plot the shapes in 3D with opacity, maybe add Manipulate for variation parameters? – Vitaliy Kaurov Mar 23 '12 at 7:19
Note that Solve and Reduce are double exponential in the problem complexity. – user900 Mar 31 '12 at 21:56
What values can $h$ take? $\alpha$ only seems to enter into the derivatives if $h$ is nonzero. I don't think this comment could be considered an answer, but the reason you are having issues is that you are solving a really complicated expression in six unknowns, with three other algebraic entities ($h$, $s$ and $t$ still being left as algebraic symbols. You might have better luck with something like N@Simplify[deriv /. {t -> 0, a -> -1, h -> 1}, Assumptions -> {ts > 0, hs > 0, as > 0}] and then NSolve that. I just made those values for $h$ etc up. – Verbeia Apr 1 '12 at 0:45

The short answer is that this is not a correct formulation of a Lagrange multiplier problem in the first place. In the question, derivatives are being taken with respect to the multipliers $\lambda1$ and $\lambda2$. That's simply wrong. These multipliers are there to enforce the fact that the gradients of the objective function and constraint conditions are linearly dependent. But they aren't themselves variables in the gradient.