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

learn more… | top users | synonyms (4)

10
votes
3answers
459 views

Maximize violating constraints

I have Maximize[{(h*10)/(300*(100 - (l^.5 + d^.4 + H^.6))), (l + d + H + h) == 669, l > 0, d > 0, H > 0, h > 0}, {h, l, d, H}] I believe ...
0
votes
3answers
279 views

Why does Maximize return a wrong answer?

I want to find the maximum of the following function, but get a wrong result. What am I doing wrong? ...
0
votes
0answers
47 views

Minimization with constraint define over a region

I would like to perform a 2D electrostatic minimization between two charged ellipsoids, provided that they should not penetrate each other; they can touch but they are hard ellipsoids. Here is what I ...
2
votes
1answer
51 views

Principal Axis Maximization

I know that, in order to use PrincipalAxis, for example in FindMaximum function: ...
2
votes
1answer
48 views

Trouble with some optimization

I am attempting to use Mathematica to solve an optimization problem related to mechanism design (4-bar). The optimization problem is basically the following: 1) Solve these two simultaneous loop ...
1
vote
1answer
75 views

Maximisation problem not working

I am trying to solve the following optimisation problem, but Mathematica is not providing me with a solution: $$\max_{x_{1},x_{2},e_{1},e_{2}}\theta_{1}\ln(x_{1})-e_{1} + \theta_{2}\ln(x_{2})-e_{2} ...
0
votes
1answer
119 views

Solving linear system with constraints

I need to come up with a solution for a rather, odd situation. Let's say I have an $M \times N$ matrix called ${\bf A}$, and I would like to solve it for ${\bf x}$ where $b_1 \le {\bf A} {\bf x} \le ...
1
vote
0answers
57 views

NMinimize / adding constraints

I have a quick question: in question:Solving an ODE with boundary conditions at infinity and 0//different problems, I asked for help concerning a differential equation- however, the whole solving ...
2
votes
1answer
51 views

Does 'True' stand for 'Else' in Maximise function output?

Maximize[a x^2 + b x + c, x] gives this solution: Does the word 'True' stand for 'Else' here?
2
votes
2answers
139 views

Can't find maximum of a function on a region

for h=0.2 I'm trying to find the maximum value of (-h^2/3)*(-1/x^2) subject to ...
24
votes
1answer
665 views

How to work with Experimental`NumericalFunction?

This question is intimately connected with previous one: "How to create internally optimized expression for computing with high WorkingPrecision?" Oleksandr R. correctly states in the comment: A ...
2
votes
1answer
212 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 ...
0
votes
0answers
65 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: ...
1
vote
2answers
125 views

How to visualise (graphically) this optimization problem in Mathematica?

I have an optimization problem in the form max $(a-\bar{a})(b-\bar{b})$ subject to $a+b=1$ Here $\bar{a}$ and $\bar{b}$ are known values and both of them are >0. The solution is given by ...
9
votes
1answer
747 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, ...
1
vote
1answer
65 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 ...
1
vote
1answer
72 views

Paramter Scans and $\chi^2$ Test in Mathematica

Is there any in-built function or a recommended package that enables one to find, say, 10 Parameters, which are used as boundary conditions in NDSolve, that minimize $\chi^2$? ...
6
votes
1answer
95 views

Simulated Annealing, SearchPoints and InitialPoints options set at the same time

I have a function that needs to be minimized. Since the function depends on real-time data (which is fetched every few hours, and the function is redefined according to the new data), I have to run ...
5
votes
2answers
312 views
7
votes
2answers
411 views

Need help with the Lagrange multiplier method

Well I am new to Mathematica and got really stuck solving this problem. In class, I was ask to use the Lagrange multiplier method to find the maximum and minimum value of $f(x,y) = x^2+y^2$ which ...
0
votes
0answers
97 views

Solving Lagrangian (4 vars to solve for)

I'm a bit new to Mathematica, but here's what I've got: ...
1
vote
1answer
58 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. ...
0
votes
0answers
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: ...
0
votes
1answer
687 views

FindMinimum produces error message

I'm trying to solve a logistic regression problem using Mathematica -- more to improve my Mathematica skills than to solve the problem as I have already solved it using Octave. The problem I am ...
1
vote
1answer
114 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 ...
1
vote
1answer
77 views

How to find a maximum value in a rotated parametric plot?

Let me just give you a bunch of tables to reproduce the problem. Here they are ...
7
votes
1answer
211 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 ...
1
vote
1answer
108 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 ...
2
votes
1answer
45 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 ...
1
vote
0answers
77 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 ...
1
vote
1answer
62 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? ...
2
votes
1answer
123 views

How to transform the output of Minimize/Maximize into a function

I want to create a function directly from the output of Maximize. Specifically, I have the following function $f(l,h,d,a)$ that I want to maximize with respect to ...
4
votes
1answer
170 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 ...
3
votes
0answers
91 views
6
votes
0answers
87 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 ...
24
votes
3answers
827 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 ...
1
vote
1answer
82 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 ...
0
votes
1answer
56 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 ...
4
votes
0answers
103 views

How is the multi-class support vector machine classifier implemented? [closed]

I am using support vector machine (SVM) method with Classify to do multi-class. Can anyone tell me the reference (paper) used by Wolfram Mathematica to develop the ...
2
votes
1answer
200 views

Maximized value of a function as an additional constraint on a variable

I want to maximize a function $f(b, h)$ with respect to its arguments and subject to some additional constraints. If these constraints are satisfied, $f$ is increasing in $h$. I then want to find an ...
4
votes
2answers
162 views

Find condition under which variables fall away

I have a somewhat lengthy expression, looking like expr = 1 + x + b + Pi + 2*a Is there some way of generating a relationship between ...
1
vote
1answer
65 views

Running this expression in Minimize function

So I got this expression here (written in pure text): ...
2
votes
1answer
56 views

How can I minimize a function with respect to the number of its variables?

Given some $d \in \Bbb{Z}_{>0}$, $t \in [0,1]$, and $0 < a < b < 1$, fix $I = [a,b]$. I'm trying to compute $$ \min_n \min_{E_n(t)} f_d(\mathbf{x}) $$ where $n \in \Bbb{Z}_{>0}$, $$ ...
1
vote
2answers
129 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 ...
13
votes
9answers
2k views

Finding maximum or minimum of implicit functions

is there any built in function that can be used to find maximum or minimum of implicit functions? For example, if we have the equation $$x^2 + y^2 = (2 x^2 + 2 y^2 - x)^2,$$ then we can visualize the ...
0
votes
0answers
110 views

Problems with NMinimize

I have written some functions that take a matrix and find its minimum inner product with a specific set of vectors ...
3
votes
0answers
70 views

Is there an analogue of Evaluated->False (in FindRoot) for FindMinimum?

I guess functions like FindRoot, FindMinimum, etc puts the estimation number into the expression, and then do other ...