Questions on the optimization functions of Mathematica such as FindMinimum/FindMaximum, Minimize/Maximize, NMinimize/NMaximize, etc.
41
votes
2answers
2k views
Shaving the last 50 ms off NMinimize
The background:
I have to fit an objective function for ~10 000 datasets in near real time (with near real time being on the order of about 10 seconds). I compile the huge objective function, so that ...
29
votes
7answers
955 views
26
votes
3answers
3k views
How to find all the local minima/maxima in a range
I want to find :
all local maxima in range
all local minima in range
From those points I can interpolate and combine functions upper and lower boundary. What I am really interested in, is the ...
17
votes
0answers
611 views
Identifying critical points of 2/3D image/cubes
Upshot
I am interested in identifying critical points of a 3D field/cubes (maxima, minima, tube-like and wall-like saddle points) and 2D field/image (maxima, minima, saddle points). I.e. the ...
14
votes
1answer
345 views
Obtain approximate Hessian using FindMinimum
According to the documentation, when FindMinimum is told to use the method "QuasiNewton" on a unconstrained problem, it uses the ...
14
votes
2answers
377 views
How can I speed up the classic GA for graph coloring?
I'm trying to compute the chromatic number of this graph (which is 28):
g = Import@"http://www.info.univ-angers.fr/pub/porumbel/graphs/dsjc250.5.col";
My genetic ...
14
votes
0answers
371 views
Optimization with assumptions
I have the following problem, when I am trying to optimize function with pre-defined assumptions.
I am using Mathematica 8 and I wrote the following simple code
...
12
votes
3answers
486 views
Strategies to avoid LessEqual::nord in NMinimize?
When using NMinimize on functions with complex intermediate expressions (but a real end result), quite often one gets the error ...
12
votes
4answers
1k views
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 ...
10
votes
4answers
310 views
Finding Local Minima / Maxima in Noisy Data
I'm trying to find local minima / maxima in noisy data, consisting of data values taken at certain time intervals. Ideally, the function should take a pair of lists (one containing time values and one ...
10
votes
2answers
315 views
Is it possible to use the LevenbergMarquardt algorithm for fitting a black-box residual function?
I have a black-box multiargument multiparametric function of the type SRD[dataPoint_List,params_List] which accepts experimental data along with the parameters of ...
9
votes
3answers
233 views
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 ...
9
votes
2answers
387 views
Maximizing a function with assumptions
Using
f[s_] := Log[(s/r)^α ((α - 2) n0 r^α + 2 π Pmax ρ r^2)
/((α - 2) n0 s^α + 2 π Pmax ρ s^2)]/s
When I run the following line:
...
8
votes
1answer
492 views
Combined numerical minimization and maximization
I want to numerically calculate the maximum of a function defined by the minimization of another function, like the following:
...
8
votes
1answer
891 views
Solve Lagrange multipliers optimization problem
I have two nested solid figure, where $V(a,h,\tau)$ defines the volume and $A(a,h,t)$ defines the surface. The outer solid figure is parametrized in $a_s$,$h_s$ and $t_s$ (they share a common center). ...
7
votes
4answers
185 views
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 ...
7
votes
1answer
141 views
Efficiently filling area with disks located at certain points
Starting from a set of points, I want to fill an area using disks. Each disk's center should be one of the points and the disks should not overlap. I've managed to write a function that, given a list ...
7
votes
1answer
407 views
How to speed up Minimum Spanning Tree algorithm?
How to speed up MST algorithm? I work with graphs and I have adopted Prim's algorithm for my needs, from here.
The graphs which I use are very dense (number of vertexes: $V=500$ and every vertex is ...
7
votes
3answers
200 views
How can I efficiently check if a graph is unit distance?
A unit distance graph is a graph that is embeddable in the plane so that every edge has length 1.
...
7
votes
1answer
336 views
Using Mathematica to help to determine the consistency of and numerically solve systems of non-linear equations
The formal problem
The question I am about to ask is applicable to many scientific and engineering problems. In short, I am bout to ask for pointers and practical advice for Mathematica beginners who ...
6
votes
2answers
561 views
Implementation of a new Game of Life Rule
I need to implement a new "game of life" in Mathematica: I have three states — black, red and white. Black means go forward, red go back and white take no action.
I would like to implement the ...
6
votes
2answers
159 views
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 ...
6
votes
1answer
213 views
Numerical problems with calculation of function
I have a problem with a calculation which I try to do with Mathematica (8.0.1).
I have the following function which describes a cone (with half opening angle ...
5
votes
3answers
363 views
Travelling salesman with start and end points for 30 points
I am doing a route optimisation for delivery vehicles and failing dismally. Please see problem statement below. My current solution uses FindShortestTour, but this does not have defined start and end ...
5
votes
2answers
256 views
What alternative notation of subscripts/superscripts that are also treated as SYMBOLS in Mathematica?
I tried to avoid using the subscript $A_0$ in the Module, and get an error with $A[0]$.
...
5
votes
1answer
246 views
Defining a non-linear optimization-problem
Consider the following non-linear optimisation problem:
...
5
votes
1answer
318 views
Multi-objective genetic algorithm in Mathematica?
Is there any implementation of a multi-objective genetic algorithm for Mathematica?
5
votes
1answer
119 views
FindMaxValue specifics
I'm using FindMaxValue to study the distribution of maxima of Abs[RiemannSiegelZ[t]] between consecutive values of ...
5
votes
0answers
191 views
Mathematica vs Sigmaplot (Non LinearModelFit)
I asked a question in a previous post that was closed because "The title of the question is not correct and the issue here is too trivial to help anyone later".
NonLinearModelFit
It's possible ...
4
votes
1answer
151 views
Maximizing functions with Which statements
I'd like to be able to find the maximum value that my Capex function (see below) generates. This is a fairly simple function so I could just add it up but I have more complex functions of a similar ...
4
votes
1answer
296 views
How to solve a quadratic integer programming problem?
I want to solve a quadratic integer programming problem in Mathematica. My first attempt looks like this:
...
4
votes
1answer
171 views
Optimizing a rank 3 tensor
Assume we have the following elements
\begin{equation}
F_i{}^j \;and\; S_{ij}{}^k,
\end{equation}
which represent the components of tensorial objects of ranks 2 and 3 respectively, with Complex ...
4
votes
1answer
161 views
Why is this minimization with Boole functions failing?
I am running this command in Mathematica 8.0.4.0:
...
4
votes
1answer
224 views
4
votes
1answer
73 views
Minimize failing on a polynomial
Calling:
Minimize[{-0.4877 - 0.1190 r^2 - 0.1885 r^4 + 2.9703 z - 0.5531 z^2,
0 <= z <= 3.5 ∧ 0 <= r <= 1.75}, {r, z}]
returns ...
4
votes
1answer
136 views
Assumptions seem not to be considered
In the following a,b is a probability distribution, i.e. a+b==1 with ...
4
votes
0answers
95 views
Speeding up multilinear PRA branch-and-bound algorithm with worst-case exponential time scenario with respect to basic events
The algorithm is a branch-and-bound algorithm that calculates dominances for PRA, probalistic risk assessment. The task was to find faster ways to do it in numerical software such as Matlab but we ...
3
votes
3answers
216 views
How to find the minimum of this constrained expression?
Let $x$, $y$, $z$ be three nonegative real numbers and $x^2 + y^2 + z^2 = 5.$ Find the minimum of the expression
$$E=\dfrac{1}{2}x^2 y^2 + y^2 z^2 + z^2 x^2 + \dfrac{96}{x + y + z + 1}.$$
I tried
...
3
votes
2answers
450 views
optimization problem with NDSolve
I want to minimize the function fcc. When fcc is calculated for a specified point the answer is correct:
...
3
votes
1answer
283 views
Optimizing a function involving NDSolve results in error messages
I want to minimize a function f with NMinimize but an error occurs that says:
...
3
votes
2answers
180 views
Find all points that have the same minimum? [duplicate]
Possible Duplicate:
How to find all the local minima/maxima in a range
Sin[x] have two points ($3\pi/2,7\pi/2$) where the same minimum ($-1$) is achieved ...
3
votes
1answer
96 views
Distance between two functions satisfying a constraint
My problem is that I have two functions that are described as follows:
...
3
votes
1answer
210 views
wrong use of _?NumberQ?
I am having trouble with a numerical exercise. Here's a simplified version of my problem.
I define two functions to find the solution to two constrained maximization problems:
...
3
votes
2answers
89 views
Find condition under which variables fall away
I have a somewhat lengthy expression, looking like
expr = 1 + x + b + Pi + 2*a
Is there some way of generating a relationship between ...
3
votes
1answer
323 views
How to use mathematica to create school time-table?
I wonder if it is possible to use Mathematica for helping myself to create school timetable. I have a feeling that it requires quite simple optimization algorithm, but I have never been into ...
3
votes
1answer
223 views
parameter optimization
Does anybody know of any tutorial material that explains how to use Mathematica to fit parameter values used in a set of ordinary differential equations to experimental values stored in a comma ...
3
votes
0answers
68 views
When using NMinimize[…,Method->“DifferentialEvolution”] is an “iteration” different than a “step”?
Hopefully this question has a simple answer. I have the following bit of code:
...
3
votes
0answers
173 views
What in practice is the difference between NMaximize[] and FindMaximum[]? [closed]
NMaximize[f,x] maximizes f numerically with respect to x.
...
3
votes
0answers
159 views
Semidefinite Programming
I want to solve a numerical optimization problem using semi-definite programming. Is there a package or add-on that equips mathematica with this functionality?
2
votes
3answers
123 views
How can I name “a[[i]]” the parts of Table “a”? Or how to make Table “a” grow inside FindMinimum?
Let's say I want to minimize a function that uses a Table named a with the Conjugate Gradient Method of ...


