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

learn more… | top users | synonyms (4)

1
vote
1answer
66 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 ...
1
vote
1answer
72 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$? ...
6
votes
1answer
98 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 ...
5
votes
2answers
329 views
7
votes
2answers
423 views

Need help with the Lagrange multiplier method

Well I am new to Mathematica and got really stuck solving this problem. In class, I was ask to use the Lagrange multiplier method to find the maximum and minimum value of $f(x,y) = x^2+y^2$ which ...
0
votes
0answers
101 views

Solving Lagrangian (4 vars to solve for)

I'm a bit new to Mathematica, but here's what I've got: ...
1
vote
1answer
63 views

Efficient maximisation of log-likelihood

I would like to efficiently find the maximum $(\sigma,\lambda)$ for the log-likelihood of the derived distribution below. I only need $\sigma$ and $\lambda$ to one decimal place - so not very precise. ...
0
votes
0answers
23 views

Casting an optimization problem into least-squares form for Levenberg-Marquardt [duplicate]

I would like to use the function FindMinimum[] with the Method LevenbergMarquardt to this function: ...
0
votes
1answer
705 views

FindMinimum produces error message

I'm trying to solve a logistic regression problem using Mathematica -- more to improve my Mathematica skills than to solve the problem as I have already solved it using Octave. The problem I am ...
1
vote
1answer
115 views

Invalid computation of maxima

I am finding the following minimum FindMinimum[{ Abs[ ArgMax[f[q, n, b, b0, b1, t, s], b] - b1 ] }, {b1, -0.5}] given ...
1
vote
1answer
80 views

How to find a maximum value in a rotated parametric plot?

Let me just give you a bunch of tables to reproduce the problem. Here they are ...
7
votes
1answer
213 views

Risk-return trade-off — solving a convex optimzation

I try to convert a convex optimisation (cvxopt) example to the Wolfram Language from python. Source of the python code: Risk-return trade-off Please advise me on how to convert the following python ...
1
vote
1answer
114 views

How to Minimize an NIntegral

My problem is to minimize in Mathematica a numerical integral. The command FindMinimum[With[{R=2.5},NIntegrate[(R*r1*a)*Sin[r1*a],{r1,1,R}]],a] does calculate ...
2
votes
1answer
46 views

How to couple NIntegrate with FindMinValue

I have a problem with a correct transfer of values of parameters when NIntegrate (and some subsequent functions) are coupled with minimizing procedures in ...
1
vote
0answers
79 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 ...
1
vote
1answer
70 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? ...
2
votes
1answer
127 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 ...
4
votes
1answer
171 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 ...
3
votes
0answers
94 views
6
votes
0answers
94 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 ...
24
votes
3answers
835 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 ...
1
vote
1answer
94 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
57 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 ...
4
votes
0answers
108 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 ...
2
votes
1answer
202 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 ...
4
votes
2answers
162 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 ...
1
vote
1answer
66 views

Running this expression in Minimize function

So I got this expression here (written in pure text): ...
2
votes
1answer
61 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}$, $$ ...
13
votes
9answers
2k 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 ...
0
votes
0answers
114 views

Problems with NMinimize

I have written some functions that take a matrix and find its minimum inner product with a specific set of vectors ...
3
votes
0answers
75 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 ...
4
votes
0answers
58 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 ...
0
votes
2answers
93 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
126 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 ...
1
vote
1answer
284 views

How to minimize the sum of squares of deviations from the mean?

I am trying to minimize the sum of squares of a deviation from the mean applying the following: Minimize[Sum[(Subscript[x, i] - μ)^2, {i, 0, n}], x] It returns ...
1
vote
1answer
71 views

Variables input generation for Minimization in High dimensional space [duplicate]

I'm currently doing optimization in a high dimensional space. I was thinking of giving FindMinimum (or NMinimize not certain ...
2
votes
2answers
167 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. ...
10
votes
1answer
400 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 ...
5
votes
2answers
99 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
52 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}$ ...
1
vote
1answer
44 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 ...
10
votes
1answer
190 views

DifferentialEvolution scaling factor randomization

Using NMinimize for finding global minima, one can choose the DifferentialEvolution method. You can find a (not so) detailed ...
1
vote
1answer
69 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
62 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
53 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
60 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
70 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 ...