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

learn more… | top users | synonyms (2)

1
vote
1answer
145 views
2
votes
2answers
162 views

Nonlinear Optimization with conditional statement

I find Maximize doesn't work well under conditional statement. Here is an example. A car is driving up a slope. I want to find out the largest slope angle the car can drive upwards. I choose the ...
0
votes
0answers
41 views

How to fit ODE's coefficient, just like using NMinimize [duplicate]

I want to fit ODE's coefficients to a model. I tried using NMinimize, but it seems it does symbolic instead of numerical calculations. ...
5
votes
2answers
290 views

Optimum number of cog teeth for two step helical gearbox

Note: Cross-posted at http://community.wolfram.com/groups/-/m/t/137895?p_p_auth=8QnKtT9I. I am to design a two step gearbox. The first step is to choose the number of teeth in each cog wheel in ...
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
357 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
140 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
160 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
472 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
409 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
119 views

Function optimization errors

I have the following Mathematica code (Mathematica version 9): ...
1
vote
1answer
215 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
192 views

Constraint syntax compaction

Is there a more compact way to represent these constraints: NMaximize[{a+b+c,...
5
votes
1answer
411 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
202 views

A problem on generating convex hull

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

NMaximize problem

Could anybody explain to me why the following code fails ? ...
2
votes
1answer
201 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
320 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
919 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
294 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
97 views

Random variation inside NMaximize

I am using NMaximize as following code. ...
2
votes
1answer
275 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
955 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
101 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
472 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
163 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
116 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
143 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
282 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
126 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
248 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
376 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
145 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
142 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
286 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
647 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
255 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
282 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
387 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
315 views
2
votes
1answer
176 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 ...