Questions tagged [mathematical-optimization]
Questions on the optimization functions of Mathematica such as FindMinimum/FindMaximum, Minimize/Maximize, NMinimize/NMaximize, etc.
294
questions
78
votes
5
answers
29k
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 mean ...
96
votes
2
answers
8k
views
Shaving the last 50 ms off NMinimize
The epilogue:
A paper where the below answer is used was published. The answer below is cited among the references:)
The background:
I have to fit an objective function for ~10 000 datasets in near ...
45
votes
2
answers
2k
views
How to work with Experimental`NumericalFunction?
This question is intimately connected with previous one: "How to create internally optimized expression for computing with high WorkingPrecision?"
Oleksandr R. correctly states in the comment:
A ...
21
votes
3
answers
10k
views
How can I implement the method of Lagrange multipliers to find constrained extrema?
I want to form the function $h=f-\lambda_{1}g_{1}-\lambda_{2}g_{2}$ where $f$ is the function to optimize subject to the constraints $g_{1}=0$ and $g_{2}=0$ so that I can solve the first partial ...
18
votes
1
answer
4k
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:
...
6
votes
1
answer
3k
views
Inequalities with assumptions and constraints
I'm using Mathematica 8
I've been searching the net without luck for this specific solutions:
Suppose I have an inequality f(x;M,m)>0 where I KNOW that M>4m and m>0. How can I let Mathematica know ...
45
votes
3
answers
5k
views
Identifying critical points/lines 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 ...
42
votes
5
answers
24k
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 ...
27
votes
12
answers
7k
views
how to get $n$ equidistributed points on the unit sphere
We can get $n$ equidistributed points in the unit circle using CirclePoints. But how do you get $n$ equidistributed points on the unit sphere(surface of a ball)? ...
19
votes
2
answers
1k
views
Determining the default Method used in optimization and root-finding algorithms
Is it possible to extract the Method which is used in functions like NMinimize, FindRoot, <...
8
votes
2
answers
962
views
Reordering numerically calculated eigenvalues assuming smooth dependence on a parameter
As was discussed in a different question here on SE (link) if you compute eigenvalues numerically of a matrix which depends on a parameter y, the resulting plot of ...
20
votes
2
answers
10k
views
Find maximum value of interpolation function - obviously wrong result
Minimizing and maximizing interpolation function has already been asked and answered, see here for example.
Yet, I observe a strange behaviour. Well, I can understand that the wrong guess of ...
16
votes
3
answers
7k
views
Finding all maxima and minima of a function
To find all (global and local) extrema of a function in $\mathbb R^3$, I have written the following.
Example function:
...
23
votes
2
answers
5k
views
Differentiating functions of vectors/matrices?
I'm dealing with derivatives of scalar functions of matrices and wondering if Mathematica can help me here.
The standard approach of expanding it in terms of components is cumbersome. As an ...
4
votes
1
answer
606
views
$L_\infty$ norm minimization
I write supplemental explanation to render my aim of optimization.
First Consider discrete time linear system below:
\begin{equation} G(z)=\frac{1-e^{-0.3T}}{z^{100}(z-e^{-0.3T})} \end{equation}
...
2
votes
3
answers
446
views
Optimization of ODE with respect to the initial condition
One has a (system) of ODEs with a one-parameter family of initial conditions. For example,
...
-1
votes
3
answers
7k
views
How do I determine the maximum value for a polynomial, given a range of x values?
I need to determine the maximum value for y = a x^2 + b x + c, where I know the coefficients and the upper and lower x values. ...
15
votes
1
answer
8k
views
Methods for NonlinearModelFit
I am using NonlinearModelFit for a thesis project.
I get quite different results if I change the Method to LevenbergMarquardt or QuasiNewton or ConjugateGradient ...
15
votes
2
answers
2k
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 ...
26
votes
2
answers
1k
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 ...
15
votes
4
answers
7k
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 ...
14
votes
1
answer
3k
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 ...
10
votes
3
answers
713
views
Maximize violating constraints
I have
Maximize[{(h*10)/(300*(100 - (l^.5 + d^.4 + H^.6))), (l + d + H + h) == 669,
l > 0, d > 0, H > 0, h > 0}, {h, l, d, H}]
I believe ...
10
votes
3
answers
2k
views
How to find local minima of data using PeakDetect
One of the great new function in v10 is PeakDetect.
It can detect peaks (local maxima) according to desired sharpness as shown in this example:
...
5
votes
2
answers
1k
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]$.
...
4
votes
2
answers
2k
views
optimization problem with NDSolve
I want to minimize the function fcc. When fcc is calculated for a specified point the answer is correct:
...
35
votes
3
answers
8k
views
Optimization of a portfolio of stocks
I would like to use Mathematica to perform an optimization of a portfolio composed by 10 stocks. I did the first part to compute yields and expected yields, but I don't know how to finish the ...
21
votes
2
answers
2k
views
Expressing a polynomial as a sum of squares
I encountered a degree 4 polynomial in 8 variables f(a1,a2,a3,a4,b1,b2,b3,b4) that I suspect can be written as a sum of squares. While sostools in MATLAB would find ...
20
votes
4
answers
1k
views
Optimization of function taking a permutation
I have a function $f$ which takes a permutation $P$ of the integers 1-100 in order to give a numerical value $f(x)$. The function is given by a black box, but is relatively "smooth", so should be ...
15
votes
1
answer
4k
views
Which methods are available for NMinimize?
I can't find in the documentation the list of methods available to NMinimize[]. Is there a way to get this?
The NMinimize page in Documentation Center mentions only ...
13
votes
1
answer
3k
views
Lagrange Multiplier
We are asked to maximize and minimize $f(x,y)=4xy$, given the constraint $4x^2+y^2=8$, using the Lagrange Multiplier method. First, I enter the functions f and g.
...
9
votes
1
answer
892
views
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 ...
9
votes
4
answers
2k
views
Minimax optimization in Mathematica
Mathematica has functions for constrained nonlinear maximization or minimization of functions, via FindMinimum and FindMaximum ...
5
votes
1
answer
1k
views
Why does NMaximize does not follow the constraints that were given to it?
(someone may want to mark it as a duplicate, but I still have to ask! I just can't figure out why!)
...
4
votes
1
answer
2k
views
How to enforce constraints in NMinimize
I am trying to minimize a function EtotalEM[R,Δ] that is defined only for Δ <= R/ ArcSinh[1] (approximately: ...
4
votes
1
answer
996
views
FindMinimum, NMinimize, etc. with external process [duplicate]
I was hoping to be able to use MMA's minimization power to work with an external process. I want to minimize the function 'TryThisNumber[x_]' which sends the value of x to something external and gets ...
3
votes
1
answer
205
views
adding a point in a manipulate command
I am having trouble adding a point to mark the Min values of each parabola when using the Manipulate command?
...
0
votes
3
answers
301
views
How to compute higher iterations in mathemtica
I have the equation $u^{\prime\prime}(t)+u^{2}(t)-t^{4}-2=0$ such that $0\leq t\leq 1$and also I have $u(0)=0$ as well as $u(1)=1$. Noe the exact solution of the equation is $u(t)=t^{2}$. Now I ...
17
votes
1
answer
2k
views
ParallelEvaluate for function minimization
Is there a parallelized version of a minimization routine available in Mathematica?
The objective function is non-linear and the gradients have to be numerically computed. Every function evaluation ...
16
votes
1
answer
985
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 ...
13
votes
9
answers
6k
views
Finding maximum or minimum of implicit functions
is there any built in function that can be used to find maximum or minimum of implicit functions?
For example, if we have the equation
$$x^2 + y^2 = (2 x^2 + 2 y^2 - x)^2,$$
then we can visualize the ...
11
votes
2
answers
2k
views
Can I use GoogleMap or other GPS data in creation of the Graphs?
I have following graph.
...
10
votes
1
answer
2k
views
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 ...
6
votes
1
answer
193
views
Given square matrices A and B, how to solve T obeys Transpose[T]. A . T = B? [duplicate]
Dear Mathematica experts,
Given two square matrices, A and B, how do we use Mathematica to solve a matrix T such that T satisfies this matrix equation? (Here we have A,B,T $\in$ general linear matrix ...
4
votes
1
answer
549
views
Plot a function after taking the supremum with respect to one variable
Assume given a continuous function $f$ with 2 variables, say $x$ and $y$. $x$ takes values on the interval $I$ and $y$ takes values on the interval $J$. I would like to know how to plot the function
$...
4
votes
1
answer
6k
views
Finding the Minimum value of an interpolating function
I can't seem to use FindMinValue to find the min. value of a curve represented by an interpolating function.
For instance the below code generates an interpolating ...
3
votes
1
answer
415
views
Does 'True' stand for 'Else' in Maximize function output? [closed]
Maximize[a x^2 + b x + c, x]
gives this solution:
Does the word True stand for "else" here? What exactly did ...
3
votes
1
answer
705
views
Non-linear curve fit problem
I am having a problem with making a fit to data in Mathematica, which may involve my understanding of the methods available.
I am trying to fit the derivative of a Frota function (which is a Single ...
1
vote
1
answer
1k
views
What is the correct way to use NIntegrate inside the FindMinimum function?
I'm having minor issues with the FindMinimum function when using NIntegrate inside. The functions work perfectly well but I get ...
0
votes
1
answer
155
views
Mathematica does not show anything after running for higher iterations
Consider a BVP: $y^{\prime\prime}=\frac{3}{2}y(t)^{2}$ with the boundary conditions $y(0)=4$ and $y(1)=1$. The exact solution is $y(t)=\frac{4}{(1+t)^{2}}$ and the initial guess is $y(t)=4-3t$. Now I ...