# Tagged Questions

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

778 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, ...
68 views

### Kernel crashes during LinearProgramming. Can you reproduce it?

Using the code from this answer for a sufficiently large problem setting crashes my kernel. I'll copy/paste the code here: ...
28 views

...
63 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. ...
23 views

### Casting an optimization problem into least-squares form for Levenberg-Marquardt [duplicate]

I would like to use the function FindMinimum[] with the Method LevenbergMarquardt to this function: ...
215 views

### Error with FindMinimum. The Message is FindMinimum::cnpcons

I want to run a rather demanding check of feasibility. I have 3565 non-negativity constraints for my variables, and one that makes them sum to a certain budget they shall not surpass. I also have ...
226 views

### Using the Levenberg - Marquardt algorithm to minimize a user-defined function

I wrote a function in Matlab that optimizes another user defined function using lsqnonlin with 'levenberg-marquardt' option. Now, I'd like to use the first to ...
117 views

### Invalid computation of maxima

I am finding the following minimum FindMinimum[{ Abs[ ArgMax[f[q, n, b, b0, b1, t, s], b] - b1 ] }, {b1, -0.5}] given ...
214 views

### Risk-return trade-off — solving a convex optimzation

I try to convert a convex optimisation (cvxopt) example to the Wolfram Language from python. Source of the python code: Risk-return trade-off Please advise me on how to convert the following python ...
46 views

### How to couple NIntegrate with FindMinValue

I have a problem with a correct transfer of values of parameters when NIntegrate (and some subsequent functions) are coupled with minimizing procedures in ...
118 views

### How to Minimize an NIntegral

My problem is to minimize in Mathematica a numerical integral. The command FindMinimum[With[{R=2.5},NIntegrate[(R*r1*a)*Sin[r1*a],{r1,1,R}]],a] does calculate ...
80 views

### Possible memory leak in FindMinimum? (MMA v10.0)

So I was running some code when I noticed Mathematica was gulping memory, and after some debugging I think the culprit is found. It turned out the function ...
73 views

### How do I write a function inside a ArgMin

I want to solve this ArgMin[NIntegrate[(Tanh[x] - Erf[x/a])^2, {x, -5, 5}], a] and it does not work, what is the correct way to do this? ...
66 views

### Finding a vector many times

I have a vector matrix of profits say prof= {{1, 1, 1, 1, 1}, {2, 2, 2, 2, 2}, {3, 3, 3, 3, 3}, {4, 4, 4, 4, 4}, {5, 5, 5, 5, 5}}; I have a "terminal value ...
100 views

### Customized StepSize control in unconstrained gradient-descent optimization

I have a type of minimization problem I frequently solve that involves warping a large 2D triangle-mesh (~25,000 vertices) to fit a model. In the mesh, vertices carry the empirical measurements (each ...
100 views

### Classification problem using SVM methods

I am running SVM on mathematica and I a used this code with classes: ...
172 views

### Goal optimization: finding the best combination of capacitors and resistors resulting in given properties

I want to edit @MarcoB answers (because the code he gave doesn't answer the question appropriately)->(the function that need to be optimised is not implemented as asked) But it seems like I am having ...
110 views

### Optimizing best fit circle to given data set [duplicate]

Given a set of data, I have plotted a slowness curve for a p-wave resulting from the given data. A slowness curve is just the reciprocal of the velocity of the p-wave. What I need to do is find a ...
57 views

### Basic question about loops in mathematica

I am very new to Mathematica programming and am trying to find the optimum of a numerical integral for various values of a parameter. Here is the basic code for one parameter value that runs fine - I ...
837 views

### Exponential fitting - isn't actually a BUG there?

There are many questions on this site about wrong exponential fitting in Mathematica but no one considers this well-known problem as a potential bug. Usually people suggest well-known workarounds ...
128 views

78 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 ...
286 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 ...
92 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): ...