The problems in this notebook pose difficulties for NMinimize.

<< NumericalMath`NMinimize`

======================================

In the following example, we see that NMinimize is more sensitive to initial range of the parameters.

Plot [Abs[2  x + x*Sin[x]],  {x, -40, 40}];

GlobalSearch[Abs[2  x + x*Sin[x]], , , {{x, 39.5, 40}},  .00000001, 
        Starts -> 1] // Timing

NMinimize[Abs[2  x + x*Sin[x]], {{x, 31, 40}}] // Timing

Quite a wide range is needed to get NMinimize started properly:

NMinimize[Abs[2  x + x*Sin[x]], {{x, 30, 40}}] // Timing

======================================

The tough problem in this long example is solved by GlobalSearch, but NMinimize does not obtain the true solution.  GlobalPenaltyFn solves it on 2 out of 4 starts.

variables  =  {{X2v1, 
            0, 35. }, {F1, 0, 40}, {F2, 0, 35. }, {W1, 0, 40}, {W2, 0, 
            35. }, {COut1v1, 90, 100}, {COut1v2, 50, 75}, {COut2v1, 160. , 
            240}, {COut2v2, 60. , 90}};

varlist = {X2v1, F1, F2, W1, W2, COut1v1, COut1v2, COut2v1, 
          COut2v2};

(* 
      Inequality constraints *) 

inequalities2  =  {-100 + 
            COut1v1, -COut1v1, -75 + 
            COut1v2, -COut1v2, -240 + 
            COut2v1, -COut2v1, -90 + 
            COut2v2, -COut2v2, -25 F1, -F1, -F2, -W1, -W2, -X2v1, -80 F2 - (80 - 
                  COut1v1) X2v1, -30 F2 - (30 - 
                  COut1v2) X2v1};

inequalities = 
      Table[inequalities2[[i]] ≤ 0, {i, 1, 
          Length[inequalities2]}]

(* 
      Equality constraints *) 


equalities  =  {COut1v1 F1 == 4000, COut1v2 F1 == 2000, 
          F1 - W1 - X2v1 == 0, F2 - W2 + X2v1 == 0, 
          COut2v1 F2 + (-COut1v1 + COut2v1) X2v1 == 5600. , 
          COut2v2 F2 + (-COut1v2 + COut2v2) X2v1 == 
            2100. };

f  =  
        F1 + F2 ;

A good feasible solution

inequalities /.  {X2v1 -> 0.`, F1 -> 40, 
        F2 -> 23.333333333333332`, W1 -> 40, 
        W2 -> 23.333333333333332`, COut1v1 -> 100, 
        COut1v2 -> 50, COut2v1 -> 240.`, 
        COut2v2 -> 90.`}

f /.  {X2v1 -> 0.`, F1 -> 40, 
        F2 -> 23.333333333333332`, W1 -> 40, 
        W2 -> 23.333333333333332`, COut1v1 -> 100, 
        COut1v2 -> 50, COut2v1 -> 240.`, 
        COut2v2 -> 90.`}

equalities2  =  {COut1v1 F1 - 4000, COut1v2 F1 - 2000, 
          F1 - W1 - X2v1, F2 - W2 + X2v1, 
          COut2v1 F2 + (-COut1v1 + COut2v1) X2v1 - 5600. , 
          COut2v2 F2 + (-COut1v2 + COut2v2) X2v1 - 
            2100. };

res = 
      GlobalSearch[f, inequalities2, equalities2, variables, 0.00000000001 , 
          Starts -> 2, ShowProgress -> False] // 
        Timing

GlobalPenaltyFn finds 2 solutions out of 4 starts, but does not do better than GlobalSearch.

res = 
      GlobalPenaltyFn[f, inequalities2, equalities2, variables, 0.000001 , 
          Starts -> 4, ShowProgress -> False] // 
        Timing

inequalities2 /. res[[2, 1, 1]]

equalities2 /. res[[2, 1, 1]]

con = Apply[And, Join[equalities, inequalities]]

The minimum is not as good as that found by GlobalSearch or GlobalPenaltyFn.

r = NMinimize[{f, con}, variables] // Timing

equality 1 is not quite satisfied

equalities2 /. r[[2, 2]]

inequalities are satisfied

inequalities2 /. r[[2, 2]]