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

learn more… | top users | synonyms (4)

15
votes
1answer
325 views

Bug in plotting function using FindMinimum?

Bug introduced in 10.0 and persisting through 10.3 or later While working on an answer to RegionPlot from NDSolve, I came across this strange behavior of ...
3
votes
2answers
267 views

How to find the maximum of this function on the positive real line?

I need to maximize this function on the positive real line: $$ \frac{1}{\Gamma(x)^{14}}\cdot\frac{1}{{\frac{323.6}{14x}}^{14x}}\cdot(1.22578*10^{19})^{x-1}e^{-14x} $$ the correct answer should be ...
2
votes
1answer
155 views

Fitting to the system of equations with no analytical solution

I'm trying to fit linear combination of 2 functions to my experimental data set (it represents voltage of 2 photodiodes - Voc1 and Voc2 - connected in series under illumination - S) ...
4
votes
1answer
76 views

How to get function output with Manipulate

I have a program, which makes Gauss-Jordan transformations (not too pretty, I suppose). I want to get output with Manipulator like that: Two-Phase Simplex Method with only "step number" slider. One ...
7
votes
1answer
190 views

ParametricNDSolve[ ] and NMinimize[ ] in Combination

I have the following code that is used to simulate a spacecraft orbiting Mars, and uses ParametricNDSolve to vary the spacecraft's initial conditions using a parameter value ...
7
votes
3answers
262 views

Find parameters that minimize the distance between two curves in terms of the infinite norm

I am trying to implement a very simple NMinimize code that would search for parameters of a polynomial that minimize (globally) the distance between this polynomial ...
2
votes
2answers
91 views

None of the NMinimize methods leads to the answers of the equation

The following 10 equations has one set of exact answer using NSolve in Mathematica 9.0.0.0 (for positive c2, alpha1, alpha3, beta1, beta3, A1 and A3): ...
1
vote
2answers
87 views

Maxima turn out to be false maxima when extremising function locally

In short: I have a 2-D function that gives this plot, where the orange dots are maxima: There are 4 maxima in this plot. Now, I plot the function again in a smaller region, close to these maxima, ...
1
vote
1answer
100 views

Find function tracing the maximum of a 2D function

I'd like to solve the following problem: Given MI[o_, n_] := Log2[1 + 4 o (Sqrt@n + Sqrt[1 + n])^2] Find a function f[n_] ...
3
votes
1answer
309 views

Numerical Instability?

Current Status Please skip ahead to Update 2: the key questions are now: 1/ Why does Mma generally fail to find the minimum for a well behaved function when the function does not have infinite ...
0
votes
1answer
72 views

a question about Nminimize [closed]

I have 10 equations and 10 unknown parameters such as alpha1,alpha2,a1,a3,... which I want to find them by minimizing ...
6
votes
2answers
290 views

Graphically solving a linear programming problem

I try to realize the graphical linear programming method. Here is my code ...
0
votes
0answers
46 views

Incorporating sophisticated constraints on the approximating function into NMinimize

Following the approach as given in the answer of Belisarius here I just wonder how one could incorporate some more sophisticated requirements on the approximating function. Suppose the approximating ...
4
votes
2answers
169 views

FindFit and NMinimize to fit a parametric model (minimize the distance of two curves)

I am trying to find a fit to the cumulative distribution of a set of points using FindFit or NMinimize. In particular, I would like to find the parameters of the cdf of the Beta Distribution that ...
1
vote
1answer
52 views
2
votes
1answer
119 views

Maximum of the minimum of two functions

I have two functions, each with 15 variables. How can I find maximum (minimum) of these functions? I know that minimum (maximum) of two functions is a multi-criteria function but I cannot find it. ...
0
votes
1answer
59 views

Problem with inequality constraint

I'm using NMinimize to solve the following objective function. ...
0
votes
0answers
46 views

Minimize function with logical arguments

How can I minimize or maximize a function (even numerically) with logical arguments, taking only 0s and 1s, also with constraints? E.g. ...
3
votes
1answer
89 views

ArgMax, FindArgMax, and NArgMax disagreeing on answer

In working on an estimation problem, I created three Gaussian-like functions. The ML estimate could be seen as the argmax of the product of the three functions. In trying to get the code to run ...
2
votes
0answers
52 views

FindMinimum not accurate [closed]

Consider the function f[B_, d_] := -158.57189 + 982.533102 B^2 - 5.6768579 d + 895.1968 d^2 + B (-18.7772 + 655.02206 d); ...
4
votes
1answer
92 views
3
votes
1answer
140 views

How to make Maximize function successfully maximize in general?

Having looked at Maximize Documentation SO: Mathematica: Commands return no output, but itself. Bug? Problem with Maximize Why won't Mathematica Solve a set of two equations for one variable? ...
5
votes
2answers
103 views

Parallel function evaluation for minimal value

