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

learn more… | top users | synonyms (4)

1
vote
0answers
64 views

Possible memory leak in FindMinimum? (MMA v10.0)

So I was running some code when I noticed Mathematica was gulping memory, and after some debugging I think the culprit is found. It turned out the function ...
-7
votes
0answers
33 views

Optimization (minimization) of equations with conditions [on hold]

I need to minimize the expression a+(b/3) + c under the conditions: ...
1
vote
1answer
53 views

How do I write a function inside a ArgMin

I want to solve this ArgMin[NIntegrate[(Tanh[x] - Erf[x/a])^2, {x, -5, 5}], a] and it does not work, what is the correct way to do this? ...
0
votes
1answer
46 views

Force mathematica to consider variables as real [on hold]

I want to implement an optimization of the form: NMinimize[{function,{constraints:A1^2+A2^2+A3^2+A4^2 ==1}},{A1, A2, A3, A4}] where I want to tell mathematica ...
0
votes
1answer
50 views

Finding a vector many times

I have a vector matrix of profits say prof= {{1, 1, 1, 1, 1}, {2, 2, 2, 2, 2}, {3, 3, 3, 3, 3}, {4, 4, 4, 4, 4}, {5, 5, 5, 5, 5}}; I have a "terminal value ...
-2
votes
0answers
29 views
6
votes
0answers
60 views

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 ...
3
votes
0answers
68 views

Classification problem using SVM methods

I am running SVM on mathematica and I a used this code with classes: ...
0
votes
0answers
30 views

Optimizing over every element in a vector [closed]

So I have a 16 element vector, called LUEigenvector, depending on a series of variables a1,a2,...b1,b2...c1,c2... All the elements depend on all the variables. I want to use NMinimize sequentially, ...
4
votes
1answer
163 views

Goal optimization: finding the best combination of capacitors and resistors resulting in given properties

