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

learn more… | top users | synonyms (4)

3
votes
1answer
149 views

Finding peaks of data

I want to find peaks in my data. My code in a reduced form so far: ...
0
votes
0answers
25 views

Generating vectors with restrictions on a lattice

Suppose we are given a certain adjacency matrix that contains the information for a given lattice. I want to generate a configuration of vectors that satisfy a restriction. Specifically, if I have ...
14
votes
3answers
2k views

How can I implement the method of Lagrange multipliers to find constrained extrema?

I want to form the function $h=f-\lambda_{1}g_{1}-\lambda_{2}g_{2}$ where $f$ is the function to optimize subject to the constraints $g_{1}=0$ and $g_{2}=0$ so that I can solve the first partial ...
8
votes
2answers
515 views

Is there any fast way to solve a quadratic matrix equation in Mathematica approximately?

Let the square nonsingular matrix $M$ is a given convergent matrix. What are the best scalar values for $\alpha$ and $\beta$ (in the real numbers domain), at which the following quadratic matrix ...
0
votes
0answers
24 views

Constraints for LP [on hold]

Im fairly new to mathematica and I'm writing a minimization problem with constraints: ...
16
votes
0answers
211 views

Can code optimize code?

Are there functions, programs or packages that deal with optimizing mathematica code i.e. re-writing ineffecive or convoluted code. -This question has haunted me since I joined SE. The background for ...
1
vote
3answers
84 views

Minimize method is not giving minimum. Why?

I was doing an optimization but facing a problem getting what exactly Minimize function do. I run the following code: ...
14
votes
2answers
430 views

Determining the default Method used in optimization and root-finding algorithms

Is it possible to extract the Method which is used in functions like NMinimize, FindRoot, ...
-8
votes
0answers
38 views

i need generalized code for genetic algorithm(an optimization technique)? [on hold]

I'm working on GA coding to optimize the locators position in fixturing system to minimize the error in precision manufacturing.I need generalize code for GA (including random population ...
1
vote
1answer
86 views

Equation solution using minimization

I have an equation F[x,y]=0. I need to plot y as a function of x. Due to the properties of ...
1
vote
0answers
43 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 ...
3
votes
3answers
70 views

Minimizing Multiple Functions

I'm trying to write a script that will minimize a given set of functions. The homework problem I've been given lists a set of dietary information, and I'm supposed to build the optimal salad based on ...
0
votes
0answers
50 views

Which method to use for finding maximum without actually computing optimization function explicitly?

I am new to Mathematica and I am currently working on an optimization problem. The optimization function that I have easy to calculate for some assignment of variable but it is very difficult to ...
1
vote
0answers
56 views

Optimizing orthogonal nonlinear regression code

I'm doing a simulation problem on the Langmuir adsorption model, where I need to obtain the model parameters from simulated data using the orthogonal nonlinear least-squares regression method. Here is ...
2
votes
1answer
161 views

How to build a list of constraints for NMinimize

Let's say I have aset = {-1, 0, 2}. I would like to create a variable Var that takes values from that set, i.e. ...
4
votes
1answer
68 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
42 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
100 views

Using NMinimize to solve the Multi Commodity Flow problem

I have the following optimization problem and I was hoping to solve it with NMinimize. Unfortunately, I don't get the desired result. I would like to get an optimal vector for $d_{e}$. This is how ...
2
votes
1answer
109 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 ...
5
votes
1answer
237 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. ...
1
vote
2answers
176 views

Is it possible to monitor the sum of squared errors in a NonlinearModelFit or FindFit procedure during the process?

Since fitting procedures using NonlinearModelFit (or FindFit) sometimes take very long, I would like to monitor the sum of ...
2
votes
1answer
100 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: ...
1
vote
2answers
92 views

Does FindFit use symbolic differentiation?

Does FindFit use symbolic differentiation when optimizing by least squares a non-linear function?
0
votes
1answer
56 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
26 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
46 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
68 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: ...
1
vote
1answer
137 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 ...
2
votes
1answer
44 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 ...
3
votes
1answer
94 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 ...
4
votes
1answer
52 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
107 views

Easy FindMaximum returns a wrong answer

FindMaximum in region is a new function in mma10,but when I tried the following example: ...
3
votes
1answer
65 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 ...
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 ...
3
votes
0answers
60 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 that uses NonLinearModelFit with NMinimize as the method to do ...
1
vote
2answers
101 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 ...
1
vote
0answers
50 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: ...
4
votes
1answer
105 views

Possible bug / numerical issues with HypergeometricU — any suggestions for a fast workaround?

I've encountered some problematic behaviour with HypergeometricU. I have a probability distribution on the positive integers that takes the following form after ...
1
vote
2answers
140 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
1answer
28 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
38 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. ...
5
votes
1answer
189 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 ...
0
votes
1answer
91 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 ...
6
votes
1answer
312 views

Speeding up the non-negativity algorithm for multilinear function with interval probabilities?

The algorithm is a branch-and-bound algorithm that calculates the non-negativity of a multilinear function with interval probabilities. The lines 9-11 has an optimization that is explained on the ...
4
votes
3answers
146 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 ...
3
votes
1answer
190 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 of ...
8
votes
2answers
1k views

Linear programming with many variables and parameters

I am trying to reconstruct the answer that is given in this report. (page 153 in Appendix B; Section B.2.1). They are given variables, parameters, constraints, and the objective function to minimize. ...
-1
votes
1answer
103 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
20 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. ...