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

learn more… | top users | synonyms (2)

1
vote
2answers
144 views

Solve within a range?

Is it possible to solve an equation in which some some of the parameters have defined ranges? Example: ...
0
votes
1answer
81 views

Mathematica won't maximize my function

I'm trying to maximize two functions. For the first one, the code runs correctly and returns the desired answer ...
1
vote
0answers
84 views

How to optimize my code?

I use Mathematica to handle data.My trial as below: Interpolation function: ...
0
votes
1answer
51 views

Optimizing repeated function calls

Easiest way to keep my library nice, is to naively call some functions many times with same parameters. Doing so prevents from zoo of (library-)global variables and complicated initialisation ...
2
votes
2answers
134 views

Fitting a variable using multiple equations

I would like to find the best fit of two variables for a number of approximate equations, such as: 1x+2y+2=7.04 2x+y+4=7.98 1.5x+1.5y-2=2.53 1.8x+3y-1=6.77 That ...
6
votes
2answers
604 views

Distribution of 10 points within a unit square

Related to some packing problems, following problem arose: Distribute 10 points within a square of sides 1, so that minimal distance between them is maximized. With the help of random simulation, or ...
2
votes
2answers
124 views

Find minimum value of function which calls NDsolve [duplicate]

I have defined a function which takes a coefficient for a differential equation as an argument, solves the differential equation with NDSolve, and returns the value of the solution at time t=10. I can ...
1
vote
0answers
76 views

DSolve does not solve my system of PDEs

I am a long time Maple user who had just recently got hands on Mathematica. I have a "simple" system of PDEs, one can be solved easily. But I cant seem to get it work in Mathematica. I am nos sure ...
1
vote
0answers
133 views

Travel time sweet spot using: Mathematica and Google Maps API

I want to use Mathematica to do some time minimisation calculations calling on Google Maps API for travel time data. I'm concerned with travel time, e.g. along roads (by car or walk) and not linear ...
1
vote
0answers
23 views

Minimizing roots of a transcendental equations [duplicate]

I'm trying to use the solution of FindRoot with parameters for further calculations. Annoyingly enough it always gives me trouble with replacing the parameters. As an example I'm attaching a simple ...
1
vote
0answers
60 views

Linear interpolation over 2 variables

I'm tuning a function to data over 4-5 variables using Differential Evolution. The objective function calls frequently interpolation function. I came to a point, where compiling the objective function ...
0
votes
0answers
57 views

Minimize solution to linear system with singular system matrix

I am trying to solve a time-dependent linear system with a singular system matrix, $A$, thus an infinite number of solutions, ${\bf x}$(t), exist that satisfy the linear system. The solution I am ...
11
votes
2answers
198 views

Rotational Averaging of Image Periodograms (FFTS)

I'm writing a code to do rotational averages of image FFT's. I have a working version but it is pretty slow. Wondering if anyone has any thoughts on a way to do this more efficiently. Data looks ...
1
vote
1answer
106 views

Help to solve the equation with RungeKutta method [closed]

I need to solve this equation. v'[t] + v[t] == 1/(1 + Exp[-v[t]]) I tried to solve it using RungeKutta method described in Wolfram ...
0
votes
0answers
29 views

NMaximize not satisfying binary constraint

I'm solving an optimization problem in Mathematica with binary integer constraints. It works alright with other constraints. But the only problem is that both NMaximize and NArgMax are not treating ...
-1
votes
1answer
43 views

Are there a function to choose the greatest value in a discrete function? [closed]

