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

learn more… | top users | synonyms (2)

3
votes
1answer
75 views

quadratic constraint feasibility

Suppose that $A$ is an $n \times n$ matrix, and I have observed some entries of $A$, say, $A_S$ ($A$ restricted on $S$) for some subset $S$ in $\{1,...,n\} \times \{1,...,n\}$. I want to know if it's ...
9
votes
1answer
352 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 ...
1
vote
1answer
139 views

Minimum value with two factors

Approximate the minimum value of $2e^{x-2}-6x+xe^{x-2}$. Is my input correct? If not can you please correct it? ...
1
vote
1answer
158 views

Maximize over permutations

I have a set $S=\{s_1,\ldots,s_k\}$ and would like to maximize a fixed expression over permutations of $S$: $\max f(x_1,\ldots,x_k)$ with $x_i\in S$ and $x_i=x_j\Rightarrow i=j$. Is there a ...
2
votes
2answers
458 views

Quadratic programming problem

I am trying to solve a (Sequence) Quadratic Programming (SQP) problem in Mathematica. Here’s the problem setup: ...
7
votes
3answers
393 views

Cannot find the maximum value of a function

Consider the following function: $a Sin(x)+b Cos(x)$ I tried to obtain the maximum value of this function using MaxValue[]: ...
1
vote
1answer
118 views

Function optimization errors

I have the following Mathematica code (Mathematica version 9): ...
1
vote
1answer
211 views

Linear Integer Programming with absolute values in objective function

I'm trying to solve a problem of the form $$ \left|a_{1,0}+a_{1,1} x_1 + a_{1,2}x_2\right| + \left|a_{2,0}+a_{2,1} x_1 + a_{2,2}x_2\right|\to\min, $$ where $a_{i,j}$ are real-valued coefficients and ...
11
votes
4answers
190 views

Constraint syntax compaction

