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
0
votes
3answers
47 views

Minimize a function with singular points ( limit exists)

I need to minimize a function that has several problem points (divergences). For example, if I consider: ...
0
votes
1answer
72 views

DSolve returns unevaluated(I need a closed or numerical solution for this system and plot solution)

I am trying to find a solution to this system of differential equations but the program gives the same output without any messages. I would like help. Please find the Mathematica code posted here. a ...
12
votes
0answers
145 views

Linear programming with lazy constraints

Does Mathematica offer any means for solving linear programming problems with "lazy constraints", as described e.g. here? While I am not very familiar with linear programming, my understanding of the ...
9
votes
2answers
131 views

FindMaximum returns a solution that violates the constraints

I am looking at the following optimization problem $$ \begin{align*} \max\ & 1000 r_1 + \frac{1}{2}r_2 + \frac{1}{3}r_3\\ \text{s.t. }& 1000^2 r_1 + \frac{1}{4}r_2 + \frac{1}{9}r_3 = \frac{1}{...
5
votes
3answers
77 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
0answers
31 views

How to solve this set of linear equations

I am trying to solve six linear equations, for which a solution exists (since it can be recovered by Matlab). I am trying to reproduce it here. I have the following MWE: ...
1
vote
0answers
25 views

Wish to increase speed of MaximizeOverPermutationMH merit function

I am working with MaximizeOverPermutationMH (see Link to discussion about function and would like to optimize the execution speed of the merit function. This function accepts a 100-digit permutation ...
1
vote
0answers
19 views

How to minimize the eigenvalues of a hermitian matrix?

Suppose I have a complex hermitian matrix, M[x_,y_] whose eigenvalues must be real.I tried to minimize the first eigenvalue by writing following command:f[x_,y_]:=Eigenvalues[M[x,y]][[1]]; Minimize[f[...
1
vote
1answer
21 views

Numerical Maximization with Alternating Sum

I need to maximize a function that involves an alternating sum and a set of constraints. I have tried the following code: NMaximize[{(-1)^{m}*n!, n + m == 7, m > 0, n > 0}, {m, n}] However, the ...
0
votes
3answers
51 views

Optimizing with respect to the parameters of an optimization problem

I’ve got this simple loop that prints out the solutions to 2 simple equations for various values of parameters $a$ and $b$. I need to add a command that would display the parameter values that lead ...
0
votes
0answers
39 views

Analytic maximization that reduce fails to solve

I'm working on an interesting problem but stuck on a step that Mathematica fails on (no matter what angle I try to get at it from). I'm attempting to find the symbolic maximum of this convex function ...
5
votes
1answer
100 views

Matching spectral data to known spectral lines

Preamble: I designed some code to help me take spectral images from a spectrometer and convert pixel number into wavelength. It does reasonably well at matching a calibration spectrum of a neon lamp ...
11
votes
2answers
210 views

Custom SGD optimizer in Mathematica neural network framework?

I have a new approach to SGD optimizer, and thought to try to test it in Mathematica. It uses gradients to simultaneously maintain online parabola model for smarter choice of step size - I only need ...
0
votes
1answer
134 views

Solving a profit maximization with Cobb-Douglas production function

I'm considering a typical profit-maximization problem: \begin{equation} \label{optimization1} \begin{aligned} & \underset{K,L}{\text{max}} & & P Y - r K - w L \\ \end{aligned} \end{...
4
votes
1answer
72 views

Working examples for SemidefiniteOptimization

It appears to me that for some types of invocation, SemidefiniteOptimization is not working for matrices larger that 2x2. An example from help that works ...
6
votes
1answer
154 views

Assign Error bars for y-intercept

I have some data (x,y) with error bars in y direction: ...
2
votes
0answers
36 views
3
votes
2answers
144 views

Plotting maxima within a simplex

I am trying to draw a particular maximum plot within a simplex. I have functions based on two variables: Write p,q for the two variables where p,q \geq 0 and p + q \leq 1. This defines the simplex ...
4
votes
4answers
205 views

Find maximum according to a parameter

I am new to Mathematica. I want to find the maximum of the functions: ...
0
votes
1answer
54 views

Maximize a definite integral with constraints on the limits

I would like to maximize the following definite double integral with respect to $0<r<\frac{1}{2}$: $\int _0^{\frac{d}{1-r}}\int _{\frac{d+r x-x}{r}}^s [(1-r) x+r y -d]dydx$ under the ...
0
votes
1answer
40 views

Solving a specific equation in Mathematica & Finding the range of a value in an inequality

Is there any way to solve (or even approximate the value of x) the following equation in Mathematica? ...
13
votes
4answers
407 views

Optimization of function taking a permutation

I have a function $f$ which takes a permutation $P$ of the integers 1-100 in order to give a numerical value $f(x)$. The function is given by a black box, but is relatively "smooth", so should be ...
0
votes
0answers
71 views

Time spent on a transformation exceeded 300 when solving the optimization problem

I have the code which shows below to solve an optimization problem, but it will show that it's over the time constraint of 300 seconds. Is there anyone who could help me solve it. Thanks. ...
4
votes
3answers
112 views

Problem with minimization of $x^z$

I have plugged in the following problem Minimize[{x^z, z >= 1, z <= 10, x >= 1}, {x, z}] Can anyone explain please why the software does not provide the ...
2
votes
0answers
42 views

How to read and write the same text file in Parallelization using ParallelTable? [closed]

I want to know how to write and read a same text file (for example, external.txt ) without conflicts in parallelization. The following is just a small idea, but the problem is there seems a conflicts ...
1
vote
0answers
68 views

Optimization in Mathematica

I'm trying to solve the optimization problem below, but it seems like I don't get something about how the function works. Anyone see what is wrong? Would be happy to exchange for the newer ...
0
votes
0answers
74 views

Plotting a maximization of a definite integral

I am applying Alex Trounev's approach suggested in this post. It worked for the function in that post. But it is now not working for another, more complicated function. My objective function is $f=\...
0
votes
0answers
73 views

3D-plot of a maximization of a definite integral

I'm applying the answer (If method) suggested by 'ThatGravityGuy' in this post in a more complicated case. Consider my objective function (pardon its formidable ...
0
votes
0answers
71 views

Efficient Mathematica Code for List Problem

Say we are given $f(m,n)=m \pm 2n + (-1)^n$ where $m>0, n>0$, $m$ as well as $n$ are integers. The problem is to generate a list of all the integers that will not be found in the list of values ...
1
vote
1answer
62 views

3D Plot multiple maximization results in one same diagram

My objective function, $f(r,k;s,d)$, takes three different expressions, denoted by $f^1$, $f^2$, and $f^3$, respecitvely, depending on the conditions for the arguments and parameters as follows: $f^1(...
0
votes
1answer
62 views

3D Plot maximization results with varying parameter values

I'm trying to maximize the following objective function with respect to $r$ and $k$ $objF = \frac{d^3+3 d^2 (k (r-1)-s)+3 d \left(k^2 ((r-3) r+1)+2 k r s-2 (r-1) s^2\right)+k^3 (r ((r-1) r+3)-1)-3 k^...
1
vote
1answer
88 views

`Maximize` is running forever

I'm trying to maximize the following function $f$ with respect to $r$ and $k$: $f=\frac{d^3+3 d^2 (k (r-1)-s)+3 d \left(k^2 ((r-3) r+1)+2 k r s-2 (r-1) s^2\right)+k^3 (r ((r-1) r+3)-1)-3 k^2 r^2 s+3 (...
2
votes
1answer
121 views

Findminimum of Integral

I am trying to find the value of $u$ that minimizes the following expression: ...
1
vote
1answer
70 views

Transpose Error

I have this code: ...
0
votes
1answer
64 views
2
votes
1answer
59 views

PeakDetect Function Behavior and Parameters

I am currently using PeakDetect for a project, but I'm not sure how the sharpness parameter works. I can qualitatively tell what it's doing, but is there a more analytical/mathematical way to define ...
1
vote
1answer
85 views

How to pass lists as arguments in NMinimize or FindMinimum?

The following code runs in Mathematica 12. But, I have two problems that I would like to solve: (1) How to pass a list as an argument to the function g in such a way that it can be used seamlessly ...
0
votes
0answers
70 views

How would you write this set of linear programming problems as latex?

I am not able to make self understood over at Mathematics Stackexchange in this question. Therefore I ask here the Mathematica experts how to write these linear programming problems as latex, the ...
0
votes
1answer
42 views

Modifying/optimizing a double sum with an If condition

I would like to better understand double summations where one of the sums depends on the upper limit of the previous sum. This appears frequently in representation theory (to the extent of my ...
0
votes
1answer
81 views

Calculating the distance between two points and get direction [closed]

I am programming a molecular dynamics program with periodic boundary conditions. Here, I have a problem: I have a list of coordinates like ...
1
vote
1answer
37 views

Linear Programming using Maximize

I am trying to solve a more complicated version of the following LP problem: I have some constraint amounts a,b,c and two variables made of those amounts. I would like to find the best way to ...
2
votes
2answers
49 views

Piecewise function and deriving - solving

I'm working in a (Economics) problem where I want to add two concave (profit) functions in order to maximize them together through one variable (quantity). My problem is that one of the two functions ...
1
vote
2answers
160 views

NMaximize not always returning solution

This question is related to a previous question and answer here: NMinimize or NMaximize for a dynamic problem but tackles a different problem. I am trying to solve a simple linear quadratic ...
0
votes
1answer
44 views

ListPlot3D for optimization with varying parameter values

This is a followup question from Alex Trounev's answer to my question in the following post: 3D-Plot optimization results for varying parameter values Consider my objective function, objF: ...
1
vote
1answer
72 views

`Minimize` runs forever

I'm trying to minimize my object function, (1/(2 (-1 + r)) (d^2 + 2 d k (-1 + r) - 2 d s + k (k + k (-3 + r) r + 2 r s)))/s^2 with respect to $r$ and $k$ under ...
0
votes
1answer
28 views

Cloud deployed NArgMin does not obey constraints (but local evaluation does)

[Edited 20:02 for concision] Problem statement: NArgMin correctly obeys constraints when evaluating locally (on $Version = "11.3.0 for Mac OS X x86 (64-bit) (March ...
3
votes
0answers
96 views

Mathematica implementations of classical genetic algorithm optimization

Are there any Mathematica implementations of genetic algorithm optimization routines, including third-party and commercial? (DifferentialEvolution isn't quite what ...
0
votes
0answers
26 views

Can one force NMaximize to continue for a specified time?

So that it is not allowed to quit (for any optimization Method) before this time has elapsed.
1
vote
1answer
96 views

Given a function $f(t,s)$, compute $\max_{t_2\in [0,1]}\min_{t_1\in [0,1]} |f(t_1,s_1)-f(t_2,s_2)|$

Given a continuous and bounded function $f(t,s)$, $t,s\in[0,1]$, I would like to compute $$\max_{t_2\in [0,1]}\min_{t_1\in [0,1]} |f(t_1,s_1)-f(t_2,s_2)|,$$ for each numeric values of $s_1$ and $s_2$....
1
vote
2answers
59 views

NMaximize selects duplicate inputs and a problem with EvaluationMonitor

The aim of the following is to maximize 'penalty' and monitor it for convergence during the process: ...