1
$\begingroup$

I am trying to determine if a certain nonlinear function can be positive when the variables have to satisfy multiple nonlinear constraints.

Currently my code looks like

FindMaximum[{f, 0 < x1 < 1, 0 < x2 < 1, 0 < x3 < 1, 0 < x4 < 1, a == 0, b > 0, c > 0},{{x1,x10},{x2,x20},{x3,x30},{x4,x40},{y1,y10},{y2,y20},{y3,y30},{y4,y40}}]

where f, a, b, and c depend in a nonlinear way on the x's and y's. (In particular, they are polynomials in the x's and trigonometric polynomials in the differences y1 - y2, y2 - y3, y3 - y4, and y4 - y1.)

My goal is to see if I can make f positive subject to the given constraints. My current approach is to run FindMaximum with a random initial point {x10,x20,x30,x40,y10,y20,y30,y40}. If FindMaximum, which looks for a local maximum and not a global maximum, doesn't return a positive value for f, I start over with another random initial point. I then reiterate this procedure 1000 times.

My question is if there is a better strategy for determining if f can be positive. (Finding the maximum of f would be nice but is not as important.) I tried to use the functions NSolve, Maximize, and FindInstance but they took a very long time to run, and I ended up aborting the computations.

$\endgroup$

closed as off-topic by Michael E2, Henrik Schumacher, Daniel Lichtblau, m_goldberg, rhermans Aug 12 '18 at 10:12

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – Michael E2, Henrik Schumacher, Daniel Lichtblau, m_goldberg, rhermans
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 6
    $\begingroup$ Just based on your question, it will be hard for us to answer without providing the definition of f. Optimization often depends on the details of the function being optimized. An initial thought: Sometimes editing the definition is a better way to create constraints to a nonlinear optimizer than providing them explicitly because the minimizer doesn't have to monitor them or use a special constrained algorithm. For example, if you desire that 0 < x < 1, you might be able to replace x with 1+Erf[x]/2. $\endgroup$ – nben Aug 10 '18 at 18:24