# Tagged Questions

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

90 views

### Speeding up constrained optimization problem solving

I have a problem on my homework with Lagrangian multipliers that Mathematica has now been bashing at fruitlessly for 10 minutes. I'm not sure whether I did something horribly wrong codewise, but it's ...
173 views

### NMinimize fails on Mesh?

Context I want to identify the minimum of a solution of a PDE found on a mesh. Problem I do not understand why NMinimize fails on a mesh? As a test case, ...
369 views

### Speeding up the non-negativity algorithm for multilinear function with interval probabilities?

The algorithm is a branch-and-bound algorithm that calculates the non-negativity of a multilinear function with interval probabilities. The lines 9-11 has an optimization that is explained on the ...
59 views

### Find multiple optimization parameters of Max-Min problem in numerically

I have an optimization problem $$\max \min [x_1,~\cdots,~x_m,~\cdots,~x_M]:~M\geq 2$$ where $$x_m=P_m(1-a_m)\prod_{j=1}^{m-1}\left(\frac{a_j}{1-a_j}+b_j\right)$$ and 0\leq a_i<1;~~0\leq ...
78 views

### Improving the speed of an optimization algorithm via compilation and parallellization

I have written an implementation of eight variants of the PSO-algorithm and I want to test them over a set of test functions. I am using parallelization as it improves the speed a lot and I have also, ...
776 views

### Obtain approximate Hessian using FindMinimum

According to the documentation, when FindMinimum is told to use the method "QuasiNewton" on a unconstrained problem, it uses the ...
329 views

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

Bug introduced in 9.0 and fixed in 10.0 FindMinimumCostFlow is introduced in 9.0. I updated my Mathematica recently to 9.0.1 cause the previous version was ...
139 views

### NMinimize Example from Wolfram Documentation Center

Here is the third example of NMinimize function from Wolfram Documentation Center at Possible Issues section. ...
45 views

### Problem with NMinimize [closed]

I wrote a code inspired by Rod's answer to this question. It is supposed to find the minimum variance portfolio of stocks and allows for arbitrary constraints on the weights of each stock: ...
59 views

### Lagrange multipliers implementation (beginner question) [closed]

I am trying to write a code to find the minimum of $f(x,y) = (Mx + Ny) \,/\sqrt{M^2 x + N^2 y}$?, subject to the constraint $g(x,y)=x+y-1$. Also, $x,y>0$, and $M$ and $N$ are positive constants. ...
35 views

### Setting value of number on certain decimal points [duplicate]

How do I fix number on certain decimal point? For example number 10304,390456 should be 10304,39. I tried NumberPoints, Nest, ...
117 views

### What methods does Maximize use like $\mathtt{Maximize}\left[\left\{3 x^2+2 \sqrt{2} x y,x^4+y^4=1\right\},\{x,y\}\right]$

I used Maximize for the maximum value of $3 x^2+2 \sqrt{2} x y$ when $x^4+y^4=1$ , $x>0,y>0$. What methods does Maximize ...
57 views

### Why the returned value is complex while my input is all real in Nminimize

This is the mathematica code I used. My goal is trying to solve eq2==0 && eq3==0 simultaneously in the region "-200 The FindRoot doesn't gives me quick answers. So I tried to use Nminimize ...
103 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 ...
56 views

### Find the maximum hyperrectangle contained in a set of points

I have a question similar to this one ( Find the largest rectangular block satisfying some condition without iterating explicitly). but in my case I have a multidimensional (up to 6 dimensions) binary ...
127 views

...
101 views

### Numerically solve recurrence equation

I have the following recurrence equation ...
91 views

### Untangling delayed definitions and substitutions [closed]

I am attempting to find the values of B1 and B0 that will minimize a metric. In the code below I define the metric and then attempt to calculate is by substituting in the current values of B1 and B0. ...
128 views

### Programming a MaxMin Linear Optimization

I want to program a function for a two-player game. Basically it's like this: . Each player has an array of options, and the result of the game is based on both players choices. So heres my most ...
220 views

### Non-linear curve fit problem

