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
2
votes
2answers
193 views

How to find second,third,etc maximum peak of list

I need to find all values of peaks. I have Table with 10000 elements in it and I plot a graphic using ListPlot. Then I tried to ...
1
vote
2answers
157 views

Anyway to Speed up this code?

I have the following code: ...
0
votes
0answers
74 views

An optimization problem

I have the following two quantities denoted by $LHS$ and $RHS$: ...
0
votes
0answers
62 views

Minimize and Table of variables

I use a list of variables to Minimize a particular quantity { Q, val1, Table[Pi, {i, 1, m, 1}} where i is the subscript of P. However in this way I have ...
3
votes
1answer
37 views

evaluation about Exp[] and Complex problem [closed]

Exp[I*Pi*0.75]*Exp[I*Pi*0.75] Exp[I*2*Pi*0.75] the results are: -2.22045*10^-16 - 1. I -1.83697*10^-16 - 1. I I know it is ...
0
votes
1answer
60 views

How can I optimize plotting the solution to ParametricNDSolve as a function of a range of values of the parameter?

I'm using ParametricNDSolve to find a solution to a set of first order ODEs which have one independent variable, z. The set of initial values contains a function of t. ...
0
votes
0answers
34 views

`Minimize` keeps running

I'm trying to determine the effect of small changes in one parameter of my problem on the KKT multipliers. The program computes the values of those multipliers (γVec...
3
votes
1answer
132 views

Generate convex-hull of a 15 dimensional space

This question follows my last post. I have a function $ \vec{f}: S^6 \times S^6 \rightarrow \mathbb{R}^{13} $ defined on two 6-dim hyperspheres. We will denote the function $ \vec{f}(\vec{x},\vec{y}) ...
0
votes
1answer
43 views

How to find minima for non scalar-valued [closed]

I want to find minima. My code: ...
2
votes
2answers
137 views

Minimization of a function

Let $T$ be a $n\times m$ matrix. I'm trying to solve $$ \min \sum_i T_{ij}{\lambda_i}^{\frac{1}{\alpha_i}}$$ $$ s.t. \sum_i \lambda_i =1, \lambda_i \geq 0$$ for $j=1,2,...,m$. When $\alpha_i=\alpha$ ...
1
vote
0answers
38 views

Finding zero linear combinations of polynomials (numerically)

I have two functions of real variables defined on two compact spaces ...
1
vote
2answers
74 views

Solve multiple equations and getting solutions [duplicate]

This is my first post here so I'm not really sure how all of this works, but I'll try my best to explain my problem. I'm supposed to solve the equation system ...
0
votes
1answer
53 views

How to optimize this script?

fx8350, 16Gb ram just need to solve this: 13, 19, 19, 16, 26, 33, 26, 31, 5, 24, 21, 34, 35, 35, 35, 20, 7, 12, 18, 17, 6, 8, 15, 24, 2, 17, 15, 22, 29, 15, 21
3
votes
2answers
109 views

Programming with Mathematica Syntax - Dunford decomposition

I am always amazed while I am reading some solutions of problems in mathematical problems of this site with Mathematica. For instance, look at the problem 48. Whereas I am writing 100 lines of code ...
4
votes
1answer
223 views

estimation of values using NMaximize over symbolic array entries

I'm trying to generate instances of a dataset that satisfy specific conditions, based on the following equation: Each of four non-zero terms (term 1, A; term 3, B; term 4, C; term 5, D) is a scalar. ...
3
votes
2answers
58 views

Find the base vectors of a point set

I have a list of coordinates that fits into a 2D periodic lattice, with some error ( $\vec{R}=n\vec{i}+m\vec{j}+\vec{\varepsilon}$). Is there a way to find the base vectors of the lattice? I guess the ...
2
votes
1answer
51 views

FindInstance for all real values satisfying a condition

I seek at least one instance of positive fractions $p,q,r$ where $p,q,r \in \mathbb{Q}^+$, for which $$\frac12 (a - 2 b + c)^2 \ge pa^2 + qb^2 + rc^2\quad \forall\ a,b,c \in \mathbb{R}.$$ I used this ...
4
votes
1answer
56 views

AccuracyGoal & PrecisionGoal: how to know which was used to yield the result?

With NMinimize (or many other functions), when an answer is found without any warnings, this means that a certain convergence criterium was achieved. It could be ...
2
votes
2answers
50 views

SearchPoints -> Automatic within DifferentialEvolution: what's its meaning?

A simple question: what is the meaning of the standard option (Automatic) for SearchPoints within the ...
2
votes
1answer
145 views

Adjacency Matrix to Clusters of Equal Sizes

I have a system with 72 nodes. I have a binary adjacency matrix $S$ of size $72\times 72$. If $S_{i,j}=1$, then node $i$ is adjacent to node $j$. So, we also have $S_{i,j}=S{j,i}$. So, $S$ is a ...
0
votes
1answer
108 views

How to find clusters with same cluster sizes?

I have a set of 71 data points. Each data point is represented by its latitude and longitude. I want to divide them into 12 clusters. The first 11 cluster will have exactly 6 points each and 12th ...
1
vote
3answers
98 views

Find k largest edges with unique nodes (kind of maximum weighted matching)

I have a weighted graph, and I am interested to find k largest edges with unique nodes. Currently, I do it in the following manner ...
0
votes
1answer
55 views

NMaximize refuses the constraint set [closed]

I want to run the following NMaximize code but I receive warnings that the constraint set is not right. ...
4
votes
4answers
327 views

Solve struggles to solve equation with variable constraint

I am trying to find {x,y} set satisfying first order conditions with the constraint: 0<x<=y<1 Here is my code, which ...
5
votes
5answers
175 views

For a polynomial F with dependence on a parameter beta, find the value of beta for which F has 2 positive roots

Good morning, I have the following polynomial with degree 4 and its coefficients are quadratic functions of a parameter beta: ...
0
votes
2answers
55 views

Minimizing a univariate function that receives a vector?

I'm trying to minimise a function of the form $f(s)=\frac{1}{T}\sum^T_{t=1}(x_t-s_t)^2+\sum^T_{t=2}(s_t-s_{t-1})^2$, where the vector $x$ is fixed, and $T$ is of the order of $10^2$. I've tried <...
1
vote
2answers
129 views

Optimization Problem: NMaximize goes out of the constraints

I am having issues with the code: ...
3
votes
0answers
164 views

Speeding up an optimization problem

I have the following code which is working well but for matrices $M_i$ of size $40000\times 4$ the optimization problem takes extremely long. ...
0
votes
0answers
65 views

Optimization issue: I'm not getting the correct maximum

I have the following code: ...
2
votes
1answer
123 views

Maximax optimization over a particular matrix

I have the summation of $N$ matrices which are weighted by some weighing factors (parameters): $$M_\alpha=\sum_{i=1}^N \alpha_i M_i$$ $$d_{\alpha}=\arg\max_{rows} M_\alpha$$ The ideal vector $d$ is ...
3
votes
0answers
56 views

NMaximize not finding initial points within simple constraints

I'm trying to do an optimization, but Mathematica seems not to be able to find starting coordinates within a simple rectangular region. When I run this code: ...
2
votes
1answer
58 views

Unable to use `Solve` to solve simultaneous equations, or use `Maximize` for exact maximum solution

Mathematica has found that the maximum of the following function is negative using NMaximize, but I am trying to prove that the maximum is negative (i.e. that the ...
0
votes
0answers
75 views

Find minimum precision setting

I am using FindMinimum command to find a local minimum of an object function. My code is below ...
0
votes
0answers
71 views

Parametric minimization running forever

I am trying to solve for the minimum distance between a line and a cone, for all possible lines in 3D space. I've formulated this as a call to Minimize, but it ...
1
vote
1answer
160 views

Golden section search method that terminate after $n$ iterations

I am attempting to code a program that executes the golden section search method and I would like to terminate the computations after $n$ iterations, where the user decides what $n$ is. My code works ...
0
votes
2answers
69 views

Global minimum of a function in a specified interval [closed]

I've got the following definition of fun1. epsilon = 10^(-8) fun1[h_] := (2 epsilon*Abs[Cos[1]]/h ) + (h*Abs[Cos[1]]/2) Let'...
0
votes
2answers
158 views

Is my Maximize expression too complicated for Mathematica to handle?

I am new to Mathematica and am using it to determine when a function reaches a maximum. ...
1
vote
1answer
52 views

Optimize the distribition of a dataset over 4 quadrants

I want to optimise the distribition of a number of records over four quadrants. As a example I use this dataset ...
3
votes
1answer
177 views

How can I get the exact answer of the maximum of this function?

I am trying to find the maximum of a fuction: $ f(x)=\sqrt{x^2+9}-\sqrt{x^2-\sqrt{3} x+1} $. I tried Maximize[Sqrt[x^2 + 9] - Sqrt[x^2 - Sqrt[3]*x + 1], x] and ...
3
votes
2answers
160 views

Formulating a tailor-made Maximum Flow problem in a directed graph

Let a digraph, G, be given, where t[i,j] and a[j,i], respectively, denote transfer capacity ...
1
vote
0answers
33 views

How do I maximise the first real root of a multi-variable polynomial in x?

I have a polynomial in x, that also depends on {y1,y2,y3,y4,y5}. It always has 10 (not necessarily distinct) real roots. It's top coefficient is (1*x^10) I aim to find the y's that maximize the ...
12
votes
10answers
1k views

Given a list of integers, find the largest sum of a contiguous subsequence

Given a list of integers, find the largest sum of a contiguous sub-sequence. {1, 2, 3, 4, 5, -1, 7, -4, -2} (* 21 *) And print the sub-array which is ...
0
votes
1answer
78 views

Constrained Optimization doesn't converge?

Given a $n\times J$ matrix $T$ with strictly positive elements, I'm trying to obtain the values ($\lambda_i$) that minimize $\sum T_{ij}\lambda_i^{\alpha_i}$ with the constraints $\lambda_i \geq 0$ ...
0
votes
0answers
35 views

Constrained optimisation problem with Maximize

I am trying to solve a constrained maximisation problem in Mathematica but I am getting the same output as my problem. My input is ...
1
vote
0answers
82 views

Is it possible to solve following question about integer programming using mathematica?

Consider a $5$-uple $(r,a,b,c,s)$ with $a,b,c\in\mathbb{Z},s\in\mathbb{Q}_+,r\in\mathbb{Z}_+$, denote $\frac{1}{2}(a^2-b^2-c^2)-\frac{s}{r}$ by $\Delta(\mathbf{v})$. Let $A$ be a positive real number....
3
votes
1answer
74 views

Solving a non-linear system of equations given $1000$ data points

I have a vector of $1000$ data points saved in a vector $y$ and I need to solve a set of non-linear equations. Since I cannot write down all $1000$ values, I will assume that I have the following data ...
0
votes
1answer
44 views

Optimization with constraint or with the constraint embedded into the problem?

I need to find the minimum of a function. However, the condition is that the final state should be normalized i.e. sum of the squares must be one. One way to deal with it is just add the constraint ...
0
votes
2answers
454 views

How to use Levenberg-Marquardt for parameter identification

Imagine I have a function called fun1 that returns a vector of numbers fun1[a,b,c,d,...]:=. ...