# Tagged Questions

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

275 views

### How to find the maximum of this function on the positive real line?

I need to maximize this function on the positive real line: $$\frac{1}{\Gamma(x)^{14}}\cdot\frac{1}{{\frac{323.6}{14x}}^{14x}}\cdot(1.22578*10^{19})^{x-1}e^{-14x}$$ the correct answer should be ...
161 views

### Fitting to the system of equations with no analytical solution

I'm trying to fit linear combination of 2 functions to my experimental data set (it represents voltage of 2 photodiodes - Voc1 and Voc2 - connected in series under illumination - S) ...
80 views

### How to get function output with Manipulate

I have a program, which makes Gauss-Jordan transformations (not too pretty, I suppose). I want to get output with Manipulator like that: Two-Phase Simplex Method with only "step number" slider. One ...
205 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 ...
108 views

### None of the NMinimize methods leads to the answers of the equation

The following 10 equations has one set of exact answer using NSolve in Mathematica 9.0.0.0 (for positive c2, alpha1, alpha3, beta1, beta3, A1 and A3): ...
96 views

### Maxima turn out to be false maxima when extremising function locally

In short: I have a 2-D function that gives this plot, where the orange dots are maxima: There are 4 maxima in this plot. Now, I plot the function again in a smaller region, close to these maxima, ...
104 views

### Find function tracing the maximum of a 2D function

I'd like to solve the following problem: Given MI[o_, n_] := Log2[1 + 4 o (Sqrt@n + Sqrt[1 + n])^2] Find a function f[n_] ...
319 views

### Numerical Instability?

Current Status Please skip ahead to Update 2: the key questions are now: 1/ Why does Mma generally fail to find the minimum for a well behaved function when the function does not have infinite ...
72 views

### a question about Nminimize [closed]

I have 10 equations and 10 unknown parameters such as alpha1,alpha2,a1,a3,... which I want to find them by minimizing ...
334 views

### Graphically solving a linear programming problem

I try to realize the graphical linear programming method. Here is my code ...
48 views

### Incorporating sophisticated constraints on the approximating function into NMinimize

Following the approach as given in the answer of Belisarius here I just wonder how one could incorporate some more sophisticated requirements on the approximating function. Suppose the approximating ...
194 views

### FindFit and NMinimize to fit a parametric model (minimize the distance of two curves)

I am trying to find a fit to the cumulative distribution of a set of points using FindFit or NMinimize. In particular, I would like to find the parameters of the cdf of the Beta Distribution that ...
57 views

### NMinimize error

I want to use NMinimize in the following way: ...
134 views

### Maximum of the minimum of two functions

I have two functions, each with 15 variables. How can I find maximum (minimum) of these functions? I know that minimum (maximum) of two functions is a multi-criteria function but I cannot find it. ...
60 views

### Problem with inequality constraint

I'm using NMinimize to solve the following objective function. ...
47 views

### Minimize function with logical arguments

How can I minimize or maximize a function (even numerically) with logical arguments, taking only 0s and 1s, also with constraints? E.g. ...
93 views

### ArgMax, FindArgMax, and NArgMax disagreeing on answer

In working on an estimation problem, I created three Gaussian-like functions. The ML estimate could be seen as the argmax of the product of the three functions. In trying to get the code to run faster,...
52 views

### FindMinimum not accurate [closed]

Consider the function f[B_, d_] := -158.57189 + 982.533102 B^2 - 5.6768579 d + 895.1968 d^2 + B (-18.7772 + 655.02206 d); ...
104 views

### FindMinimum with compiled function [duplicate]

I don't know how to fix this problem: ...
168 views

### How to make Maximize function successfully maximize in general?

Having looked at Maximize Documentation SO: Mathematica: Commands return no output, but itself. Bug? Problem with Maximize Why won't Mathematica Solve a set of two equations for one variable? ...
108 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 ...
62 views

### Trying to maximize an expression with integer and real variables

I am trying to solve this equation The link has a screen capture of the equation and the solution. I am looking for the values of a1 and a2 in particular, but they need to be real numbers. s1 and s2 ...
101 views

### Optimization not evaluating, further specifications?

I am trying to find the global minimum of this simple function for real x and y f = x^2*(1 + Sin[y]); Of course, I know it is 0. But Mathematica seems not be able to handle this expression since ...
76 views

### Trying to minimize a function over the integers [duplicate]

I am trying to evaluate the following expression. ...
94 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 ...
183 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, ...
370 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 10-...
65 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 b_i<1;...
93 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, ...
796 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 ...
331 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 ...
150 views

### NMinimize Example from Wolfram Documentation Center

Here is the third example of NMinimize function from Wolfram Documentation Center at Possible Issues section. ...
46 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: ...
64 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. ...
36 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, ...
122 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 ...
63 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 ...
105 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 ...
66 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 ...
136 views

...
118 views

### Numerically solve recurrence equation

I have the following recurrence equation ...
92 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. ...
130 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 ...
240 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 ...
39 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 ...
132 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 ...
53 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: ...