I am asking myself, if the evaluation of a function f looking for a minimal value over a discrete set of values can be parallelize (brute scan for a potential ...
1
vote
1answer
60 views

Trying to maximize an expression with integer and real variables

I am trying to solve this equation The link has a screen capture of the equation and the solution. I am looking for the values of a1 and a2 in particular, but they need to be real numbers. s1 and s2 ...
3
votes
2answers
98 views

Optimization not evaluating, further specifications?

I am trying to find the global minimum of this simple function for real x and y f = x^2*(1 + Sin[y]); Of course, I know it is 0. But Mathematica seems not be able to handle this expression since ...
1
vote
0answers
63 views
3
votes
1answer
90 views

Speeding up constrained optimization problem solving

I have a problem on my homework with Lagrangian multipliers that Mathematica has now been bashing at fruitlessly for 10 minutes. I'm not sure whether I did something horribly wrong codewise, but it's ...
4
votes
1answer
175 views

NMinimize fails on Mesh?

Context I want to identify the minimum of a solution of a PDE found on a mesh. Problem I do not understand why NMinimize fails on a mesh? As a test case, ...
6
votes
1answer
369 views

Speeding up the non-negativity algorithm for multilinear function with interval probabilities?

The algorithm is a branch-and-bound algorithm that calculates the non-negativity of a multilinear function with interval probabilities. The lines 9-11 has an optimization that is explained on the ...
1
vote
0answers
60 views

Find multiple optimization parameters of Max-Min problem in numerically

I have an optimization problem $$\max \min [x_1,~\cdots,~x_m,~\cdots,~x_M]:~M\geq 2$$ where $$x_m=P_m(1-a_m)\prod_{j=1}^{m-1}\left(\frac{a_j}{1-a_j}+b_j\right)$$ and $$0\leq a_i<1;~~0\leq ...
4
votes
0answers
83 views

Improving the speed of an optimization algorithm via compilation and parallellization

I have written an implementation of eight variants of the PSO-algorithm and I want to test them over a set of test functions. I am using parallelization as it improves the speed a lot and I have also, ...
20
votes
2answers
780 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 ...
2
votes
0answers
329 views

Why my Mathematica 9.0.1 wont work with some samples of Mathematica in Graph Theory?

Bug introduced in 9.0 and fixed in 10.0 FindMinimumCostFlow is introduced in 9.0. I updated my Mathematica recently to 9.0.1 cause the previous version was ...
6
votes
1answer
143 views

NMinimize Example from Wolfram Documentation Center

Here is the third example of NMinimize function from Wolfram Documentation Center at Possible Issues section. ...
1
vote
0answers
46 views

Problem with `NMinimize` [closed]

I wrote a code inspired by Rod's answer to this question. It is supposed to find the minimum variance portfolio of stocks and allows for arbitrary constraints on the weights of each stock: ...
0
votes
1answer
63 views

Lagrange multipliers implementation (beginner question) [closed]

I am trying to write a code to find the minimum of $f(x,y) = (Mx + Ny) \,/\sqrt{M^2 x + N^2 y}$?, subject to the constraint $g(x,y)=x+y-1$. Also, $x,y>0$, and $M$ and $N$ are positive constants. ...
0
votes
1answer
35 views

Setting value of number on certain decimal points [duplicate]

How do I fix number on certain decimal point? For example number 10304,390456 should be 10304,39. I tried NumberPoints, Nest, ...
1
vote
1answer
119 views

What methods does Maximize use like $\mathtt{Maximize}\left[\left\{3 x^2+2 \sqrt{2} x y,x^4+y^4=1\right\},\{x,y\}\right]$

I used Maximize for the maximum value of $3 x^2+2 \sqrt{2} x y$ when $x^4+y^4=1$ , $x>0,y>0$. What methods does Maximize ...
0
votes
1answer
59 views

Why the returned value is complex while my input is all real in Nminimize

This is the mathematica code I used. My goal is trying to solve eq2==0 && eq3==0 simultaneously in the region "-200 The FindRoot doesn't gives me quick answers. So I tried to use Nminimize ...
8
votes
1answer
103 views

Minimizing NExpectation for a custom distribution

As discussed and advised in Meta: Migrate a question..., I've copied a 2012 posted question from StackOverflow (posted before this site began running), which has gotten a lot of attention (but after 3 ...
0
votes
0answers
60 views

Find the maximum hyperrectangle contained in a set of points

I have a question similar to this one ( Find the largest rectangular block satisfying some condition without iterating explicitly). but in my case I have a multidimensional (up to 6 dimensions) binary ...
3
votes
1answer
106 views
-3
votes
1answer
91 views

Untangling delayed definitions and substitutions [closed]

I am attempting to find the values of B1 and B0 that will minimize a metric. In the code below I define the metric and then attempt to calculate is by substituting in the current values of B1 and B0. ...
3
votes
1answer
128 views

Programming a MaxMin Linear Optimization

I want to program a function for a two-player game. Basically it's like this: . Each player has an array of options, and the result of the game is based on both players choices. So heres my most ...
2
votes
1answer
224 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 ...
33
votes
5answers
8k 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 ...
0
votes
0answers
38 views

How to determine whether NMinimize returns a solution or not?

I'm using NMinimize to find the minimum solution for a non-linear objective function. As I change the set of constraints, most of times ...
3
votes
1answer
124 views

Repeated interpolation for 3D unstructured grid -> Optimization

Trying to perform mesh-to-mesh 3D interpolation on unstructured grid. Mesh size is about 200k nodes. Painful thing that interpolation shoud be repeated ~1000 times (different thermal map) on the same ...
0
votes
0answers
49 views

NIntegrate within NMinimize - how to optimize the code?

How I can optimize these numerical calculations? Most annoying is encountering instabilities (numerical errors). I have a predefined function: ...