# Tagged Questions

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

400 views

### Minimizing the largest difference between two functions

I have two functions defined on the same domain, $f(x)$ and $g(x)$ where $x$ is in $(0,1)$: f[x_] := (-1 + x) Log[1 - x] - x Log[x] g[x_] := Log[1 + 2 (-1 + x) x] ...
389 views

### Problems finding intersection points between line and generic function

I'm trying to find Intersection points between a line, which is given by 2 points, and a generic function (I want it to be able to handle polynomial functions, circles/ovals, lines and all ...
77 views

### Vector optimization with vector length as a free variable

I'm trying to solve the following problem: For a vector $v$ of length $c$, $\min \frac{\sum v[i]^4}{(\sum v[i]^2)^2}$ subject to $\sum v[i] = N$. I can solve this numerically for a given $c$ using ...
479 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. ...
77 views

### Parallelize: No speed-up when using with FindMaximum [on hold]

I have developed a program to compute the maximum value of an specific function multiple times, with different parameter values each time. I've been using the ...
105 views

### Precision of starting values in FindMinimum [closed]

I am currently working on an optimization of chemical kinetic model. Starting points for FindMinimum are defined as: ...
290 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 ...
129 views

### Only one root at specific interval

I need a help to find k here: $f(x)=-k^x + x^2$ It is not too simple. I have interest to find the single value of "k" where, inside interval {x,2,3}, the function have only one value to x when f(x) ...
42 views

### Specific formatting while exporting some data output into a file

I used the following code ...
104 views

### Optimizing matrix inequalities over trace

I need to solve the following problem. Given $n \times n$ Hermitian matrices $A\geq 0$ and $B_1, ~ B_2$ (need not be positive semidefinite), with $Tr(AB_1)<0~,Tr(AB_2)<0$ construct a ...
111 views

### Mathematica global optimization add ons

Can somebody tell me the major differences between Global Optimization add on, MathOptimizer Professional, and NMinimize which does global optimization in ...
227 views

### How to find Multiple Maxima/Minima [duplicate]

I am trying to solve a problem that requires finding multiple maxima of a numerical function. So the function generates some numbers that are coming out of an experiment. I tried using NMaximize or ...
70 views

...
104 views

### Optimizing complex functions

I am trying to optimize a function containing complex numbers, however I keep running into errors. Consider the simple optimization problem: ...
225 views

### Incorporate error bars to best-fit curve [closed]

I have managed to get mathematica to perform a best fit curve. However, I wish to add error bar to the curve, how do I do so?
162 views

### How to implement the dual Lagrange?

I have seen in the Pang book of data mining the following example: ...
73 views

Trying to maximize a two-variable expression and to get variables' values at maximum points: ...
191 views

### How do I disorder a list in Mathematica?

Given a list like this (the original list is much longer), how I can get a completely unordered list and save it in plain text? I change the file names (names at random), using a length of 5 digits, ...
49 views

### Where can I find detailed information about the SystemOptions?

I'm looking to optimize my Mathematica script, and I'm willing to go spelunking with low-level system options. The problem is that I've been looking in the Mathematica documentation, but there ...
159 views

### FindMinimum's WorkingPrecision behaviour

I discovered the following behaviour when using FindMinimum for constrained optimization: ...
261 views

### Slow-down encountered when using NMinimize with a compiled function

I'm minimizing a large function. Evaluating the function is very slow symbolically but using Compile I can get ~100x speed-up on this step. However, despite this, the NMinimize process is only ...
103 views

### Fit a complicated function to a constant with NonlinearModelFit

I wish to fit a complicated parametric function (logder, with lambda parameters) to a constant (L) in order to minimize its dependence with the variable k in a given interval. To do that, I use a ...
77 views

### Getting result from Maximize

I'm trying to get maximization result from Maximize function to use it in later calculations. At the moment I use the following code: ...
398 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 ...
71 views

### Variables input generation for Minimization in High dimensional space [duplicate]

I'm currently doing optimization in a high dimensional space. I was thinking of giving FindMinimum (or NMinimize not certain ...
38 views

### How to evaluate NMinimize inside a function

I want to define a function that returns a sum of differences of some points to a given function. To obtain these differences I would like to use NMinimize, but if I implement that straightforwardly, ...
203 views

