Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

# Questions tagged [mathematical-optimization]

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

1,317 questions
Filter by
Sorted by
Tagged with
77 views

### Find integration boundaries by comparing two data sets

EDIT: the mathematica problem: My spectra are two 1-D lists of numbers (which I will copy at the end of this message), and so as to be able to integrate the narrow-slit-data, I created an ...
70 views

### Point selection criterion in Method->RandomSearch

In NonlinearModelFit one can specify Method->{"NMinimize", Method->"RandomSearch"} while giving a guess for the fit ...
112 views

### Linear programming pivot

Here my object is purely pedagogical. When I was a student I hated linear programming because of the numerous operation we have to solve the simplest linear program. So now that I teach linear ...
77 views

### how to realized parallelization computing on 12 CPUs on linux OS

Mathematica 10.3.0 linux Question description: The data I use is a sample of m stocks, each stock has transaction data of n days. The unit of my sample is a 48*1 matrix, which is data for one stock ...
100 views

### Can you run FindMinimum excluding imaginary results?

I have a FindMinimum task that I described in an earlier post. One of the suggestions to make the minimization algorithm work was to try to scale the input variables so they are closer. One of the ...
70 views

### NMaximize — Error + Output

When I run the code, Table[ NMaximize[ {f[α, χ, τ], 0 <= α <= 2 π, 0 <= χ <= π}, {α, χ}, WorkingPrecision -> 10 ], {τ, 0.1, 2, 0.1} ] ...
288 views

### Solve equations involving summation expressions in Mathematica

I am trying to solve the simple linear regression equation analytically in Mathematica (not using builtin functions). I managed to calculate the gradient as follows f is loss function using RSS and ...
221 views

### Gradient Descent's Update Rule for Multiparameter Functions

I'm sure this has been answered before, but I haven't been able to find it. I'm trying to manually implement gradient descent for some function, f, with a vector of any length. I define the update ...
35 views

### How to make FindMiniumum work with delayed function and NIntegrate [duplicate]

I can plot my function penalty[v] just fine, but FindMinimum doesn't work, it just complains non-numerical values from ...
204 views

### Minimize: which algorithm is in use?

How can I know which algorithm has been used by Minimize to solve a given problem? Can I force Minimize to use a specific ...
170 views

### Problems with NMaximize [duplicate]

The Objective function I would like to Maximize takes less than a second to evaluate. There are several packages needed to evaluate it, so I'm not showing it here. ...
77 views

### Check if interpolated function passes through a specified region

Is there an efficient way to check if a curve that was obtained as an Interpolating Function (from solving differential equations numerically) passes through a given region? I am solving for two ...
97 views

### Using ParametricPlot to Display result of Maximize

One would expect that: Plot[f[x],{x,0,1/2}] and ParametricPlot[{x,f[x]},{x,0,1/2}] would always yield identical outputs. ...
34 views

### Maximum of an integral that depends on a parameter [duplicate]

I have defined a function f(x,t) : ...
81 views

### Minimization with constraint define over a region

I would like to perform a 2D electrostatic minimization between two charged ellipsoids, provided that they should not penetrate each other; they can touch but they are hard ellipsoids. Here is what I ...
120 views

### Kernel crashes during LinearProgramming. Can you reproduce it?

Using the code from this answer for a sufficiently large problem setting crashes my kernel. I'll copy/paste the code here: ...
67 views

### Incorporating sophisticated constraints on the approximating function into NMinimize

Following the approach as given in the answer of Belisarius here I just wonder how one could incorporate some more sophisticated requirements on the approximating function. Suppose the approximating ...
206 views

### Find the maximum hyperrectangle contained in a set of points

I have a question similar to this one ( Find the largest rectangular block satisfying some condition without iterating explicitly). but in my case I have a multidimensional (up to 6 dimensions) binary ...
52 views

### How to determine whether NMinimize returns a solution or not?

I'm using NMinimize to find the minimum solution for a non-linear objective function. As I change the set of constraints, most of times ...
93 views

### NIntegrate within NMinimize - how to optimize the code?

How I can optimize these numerical calculations? Most annoying is encountering instabilities (numerical errors). I have a predefined function: ...
117 views

