# Questions tagged [mathematical-optimization]

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

192 questions
Filter by
Sorted by
Tagged with
175 views

### Formulating a tailor-made Maximum Flow problem in a directed graph

Let a digraph, G, be given, where t[i,j] and a[j,i], respectively, denote transfer capacity ...
1k views

### Finding minimal distance between two surfaces

This code will display two parametric surfaces: ...
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? ...
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 ...
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 ...
476 views

### Techniques to find all local minima of black box function with n continuous derivatives?

I have a blackbox function f on [a,b] that is known to be continuous, and has n continuous derivatives. The function uses polynomial interpolations (but isn't a polynomial interpolation itself), so no ...
513 views

### NMinimize in one-dimensional Interval

An Interval should be a one-dimensional region, so a region. I tried to minimize a function over an interval, e.g.: ...
537 views

### Minimax optimization in Mathematica

Mathematica has functions for constrained nonlinear maximization or minimization of functions, via FindMinimum and FindMaximum ...
276 views

### Using FindFit to fit nonlinear ODE parameters, subject to a constraint (an inverse problem) [duplicate]

Similar to this post I am finding that constraints tend to make FindFit poor at finding a good fit. However, unlike the previous post, the constraints are required ...
603 views

### Fitting a variable using multiple equations

I would like to find the best fit of two variables for a number of approximate equations, such as: 1x+2y+2=7.04 2x+y+4=7.98 1.5x+1.5y-2=2.53 1.8x+3y-1=6.77 That ...
193 views

### Printing from the function to be minimized in FindMinimum

I know that there is an option EvaluationMonitor for various numerical computation and plotting functions. But I am curious, why a simple ...
94 views

### 3D-Plot optimization results for varying parameter values

Before starting, FYI: This is a question related to 3D Plot the result of local Minimize with varying parameter values Consider my objective function, $objF$: ...
247 views

### Counterpart of Maple's LSSolve in Mathematica

I am a great fan of Mathematica. Unfortunately, due to some specific tasks I had to move to Maple. I think it's my lack of info that is not letting me do those tasks. That is why I am asking some ...
611 views

### Why does NMaximize does not follow the constraints that were given to it?

(someone may want to mark it as a duplicate, but I still have to ask! I just can't figure out why!) ...
596 views

### Using ParametricNDSolve and NMinimize to find accurate interplanetary trajectory arrival periapse radius

I have an interplanetary trajectory simulation that calculates the required velocity (using a Lambert solver) and escape angle for a spacecraft to travel from Earth to Mars. This model does not use a ...
1k views

### Can't find maximum of a function on a region

for h=0.2 I'm trying to find the maximum value of (-h^2/3)*(-1/x^2) subject to ...
280 views

### Forcing optimal solution for FindShortestTour

I use FindShortestTour as explained here and it works nicely for a small number of cities. However when I try this with as little as 16 cities, the given tour isn't ...
180 views

### Simplifying Expressions for FindMinimum

I am currently trying to apply the FindMinimum function to find the lowest energy of an expression. My current expression as of now is relatively complicated. It is the summation of 48 similar terms, ...
219 views

### Optimization of ODE with respect to the initial condition

One has a (system) of ODEs with a one-parameter family of initial conditions. For example, ...
706 views

### How to enforce constraints in NMinimize

I am trying to minimize a function EtotalEM[R,Δ] that is defined only for Δ <= R/ ArcSinh (approximately: ...
1k views

### Symbolic Constrained Optimization

I have a question regarding evaluating constrained optimization problems in symbolic terms. I would like to perform How can I implement the method of Lagrange multipliers to find constrained extrema? ...
112 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. ...
70 views

### 3D-plot of a maximization of a definite integral

I'm applying the answer (If method) suggested by 'ThatGravityGuy' in this post in a more complicated case. Consider my objective function (pardon its formidable ...
1k views

### NMinimize to optimize function Module

I am using Nminimize for simulation based optimization. I define the objective function (simulation with a variable "a") as a module to be used in the minimization. ...
2k views

### Schedule programing problem with integer linear programming

I know how to model this question on paper, but I don't know how doing it in Mathematica. Imagine , there is a university student who want to choose courses for this semester and he got the ...
390 views

### Optimization of function taking a permutation

I have a function $f$ which takes a permutation $P$ of the integers 1-100 in order to give a numerical value $f(x)$. The function is given by a black box, but is relatively "smooth", so should be ...
371 views

### Time constrained optimization?

I'm trying to solve a maximization problem that apparently is too complicated (it's a convex function) and NMaximize just runs endlessly. I'd like to have an approximate result, though. How can I ...
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, ...
390 views

### FindMinimum doesn't increase step size when necessary

(Cross-posted on Wolfram Community.) I've spent much time finding a minimal example demonstrating this problem with FindMinimum. Normally one faces this problem ...
512 views

### Minimum energy path of a potential energy surface

I have calculated the energies of a molecule by varying two parameters (Data points are here data). I want to find the minimum energy path from the point (180.0, 179.99, 21.132) to (124.5, 124.49, 0) ...
645 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 ...
909 views

### How to use a compiled function in numerical optimization

I'm trying to wrap my head around function Compile. So, this is a spin-off question from: a previous question on using compile[] correctly. I have a function that ...
493 views

### Bug in plotting function using FindMinimum?

Bug introduced in 10.0 and persisting through 11.0.1 or later While working on an answer to RegionPlot from NDSolve, I came across this strange behavior of ...
425 views

### How to stop optimization (e.g. NMinimize) after reaching target value

Suppose we have some function f[x,y] that we want to optimize in way that we are only interested in values (x,y) that guarantee ...
384 views

### Problems extending NelderMeadMinimize into 2D

Update The eventual route I followed was to adapt a version of the NM-simplex written in C and link to it with MathLink. Once I've tested this out fully I'll post it here. I've been playing around ...
277 views

### Solving optimal control problem when input is constrained

Given a linear time-invariant system: $$x'(t)=Ax(t)+Bu(t)$$ with initial state $x(0)=x0$ and final state $x(T)=xT$. The performance measure to be minimized is: $$∫_0^Tu(t)^2dt$$ The most important ...
555 views

### Is it possible to monitor the sum of squared errors in a NonlinearModelFit or FindFit procedure during the process?

Since fitting procedures using NonlinearModelFit (or FindFit) sometimes take very long, I would like to monitor the sum of ...
1k views

### Fitting Vogel's formula for phyllotaxis to the image of a flower

After having read this question I was inspired to investigate how we could take an image of a plant displaying phyllotaxis and fit Vogel's model of phyllotaxis to the image. The theory is very simple. ...
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 ...
761 views

### Not able to get a solution to a Lagrange Multiplier Equation

I assigned several constrained optimization problems to my calc IV students to solve with Mathematica, but this one is being stubborn. The function to optimize is: f(x,y,z) = y Exp[x-z] with the ...
291 views

### Using least independent rectangle area to separate every point

Description I want to add vertical line and horizonal lines between data to make every point have an independent rectangle area. In addtion, every independent rectangle has a number $1,2,3,4,5,\ldots$...
3k views

### Finding peaks of data

I want to find peaks in my data. My code in a reduced form so far: ...
249 views

### Parallel function evaluation for minimal value

I am asking myself, if the evaluation of a function f looking for a minimal value over a discrete set of values can be parallelize (brute scan for a potential ...
1k views

### FindMinimum works only if you know the answer

I am processing SNe Ia data and using FindMinimum to try and extract two values: t1 and a0. The FindMinimum value works only if I supply values that are close to the answer. If I provide no starting ...
356 views

### How to define and plot a maximum function?

Define a function $g$ as follows: ...
185 views

### Bound on number of function evalulations in FindMinimum

I am minimizing a nonlinear constrained problem using FindMinimum. The problem involves about 200 variables and the function is a black-box which cannot be compiled/...
354 views

### Experimental`NumericalFunction in NMinimize solution

I try to make a number of optimizations using this code: ...
576 views

### Is there any strategy to have a compiled version of FindFit or NonlinearModelFit?

Disclaimer: This is not a precise question with a definite answer. I know that neither FindFit nor NonlinearModelFit is in the ...