# Minimizing a function problem

I'm solving an elastoplastic problem of the Ducker Prager model using the closest point projection method, which consists of minimizing a distance between a trial stress and the yield surface in the principal stress space. I need to to find the values of the variables xi and beta that minimize the following square distance function:

rho = Sqrt (B c - A xi);
sstarsurface = {xi/Sqrt + Sqrt[2/3] rho Cos[beta],
xi/Sqrt + Sqrt[2/3] rho Cos[beta - 2 Pi/3],
xi/Sqrt + Sqrt[2/3] rho Cos[beta + 2 Pi/3]};
diff = {sig1trial, sig2trial, sig3trial} - sstarsurface;
eq = diff.diff (*need to minimize this function!*)


Where A, B and c are material constants. I tried this:

Minimize[eq, {xi, beta}]


But obtained no success. Then I tried this and it works, but the result is too cumbersome:

deq = {D[eq, xi], D[eq, beta]}
Solve[deq == 0, {xi, beta}] // Simplify


Does anyone has an idea on how to simplify this result?

• First of all just because the derivative is zero doesn't mean that you have a minimum. – user59583 Dec 21 '18 at 16:32
• I think the problem is that beta is the angle of the Cos function and this creates the problem. Instead use the t1=Cos[beta], Sqrt[1-t1^2]=Sin[beta] and then use the Minimize. It still won't be easy because the result will be have many conditions such as the parameters being real or not etc... But at least it is doing something then. – user59583 Dec 21 '18 at 16:56
• @Buddha thank tou for tour comments. The constants are real values and the stresses sig1trial>sig2trial>sig3trial – Diogo Dec 21 '18 at 17:03
• The Square distance function has two minimuns since It is a distance relative to a volume in the space. Using the derivative equal to zero gives these two possible solutions – Diogo Dec 21 '18 at 17:12
• Ok, you are right. – user59583 Dec 21 '18 at 17:15

You can simplify your result using Weierstrass substitution to force -Pi<beta<Pi

glnu = (1 + u^2) deq /. beta -> 2 ArcTan[u] // TrigExpand // FullSimplify
(Solve[glnu == 0 , {u, xi }] // FullSimplify) /. u -> Tan[beta/2]


This gives a simpler result without ConditionalExpression!

remark the substitution gives a functional J = (1 + u^2) eq /. beta -> 2 ArcTan[u] // TrigExpand // Simplify which is quadratic in u and xi. Perhaps Minimize can solve this problem?

• Newmann Thank you for your answer! But I didn' t understand. What is glnu and gln? Should I use your code in my solution? – Diogo Dec 22 '18 at 12:58
• Sorry I edited my answer: Just substitute gln by deq! – Ulrich Neumann Dec 22 '18 at 14:04
• Very good, thank you! – Diogo Dec 22 '18 at 14:29
• @Diogo You're welcome. The definition of J in my answer is the cone shape I think. – Ulrich Neumann Dec 23 '18 at 10:27