Finding a global minimum for thethis problem (non-linear optimization by the downhill simplex method by Nelder-Mead downhill simplex method) may not be possible, but by finding local minimum, I am expecting the value of the function at the minimum is around 1 or (far) less than 1 (the lower the value, the better is the answer).
"Nelder-Mead""Nelder-Mead"
method is available for "NMinimize"NMinimize
in MathematicaMathematica. The problem I am facing is, even though I am changing the method options available for Nelder-Mead, as for (for example "ShrinkRatio", "ShrinkRatio"
, "ContractRatio" "ContractRatio"
, "ReflectRatio" or"ReflectRatio"
, and so on) and also initializing the calculation for different initial values which(which is chosen by the "RandomSeed" "RandomSeed"
), I am getting minima which are way greater than 1 (where as I am looking for minima which is/are way less than 1). Anyone can help me with what I am missing ?
I found people deal these kindakind of problems by writing codes either in C++ or Fortran and the results are too good, but I know neither of them so I am trying to do it with Mathematica byMathematica using the built-in functions.
A = ({{a11, 0},{0, a22}});
B = ({{b11, b13},{b13, b22}});
M1 = A + Exp[I phi] B;
M2 = a A + b Exp[I theta] B;
M3 = a A - 3 b Exp[I theta] B;
m1 = Abs[Eigenvalues[M1]];
m2 = Abs[Eigenvalues[M2]];
m3 = Abs[Eigenvalues[M3]];
t1 = T1[a11_?NumberQ, a22_?NumberQ, b11_?NumberQ, b22_?NumberQ,
b13_?NumberQ, phi_?NumberQ] = m1[[1]];
t2 = T2[a11_?NumberQ, a22_?NumberQ, b11_?NumberQ, b22_?NumberQ,
b13_?NumberQ, phi_?NumberQ] = m1[[2]];
t3 = T3[a11_?NumberQ, a22_?NumberQ, b11_?NumberQ, b22_?NumberQ,
b13_?NumberQ, theta_?NumberQ, a_?NumberQ, b_?NumberQ] = m2[[1]];
t4 = T4[a11_?NumberQ, a22_?NumberQ, b11_?NumberQ, b22_?NumberQ,
b13_?NumberQ, theta_?NumberQ, a_?NumberQ, b_?NumberQ] = m2[[2]];
t5 = T5[a11_?NumberQ, a22_?NumberQ, b11_?NumberQ, b22_?NumberQ,
b13_?NumberQ, theta_?NumberQ, a_?NumberQ, b_?NumberQ] = m3[[1]];
t6 = T6[a11_?NumberQ, a22_?NumberQ, b11_?NumberQ, b22_?NumberQ,
b13_?NumberQ, theta_?NumberQ, a_?NumberQ, b_?NumberQ] = m3[[2]];
O2 = 0.235; O1 = 72;
E2 = 0.031; E1 = 0.87;
O4 = 0.0222196; O3 = 0.958157;
E4 = 0.006198; E3 = 0.018862;
O6 = 0.0941698; O5 = 1.60087;
E6 = 3.6079*^-7; E5 = 0.00026;
function[a11, a22, b11, b22, b13, a, b, phi,theta] =
((t1 - O1)/E1)^2 + ((t2 - O2)/E2)^2 + ((t3 - O3)/E3)^2 + ((t4 - O4)/E4)^2 +
((t5 - O5)/E5)^2 + ((t6 - O6)/E6)^2;
Do[Print[NMinimize[
function[a11, a22, b11, b22, b13, a, b, phi, theta],
{a11, a22,b11, b22, b13, a, b, phi, theta},
Method -> {"NelderMead", "ShrinkRatio" -> 0.5,"ContractRatio" -> 0.7,
"ReflectRatio" -> 1, "ExpandRatio" -> 2,"RandomSeed" -> j}]], {j, 5}]
Five random iterations (with different initial conditions chosen randomly) find different minima but all are notmuch greater than the expected result. Here are they are:
I tried with the different combinations of the NeilderNelder-Mead options (such as "ShrinkRatio" , "ContractRatio" , "ReflectRatio") with no improvements. The default value of the Max Iteration of Nelder-MeadMaxIterations
is 100, and I also tried by increasing the number of Max Iteration iterations by using the package of Nelder-Mead from the excellent post
Shaving the last 50 ms off NMinimize
by http://mathematica.stackexchangeOleksandr R.com/users/312/oleksandr-r , but again did not get any improvement. What amCan anyone help me with what I am missing ?