# Questions tagged [mathematical-optimization]

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

1,917 questions
Filter by
Sorted by
Tagged with
50 views

### Least norm solution to a set of linear equations [closed]

Suppose I have a set of linear equations $M x = y$ where there are infinitely many solutions. I want to find a solution $x$ with the smallest $l_2$ norm $\|x\|_2$. Is there an efficient way to do this?...
• 171
65 views

### Optimization problem with parameter dependent interval of functions

I am working on an optimization problem but ran into a problem. Here is a simplified version of the problem: ...
• 23
104 views

### Express polynomials as sum of squares

Well, while SOStools of Matlab can express a polynomials as SOS (Sum Of Squares) by the following theorem: A multivariate polynomial p in n variables and of degree 2d is a sum of squares if and only ...
• 153
38 views

### Choice of initial values for FindMinimum

I have been using the FindMinimum function in Mathematica to implement nonlinear regression (for function $f(x,y)$, say). I am curious to find how the starting ...
107 views

### Using Compile on Gradient within FindMinimum efficiently

This is an example from the documentation: ...
• 2,160
49 views

### Real valued solution

I want to obtain the critical points or if you like a real solution for the first derivative of the function set to zero, and the second derivative also vanishes of the function : ...
136 views

### Nonnegative Least Squares Algorithm (NNLS) [closed]

Can anyone optimize the code below which is developed in an old version of Mathematica (2003) both in terms of efficiency and adaption to the latest versions of Mathematica? Description of the code: ...
87 views

### Solution to a linear equation with minimum rank

Suppose I have a linear equation, $X.M=A$, for given matrices $M$ and $A$. I can use FindInstance to produce a solution $X$. How can I add the constraint that $X$ has the least rank? Indeed, I could ...
192 views

### How to make these callout labels not overlap

This is my code: ...
• 23.7k
51 views

### Minimum of a function that depends on several variables

I have a function, $$A=\sum_{m}mx$$ provided $$x=\frac{2(y1+iz)}{2t1-\left|\frac{t2}{iy2}+z\right|}$$ Here $$y1,z,t1,t2,y2$$ all are varying. But $x$ needs to be in the limit of $-1$ and $0$. Is there ...
• 1,163
1 vote
42 views

### Find min value of a complex Root function [closed]

Could someone tell me how to obtain the min value of this function when lambda is between 0 and 1: ...
• 11
98 views

### Optimize cost when ordering wood boards (cutting stock problem)

That is probably a common optimization problem, but I don't know how to solve it efficiently. Say you want to buy the following wood boards: 2 to 1m, 3 of 1.5m, 2 of 2m. The shop has the following ...
• 13.8k
1 vote
117 views

### Find the maximum of a given function

I calculate a target function f about two variates a and b. ...
• 135
72 views

### How to take the derivative with respect to a function with more than one variable?

I have a function that includes another function inside. I want to know the derivative at every point x. I have spent a lot of time trying to figure out how to do this, but I am very lost. I have ...
38 views

### NMinimize and DE

I would like to use the Differential Evolution option of NMinimize to find the "optimal" solution for the hyper-sphere function defined as follows, ...
1 vote
72 views

### How to get a rational solution of the linear system efficiently?

I got a large linear system ...
• 71
38 views

### Is is possible to specify use of a non-Euclidean norm for NonlinearModelFit

When using NonlinearModelFit with Method->NMinimize I have received the warning message NonlinearModelFit::lmnl, which includes the text ""The model -cVar+Log[1+0.00821596 t] is linear in ...
• 83
121 views

### A problem of nonlinear multi-objective optimization

I have two variables x1 and x2 and I use them to calculate 4 metrics y1,y2,y3, and y4. now I want to solve for the value of x1 and x2 so that these four metrics are as large as possible. Can anyone ...
1 vote
43 views

### Boolean constraint in an interval for FindMinimum

I have a function with a large number of variables that I am trying to minimize subject to some constraints, but for simplicity let us say that it only has two variables, f[x, y]. The constraint is ...
• 121
565 views

### My model has not finished evaluating in more than a day so can't test if it works, what is wrong with it?

Hello I have this modified monocentric city model that I have been working on for a while. Sorry for the long post, I wanted to add the whole code, because it's all connected. My suspicion is that it ...
73 views

### Local extrema points of a function of two variables

i need to find local extrema points of a function of two variables, but it doesnt work FindMaximum[x^3 - 2 y^3 - 3 x + 6 y, {x, y}] I have this error: ...
• 43
99 views

### Finding local minimum of a 2D potential

I tried to find a local minimum point of a 2D potential U[\[Chi],\[CurlyPhi]] with both FindMinimum and ...
• 13
32 views

For FindFit I want to have a norm that just sums up all residuals. For the sum of absolute values there is NormFunction -> (Norm[#, 1] &), but I don't know ...
• 77
588 views

### How can I quickly find the coordinates of key points? [closed]

There are 1000 points in the space. The coordinates are (0,0,0) - (9,9,9). Any point can cover all points on the three straight lines (parallel to the X, Y and Z axes respectively) where this point is ...
• 301
1 vote
162 views

• 493
137 views

• 115
40 views

### Why do I get NMinimize::nrnum error?

I have this minimization program and although I've restricted my variables to be non negative, I get a nrnum error in the NMinimize step. I'm guessing this is what ...
• 543
45 views

### Maximizing arbitrarily scaled step function

I am attempting to maximize a function dependent on a single variable (x) that contains multiple parameters. The case of a simply loaded beam with discontinuities in the loading. However so far I have ...