minimize – Minimization of a very simple polynomial

The primary difference between case 1 and case 3 is that the former is a polynomial, whereas the latter is not.

As per Mathematica documentation for Minimize, if the function to be minimzed and the constraints (if any) for minimization happen to be polynomials, then Minimze would give us the global minimum. A quick 3D plot for 1 reveals that it has no global minimum, which explains why Minimze demonstrates the behaviour it does.

Plot for 1, both x and y run from -1000 to 1000

In fact, 1 describes a saddle surface.

In case of 3, however, it can be clearly understood that the function descends from $infty$ as Abs(x) grows larger, on either side of the $y$-axis, and as Abs(x) $ rightarrow infty $ on either side, y $ rightarrow 0 $ asymptotically. There’s no global minimum again, in-fact, no stationary points at all (contrast this with saddle/inflection points of a curve, where the univariate function is stationary, even if it’s not an extremum).

So, in both cases, the output obtained is what one should expect, going by the behaviour of the function, and the Mathematica documentation for Minimize.

combinatorial optimization – Upper bound in minimization problem

If we have tight lower bounds (infeasible or optimal) for optimization problem (minimization)

Is it important in minimization problem to generate feasible upper bound? If it is, what is the best current methods to generate tight upper bounds for minimization problem?

How to benefit from both of them to generate good solution? I need references or any example of approaches used them together.

data transfer minimization problem

You have $2$ computers denoted by $C_1$ and $C_2$ and
$n$ missions $M_1,M_2, dots M_n$.
Doing the $i$-th mission on $C_1$ (resp. $C_2$) costs $a_i$ (resp. $b_i$).
Moreover if you do $M_i$ and $M_j$ are done on different computers. you incur an additional cost of $d_{i,j}$.
I need to find an efficient algorithm that minimizes the cost needed to do all missions.

I know how to solve this problem if all $d_{i,j}$s are $0$.

I think the solution should use either flow networks or minimal spanning trees.

Thanks in advance.

mathematical optimization – Stop Minimization after condition

I want to interrupt the optimization of a function when a particular condition is satisfied. Here I provide a test function.

Catch[NMinimize[x^6 + y^4 - 1, {x, y}, Method -> {"RandomSearch"} , 
EvaluationMonitor :> If[x^6 + y^4 - 1 < -0.95, Throw[x]]]]

I would expect the result to be x=..., but Mathematica seems not to evaluate the code and returns just

NMinimize[-1 + x^6 + y^4, {x, y}, Method -> {"RandomSearch"}, 
 EvaluationMonitor :> If[x^6 + y^4 - 1 < -0.95, Throw[x]]]

I am new on Mathematica, so any help would be really appreciated. Thanks.

boolean algebra – Minimization of an expression through K-map, in which there are more chances of errors and with Quine-McCluskey Method there are less chance of errors

Minimization of any expression of 4 variables through K-map, in which there are more chances of errors (like error in grouping) and the same expression with Quine-McCluskey Method there are less chance of errors but it should be of 4 variables. And I know that Quine-McCluskey Method gives accurate result as compare to K-map, when the number of variables exceed from 4 but what about 4 variables?

mathematical optimization – constraint minimization; 3 body problem

In my Monte Carlo simulations, hard particles aggregate into sets of triple particles due to the energy minimization. The particles cannot overlap, but they touch at the minimum of the energy. The potential between them is a pair potential which depends on the distance between the pairs and orientation of each particles.

The orientation is measured based on the angle between the orientation vector of each particle and the line which connects the centre of them.

I do understand how the Monte Carlo works, but I would like to use Mathematica to find the minimum energy of only 3 particles besides the relevant parameters like orientation angles.
From the Monte Carlo I know they form equilateral triangle so it is possible to fix the distance by putting the particles on the vertices of an equilateral triangle. Then the energy will be minimized by changing the orientation angles.

How can I do such constraint minimization in Mathematica?

I thought something like what happen in Monte Carlo simulation, iterative minimization, should work, but I could not put it together correctly.

Could you please let me know how should I handle it correctly?

Below you can find a minimal version of the problem. The radius of each particle is R=10 which makes the minimum distance, r= 20. The goal is to minimize v12+v13+v23 and finding B1, B2, B3.

Thank you.

(*r12=r13=r23= r ; the distance between the particles. The goal is to minimize v12+v13+v23*)

v12(B1_ , B2_) = 
  10^6 r^-3 E^-r  (-r^2 Cos(B1) Cos(B2) + r Sin(B1) Sin(B2)) ;
