I try to find the local minimum of a function $$\Pi(\vec{d})$$ where $$\vec{d} = (d_1,d_2,...,d_n)$$ should satisfy $$d_i>0$$ for $i \in [1,n]$.

I use the FindMinimum function in Mathematica; i.e., use something like $$\mathtt{FindMinimum}[\{\Pi(\vec{d}),d_i>0\},\vec{d}].$$ But I don't know how to apply the constraints $d_i>0$. If it is indeed possible, it would very much help me to know how to formulate such a command. Thanks!

  • $\begingroup$ FindMinimum[{pi[dvector], Apply[Min, dvector] > 0}, dvector] or you can learn to use the various abbreviations that MMA provides and then use FindMinimum[{pi[dvector], Min@@dvector > 0}, dvector] $\endgroup$
    – Bill
    Aug 7 '17 at 6:30
  • $\begingroup$ Thank you so much. It works perfectly. Could you please show me where to find the various abbreviations that MMA provides as you said? $\endgroup$
    – Wilhelm
    Aug 7 '17 at 7:11
  • $\begingroup$ This reference.wolfram.com/language/howto/UseShorthandNotations.html might get you started. $\endgroup$
    – Bill
    Aug 8 '17 at 6:49

ConicHullRegion[] is a useful constraining region to use for vectors with all positive components. In particular, one can express the first orthant for n-dimensional space in region form as ConicHullRegion[{ConstantArray[0, n]}, IdentityMatrix[n]].

Using the generalized Rosenbrock function as an example:

rosenbrock[v_?VectorQ] := With[{n = Length[v]}, 
  Sum[100 (Indexed[v, k + 1] - Indexed[v, k]^2)^2 + (1 - Indexed[v, k])^2, {k, 1, n - 1}]]

With[{n = 8}, 
                  v ∈ ConicHullRegion[{ConstantArray[0, n]}, IdentityMatrix[n]]},
                 {v, ConstantArray[0.5, n]}]]
   {2.46713*^-14, {v -> {1., 1., 1., 1., 1., 1., 1., 1.}}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.