I want to edit @MarcoB answers (because the code he gave doesn't answer the question appropriately)->(the function that need to be optimised is not implemented as asked) But it seems like I am having ...
1
vote
1answer
54 views

Optimizing best fit circle to given data set [duplicate]

Given a set of data, I have plotted a slowness curve for a p-wave resulting from the given data. A slowness curve is just the reciprocal of the velocity of the p-wave. What I need to do is find a ...
0
votes
1answer
51 views

Basic question about loops in mathematica

I am very new to Mathematica programming and am trying to find the optimum of a numerical integral for various values of a parameter. Here is the basic code for one parameter value that runs fine - I ...
21
votes
3answers
750 views

Exponential fitting - isn't actually a BUG there?

There are many questions on this site about wrong exponential fitting in Mathematica but no one considers this well-known problem as a potential bug. Usually people suggest well-known workarounds ...
2
votes
1answer
108 views

How to transform the output of Minimize/Maximize into a function

I want to create a function directly from the output of Maximize. Specifically, I have the following function $f(l,h,d,a)$ that I want to maximize with respect to ...
0
votes
0answers
24 views

Making the inequality constraints using NMinimize a convex function [closed]

While performing minimization using NMinimize, my constraint equation has the inequality $0 \leqslant x \leqslant 1 $ due to which my function is not minimized properly. In spirit of the answer to ...
0
votes
0answers
45 views

Obtained solution by NMinimize with constraints doesn't satisfy constraints [on hold]

I am minimizing a multivariate function F(x_1, x_2, x_3 .... x_N) where N goes to 12, subject to a constraint z == 0 using ...
1
vote
1answer
58 views

How to check a clockwise direction for a list of point [closed]

Suppose that we have a list of points and we need to order them in clockwise direction by starting from a special point. I implemented this code to order them but I need to detect if it is ordered in ...
4
votes
0answers
73 views

Why has Version 10.3 precision reduced?

In version 7.0.1.0 and versions 10.0 and 10.1 the following is produced: ...
1
vote
1answer
50 views

Paramter Scans and $\chi^2$ Test in Mathematica

Is there any in-built function or a recommended package that enables one to find, say, 10 Parameters, which are used as boundary conditions in NDSolve, that minimize $\chi^2$? ...
4
votes
0answers
91 views

How is the multi-class support vector machine classifier implemented? [closed]

I am using support vector machine (SVM) method with Classify to do multi-class. Can anyone tell me the reference (paper) used by Wolfram Mathematica to develop the ...
1
vote
1answer
59 views

Running this expression in Minimize function

So I got this expression here (written in pure text): ...
3
votes
2answers
72 views

ListSliceContourPlot3D with non-opaque stacked planes

I'd like to make a ListSliceContourPlot3D in Mathematica with using the stacked planes (x, y, or z) for the contours, but I'd like the planes to have an opacity ...
2
votes
1answer
195 views

Maximized value of a function as an additional constraint on a variable

I want to maximize a function $f(b, h)$ with respect to its arguments and subject to some additional constraints. If these constraints are satisfied, $f$ is increasing in $h$. I then want to find an ...
9
votes
1answer
200 views

Speed up construction of a dense matrix

I wish to find the numerical eigenvalues of a relatively small (100 dimensional) Hermitian matrix. While the eigenvalue calculation itself is fast, the construction of the matrix is taking longer than ...
6
votes
1answer
67 views

Simulated Annealing, SearchPoints and InitialPoints options set at the same time

I have a function that needs to be minimized. Since the function depends on real-time data (which is fetched every few hours, and the function is redefined according to the new data), I have to run ...
4
votes
0answers
48 views

NMinValue , NMaxValue , NMinimize and NMaximize behave poorly for 2-dimensional function unless the constraint is posed as an ImplicitRegion

I am making a plotting function where I need to know the max value the function takes over the given 2D range. I noticed a difference between the behavior of ...
3
votes
0answers
51 views

Is there an analogue of Evaluated->False (in FindRoot) for FindMinimum?

I guess functions like FindRoot, FindMinimum, etc puts the estimation number into the expression, and then do other ...
0
votes
2answers
85 views

How to get the correct answer of this expression with Minimize? [closed]

I want to find minimum value of the expression $$P = 13 x^2 + 12 y^2 + 22 z^2$$ such that $x y + y z + z x = 1$. I tried ...
3
votes
1answer
97 views

FindMaximum “is not a real number at” nrnum problem

I'm experiencing a problem using FindMaximum that I don't understand (due to my newbie knowledge of Mathematica's syntax). That is, FindMaximum sometimes returns a (correct) answer, but sometimes ...
2
votes
1answer
44 views

How can I minimize a function with respect to the number of its variables?

Given some $d \in \Bbb{Z}_{>0}$, $t \in [0,1]$, and $0 < a < b < 1$, fix $I = [a,b]$. I'm trying to compute $$ \min_n \min_{E_n(t)} f_d(\mathbf{x}) $$ where $n \in \Bbb{Z}_{>0}$, $$ ...
10
votes
1answer
388 views

Shortest tour with vertex priority

I changed the title of my question and tried to simplify formulation of the problem. I solve a very big vehicle routing problem. I divided this one big problem on many small sub-problems. Each small ...
1
vote
1answer
51 views

How can I improve the result of this non-linear optimization?

Given a positive integer $d$ and some $0 < t < 1$ I would like to find a global minimum1 for $$ \sum_{k = 1}^n d^2 \tan\left(\frac{\pi}{2} \, x_k\right) + 8 d $$ over $n \in \Bbb{Z}_{> 0}$ ...
4
votes
2answers
94 views

How to find alignments of interlocking shapes?

I'm searching for the ways to align interlocking shapes, that is, finding the locations and rotations that maximize the arc length at which they touch. For simplicity, I'm assuming 'shapes' are one ...
1
vote
1answer
36 views

How to solve Quadratic Program in vector form?

I've gotten Q matrix and Y vector, Q matrix is a 7x7 matrix, but the "NMinimize" in wolfram seem can only solve the real number not vector, how to solve it in vector form? (alpha 7x1 vector, Y 7x1 ...
2
votes
2answers
143 views

Maximizing over an integral with a single parameter

There is probably a neat approach to solve this problem...but can't get to it at the moment. How do you maximize an integral with respect to a single parameter? My code below produces error messages. ...
1
vote
1answer
58 views

Improving strategy to solve this constrained root-finding problem

I am looking for roots of the function eqs defined below. It has $2k$ unknowns and returns a vector of $2k-1$ components. The sole purpose of the following block ...
1
vote
0answers
38 views
1
vote
0answers
60 views

Exponential Matrix Diffentiation

I have been struggling with the following question while solving an optimization problem in $\mathbb{R}_{+}^G$. Basically, I have $$\min_{y \in \mathbb{R}_{+}^G} F(y) = y^{T}\mathcal{K} + \exp(-y^{T} ...
0
votes
1answer
49 views

Minimization with respect to functional constraints [closed]

I am trying to do the following on Mathematica: Given a pair $(x,y)$, minimize an objective function $f(x,z)$ such that z satisfies $g(x,z) \leq g(x,y)$. I have defined both functions ...
1
vote
1answer
55 views

Count and NMinimize don't seem to work together

Initially I write down a 2x2 unitary (Uni) , make a tensor product 4 times (LocalUni) and apply it to an initial numerical matrix Rho, to obtain RhoLU, that depends on 12 parameters. This is my code: ...
0
votes
1answer
56 views

Minimization of linear combination of vectors

Suppose I have a vectors in $\mathbb{R}^{6}$. For example, take the vector $v = k(-2,2,4,6,2,2)$. I would like to find some $k$ with the constraint that the last two components are necessarily ...
4
votes
1answer
60 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
3answers
196 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
85 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
73 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
94 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_] ...
2
votes
1answer
144 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) ...
0
votes
1answer
71 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 ...
0
votes
0answers
44 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 ...