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
108 views

Reordering numerically calculated eigenvalues assuming smooth dependence on a parameter

As was discussed in a different question here on SE (link) if you compute eigenvalues numerically of a matrix which depends on a parameter y, the resulting plot of ...
4
votes
1answer
81 views

What is the status of the FindMinimum method “QuadraticProgramming”?

As a method option to FindMinimum "QuadraticProgramming" is still a valid option. It has the advantage of being significantly ...
0
votes
0answers
51 views

Constrained optimization and problem with complex numbers

I am trying to solve a constrained optimization problem with an implicitly defined function $\pi$. The problem is non linear and of high order, so I use numerical methods instead. The code I use is: ...
1
vote
0answers
28 views

Using ForAll in Maximize to define a bunch of conditions

I'm trying to do something very straight forward. The following maximization works: ...
1
vote
1answer
50 views

NMinimize error: Nearest::neard:

I have this function GuessError, here's a plot assuming a single variable x, Plot[GuessError[10^x, etc..], {x, 8, 12}] , being etc some more variables which are ...
-2
votes
1answer
94 views
2
votes
1answer
72 views

NMinimize works only if expression is pasted directly

Niminize works fine if I copy the minimized function directly by hands, but doesn't work if I try to do something like this: ...
2
votes
1answer
103 views

How can I change a lot of parameters to Real? [closed]

Because of some formulas with Conjugate in a notebook, I have to tell mathematica to change a lot of parameters to Real! I know that I can use Refine with Element or Assumptions: ...
2
votes
1answer
49 views

Application of Maximize: The cuboid constrained to the ellipsoid in $\mathbb{R}^3$

Since I am a student of Mathematics I enjoy to apply MMA to problems that I have a solid understanding in. The following would be such a problem: Maximize $f: \mathbb{R}^3 \to \mathbb{R}$ given by ...
1
vote
1answer
138 views

Why does it matter at what point I replace?

