Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [mathematical-optimization]

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

Filter by
Sorted by
Tagged with
11
votes
2answers
727 views

Rotational Averaging of Image Periodograms (FFTS)

I'm writing a code to do rotational averages of image FFT's. I have a working version but it is pretty slow. Wondering if anyone has any thoughts on a way to do this more efficiently. Data looks ...
11
votes
1answer
302 views

Minimizing with differential evolution

A differential evolution algorithm is given here. I would like to get this kind of animation. I thought I could use NMinimize, given ...
11
votes
2answers
582 views

Using StepMonitor/EvaluationMonitor with DifferentialEvolution in NMinimize

My question about tracking the progress of a minimisation/fitting process is two-fold: 1. The first part of my question can be considered a slight duplicate/follow-up of this question. There the OP ...
11
votes
1answer
273 views

DifferentialEvolution scaling factor randomization

Using NMinimize for finding global minima, one can choose the DifferentialEvolution method. You can find a (not so) detailed ...
11
votes
1answer
380 views

Maximize area of intersecting triangle and square with constraints

There is this nice problem on mathoverflow to find a maximum intersection area of a square and a triangle with a constraint that they both have unit areas. I tried to solve it with a help of ...
11
votes
2answers
1k views

Can I use GoogleMap or other GPS data in creation of the Graphs?

I have following graph. ...
11
votes
1answer
354 views