I am having a problem with making a fit to data in Mathematica, which may involve my understanding of the methods available. I am trying to fit the derivative of a Frota function (which is a Single ...
8k views

### Finding Local Minima / Maxima in Noisy Data

I'm trying to find local minima / maxima in noisy data, consisting of data values taken at certain time intervals. Ideally, the function should take a pair of lists (one containing time values and one ...
36 views

### How to determine whether NMinimize returns a solution or not?

I'm using NMinimize to find the minimum solution for a non-linear objective function. As I change the set of constraints, most of times ...
117 views

### Repeated interpolation for 3D unstructured grid -> Optimization

Trying to perform mesh-to-mesh 3D interpolation on unstructured grid. Mesh size is about 200k nodes. Painful thing that interpolation shoud be repeated ~1000 times (different thermal map) on the same ...
49 views

### NIntegrate within NMinimize - how to optimize the code?

How I can optimize these numerical calculations? Most annoying is encountering instabilities (numerical errors). I have a predefined function: ...
96 views

### Long Processing time [closed]

I have access to a cluster and I was wondering if NMinimize[] with the "Differential Evolution" method could be used to parallel ...
78 views

### Findminimum fails in loops

Introduction to the problem: the function F[x][u,v,w] I'm currently dealing with a very strange minimalization problem. I have a function F[x][u,v,w] which is ...
272 views

### NMinimize with NIntegrate (crash in symbolic evaluation, memory leak)

This is a "common" problem from what I've seen, but with a different spin. I have a function I use often that finds a fit of an expression to another expression with some free parameters (e.g. for ...
96 views

### Lagrange multipliers code runs forever

I am writing a code for a Lagrange multipliers problem with three variables. My code looks like this: ...
45 views

### Evaluation of likelihood very slow

I am trying to implement a simple statistical model for the first time in Mathematica. My model is made my one random variable which is the sum of background and signal. Background is an exponential ...
83 views

### FindMinimum with LevenbergMarquardt Method: syntax to set lower/higher bounds for parameters

I use the LevenbergMarquardt method of the FindMinimum function to minimize a residual function (mathematical-optimization). The 2013 post Is it possible to use the LevenbergMarquardt (LM) algorithm ...
81 views

### Using NMaximize to get integer results for a fractional programming problem

I have an optimization problem that I am trying to model in mathematica (wolfram cloud, to be precise). Link to notebook for code described here: ...
64 views

### Findminimum evaluates input for NIntegrate at non numerical value (NIntegrate::inumr:) [duplicate]

The goal is to minimise a functional in this case I want to find the input function, defined by its (many) values on a grid for which the functional attains its minimum. Below is a piece of code where ...
101 views

### Simple minimization not evaluating

I tried to solve a rather simple optimization problem, which Mathematica apparently cannot handle. A minimal example is the following: ...
450 views

### Minimal overlap area of circles

I have 20 points in the 2D plane with $(x_i,y_i)$ coordinates. I want to use Mathematica to optimally distribute 10 circles with equal radius of a given positive value $R$, i.e. to determine with the ...
79 views

### Using ouput of ParametericNDSolve as argument in NMinimize: NMinimize::nnum: function value not a number

I am trying to fit some experimental data and I am trying to use NMinimize function to calculate the parameters that fit the experimental dataset. I am also using ...
153 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 ...
154 views

### Maximizing a function defined using NIntegrate [duplicate]

I have two functions fn[x,y,z] which is in integral form and I have another function gn[x,y] which is also in integral form ...
116 views

### Linear interpolation over 2 variables [duplicate]

I'm tuning a function to data over 4-5 variables using Differential Evolution. The objective function calls frequently interpolation function. I came to a point, where compiling the objective function ...
125 views

### FindMaximum failing on a trivial problem [closed]

I am trying to solve a trivial optimization problem with FindMaximum but for some reason it is not going. I reduced the problem down to the following non-working ...
72 views

### Calculate Max-Min value and corresponding parameters

I have two functions funA and funB which are also functions a,b,x,and ...
387 views

### Finding resolution of an optical system using Rayleigh criterion

I want to use the Rayleigh criterion to find the resolution of an optical system. I have two functions f1 = Sinc[x]^2 and ...
54 views

### Numerical functions as constraints for NMaximize

I want to use NMaximize to solve a problem like this: $\quad \quad \max_y f(y) \text{ subject to } \max_x g(x, y) \leq c.$ Rather than reproduce my (messier) ...
326 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 ...
68 views

### In NMinimize, how can I efficiently handle NIntegrate errors for non-integrable functions?

I am using NMinimize to find parameters that minimise the integral of a function in the least squares sense: ...
1k views

### Which methods are available for NMinimize?

I can't find in the documentation the list of methods available to NMinimize[]. Is there a way to get this? The NMinimize page in Documentation Center mentions only ...
317 views

### Maximization in Mathematica using matrix and vector notation

I am trying to solve a simple maximization problem in Mathematica, using matrix and vector notation. ...
262 views

### Simulating an optimization problem

I have an optimization problem like below: $\text{minimize } - \sum_k w_k \log r_k$ $a \leq r_k \leq b_k, k = 1, \cdots, 10$ Here, $w$ and $b$ is a set of constant: $w = [w_1, \cdots, w_{10}]$ ...
67 views

### Solving a Nonlinear Optimization using Primal-Dual Interior point method [closed]

I want to solve an optimization problem using the Primal-Dual Interior Point Method. Although Mathematica gives the result directly when I use the command ...