v13(B1_, B3_) = 
  10^6 r^-3 E^-r  (-r^2 Cos(B1) Cos(B3) + r Sin(B1) Sin(B3)) ;
v23(B2_, B3_) = 
  10^6 r^-3 E^-r  (-r^2 Cos(B2) Cos(B3) + r Sin(B2) Sin(B3)) ;

R = 10.0;
r = 20.0;
b1 = 0; b2 = 0; b3 = 0; aa0 = 10^4; aa = 0; a1 = 0; a2 = 0; a3 = 0;
{a1, {b1 , b2}} = 
 While(Abs(aa - aa0) > 10^-5, aa0 = aa; 
    v12(B1 , 
     B2 ), {{B1, b1 - 0.1, b1 + 0.1}, {B2, b2 - 0.1, b2 + 0.1}}, 
    AccuracyGoal -> 20, PrecisionGoal -> 18, 
    WorkingPrecision -> 10) /. sol : {__Rule} :> Values(sol);
  {a2, {b1 , b3}} = 
     v13(B1 , 
      B3), {{B1, b1 - 0.1, b1 + 0.1}, {B3, b3 - 0.1, b3 + 0.1}}, 
     AccuracyGoal -> 20, PrecisionGoal -> 18, 
     WorkingPrecision -> 10) /. sol : {__Rule} :> Values(sol);
  {a3, {b2 , b3}} = 
     v23(B2, B3), {{B2, b2 - 0.1, b2 + 0.1}, {B3, b3 - 0.1, 
       b3 + 0.1}}, AccuracyGoal -> 20, PrecisionGoal -> 18, 
     WorkingPrecision -> 10) /. sol : {__Rule} :> Values(sol);
  aa = a1 + a2 + a3;)

macos – How can I script selective minimization of documents in text edit when several files may be open?

From the Terminal, or in a shell file, I know how to open multiple files in a particular app in text edit from the command line and have all of their windows minimized like this:

open -a ~/Documents/doc1.txt ~/Documents/doc2.txt ~/Documents/doc3.txt
osascript -e 'tell application "TextEdit" to set miniaturized of every window to true'

Is there a command to minimize not all of thow windows but just a particular one of them or equivalently, iterate over minimized windows to restore one by name like ~/Documents/doc1.txt?

mathematical optimization – Numerical Minimization for a function of five variables

I have the function

f(w_,x_,y_, α_,g_)=Sqrt(((w^2 + x^4) (1 + 2 w α^2 + α^4))/(
 2 x^2 w) - α^2 y)*Sqrt(((g w)^2/x^2) + (2 x^2)/w + (2 w (g α - 1 )^2)/x^2)

with the restrictions

$$w geq 1, $$

$$ x>0, $$

$$ y,alpha, g in mathbb{R}.$$

and I appeal to NMinimize() to find a numerical value for the minimum of the function f(w_,x_,y_, (Alpha)_,g_), that is,

NMinimize({f(w, x, y, α, g), x > 0 && w >= 1}, {w, 
   x, {α, y, g} ∈ Reals}) // Quiet

therefore mathematica shows the result

{2., {w -> 1.78095, x -> 1.33452, (Alpha) -> -8.73751*10^-9, 
  y -> 0.731324, g -> -2.98148*10^-8}}

On the other hand, inquiring in the package help of the software I find that I can specify a non-default method which could give a better solution (with more accuracy), for example with DifferentialEvolution; that is,

NMinimize({f(w, x, y, α, g), x > 0 && w >= 1}, {w, 
   x, {α, y, g} ∈ Reals}, 
  Method -> "DifferentialEvolution") // Quiet

giving the result

{1.09831, {w -> 1.00016, x -> 0.962037, (Alpha) -> 0.276323, 
  y -> 11.3393, g -> -0.0477925}}

Therefore, I have the question:

What is the best method (with mathematica) to obtain the most accurate value for the real minimum of the function?

I am a novice with the use of NMinimize comand

mathematical optimization – Minimization of constrained variable

I am trying to perform a minimization of a variable but NMinimize() does not seems what I need (it minimize a function, but my variable is inside a function)

I want to minimize “h” with respect to “P0” and “yp” with the following constraints:

 c1 <= F(h,P0,yp) <= c2
 c1 <= G(h,P0,yp) <= c2
 c1 <= H(h,P0,yp) <= c2
 c1 <= J(h,P0,yp) <= c2

I tried:


but it does not work.

h,P0,yp are all variables and not functions.