### Problem with FindMinimum

I am struggling with a problem on fitting a function to my data using FindMinimum. The problem is related to small angle x-ray scattering and my approach is the following: I define the electron ...
129 views

### Problem with the laplace transform [closed]

I am trying to write a program in mathematica to solve green's functions, like the following. They come up all the time in Quantum Field Theory. I have learned, student's can sometimes see it better ...
25 views

### Iterating a model with 2nd order difference equations using Manipulate [duplicate]

I have a model including first and second order difference equations. It works for the case of first difference equation, which is below: ...
153 views

### Simple-looking Minimize takes for ever

Consider the following: Minimize[{(ξ - x)^2 + (η - y)^2, a ξ + b η == c}, {ξ, η}, Reals] After asking Mathematica to do this yesterday afternoon and forgetting ...
122 views

### optimization of CountourPlot with NIntegrate

I have to use ContourPlot with a complicated function depending on 2 parametrs (that I cannot report here) that contains numerical integrations. Here is a simple ...
141 views

### Using FindMinimum with matrix input

I define the following function which spits out a number S when I feed it a dxd square matrix: ...
187 views

### How to plot feasible objective space of a Generic Multiobjective Optimization problem?

As you know, a generic Multiobjective optimization problem can be stated as follows: $min{\space}F(\bf{X})=[f_1(x),...,f_n(x)]$ $h_k(x)=0{\space\space\space} k=1,...,n_e$ ...
144 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.: ...
265 views

### Packages for Semidefinite programming

This question has already been asked here. I am not sure, whether I should have asked this question as a comment of an old question or in the general programming forum of stackexchange. Moderators ...
96 views

### Black Ovals appeared in my Mathematica notebook [duplicate]

I copied and pasted something from another Mathematic notebook and started getting the same black ovals seen in this question: Colored marks appearing in notebook input text? The suggestion to turn ...
102 views

### Does FindFit use symbolic differentiation?

Does FindFit use symbolic differentiation when optimizing by least squares a non-linear function?
237 views

### How to determine reason for kernel crash? -> Nelder Mead optimisation

I am making use of the Nelder Mead algorithm inside Mathematica's NMaximize to find a parameter set by solving the Schrodinger equation for a given system. (see ...
131 views

### Maximizing the number of zero entries in a matrix

I have a matrix with a bunch of parameters in its entries, they all come in different combinations in different places of the matrix. I can post the matrix itself if requested, but I think what I mean ...
118 views

### Maximum likelihood estimation based on frequency table

I have a frequency table of grades, I'm trying to estimate the distribution as a truncated normal distribution (a grade below 65 is a failing grade and doesn't count). Since I don't have the actual ...
176 views

### Nash equilibrium in game theory?

Are there examples of the solution of Nash non-cooperative games with mixed or pure strategies? How could be implemented in Mathematica 10?
78 views

### My code of plotting a two-variable function is too slow [closed]

I have a code in which my complicated function to be plotted is F(x,p). I would like to graph it for 5 values of p equal to 10^7, 10^8, 10^9, 10^10 and 10^11 for x values between 0.01 and 0.99. All ...
178 views

### How to properly apply NumericQ or s.th. similar here? - NDSolve inside NMaximize

I wrote a function that numerically solves a given Schrodinger equation and returns replacement rules to obtain the time evolution operator. It looks and is used as follows: ...
423 views

### Maximize[Cos[x - 1], x] is not evaluated

No explanation needed: Maximize[Cos[x + 1], x] Maximize[Cos[x - 1], x] producing ...
283 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 ...
216 views

### How to find Lagrange multipliers corresponding to constraints?

I have a constrained optimisation problem that I solved using Mathematica's FindMinimum function. I would like to know how to get the dual variables corresponding to the constraints I have. Obviously ...
155 views

### Set first line in CSV as header in mathematica list

New to stackexchange. Need some help with mathematica - also new to this!. I have a CSV file with 80 something columns and 6000 something rows = 500,000ish elements in total. I am trying to import ...
87 views

### NMaximize against LinearProgramming [closed]

i'm starting my studies of Operational Research with Mathematica and i'm stuck on a problem with 12 variables. In fact, I was able to solve the problem using ...