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

learn more… | top users | synonyms (2)

0
votes
0answers
101 views

How to minimize the sum of squares of deviations from the mean?

I am trying to minimize the sum of squares of a deviation from the mean applying the following: Minimize[Sum[(Subscript[x, i] - \[Mu])^2, {i, 0, n}], x] It ...
0
votes
0answers
67 views

Constraint minimization with NMinimize

I am using the following code in order to minimize the function chi ...
0
votes
0answers
52 views

Interpreting a certain result of Minimize

I am given a certain function $f(k_1)$ that I would like to minimize. Asking Mathematica to do it (and supplying the given bounds of other parameters in the expression) I get the following result: ...
1
vote
2answers
333 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
96 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
87 views

How to optimize my code?

I use Mathematica to handle data.My trial as below: Interpolation function: ...
0
votes
1answer
58 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
177 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
648 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
167 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
90 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
179 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
25 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
72 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
77 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
230 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
110 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
40 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
60 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
102 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
98 views

How to use Maximize correctly

I would like to Maximize this fairly simple expression ...
0
votes
0answers
102 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
94 views

How do I find where the maximum is?

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

Optimization problem test suites

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

Understanding execution time in nested loops

I have the following simple code ...
0
votes
0answers
747 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
56 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
45 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
87 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
60 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
252 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
89 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
23 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 ...
20
votes
1answer
351 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
88 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 ...
6
votes
2answers
198 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 ...
5
votes
1answer
133 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
293 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
88 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
139 views

Experimental`NumericalFunction in NMinimize solution

I try to make a number of optimizations using this code: ...
4
votes
0answers
155 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
517 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
102 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
206 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
90 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
301 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
236 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 ...