Questions tagged [mathematical-optimization]

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

Filter by
Sorted by
Tagged with
77 votes
5 answers
27k 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 ...
user avatar
  • 1,977
94 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 ...
user avatar
  • 13.4k
43 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 ...
user avatar
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 ...
user avatar
  • 517
17 votes
1 answer
3k 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: ...
user avatar
  • 18.8k
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 ...
user avatar
  • 115
44 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 ...
user avatar
  • 21.7k
40 votes
5 answers
21k 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 ...
user avatar
25 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)? ...
user avatar
  • 23.7k
18 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, <...
user avatar
  • 111k
8 votes
2 answers
827 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 ...
user avatar
  • 859
15 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: ...
user avatar
  • 34.6k
20 votes
2 answers
9k 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 ...
user avatar
  • 13.8k
2 votes
3 answers
347 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, ...
user avatar
-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. ...
user avatar
  • 99
14 votes
1 answer
7k 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 ...
user avatar
  • 1,163
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 ...
user avatar
25 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 ...
user avatar
  • 1,255
21 votes
2 answers
3k 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 ...
user avatar
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 ...
user avatar
  • 10.6k
14 votes
1 answer
2k 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 ...
user avatar
  • 433
4 votes
1 answer
564 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} ...
user avatar
  • 165
5 votes
2 answers
952 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]$. ...
user avatar
  • 979
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: ...
user avatar
10 votes
3 answers
692 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 ...
user avatar
33 votes
3 answers
7k 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 ...
user avatar
  • 399
18 votes
4 answers
962 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 ...
user avatar
  • 5,438
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. ...
user avatar
  • 14.5k
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: ...
user avatar
15 votes
1 answer
3k 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 ...
user avatar
  • 7,757
20 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 ...
user avatar
  • 301
4 votes
1 answer
962 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 ...
user avatar
  • 1,411
3 votes
1 answer
141 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? ...
user avatar
0 votes
3 answers
239 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 ...
user avatar
  • 169
5 votes
1 answer
986 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!) ...
user avatar
11 votes
2 answers
2k views

Can I use GoogleMap or other GPS data in creation of the Graphs?

I have following graph. ...
user avatar
  • 1,165
16 votes
1 answer
936 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 ...
user avatar
  • 3,964
15 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 ...
user avatar
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 ...
user avatar
  • 888
13 votes
9 answers
5k 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 ...
user avatar
8 votes
1 answer
829 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 ...
user avatar
7 votes
4 answers
1k views

Minimax optimization in Mathematica

Mathematica has functions for constrained nonlinear maximization or minimization of functions, via FindMinimum and FindMaximum ...
user avatar
  • 10.7k
4 votes
1 answer
5k 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 ...
user avatar
  • 5,171
4 votes
1 answer
434 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 $...
user avatar
  • 191
3 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: ...
user avatar
  • 3,731
3 votes
1 answer
655 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 ...
user avatar
3 votes
1 answer
376 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 ...
user avatar
  • 283
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 ...
user avatar
  • 745
-1 votes
1 answer
190 views

Finding optimal taxation policy- constrained optimization [closed]

I need to solve two constrained optimization problems where the second problem depends on the results of the first. The agents in my economy maximize utility: $$\max_{c,d,l} p\ln(c)+\ln(d)+\ln(l)$$ ...
user avatar
17 votes
4 answers
6k 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 ...
user avatar
  • 1,079

1
2 3 4 5 6