I need to find four orthogonal linear combinations of complicated functions, that vanish at four different points. I use (LK4 is defined below, but its shape should have nothing to do with my ...
3
votes
1answer
107 views

How to stop optimization (e.g. NMinimize) after reaching target value

Suppose we have some function f[x,y] that we want to optimize in way that we are only interested in values (x,y) that guarantee ...
0
votes
0answers
23 views

Timing of an Evaluation is not correctly displayed

From: http://reference.wolfram.com/language/howto/DisplayTheTimingOfAnEvaluationInANotebookWindow.html I ran a process that took about two minutes to finish. But the time recorded is only 0.18 ...
5
votes
0answers
98 views

Custom Methods for NMinimize/NonLinearModelFit

Is there a way to write custom methods for NonLinearModelFit or NMinimize? To give background, I currently have a batch of code ...
3
votes
1answer
75 views

Why minimization does not work with symbolic array as arguments

If I try to minimize with constraints a function of several variables, with Gamma regularized function involved in the constraints it seems to works, as shown below (this is just a dummy example ...
1
vote
0answers
57 views

Maximize and NMaximize don't work for my function

I defined the following function: d1[x_] := Min[Abs[FractionalPart[x]], 1 - Abs[FractionalPart[x]]] and tried to evaluate the following function: ...
1
vote
2answers
105 views

Minimize the sum-of-squares errors for a system of ODEs

I'm trying to minimizing the sum of squared errors on a 2-equation system of ODEs and empirical data. I keep getting an error and I think the root of the problem is my invocation of ...
0
votes
1answer
56 views

Plotting Minimize output for a range of constraint values

I want to plot the minimum of a function returned by Minimize over a range of constraint values. ...
1
vote
1answer
54 views

FindMinimum function does not produce minimum from near point

Using my simple program and I would like to find such matrix elements that minimize difference of their eigenvalues. ...
4
votes
1answer
68 views

Why does EvaluationMonitor in FindMaximum only work for some regions?

This has come about after trying to understand what was going on with this question about FindMaximum and regions. My first thought in that scenario was to set-up ...
5
votes
1answer
122 views

Easy FindMaximum returns a wrong answer

FindMaximum in region is a new function in mma10,but when I tried the following example: ...
4
votes
3answers
181 views

How to fit parameters in a system of coupled differential equations

Problem description: I'm studying a chemical reaction that can be modeled by a system of coupled differential equations, and I want to use measured data to determine the parameters that appear in the ...
1
vote
1answer
119 views

Fibonacci Line Search Method

I am attempting to write a code to find to bracket the minimum of a function using the Fibonacci Line Search Method, I believe my code is well written but I am not ...
0
votes
0answers
25 views

Trouble with Minimize function

I'm trying to do my own curve fitting, by specifying a model, an error function, and minimizing it for some data. I realize I could just use FindFit, but I would like to do it this way just for fun. ...
-1
votes
1answer
121 views

Implementing the Golden Section Rule

I am attempting to write a code which brackets the minimum of a unimodal function, using the Golden Section Method Below. I am have serious issues debugging my program though, any help will be ...
0
votes
0answers
46 views
0
votes
0answers
50 views

Solving Lagrangian (4 vars to solve for)

I'm a bit new to Mathematica, but here's what I've got: ...
4
votes
1answer
237 views

How to draw a tropical surface?

By definition, a tropical surface in $\mathbb R^3$ is the set of points $(x,y,z)$ where the maximum $f=\max(f_1,f_2,\dots,f_n)$ is attained at least twice, here $f_i$ stand for some linear functions ...
1
vote
1answer
83 views

Complicated equation solving

I want to find the maximum point or optimal value $y$ of Rx1[y_, a_, b_]. ...
6
votes
2answers
70 views

Maximise output issue

When I execute the following command, I get a numerical output as follows: ...
0
votes
1answer
39 views

Minimizing a function which involves Maximize [duplicate]

I have a mathematical function: $f = \frac{c^3}{2 a (k T)^3} \sqrt{\frac{\pi u v w}{2 b}} \exp \left[ - \frac{c}{k T} \sqrt{\frac{x^2+y^2}{a}+\frac{z^2}{b}} + \frac{1}{2} \left( \frac{x^2}{u} + ...
0
votes
1answer
67 views

Minimization Nminimize nnum error

I have imported data (mat is the name, 1x100 dimensional vector)and written a likelihood function for normal distribution. ...
1
vote
0answers
113 views

How can I speed up this NM optimization? Most delay seems to be due to long analytic expression

I am struggling with computational speed of a NelderMead optimization. Nevertheless my impression is that I lose lots of speed not only due to the NM optimization itself but rather to for instance ...
-1
votes
1answer
76 views

Looping within linear programming

I am trying to do some network programming around optimization. Here is a reduced sample: ...
0
votes
0answers
49 views

imaginary part in optimization problems

I have some trouble with an optimization problem. The constraints are always real, but in the first place there are also complex parts in the expression (which all sum up to 0). The problem now is ...
1
vote
0answers
98 views

Imposing constraints to NMinimize/NMaximize leads to wrong function values

I wrote a function that uses NMaximize to find certain parameters (using NelderMead simplex algorithm). My objective functional $J({x_i})$ is real-valued and its ...
0
votes
0answers
34 views

Passing complicated functions to NMinimize [duplicate]

I am using NMinimize to do a minimization of sum of squares. I have a module based on the following code ...
0
votes
0answers
85 views

Minimizing/maximizing function and selected parameters simultaneously

I have a function over several variables which I would like to minimize while maximizing (or minimizing) at least one other variable subordinate to the global function minimum. As a trivial ...
0
votes
0answers
41 views

How to add a positive definiteness of a unsymmetric matrix as a constraint to a Findminimum problem

The problem is I have a function which has 33 variables, and which to minimize it in a given set of contraints. I have also a matrix consisting of these 33 variables. The condition is that this matrix ...
0
votes
0answers
9 views

Add positive definite matrix constraint to an optimization problem [duplicate]

The problem is I have a function which has 33 variables, and which to minimize it in a given set of contraints. I have also a matrix consisting of these 33 variables. The condition is that this matrix ...
1
vote
2answers
182 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] ...
1
vote
2answers
203 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 ...
0
votes
2answers
64 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 ...
5
votes
1answer
287 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. ...
0
votes
0answers
33 views

FindMaximum slow for fixed parameters

I hope my problem can be solved by just showing you this tiny part of my code which does not run on its own. I have an optimization problem and want these functions to work on various data sets. ...
0
votes
0answers
43 views

Parallelize: No speed-up when using with FindMaximum

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 ...
1
vote
1answer
60 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: ...
9
votes
2answers
223 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 ...
2
votes
2answers
104 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) ...
1
vote
1answer
79 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 ...