### Simplifying sums of rational trigonometric functions

After simplifying the trigonometric functions as advised before (cf. Simplifying Expressions for FindMinimum), I obtained a sum of 62 similar expressions, the first three as in the below: ...
122 views

### Optimization over 6 vectors

Suppose I have an expression which depends on 6 unit vectors (3 dimensional). Hence, I need to optimize over 12 parameters (every vector contains 3 parameters, but one we can reduce by considering ...
318 views

### How to optimize a cost function which involve the solution of a ODE system using the NMinmize?

I have created a cost function, the value of which depends on the solution of a ODE (ordinary differential equation). The parameters of the ODE are not determined, and my goal is to determine them ...
70 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: ...
316 views

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

I'm a bit new to Mathematica, but here's what I've got: ...
39 views

...
87 views

...
498 views

### Optimization method L-BFGS-B

I am comparing a result of optimization using R and Mathematica. Mathematica (NMaximize) has found a significantly better (global optimum) result then R (using L-...
96 views

### Transform NMinimze into LinearProgramming formulation

I have the following maximization problem that I currently try to solve with Minimize/NMinimize. Unfortunately, this kind of solution method takes really long for large systems of equations and ...
529 views

### Improve on timing of NMinimize

I got a little performance problem with the function NMinimize (it takes mathematica approximately 10 minutes to compute the results). Here i s my sample code: ...
157 views

### Speed up numerical optimization (for plotting and solving)?

Briefly speaking, I want to plot a function PIfun[], which its value is based on numerical optimization using NMaximize. It ...
221 views

...
36 views

### What is that Root[…] inside the answer represent? [duplicate]

So I am encountering this situation, in which mathematica doesn't give me the answer, but in a form of "Root". How do I interpret this ? what is the number after the "&" represent? How should I ...
126 views

### Linear interpolation over 2 variables [duplicate]

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 ...
69 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 is:...
316 views

### Maximum of NDSolve output. Problem with interpolating function

I solve a NonLinear PDE and get a solution (which for other reasons I put into a vector): SolVec1[][x,t], where x and t are the indipendent variables. Now, I would like to get a distribution ...
65 views

### Compiling Visual Studio C++ to Run on Computers without Mathematica [duplicate]

I have written a console application on Visual Studio C++ as below ...
53 views

### How to manipulate lists to get only part of the value [duplicate]

This is really a question about manipulating the output of Maximize. I have a function of 2 variables, defined thus: ...
70 views

### NMinimize and FindRoot Issues with System of Equations [duplicate]

I am trying to solve a constrained optimization problem with a system of transcendental equations and am running into issues with NMinimize. I have a system of equations (...
50 views

### How can I assign EdgeCost for the graph edges? [duplicate]

Here is my code: ...
1k views

### Mathematica, nested optmization [duplicate]

I want to use the solution of Maximize, defined as a function, in another function. Here's an example: ...
6k views

### How do I determine the maximum value for a polynomial, given a range of x values?

I need to determine the maximum value for y = a x^2 + b x + c, where I know the coefficients and the upper and lower x values. ...
189 views

### Can Minimize work faster and/or be parallelized?

Having executed ...
180 views

### Linear least squares [closed]

Maybe someone has code of linear least squares? https://en.wikipedia.org/wiki/Linear_least_squares_(mathematics)#Example
160 views

### Finding optimal taxation policy- constrained optimization [closed]

I need to solve two constrained optimization problems where the second problem depends on the results of the first. The agents in my economy maximize utility: $$\max_{c,d,l} p\ln(c)+\ln(d)+\ln(l)$$ ...
225 views

### Optimization Algorithm: ideas wanted

EDIT: Lets assume a random matrix: ...
172 views

### Solving inequality using matrix form condition

*answer is $x=(10,5)^T$ (a,b) is inner product. x and y is 2d vector. Find $\bar{x}$ within the area by the systems of inequality,$K(x)$ s.t. About inner product of vector F(x) and (y-x),\$F(\...
71 views

### Search optimum on connected simulation

Do you know how can I find minimum/maximum of a simulation written in a Module. The simulation calculates a potential value to a territory after some steps. It would seem like this: ...