Questions tagged [mathematical-optimization]

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

Filter by
Sorted by
Tagged with
5 votes
1 answer
101 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 ...
2 votes
2 answers
60 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: ...
0 votes
0 answers
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 ...
2 votes
2 answers
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 ...
9 votes
3 answers
191 views

How to make these callout labels not overlap

This is my code: ...
1 vote
1 answer
193 views

RegionPlot of the Maximum of a function

For the function fun[a_, b_, x_, y_] = Sin[a x] Cos[b y] (a x + b y);corresponding to $x$ and $y$, I need a RegionPlot showing the maximum of function $fun[a, b, x, ...
2 votes
2 answers
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 ...
7 votes
1 answer
107 views

Using Compile on Gradient within FindMinimum efficiently

This is an example from the documentation: ...
20 votes
2 answers
2k views

Expressing a polynomial as a sum of squares

I encountered a degree 4 polynomial in 8 variables f(a1,a2,a3,a4,b1,b2,b3,b4) that I suspect can be written as a sum of squares. While sostools in MATLAB would find ...
0 votes
1 answer
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 : ...
4 votes
1 answer
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: ...
5 votes
4 answers
276 views

Approximate strictly positive solution to a linear set of equations?

Consider a positive matrix M and a positive vector b, e.g. ...
0 votes
0 answers
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 vote
2 answers
41 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: ...
5 votes
1 answer
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 ...
6 votes
1 answer
532 views

Specify a constraint on an interval under FindMinimum

I have an interpolated function that looks like this: $\hskip1.2in$ and, based on extreme and critical points, I want to use a polynomial to approximate the function. The points in question are: <...
1 vote
1 answer
117 views

Find the maximum of a given function

I calculate a target function f about two variates a and b. ...
0 votes
2 answers
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 ...
3 votes
1 answer
1k views

Solve overdetermined set using Mathematica?

As shown below, this is a overdetermined system. Could you teach me how to find the optimized solution in Mathematica? I know it could be solved by the method of least square, but how to realize it in ...
0 votes
0 answers
104 views

Solving a system of equations as part of maximizing a multivariable function

This is my code ...
1 vote
1 answer
95 views

How to optimize the $L^{2}$ norm in Mathematica for an iteration scheme and How to plot its 3D graph?

Consider the BVP $y^{\prime\prime}(t)=\frac{3}{2}y(t)^{2}$ with boundary conditions $y(0)=4$ and $y(1)=1$. The initial iterate is in this case $x_{0}=4-3t$. The higher iterates are given by the ...
1 vote
1 answer
72 views

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

I got a large linear system ...
0 votes
1 answer
49 views

Finding element selected in NMaximize[{Min[...], constraints},{vars}]

How can I determine which element of Min[] is being selected in a NMaximize[{Min[...], constraints},{vars}] problem? For example,...
0 votes
0 answers
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, ...
0 votes
0 answers
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 ...
1 vote
1 answer
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 ...
4 votes
1 answer
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 ...
2 votes
1 answer
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: ...
1 vote
2 answers
162 views

Minimax / Minmax optimization

For the complex polynomial $$P_n(z) := 1+z+\frac{z^2}{2} + \sum_{j=3}^n \gamma_j z^j,\quad z \in \mathbb C.$$ I want to solve the following minimax/minmax optimization problem: $$\min_{\gamma_j} \max_{...
7 votes
3 answers
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 ...
0 votes
1 answer
98 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 ...
0 votes
0 answers
32 views

Norm adding up residual

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 ...
0 votes
1 answer
137 views

Implementing an optimization algorithm in WL

I am trying to implement the Jaya optimization algorithm (Jaya). This is a flowchart from the Author 's webpage showing the details of the Algorithm. Note that there is a typo in the equation in the ...
0 votes
0 answers
22 views

Issues with ConvexOptimization and SetPrecision

I am completely new to Mathematica (second day), so do not expect things to look polished. I am trying to perform a ConvexOptimization over a List/Array (dimensionality ...
3 votes
1 answer
1k views

Is there a faster way to solve this linear programming problem?

I need to get a rational solution of the linear constraints ...
2 votes
1 answer
78 views

Parametric minimization of a quadratic expression in two variables

I am not an expert in using Mathematica, and I do not understand the following result (apologies if it appears trivial). I want to find the general solution to minimize the following expression over $...
3 votes
1 answer
184 views

How to provide an RNN various type of inputs?

I'm trying to build an RNN in Mathematica. My window is only 2 but the variables are of different types: ...
6 votes
2 answers
237 views

Steiner Trees for Unit Polygons?

I know this is a longshot, and it's a rather broad question, but hopefully someone can help. Is there a simple or fast way to find Steiner Trees for unit polygons using Mathematica? By unit polygon, I ...
2 votes
1 answer
109 views

Weakness in Maximize

Solving a minimization problem in version 13 on Windows 10, I obtain ...
0 votes
1 answer
111 views

Two problems with ConjugateGradient

I am trying to solve a maximization problem for which I give you the code and try to step by step show you were it broke down. The first issue is that I have a constrained problem, which I try to ...
1 vote
0 answers
36 views

When can you guarantee Minimize outputs the global minimum? [closed]

In the Minimize documentation, it's stated that "Minimize will return exact results if given exact input. With approximate input, it automatically calls NMinimize." What is an approximate ...
0 votes
2 answers
130 views

NMinimize does not reach the minimum

I need to minimize numerically an expression with constraints. The expression also includes a numerical integral (called 'PNoninteract'). The minimization apparently stops prematurely (I know roughly ...
2 votes
2 answers
137 views

Find the maximum value of the minimum eigenvalue of the matrix

There is a $4×4$ matrix $Q$ where $c,d,e,m,n$ are variables. How to get the maximum value of the minimum eigenvalue of $Q$? $Q=$ $$\\\left( \begin{array}{cccc} \frac{12058305}{23104}-304 c & -849 ...
3 votes
1 answer
81 views

Convex optimization of a least squares regularized objective function [closed]

Given, a vector of observations $\mathbf{y}=(y_1, y_2,\ldots,y_n)$ I am trying to find the soltuion to the following optimization problem: $$ \min{ (1/2) \|\mathbf{y-x}\|_2^2 + \lambda \|\mathbf{Dx}\|...
1 vote
1 answer
129 views

How to numerically solve an equation

I would like to solve for $r_2$ the following two (independent) equations: $x_{Min}(a,b,c,r_1,F)=x_{Max}(a,b,c,r_2,F)$ (1) and $x_{Min}(a,b,c,r_2,F)=x_{Max}(a,b,c,r_1,F)$ (2) where $a$, $b$, $c$, $r_1$...
0 votes
0 answers
90 views

Simplification of long trigonometric expression taking a long time

I have tried to Simplify as well as FullSimplify a long trigonometric expression to get a simplified form of the expression but it takes a very long time almost hours and sometimes it also shows error ...
1 vote
0 answers
38 views

Selecting a set of points from a region to maximize the smallest pairwise distance

Suppose, we have a region (say, for simplicity, a unit cube) and a distance function that, given the coordinates of any two points in the region, calculates the distance between them. It is not simply ...
2 votes
2 answers
77 views

Plot issue : put a legend instead of a top label

I have an issue about putting a legend consisted of a text and numerical value instead of a label. For example, with this command line : ...
1 vote
1 answer
53 views

Plot issue : bad label ordering with concatenation of strings

I have an issue about a label which is consisted of a variable name [Omega]BD and a numerical value associated. Firstly, I put the BD subscript to ...
0 votes
1 answer
115 views

Minimizing a function over a bounded domain with binary variables

I want to minimize the following function: $$ f(m,n)= \sum_{i=1}^N\Big\{ \alpha_i(x_i-m)^T(x_i-m) \Big\} + \sum_{i=1}^N\Big\{\beta_i (x_i-n)^T(x_i-n) \Big\} $$ where $m,n$ are all 2-d vectors: $$ m:= ...

1
2 3 4 5
39