# Tagged Questions

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

176 views

### FindMinimum and WhenEvent

Is there any way to incorporate WhenEvent[] into the FindMinimumfunction ? I'm currently trying to minimize an interpolating function with FindMinimum (since the origional function is to cumbersome ...
206 views

### NMaximize with Nelder-Mead method fails to convergence when tolerance set too high

Recently I have been working on a optimization problem for which I use NMaximize with Nelder-Mead method. In general, I have to check a lot of systems which are built automatically. I want to skip ...
54 views

### Sharp Ratio Maximization, Closed Forms

I am trying to get a closed form for the following first order conditions (n=4): Here's the nb-File. The code is as follows: ...
154 views

### Find fit does not find the best fit

Here is my data ...
81 views

### Performance of a bootstrap - time of computation not linear with number of iterations

I'm doing a bootstrap based on this thread with the following code (file.txt here): ...
120 views

### Both FindMinimum and NMinimize have trouble

I'm trying to minimize a function I wrote, in a not entirely elegant (but functional) way. As a side note, if you have advice on how to write this in a smarter way, that's also welcome. In any case, ...
88 views

### Symbolically Minimizing a Max function

I'm having a tough time with seemingly simple symbolic Minimization/Maximization in Mathematica. I would like to use the Maximize function to work on some unknown random variables and so use min/max ...
110 views

### Maximise a function over one parameter that is continuous, and one that is discrete

I have a function that I would like to maximise with respect to two parameters: one continuous, another which is discrete. A simple example of this might be the following: ...
149 views

### i need a swap mutation code (genetic algorithm) in Mathematica?

I'm working on GA coding to optimize the locators position in fixturing system to minimize the error in precision manufacturing.I need a code for mutation (genetic algorithm) in Mathematica. Here, I ...
1k views

### Minimizing using indices, error: Part::pkspec1: The expression cannot be used as a part specification

I want to use Minimize where the variables to minimize are indices pointing into an array. Here a MWE that hopefully shows what my problem is. ...
94 views

### How to perform Bayesian optimization with Mathematica? [duplicate]

Does Mathematica have any Bayesian optimization methods for learning hyper-parameters? Practical Bayesian Optimization of Machine Learning Algorithms Jasper Snoek, Hugo Larochelle and Ryan P. ...
113 views

### How can I calculate Lagrange multiplier and the critical points with Mathematica? [closed]

I have constraints and a function I want to know the critic points but is there a way that I can compute this method so that I can see results faster
244 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: ...
940 views

### Finding peaks of data

I want to find peaks in my data. My code in a reduced form so far: ...
69 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 ...
127 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 ...
126 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 ...
203 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 ...
137 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 ...
103 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: <...
41 views

### Using ForAll in Maximize to define a bunch of conditions [closed]

I'm trying to do something very straight forward. The following maximization works: ...
80 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 ...
197 views

...
100 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: ...
107 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: ...
71 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 ...
144 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 problem)...
174 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 ...
168 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 ...
87 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 ...
120 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: Maximize[{Min[d1[15*x],d1[12*x],d1[18*x]],...
122 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 ...
158 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. ...
139 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. ...
102 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 <...
162 views

### Easy FindMaximum returns a wrong answer

FindMaximum in region is a new function in mma10,but when I tried the following example: ...
314 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 ...
232 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 ...
283 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 ...
101 views

### Solving Lagrangian (4 vars to solve for)

I'm a bit new to Mathematica, but here's what I've got: ...
279 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 ...
94 views

### Complicated equation solving

I want to find the maximum point or optimal value $y$ of Rx1[y_, a_, b_]. ...
150 views

### How to plot a table of the results of findmaximum?

Here is my code ...