Experimental`NumericalFunction in NMinimize solution

I try to make a number of optimizations using this code: ...
11
votes
2answers
194 views

Custom SGD optimizer in Mathematica neural network framework?

I have a new approach to SGD optimizer, and thought to try to test it in Mathematica. It uses gradients to simultaneously maintain online parabola model for smarter choice of step size - I only need ...
11
votes
0answers
300 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 ...
10
votes
1answer
1k views

Max & min distance between two moving points

I am trying to find the minimal and maximum distance between two moving points with Mathematica in an interval. For example, ...
10
votes
3answers
1k views

How to find local minima of data using PeakDetect

One of the great new function in v10 is PeakDetect. It can detect peaks (local maxima) according to desired sharpness as shown in this example: ...
10
votes
4answers
904 views

Finding a point from a set of contours such that it is nearest to a given point

I have several contour lines and one point. How can I find a point in one of those contour lines which is nearest to the given point? ...
10
votes
3answers
599 views

Maximize violating constraints

I have Maximize[{(h*10)/(300*(100 - (l^.5 + d^.4 + H^.6))), (l + d + H + h) == 669, l > 0, d > 0, H > 0, h > 0}, {h, l, d, H}] I believe ...
10
votes
2answers
513 views

Efficient solution for a discrete assignment problem with pairwise costs

Let's consider a simple graph with N vertices, and a corresponding set of N items. The goal of the problem is to assign every item to a vertex on the graph so that sum of a per-edge (that is item-...
10
votes
1answer
2k views

Lagrange Multiplier

We are asked to maximize and minimize $f(x,y)=4xy$, given the constraint $4x^2+y^2=8$, using the Lagrange Multiplier method. First, I enter the functions f and g. ...
10
votes
1answer
835 views

How trustworthy is NMaximize?

Suppose I solve a constrained optimisation problem using NMaximize. How confident can I be of the accuracy of the result? For concreteness, suppose that F,G are (...
10
votes
3answers
2k views

Built-ins for discrete ArgMax or ArgMin?

Wondering whether there are discrete versions of ArgMax / ArgMin, that is, something that will find the part of an expression at ...
10
votes
3answers
797 views

How to describe the convex hull of a set of points as an implicit region for optimization?

Last edit: 2016-05-03 A.G.'s answer was the one helped me the most, see explanation at the end of this question. Original question In Mathematica you can create out of a set of points in 2D and 3D ...
10
votes
1answer
679 views

Expressing a polynomial as a sum of squares

I encountered a degree 4 polynomial in 8 variables f(a1,a2,a3,a4,b1,b2,b3,b4) that I suspect can be written as a sum of squares. While sostools in Matlab would find ...
10
votes
3answers
1k views

How can I complete a correlation matrix with missing values?

I would like to complete a correlation matrix with missing entries, such that the resulting matrix is positive semi-definite. Say I want to find some x and some y in the next matrix that satisfy ...
10
votes
2answers
4k 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. ...
10
votes
1answer
1k views

Simulated Annealing Convergence

I am using Simulated Annealing method for a simulation based optimization of a process that has 3 variables, using NMinimize. I print the input/output during every ...
10
votes
0answers
3k views

Precision and accuracy in NDSolve and NMinimize

I use NDSolve quite a lot and have noticed that setting values for AccuracyGoal and ...
9
votes
3answers
521 views

Strange domain dependency with Maximize

I'm using Mathematica 8 and strangely enough this code: Maximize[{x*(1-0.01 x),x>0},x,Integers] produces the result ...
9
votes
2answers
246 views

Checking linear program feasibility?

I want to check whether a certain linear program is feasible programmatically. If I just type in an infeasible instance, such as ...
9
votes
2answers
129 views

FindMaximum returns a solution that violates the constraints

I am looking at the following optimization problem $$ \begin{align*} \max\ & 1000 r_1 + \frac{1}{2}r_2 + \frac{1}{3}r_3\\ \text{s.t. }& 1000^2 r_1 + \frac{1}{4}r_2 + \frac{1}{9}r_3 = \frac{1}{...
9
votes
2answers
554 views

Relaxation of Mass-Spring System with Pinned Masses

Problem Assume that four masses are connected to each other by springs while two of them are pinned down at their initial positions. Find the position of masses when system is at its minimum (...
9
votes
1answer
212 views

Why FindMinimum crashes the kernel in specific situation

Bug introduced in 11.0.0 and fixed in 11.1 I have found that FindMinimum crahses is a certain situation. Here is my minimal working example: ...
9
votes
0answers
266 views

Help finding the centre of a faint, incomplete circle? [closed]

so I found a program in the answers to this question that I thought was brilliant, so here it is applied to my situation: I have the image and here's the code: ...
9
votes
0answers
131 views

LinearProgramming returns an invalid null solution that apparently doesn't satisfy constraints without any warning

Bug introduced in 9.0 or earlier and persisting through 11.0.1 or later While searching to answer the question Solving the magic backyard puzzle with MMA at some time I composed a set of arguments ...
8
votes
2answers
1k views

Distribution of 10 points within a unit square

Related to some packing problems, following problem arose: Distribute 10 points within a square of sides 1, so that minimal distance between them is maximized. With the help of random simulation, or ...
8
votes
3answers
4k views

Travelling salesman with start and end points for 30 points

I am doing a route optimisation for delivery vehicles and failing dismally. Please see problem statement below. My current solution uses FindShortestTour, but this does not have defined start and end ...
8
votes
4answers
1k views

Finding the point of minimum distance between two parametric functions

I have two functions re and rm, for which I computed the minimum distance between them. Now I would like to add a point at the ...
8
votes
3answers
435 views

Numerical minimum of a one-valued function

Bug introduced in 12.0 [CASE:4332003] My problem is that the Kernel cannot finish computation and eats up memory when a simple constraint like 0 <= x <= 2 is ...
8
votes
2answers
2k views

Implementation of a new Game of Life Rule

I need to implement a new "game of life" in Mathematica: I have three states — black, red and white. Black means go forward, red go back and white take no action. I would like to implement the ...
8
votes
1answer
714 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 ...
8
votes
3answers
2k 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[]: ...
8
votes
3answers
402 views

Locally Weighted Linear Regression

I am following the online Stanford Course in Machine Learning and I am trying to implement the algorithms on the fly in Mathematica. Currently, I have issues with minimizing the Locally Weighted ...
8
votes
5answers
867 views

Indicate minimal path sum

Described on the page: http://www.mathblog.dk/project-euler-81-find-the-minimal-path-sum-from-the-top-left-to-the-bottom-right-by-moving-right-and-down/ It is an example of the solution indicated in ...
8
votes
3answers
807 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 ...
8
votes
2answers
832 views

Is there any fast way to solve a quadratic matrix equation in Mathematica approximately?

Let the square nonsingular matrix $M$ is a given convergent matrix. What are the best scalar values for $\alpha$ and $\beta$ (in the real numbers domain), at which the following quadratic matrix ...
8
votes
2answers
727 views

Finding the least positive integer satisfying a quantified statement

I'm studying the convergence of the sequence of functions $f_n:[0,1]\subset\mathbb{R}\to\mathbb{R}$ defined by $$f_n(x)=n^2x(1-x^2)^n$$ for $n\in\mathbb{N}$. These functions converge pointwise to the ...
8
votes
2answers
572 views

Numerical Optimization Methods

I am curious if any one has comments on "specific characteristics" of a problem that will deem it to be best solved by a specific optimization method such as ...
8
votes
1answer
644 views

NMinimize go out of bounds on some linear constraints

I'm trying to minimize a non-linear function of four variables with some linear constraints. NMinimize on Mathematica 8 seems to go out of bounds on some constraints giving complex values of the ...
8
votes
3answers
2k views

How to find the maximum value of an integer that satisfies some inequality

Consider the following Mathematica expression: Reduce[2^j/(j + 1) <= 10, j, Integers] which outputs: ...
8
votes
1answer
475 views

What is going on in this plot?

Plot[{ArgMax[Cos[t] Sinc[2*Pi kl (Sin[t] - 1/Sqrt[2])], t]*180/Pi, 45}, {kl, 0, 10}, PlotRange -> Full] I want to know what causes this, and how to fix it ...
8
votes
1answer
410 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 ...
8
votes
1answer
228 views

Is there any way to speed up this code that's Maximizing a function got from numerical integration?

I have this code below, which is calculating the Binding energy of an electron in a Quantum Well Wire with a hydrogenic impurity in it. Well you don't have to care much about what kind of calculation ...
8
votes
1answer
150 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 ...
8
votes
1answer
132 views

A puzzling maximization issue using Abs[ ] in the constraints

Consider the following pair of commands. Maximize[{x^2 + y^2, Abs[x] <= 1, Abs[y] <= 1}, {x, y}] $\{2, \{x \rightarrow -1, y \rightarrow -1\}\}$ ...