Questions tagged [mathematical-optimization]
Questions on the optimization functions of Mathematica such as FindMinimum/FindMaximum, Minimize/Maximize, NMinimize/NMaximize, etc.
2,222
questions
2
votes
4
answers
115
views
Problem with Min and Max [closed]
s=min{max{0,a}, max{0,b}, 1/(1-a) max{0,1-a}}
is there any alternative way to make this more concise without condition and in one expression.
Condition is -infty<a<infty and -infty<b<1
2
votes
3
answers
285
views
How to solve this equation over the integers with Mathematica?
I try to solve with Mathematica 13.3.1 on Windows 10 the problem $$x^2+2^{x^2+1990}-y^2=2^{y^2+y}+y-1990\land x+y>1990,\, x\in \mathbb{Z},\,y\in \mathbb{Z}$$
which originates from Bauman Moscow ...
1
vote
2
answers
142
views
How to calculate the depth of the lake in mathematica?
I want to calculate mean depth of Goose lake (mean depth=4.6 m), I use bellow command for this operation, But this command is not automatic and we have to create the coordinates manually, and on the ...
0
votes
2
answers
106
views
Why can't NSolve find values that FindInstance can?
I am trying to solve for \[Epsilon], given three input paramters n, x and ...
1
vote
3
answers
121
views
Find the point with the largest slope change
I have a list of x-y data:
...
1
vote
1
answer
60
views
`FindMinimum` can't evaluate `Nearest` numerically
I'm trying to use Nearest as a function to minimize over: a toy example is
...
0
votes
2
answers
215
views
Finding a fixed point of function without a closed-form solution
I am trying to find a fixed point of a function that does not have a closed-form solution (it is the solution to a NMaximize problem). The following simplified problem, which would have an easy ...
3
votes
0
answers
127
views
How to estimate Lake area and volume in Mathematica?
I have a satellite image of the lake and I want to estimate its area and volume.
Actual volume:1.49*10e8 m^3
Actual Area:36.9 km^2
I did the following command to find the volume, but it is not very ...
0
votes
0
answers
71
views
How to extract shape from image in the Mathematica?
I have some satellite images for the lakes. How to extract the shape of the lake with maximum accuracy from the image?
0
votes
1
answer
37
views
I am trying to plot the function below, however, it does not seem to be working [closed]
Do you know what I am doing wrong? The image I put below shows the function I would like to plot.
3
votes
1
answer
97
views
Using GraphicsGrid for density plots with color scales
I would like to arrange the density plots in a certain order using GraphicsGrid. But when using GraphicsGrid, there is problem with the color scale, it doesn't display completely. How should ...
1
vote
1
answer
80
views
What are some ways to speed up calculations
Below is the code for calculating the eigenfunctions and eigenvalues of the following system:
$HC[u(\rho,z)]=-\frac{1}{2}\Delta u(\rho,z)-\frac{1}{\sqrt{\rho^2+z^2}}u(\rho,z)+\frac{B^2}{8}\rho^2 u(\...
1
vote
2
answers
258
views
How to find a densest configuration of several non-overlapping unit disks? [closed]
Let us consider three non-overlapping unit disks in the plane. I'd like to find
a configuration of these disks s.t. the area of the convex hull of these disks is smallest.
This is related to the ...
2
votes
1
answer
59
views
Plot several graphs of a function density distribution using Table
I would like to plot the density distribution graphs of the eigenfunction en[B][[2, 1]] when a parameter B is changed.
But the ...
0
votes
0
answers
57
views
ODE of HJB function
I want to solve the following ODE where W is a function of x. Any suggestion? Thank you!
...
1
vote
2
answers
147
views
How to do edge detection in Mathematica?
I have some pictures of water level and I want to do edge detection, I used the following command, but this command is vertical edge detection and I want horizontal edge detection and water level. ...
0
votes
1
answer
66
views
How to make a density plot for an isotropic function written in cylindrical coordinates?
$f(\rho,z)=2\rho^2+\frac{2}{3}z^2 \quad$ is a function in the cylindrical coordinate system $(\rho,\theta,z)$
The function $f(\rho,z)$ is isotropic because it does not depend on the angle $\theta$. ...
0
votes
1
answer
50
views
Using UnrankPermutation with Maximize
I want to try and use Maximize with UnrankPermutation to find Costas Arrays (or as close as possible) for a given length l with first two elements l, 1. A permutation array that maximizes the number ...
0
votes
0
answers
51
views
NMinimize or other means for mixed-integer problem with constrains
Given two real numbers 0 < x < 1/2, 0 < y < 1/2 and an integer n, harmonics are ...
3
votes
1
answer
209
views
Improve performance of Linear Optimization
EDIT
I am reframing the question here by pulling out the relevant part about linear optimization, you can find the original question and the entire code down below.
I am trying to increase the ...
0
votes
0
answers
69
views
Find knee by intersecting line method
I have an x-y data list. The data is here. It looks like below:
I want to mark the knee location. I mean I need to find the point of greatest slope change and get the x coordinate of this point. ...
2
votes
2
answers
124
views
0
votes
0
answers
32
views
What is the network structure of Ademxapp Model A1 Trained on Cityscapes Data in the Mathematica?
I want to implement the model (Ademxapp Model A1 Trained on Cityscapes Data) on my data for segmentation, so I need the partial structure of this model, can anyone help?
0
votes
0
answers
72
views
Maximize does not finish or does not work
I need to maximize the following expression over the two variables $d$ and $a$, in terms of the parameters $t, m, k$:
...
1
vote
0
answers
92
views
Trying to use Linear Optimization to solve inequalities
I am trying to use Mathematica to get bounds on some quantities using a certain procedure which is called conformal bootstrap. For the users who don't come with a background in HEP, I am basically ...
0
votes
1
answer
64
views
NMinimze cant find points that satisfy constraints
NMinimize cant find solutions for a function which clearly has one. Setting a working precision resulted in some output, however with error messages about tolerance and precision.
Heres my code. The ...
1
vote
0
answers
65
views
Numerical Error using compile
I'm trying to compile a function and I'm running into the following error
CompiledFunction::cfne : Numerical error encountered; proceeding with uncompiled evaluation.
I think I have succeeded in ...
2
votes
2
answers
91
views
Minimax problem where a combination of Minimize and Maximize gives no result at all
I rarely use Mathematica, but I usually do not have any problem with simple commands like Minimize or Maximize. I have find to ...
1
vote
3
answers
265
views
Finding maximum value of a function with parameter
How can I find the maximum value (and the corresponding $x$) of the following function with parameter $t$:
$$ f(x) = |x^2-tx + 2t|$$
on a closed interval $x\in[0,1]$?
I tried using ...
0
votes
2
answers
113
views
Finding the Minimum of a Four-Variable Function
Greetings esteemed colleagues. I had previously posted regarding the minimisation of a function using Mathematica, and colleagues were kind enough to provide some useful suggestions that proved quite ...
1
vote
0
answers
223
views
Help with code for impulsive optimal control problem
I am using Mathematica 13.3 to numerically solve/generate numerical plots for my impulsive control problem.
The optimal control problem is:
T is time from0 to T where T is the terminal time
K(t), B(t) ...
1
vote
0
answers
61
views
Finding the symbolic root of a non-linear function with fractional exponents
Define $f(x, a, t) = (x-t)^a - \frac{x^2}{2}$ where $x>0$ is the main variable of interest and $\alpha \in (0,1)$ is the parameter of curvature:
...
1
vote
1
answer
113
views
Finding the maximum of a non-linear function symbolically
I have the function $$f(x,\alpha) = x^\alpha - \frac{x^2}{2}$$ where $x>0$ is the main variable of interest and $\alpha \in (0,1)$ is the parameter of curvature:
...
0
votes
0
answers
48
views
Optimization problem with complex and real values
I have the following optimization problem:
$\underset{{{a}_{1}},...,{{a}_{m}}}{\mathop{\max }}\,\parallel \sum\limits_{n=1}^{N}{{{a}_{n}}}{{\varpi }_{n}}{{e}^{j{{\theta }_{n}}}}{{\varphi }_{n}}{{\...
-1
votes
1
answer
73
views
Calculate Fourier coefficients in optimization problem [closed]
I am using Differential Evolution optimization algorithm to estimate Fourier Coefficients to recover my objective function. In this case, coefficient samples are generated, and then the algorithm ...
2
votes
1
answer
28
views
Fitting a free parameter by matching a an array with another array
I have the following problem that I can't figure out how to solve.
I have two measured signals, (data1 and data1), and their measured sum (datasummeasured). I have a theoretical description of how the ...
3
votes
1
answer
171
views
Is it possible to ask Mathematica to obtain the function describing the upper and lower boundaries of a combinations of functions?
Assume that I have three one-variable non-periodic functions $f(x),g(x),h(x)$ for $x>0$. The question is: is it possible to ask Mathematica to obtain the function describing the upper and lower ...
2
votes
2
answers
1k
views
Why can't we find the minimum value of 2a+b?
Find the minimum value of 2a+b
In[27]:= Clear["Global`*"]
f[x_] = Abs[Log[x]]
Minimize[{2 a + b, f[a] == f[b], a > 0, b > 0, b > a}, {a, b}]
No ...
0
votes
0
answers
38
views
How to use Semidefinite Optimization for a problem?
What is this error message and how can I make this SemidefiniteOptimization work?
Also, is there an easier way to input my constraint in terms of each element ...
4
votes
2
answers
219
views
Efficient use of GatherBy on large list to remove duplicates
I have a large nested list of rules, wherein elements which have repeated entries on the LHS of the rules should be deleted. For instance
...
1
vote
0
answers
78
views
How to find the eigenvalues of a particle in the Coulomb field using NDEigensystem?
As advised in the previous two questions (Why, if I enter an angle into the function, then does the code not work correctly?, let us solve the problem for the Coulomb potential in spherical ...
1
vote
2
answers
150
views
NMinimize and NMaximize stopping evaluating for more complex conditions
I am trying to obtain the maximum and the minimum of (the negative of) a function F(R,P) given by
...
2
votes
0
answers
190
views
How to approximate an exponential series?
Consider the following expression
$$
y_j= \sum_{k=0}^{L} \frac{e^{-\sum_{i=-k}^k(k-|i|)x_{j+i}}-e^{-\sum_{i=-k}^k(k+1-|i|)x_{j+i}}}{\sum_{i=-k}^k x_{j+i}}\tag{1}
$$
for $1\leq j \leq L$. Given smooth ...
0
votes
0
answers
50
views
Eigenvalues and eigenfunctions of a parameter dependent system
There is the following system $H=-\frac{1}{2}\Delta-a\frac{1}{r}$, where a is a parameter. I'd like to find eigenvalues and eigenfunctions depending on the ...
0
votes
0
answers
53
views
How can NDSolveValue and ParametricNDSolveValue be used correctly to find eigenvalues and eigenfunctions?
NDEigensystem can be used to find the eigenvalues and eigenfunctions of the following system $H=-\frac{1}{2}\Delta-\frac{1}{r}$.
...
0
votes
0
answers
28
views
How to run QR decomposition inside NMinimize function?
I'm trying to optimize a custom function using NMinimize in Mathematica. The custom function contains QRDecomposition in it ...
0
votes
0
answers
115
views
NMaximize error: The function is value....is not a number
I cannot manage to solve this problem:
$$max_{p1,p2} \hspace{0.1cm} (p1 - w1) * \frac{\exp(beta*x1 - alpha*p1)}{1 + \exp(beta*x1 - alpha*p1) + exp(beta*x2 - alpha*p2)}$$
$$ + (p2 - w2) * \frac{exp(...
0
votes
0
answers
77
views
Solving a system of complex matrix equation using Reduce function
I am trying to solve a system of four matrix equations using Reduce function. The system arises in Quantum Information. The system is solvable with a solution i.e. phi, but the following code gives ...
1
vote
1
answer
66
views
Find minimum of integral with two variable terms
I wanted to see an approach to solving this problem with Mathematica: https://math.stackexchange.com/questions/4723531/how-would-you-attack-this-problem
Determine real numbers a and b so that the ...
0
votes
1
answer
100
views
ArgMax returns the input
I am new to Mathematica so I don't know if I am missing something.
I am trying to use ArgMax for a specific function I have, which includes ...