Questions tagged [mathematical-optimization]

Questions on the optimization functions of Mathematica such as FindMinimum/FindMaximum, Minimize/Maximize, NMinimize/NMaximize, etc.

Mathematical optimization is a field of science/engineering that deals with minimizing/maximizing a real function (also called objective function or cost function) over a known domain, with or without additional constraints. This tag is a superset of subfields such as linear/non-linear/quadratic/integer programming, dynamic programming, convex optimization, etc.

Some useful Mathematica tutorials and references on this subject:

2217 questions
20
votes
2 answers

Maximize[Cos[x - 1], x] is not evaluated

No explanation needed: Maximize[Cos[x + 1], x] Maximize[Cos[x - 1], x] producing {1, {x -> -1 + 2 π}} Maximize[Cos[1 - x], x] Needless to say, this is pretty amusing. Does anyone know why this is happening? I am using V10.0.2 Windows 7 64-bit,…
DumpsterDoofus
  • 11,857
  • 1
  • 29
  • 49
17
votes
4 answers

NMinimize usage

I would like to minimize functions including the following. NMinimize[{1 - (1 - 1/n)^x - x/n, n > x, x > 1}, {n, x}] However Mathematica complains about values not being real. How should I do this?
Simd
  • 1,119
  • 1
  • 7
  • 17
15
votes
4 answers

Minimizing a function of many coordinates

I'm trying to obtain a series of points on the unit sphere with a somewhat homogeneous distribution, by minimizing a function depending on distances (I took $\exp(-d)$). My points are represented by spherical angles $\theta$ and $\phi$, starting by…
F'x
  • 10,817
  • 3
  • 52
  • 92
15
votes
2 answers

Why can't I provide NMinimize with initial points when minimizing over two variables but not one?

Supplying initial guesses works for two parameters: In[238]:= Table[{i, j}, {i, 1/10, 1, 1/10}, {j, 1/10, 1, 1/10}]; testtab = Flatten[%, 1]; In[240]:= NMinimize[(x + y - 2/10)^2, {x, y}, Method -> {"Automatic", "InitialPoints" ->…
DJBunk
  • 683
  • 1
  • 8
  • 18
12
votes
2 answers

Time constrained optimization?

I'm trying to solve a maximization problem that apparently is too complicated (it's a convex function) and NMaximize just runs endlessly. I'd like to have an approximate result, though. How can I tell NMaximize to just give up after $n$ seconds and…
Ziofil
  • 2,470
  • 16
  • 30
12
votes
1 answer

Constrained optimization with three variables

A standard optimization problem in economics is choosing a consumption bundle subject to prices and a budget constraint: $$\max_{x,y} \sqrt{x} + \sqrt{y} \hspace{1cm} \text{s.t. } p_x \cdot x + p_y \cdot y \leq w $$ With the two goods, x and y,…
Shane
  • 1,003
  • 1
  • 6
  • 18
11
votes
1 answer

Status of DualLinearProgramming

DualLinearProgramming is referenced in this tutorial tutorial/ConstrainedOptimizationLinearProgramming It exists in Mathematica 12, but lacks documentation. I guess that it has been superseded by LinearOptimization. Is there any information…
mikado
  • 16,741
  • 2
  • 20
  • 54
11
votes
0 answers

Customized StepSize control in unconstrained gradient-descent optimization

I have a type of minimization problem I frequently solve that involves warping a large 2D triangle-mesh (~25,000 vertices) to fit a model. In the mesh, vertices carry the empirical measurements (each of which has a predicted position in the model,…
nben
  • 2,148
  • 9
  • 20
10
votes
1 answer

Simulated Annealing Convergence

I am using Simulated Annealing method for a simulation based optimization of a process that has 3 variables, using NMinimize. I print the input/output during every iteration using the "Evaluation Monitor". I have noticed that after about 3000…
brama
  • 898
  • 5
  • 18
10
votes
2 answers

Linear programming with many variables and parameters

I am trying to reconstruct the answer that is given in this report. (page 153 in Appendix B; Section B.2.1). They are given variables, parameters, constraints, and the objective function to minimize. Summary of the problem: Minimize: q01 + q11 + q21…
sheppa28
  • 387
  • 2
  • 7
10
votes
3 answers

Built-ins for discrete ArgMax or ArgMin?

Wondering whether there are discrete versions of ArgMax / ArgMin, that is, something that will find the part of an expression at which some function f of the elements is maximized (or minimized). Last[Ordering[f/@list]] and First[Ordering[f/@list]]…
Reb.Cabin
  • 8,661
  • 1
  • 34
  • 62
9
votes
3 answers

Strange domain dependency with Maximize

I'm using Mathematica 8 and strangely enough this code: Maximize[{x*(1-0.01 x),x>0},x,Integers] produces the result {8.19,{x->9}}, which seems at odds with the actual answer of x->25. Does anyone know if it is an intended behavior or my…
iav
  • 2,006
  • 17
  • 26
9
votes
2 answers

Numerical Optimization Methods

I am curious if any one has comments on "specific characteristics" of a problem that will deem it to be best solved by a specific optimization method such as SimulatedAnnealing, Random Search, or Diferential Evolution, etc. Edit: I am familiar with…
brama
  • 898
  • 5
  • 18
9
votes
1 answer

NMinimize go out of bounds on some linear constraints

I'm trying to minimize a non-linear function of four variables with some linear constraints. NMinimize on Mathematica 8 seems to go out of bounds on some constraints giving complex values of the function at some point in the iteration. The function…
9
votes
3 answers

Cannot find the maximum value of a function

Consider the following function: $a Sin(x)+b Cos(x)$ I tried to obtain the maximum value of this function using MaxValue[]: MaxValue[a Sin[x] + b Cos[x], x, Reals] I expect Mathematica to return the following answer: $\sqrt{a^2+b^2}$ But…
M6299
  • 1,471
  • 1
  • 13
  • 20
1
2 3
36 37