Supose a discrete function show 1st, 2nd,...6th value are h = {5, 4, 2, 8, 9, 1} And I want to find the maximun in the subset of indexes 1,3,5,6 (what are ...
0
votes
0answers
54 views

inequalities in equations and constraints

Say That I have the constraint: .5<x1<x2<x3<x4<40 I want to use this constraint in a Nminimize function. It seems that mathematica runs into a ...
3
votes
1answer
98 views

What does LinearModelFit depend on except for its' arguments?

I thought this would be always true, but most likely it returns false. ...
2
votes
0answers
49 views

How to reduce notebook or CDF file size with many images in it? [duplicate]

We love to use Mathematica notebooks to keep our notes, so we import lot of scanned photos into notebooks. However, the nb file size goes crazy large after importing photos in it. For example, ...
2
votes
1answer
91 views

How to use Maximize correctly

I would like to Maximize this fairly simple expression ...
0
votes
0answers
91 views

Constrained maximum likelihood

Trying to solve a MLE with nonlinear constraints that need to be satisfied. However, the given solution do not match the constraints. Am I doing it correctly? ...
0
votes
0answers
91 views

How do I find where the maximum is?

I have a function given by: ...
1
vote
0answers
59 views

Optimization problem test suites

Mathematica provides nonlinear, unconstrained test problems here: Needs["Optimization`UnconstrainedProblems`"] and LP test problems here: ...
1
vote
1answer
236 views

Understanding execution time in nested loops

I have the following simple code ...
0
votes
0answers
615 views

Fastest way to create a NxNxNxN dimensional matrix

I have a function that outputs a complex number Func[x_,y_]:= blah blah; I have constructed a table of all possible values of this function. ...
0
votes
0answers
49 views

FindRoot to find numerical solution of a given index

I want to find solutions of a system of multivariate nonlinear equations of a specific index (i.e., the no. of positive eigenvalues of the Jacobian evaluated at the solution). I know the FindRoot ...
0
votes
0answers
43 views

How to obtain all minima? [duplicate]

If you Solve an equation, you obtain all solutions. But If you NMinimize a function, you only get one minimum. The question ...
0
votes
1answer
70 views

How to save numbers that are in Mathematica messages

I have a program that calls FindDistributionParameters and I get the Mathematica message FindMaximum::eit each time I call the function. The message is FindMaximum::eit: The algorithm does not ...
-1
votes
1answer
54 views

How to fit one parametric array to another numerical array?

I have two arrays of length n. One of them is obtained by experiment, so every element of the array is a number. The other array is parametric, each element is a ...
1
vote
1answer
233 views

Solving a System of four equations (with logs) [closed]

I am trying to solve a system of four equations in four variables. I have read a number of threads on similar issues and tried to follow the suggestions. But I think it is a bit messy because of the ...
0
votes
1answer
77 views

LinearProgramming and Maximize giving different results [closed]

I'trying to do an embarrassingly simple linear programming problem, and being a total Mathematica and maths analphabet I'm stuck. The problem is to optimize (maximize) the function $1.2x+y$, with ...
1
vote
0answers
22 views

$H_{\infty}$ optimization of transfer function matrix [duplicate]

I have a two-dimensional $(2 \times 2)$ transfer function matrix like this: $$G(s) = \begin{pmatrix} \frac{1}{xs+1} & \frac{1}{s+0.5}\\ \frac{3}{s+3}& \frac{1}{ys+2} \end{pmatrix} $$ The ...
17
votes
1answer
279 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 ...
1
vote
0answers
76 views

Increase optimization processing speed

As you know, sometimes numerically solving of optimization problems takes several minutes. For this reason 2 question came up to me: 1 - When one is abort the optimization procedure, how it is ...
5
votes
2answers
173 views

Numerical Optimization Methods

I am curious if any one has comments on "specific characteristics" of a problem that will deem it to be best solved by a specific optimization method such as ...
2
votes
1answer
97 views

NMinimize go out of bounds on some linear constraints

I'm trying to minimize a non-linear function of four variables with some linear constraints. NMinimize on Mathematica 8 seems to go out of bounds on some constraints giving complex values of the ...
0
votes
1answer
208 views

NMinimize to optimize function Module

I am using Nminimize for simulation based optimization. I define the objective function (simulation with a variable "a") as a module to be used in the minimization. ...
1
vote
2answers
82 views

Minimizing the maximal residual in mathematica

With this: d1 = 10; d2 = 4; mat = RandomReal[{-1, 1}, {d1, d2}]; vec = RandomReal[{-1, 1}, d1]; LeastSquares[mat, vec] ...
8
votes
1answer
120 views

Experimental`NumericalFunction in NMinimize solution

I try to make a number of optimizations using this code: ...
3
votes
0answers
132 views

Simulated Annealing Parameters and Results

I am using SimulatedAnnealing method for a simulation based optimization problem and was wondering if someone can enlighten me on the following features: Is there ...
6
votes
1answer
405 views

Simulated Annealing Convergence

I am using Simulated Annealing method for a simulation based optimization of a process that has 3 variables, using NMinimize. I print the input/output during every ...
0
votes
1answer
79 views

Trouble with NMaximize

I am having trouble with maximizing a function I am interested in. Below is the code I am using. ...
4
votes
2answers
179 views

How to set up and minimize a large system of equations to resolve the individual components

I am trying to set up a system of 400*N equations to deconvolute spectral data for four different compounds. I monitored 400 different wavelengths in N solvents (3 solvents in this case). In order ...
1
vote
0answers
75 views

DifferentialEvolution scaling factor randomization

Using NMinimize for finding global minima, one can choose the DifferentialEvolution method. You can find a (not so) detailed ...
3
votes
2answers
193 views

Convert number to exponent form with highest power possible

As a school assignment we have to write a program which solves this issue. Since the program has to run efficient I am wondering what the best way is to approach this issue. Of course there you can ...
0
votes
0answers
38 views

Faster evaluation of an expression for brute force optimization [duplicate]

I'm trying to bruteforce an optimization problem and I want to generate roughly a million function evaluations. I was wondering what would be the best for me to do in terms of having the expressions ...
3
votes
3answers
203 views

Fastest way to check if an expression contains all symbols from a list

I need to execute this function thousands of times, and the faster, the better. I came up with two versions, but wanted to see if you can come up with an even faster way. Is there a better way? I use ...
3
votes
0answers
90 views

NMinimize seems to call function with the same values multiple times

I have to minimize a function where the evaluation of one parameter set takes very long (around 5sec) and discovered alongside, that NMinimize seems to call this ...
0
votes
1answer
130 views

Domain errors with Maximize/NMaximize

I am trying to maximize a (somewhat) complicated function over probability distribution $p$ and $q$. Here is my input: ...
0
votes
1answer
103 views

Maximization of a function within a unit square [closed]

I work in a unit square. I have some conditions under which areas within the unit square are defined. Say for simplicity that there are two conditions which define two areas. For example, if y > 1/2 ...