TransWikia.com

NMinimize for searching global minimum

Mathematica Asked by xxtilenxx on June 10, 2021

I have been trying to find global minimum for this equation for some time now.

The equation is quite easy to understand. It is made with sumation of stress equations of points on the border where $σ_{rr,i} = σ_{rvarphi,i} = 0$, where $i$ stand for $i$-th hole of $n$ holes. So I have multiple points with those two equations and I sum them in equation below:

$eq=σ_{rr,i}^2 + σ_{rvarphi,i}^2+σ_{rr,i+1}^2 + σ_{rvarphi,i+1}^2 +…$

Each of the functions has coefficients $A_{1}, B_{1}, C_{1}, D_{1}, A_{2} … $ Then I use Simplify on $eq$ and get something like:

$K_1 A_1 + K_2 B_1 …$ where $K_j$ is real number and value of $A, B, C, D$ is what I am looking for. Below is a picture of this equation.

enter image description here

Now I use the function as follows:

$NMinimize[eq, kList]$ where $kList=[A_1, B_1 …]$.

The lowest result that I get is around 40 000, and values are not correct. I know there is a solution and if I plot the function I can tell if results are correct.

Everything works with only one set of points, with two sets of points NMinimize doesnt find the minimum. There are 14 coefficients in the $kList$.
What am I doing wrong?

Here is the code:

pointsFlat = ToPolarCoordinates@Flatten[points, 1];
eqList = Simplify@
   Flatten@Table[{Subscript[[Sigma], rr][N@pointsFlat[[i, 1]], 
       N@pointsFlat[[i, 2]]], 
      Subscript[[Sigma], r[CurlyPhi]][N@pointsFlat[[i, 1]], 
       N@pointsFlat[[i, 2]]]}, {i, 1, Length@pointsFlat}];

KList:

{Subscript[A, 1, 0], Subscript[A, 1, 1], Subscript[B, 1, 1], 
Subscript[A, 1, 2], Subscript[B, 1, 2], Subscript[C, 1, 2], 
Subscript[D, 1, 2], Subscript[A, 2, 0], Subscript[A, 2, 1], 
Subscript[B, 2, 1], Subscript[A, 2, 2], Subscript[B, 2, 2], 
Subscript[C, 2, 2], Subscript[D, 2, 2]}

Searching for solution:

NMinimize[Total[eqList^2], kList, MaxIterations -> 10000,Method -> 
"DifferentialEvolution"

And the output is:

{40704.3, {Subscript[A, 1, 0] -> -57.9097, 
Subscript[A, 1, 1] -> 1.2073, Subscript[B, 1, 1] -> 0.00694863, 
Subscript[A, 1, 2] -> -34.5356, Subscript[B, 1, 2] -> 0.0454918, 
Subscript[C, 1, 2] -> 69.305, Subscript[D, 1, 2] -> -0.0722133, 
Subscript[A, 2, 0] -> -2.56125, Subscript[A, 2, 1] -> 1.06113, 
Subscript[B, 2, 1] -> 0.280895, Subscript[A, 2, 2] -> 2.14184, 
Subscript[B, 2, 2] -> -0.155145, Subscript[C, 2, 2] -> -5.80381, 
Subscript[D, 2, 2] -> -0.0825128}}

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP