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

learn more… | top users | synonyms (4)

2
votes
2answers
174 views

Maximizing over an integral with a single parameter

There is probably a neat approach to solve this problem...but can't get to it at the moment. How do you maximize an integral with respect to a single parameter? My code below produces error messages. ...
1
vote
1answer
73 views

Improving strategy to solve this constrained root-finding problem

I am looking for roots of the function eqs defined below. It has $2k$ unknowns and returns a vector of $2k-1$ components. The sole purpose of the following block ...
1
vote
0answers
47 views
1
vote
0answers
62 views

Exponential Matrix Diffentiation

I have been struggling with the following question while solving an optimization problem in $\mathbb{R}_{+}^G$. Basically, I have $$\min_{y \in \mathbb{R}_{+}^G} F(y) = y^{T}\mathcal{K} + \exp(-y^{T} \...
0
votes
1answer
58 views

Minimization with respect to functional constraints [closed]

I am trying to do the following on Mathematica: Given a pair $(x,y)$, minimize an objective function $f(x,z)$ such that z satisfies $g(x,z) \leq g(x,y)$. I have defined both functions ...
1
vote
1answer
62 views

Count and NMinimize don't seem to work together

Initially I write down a 2x2 unitary (Uni) , make a tensor product 4 times (LocalUni) and apply it to an initial numerical matrix Rho, to obtain RhoLU, that depends on 12 parameters. This is my code: ...
0
votes
1answer
76 views

Minimization of linear combination of vectors

Suppose I have a vectors in $\mathbb{R}^{6}$. For example, take the vector $v = k(-2,2,4,6,2,2)$. I would like to find some $k$ with the constraint that the last two components are necessarily non-...
4
votes
1answer
79 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 ...
8
votes
3answers
311 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 ...
2
votes
2answers
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): ...
1
vote
2answers
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, ...
1
vote
1answer
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_] ...
2
votes
1answer
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) ...
0
votes
1answer
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 ...
0
votes
0answers
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 ...
6
votes
2answers
331 views

Graphically solving a linear programming problem

I try to realize the graphical linear programming method. Here is my code ...
1
vote
1answer
56 views

NMinimize error

I want to use NMinimize in the following way: ...
4
votes
2answers
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 ...
2
votes
1answer
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. ...
0
votes
1answer
60 views

Problem with inequality constraint

I'm using NMinimize to solve the following objective function. ...
0
votes
0answers
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. ...
3
votes
1answer
92 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,...
2
votes
0answers
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); ...
4
votes
1answer
104 views

`FindMinimum` with compiled function [duplicate]

I don't know how to fix this problem: ...
2
votes
3answers
170 views

Use NMinimize instead of FindFit for constrained search (of coefficients)

(My problem is more complex, but let us formulate it through this example) I am trying to find the best polynomial approximation to the following function ...
3
votes
1answer
167 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? ...
1
vote
1answer
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 ...
1
vote
0answers
76 views

Trying to minimize a function over the integers [duplicate]

I am trying to evaluate the following expression. ...
5
votes
2answers
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 ...
3
votes
1answer
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 ...
3
votes
2answers
100 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 ...
1
vote
0answers
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;...
4
votes
0answers
92 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, ...
1
vote
0answers
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: ...
0
votes
1answer
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, ...
1
vote
1answer
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 ...
0
votes
1answer
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 ...
0
votes
0answers
65 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 ...
3
votes
1answer
116 views

Numerically solve recurrence equation

I have the following recurrence equation ...
0
votes
0answers
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 ...
3
votes
1answer
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 ...
2
votes
1answer
239 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 ...
0
votes
0answers
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: ...
-3
votes
1answer
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. ...
2
votes
0answers
84 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 ...
3
votes
1answer
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 ...
0
votes
2answers
103 views

Lagrange multipliers code runs forever

I am writing a code for a Lagrange multipliers problem with three variables. My code looks like this: ...
0
votes
1answer
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. ...
2
votes
1answer
97 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 ...
1
vote
0answers
52 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 ...