Is there a more compact way to represent these constraints: NMaximize[{a+b+c,...
5
votes
1answer
403 views

Packing squares into a circle

I am currently trying to solve and understand a problem about packing the maximum of squares into a circle. What I am trying to do, is to calculate the maximum number of variable sized squares (with ...
0
votes
1answer
198 views

A problem on generating convex hull

For example, I typed the following: ...
1
vote
1answer
231 views

NMaximize problem

Could anybody explain to me why the following code fails ? ...
2
votes
1answer
197 views

NMaximize and Conditional Loop

I have developed the following code that simulates a process that decays over time and then returns to its initial state periodically. When I pass a list of random integers in the interval $(1,0)$ as ...
1
vote
2answers
314 views

Finding shortest non-zero vector $x$ satisfying $Ax=0 \pmod q$

Let $n$, $m$, and $q$ be positive integers (with $m > n$), and $A$ be a matrix over $\mathbb{Z}_q^{n \times m}$. Using Mathematica, I want to find the shortest non-zero vectors $x \in ...
7
votes
1answer
895 views

Linear programming with many variables and parameters

I am trying to reconstruct the answer that is given in this report. (page 153 in Appendix B; Section B.2.1). They are given variables, parameters, constraints, and the objective function to minimize. ...
3
votes
2answers
283 views

Optimization problem with matrix positivity constraints

Is it possible for Mathematica to parametrically find a local minimum of a given function (say of some variable $x$ where $(a,b,c)$ serve as parameters) subject to the constraint that a given ...
0
votes
1answer
96 views

Random variation inside NMaximize

I am using NMaximize as following code. ...
2
votes
1answer
268 views

Finding a fixed vector which minimizes the pairwise distance between noisy elements in two unordered arrays

Let $A$ and $B$ be two sets of $d$-dimensional coordinates of comparible (though not necessarily equal length). For example, here we can set $d = 3$ and have normalized values like: ...
7
votes
1answer
930 views

Minimization by Nelder-Mead

Finding a global minimum for this problem (non-linear optimization by the Nelder-Mead downhill simplex method) may not be possible, but by finding local minimum, I am expecting the value of the ...
4
votes
1answer
99 views

Exiting FindMinimum when a condition is met

I want to determine if a function f[x] can take negative values. f is expensive to compute and ...
0
votes
0answers
93 views

Inconsistent results in fits from NArgMin

EDIT: Just realized I had misspelled "inconsistent." I'm using version 7.0. I'm trying to fit a (noisy) data set to a large-order polynomial. (Just for context: there isn't a model for the ...
3
votes
1answer
451 views

How to maximize a function over a rotation matrix?

I have list of pairs of points: $\{(x_i,y_i)\}_{1\le i\le n}$, $x_i \in \mathbb{R}^3$, $y_i \in\mathbb{R}^2$ and would like to optimize over a rotation $R \in SO(3)$, a translation $t \in ...
1
vote
2answers
161 views

Need an efficient method for finding certain matrices

I am trying to write a function which produces square matrices with certain characteristics. The function should have two inputs: number of the rows, n number of ...
1
vote
1answer
115 views

Working precision for each variable

How can I define working precision for each variable individually for example: Maximize[x y< 100, {x, y}] where the working precisions for ...
0
votes
0answers
141 views

Non linear constrained interger Optimization

I need to maximize the equation below which is subjected to some nonlinear constraints Maximize hsum + isum + jsum + ksum + lsum + msum + nsum + osum ...
1
vote
0answers
76 views

NMaximize with matrix input

I defined function f[x_, fixed_] := {...}. Here x is an $M\times N$ matrix. I want to maximize $f$ with respect to $x$. I have ...
0
votes
1answer
278 views

Maximizing trig functions in Mathematica

Just to give some context, my motivation for this programming question is to understand the derivation of the CSHS inequality and basically entails maximizing the following function: ...
0
votes
0answers
54 views

NMinimize and FindRoot Issues with System of Equations [duplicate]

I am trying to solve a constrained optimization problem with a system of transcendental equations and am running into issues with NMinimize. I have a system of equations (...
1
vote
0answers
123 views

Conditional solution for system of linear equations

I have a linear equation system Q.m = t, with m unkown and where Q has dimensions ...
1
vote
2answers
243 views

Finding normals to a curve through a given point

I want to find x on curve $y(x)$, where curve $y(x)$ is perpendicular to point $(x_0,y_0)$. for this I minimize the distance between points $(x,y(x))$ and $(x_0,y_0)$, here's an example for point ...
9
votes
3answers
373 views

FindShortestTour for charity (or: How can I optimize meal delivery with FindShortestTour?)

I've been wondering about this for a while - but never got around to asking - until I saw faleichik's incredible answer to Mathematica Minecraft. I did some work at a not-for-profit a little while ...
3
votes
0answers
143 views

Trouble with Minimize

Minimize[{t^2, 1 == 3*t + 16*u}, {t, u}, Integers] It does not give the solution t = -5 and u = 1. Am I missing something? The solution being known and ...
1
vote
1answer
140 views

Feasibility of Linear Program

I have a set of (real) linear equations/inequalities and I want to know whether they have a solution, and to find at least one. The goal is to do this quickly. ...
0
votes
0answers
64 views

Initializing Minimization [duplicate]

I am trying to implement a model predictive control scheme in Mathematica, e.g. I optimize input sequences by predicting future outputs. So every time I call the cost function it will simulate the ...
4
votes
1answer
185 views

How to solve this simple equation?

I want to minimize a quadratic equation, but Mathematica does not solve it and only rewrites the solution. I wonder if there exist any way I can skip the computation by hand (I can solve it using ...
1
vote
1answer
274 views

using array elements in minimization

I have switched from mupad to Mathematica, however the syntax is completely different here. I want to ...
7
votes
2answers
627 views
1
vote
0answers
118 views

How can I say that all quantities need to be positive (and real)? [duplicate]

Can you say at the beginning of a script in Mathematica that you want all the quantities to be positive (and real)? So that in all calculations, only the real values of these quantities will be ...
1
vote
1answer
1k views

Using NonlinearModelFit to fit data with errors

Assume we have some data of measurements SeedRandom[9]; data = Table[{i,2*(1 + 5*RandomReal[])*Exp[-0.01*(1 + RandomReal[])*i]}, {i, {0, 100, 200, 400, 700}}]; ...
2
votes
2answers
250 views

Optimizing functions taking matrix arguments

I'm looking for general information on how to optimize matrix valued functions, I have the following function I'm looking to maximize (or figure out if this is possible at all). ...
2
votes
0answers
158 views

Speeding up a numerical constrained quadratic optimization

I'm trying to solve a quadratic optimization problem in 35 variables, $\vec{α} = \left< α_1, \ldots, α_{35}\right>$: $$ \begin{aligned} &\operatorname*{maximize}_\vec{α}&&1.0\cdot ...
2
votes
0answers
280 views

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

I updated my Mathematica recently to 9.0.1 cause the previous version was giving me freaky result especially in FindMinimumCostFlow and ...
0
votes
0answers
46 views
4
votes
0answers
367 views

When using NMinimize[…,Method->“DifferentialEvolution”] is an “iteration” different than a “step”?

Hopefully this question has a simple answer. I have the following bit of code: ...
2
votes
1answer
307 views
2
votes
1answer
175 views

How can I change the MPS format in Linear Programming samples of Mathematica?

I am trying to play with some linear programming examples of Mathematica as ExampleData[{"LinearProgramming", "blend"}, "Equations"]. It gives me the MPS format of ...
4
votes
1answer
125 views

Minimize failing on a polynomial

Calling: Minimize[{-0.4877 - 0.1190 r^2 - 0.1885 r^4 + 2.9703 z - 0.5531 z^2, 0 <= z <= 3.5 ∧ 0 <= r <= 1.75}, {r, z}] returns ...
1
vote
1answer
158 views

List comparison in constraints for Minimize

I am trying to solve an optimization problem, a simplified version of which is as follows: ...
4
votes
3answers
370 views

How to find the minimum of this constrained expression?

Let $x$, $y$, $z$ be three nonegative real numbers and $x^2 + y^2 + z^2 = 5.$ Find the minimum of the expression $$E=\dfrac{1}{2}x^2 y^2 + y^2 z^2 + z^2 x^2 + \dfrac{96}{x + y + z + 1}.$$ I tried ...
3
votes
1answer
188 views

Distance between two functions satisfying a constraint

My problem is that I have two functions that are described as follows: ...