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
1 vote
2 answers
129 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. ...
Erfan's user avatar
  • 159
0 votes
1 answer
60 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$. ...
Mam Mam's user avatar
  • 1,753
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 ...
Eriek's user avatar
  • 817
0 votes
0 answers
48 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 ...
I.M.'s user avatar
  • 2,826
3 votes
1 answer
193 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 ...
Dotman's user avatar
  • 424
0 votes
0 answers
68 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. ...
Mr.2023's user avatar
  • 189
2 votes
2 answers
120 views

Using ParallelTable for assignment

...
Mam Mam's user avatar
  • 1,753
0 votes
0 answers
30 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?
Erfan's user avatar
  • 159
0 votes
0 answers
65 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$: ...
Penelope Benenati's user avatar
1 vote
0 answers
85 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 ...
QFTheorist's user avatar
0 votes
1 answer
54 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 ...
Dotman's user avatar
  • 424
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 ...
Dotman's user avatar
  • 424
2 votes
2 answers
90 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 ...
Penelope Benenati's user avatar
1 vote
3 answers
224 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 ...
csn899's user avatar
  • 2,905
0 votes
2 answers
96 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 ...
Hooman Puyandeh's user avatar
1 vote
0 answers
61 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) ...
Lynoure's user avatar
  • 11
1 vote
0 answers
60 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: ...
Gorkem Aksaray's user avatar
1 vote
1 answer
106 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: ...
Gorkem Aksaray's user avatar
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}}{{\...
mariamavr's user avatar
-1 votes
1 answer
68 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 ...
Cairo Martins's user avatar
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 ...
Niky177's user avatar
  • 21
3 votes
1 answer
168 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 ...
math2021's user avatar
  • 689
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 ...
csn899's user avatar
  • 2,905
0 votes
0 answers
26 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 ...
Saurabh Shringarpure's user avatar
4 votes
2 answers
215 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 ...
lackofgravitas's user avatar
1 vote
0 answers
72 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 ...
Mam Mam's user avatar
  • 1,753
1 vote
2 answers
144 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 ...
Gabriel Picanço's user avatar
2 votes
0 answers
186 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 ...
sam wolfe's user avatar
  • 4,179
0 votes
0 answers
47 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 ...
Mam Mam's user avatar
  • 1,753
0 votes
0 answers
49 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}$. ...
Mam Mam's user avatar
  • 1,753
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 ...
Yinghan's user avatar
0 votes
0 answers
106 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(...
Jakob's user avatar
  • 1
0 votes
0 answers
76 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 ...
Ruthless_Tornado's user avatar
1 vote
1 answer
59 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 ...
Moo's user avatar
  • 3,044
0 votes
1 answer
85 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 ...
hilarlia's user avatar
3 votes
1 answer
292 views

SVD decomposition with optimization

Let's suppose there is a matrix A nxn, which will be decomposed into SVD: where ui and vi are singular vectors composing matrix U and V. sigma is a vector that contains the eigenvalues. In ...
Cairo Martins's user avatar
0 votes
1 answer
88 views

How should a function written through the Module be written in the FindMinimum correctly?

There is a function that is written using a module ...
Mam Mam's user avatar
  • 1,753
1 vote
2 answers
107 views

Parameter Estimation on ODE Using NMinimize (Least Squares Method)

I'm trying to estimate the parameters in this equation using this code: ...
Malanie's user avatar
  • 11
1 vote
1 answer
52 views

What is the correct way to use FindMinimum with NDEigensystem?

I would like to find the minimum of a function dE[me_, mh_, e0_] using FindMinimum but Mathematica shows errors from ...
Mam Mam's user avatar
  • 1,753
2 votes
2 answers
138 views

Optimize parameters for differential equations

I have differential equations f11, f12, f21, and f22 with respect to t with parameters A and B. I've defined and solved these equations using NDSolve in Mathematica as follows: ...
Saesun Kim's user avatar
  • 1,780
1 vote
2 answers
105 views

Why mathematica Minimize function cannot handle Integers constraint in this case?

I am an electrical engineer and sudenly a problem of this form appear during my research For this kind of problem, Mathematica can work just fine. But as soon as I as the Integers option then I ...
Tuong Nguyen Minh's user avatar
-1 votes
1 answer
75 views

Finding the dimensions of the cylinder that can cover $n$ given smaller cylinders (based on empty space, not least materials)

Let $r_k$ and $h_k$ be, respectively, the radius and the height of the $k^\text{th}$ cylinder. We have $n$ cylinders. Let $R$ and $H$ be, respectively, the radius and the height of the big that can ...
Hussain-Alqatari's user avatar
1 vote
1 answer
112 views

Minimize is returning unevaluated for a simple positive integer domain problem [closed]

I don't understand why the following Minimize code is returning unevaluated. I believe I have it coded properly and the expected minimum is $x=14$ and $y=1$. <...
josh's user avatar
  • 2,340
4 votes
2 answers
192 views

Finding the sum of eigenvalues of a matrix depending on the parameters

There is a system that has the following Hamiltonian: $H=-\frac{1}{2}\Delta-\frac{1}{r}+\frac{B^2}{8}\rho^2-\frac{B}{2} (m + 2 m_s)$, where $r=(\rho,z,\phi), B=5, m=0, m_s=-1/2$. To find the ...
Mam Mam's user avatar
  • 1,753
0 votes
2 answers
86 views

How can I find the minimum value of an algebraic expression as a function of some parameters?

Minimize[ { (2 a (a^2 - c^2))/(a^2 - c^2 Cos[θ]^2), 0 <= θ < π, a > 0, c > 0, a > c }, {a, c, θ} ] // FullSimplify The expected result ...
csn899's user avatar
  • 2,905
0 votes
1 answer
168 views

Can I use WolframScript to solve this system of equations?

I have these three equations: ...
Lawton's user avatar
  • 103
1 vote
1 answer
71 views

FindMaximum is not working properly?

I'm trying to find maximum of the functions that I created by interpolating experimental data by using FindMaximum: ...
Филипп Цветков's user avatar
1 vote
1 answer
121 views

How to estimate whether the objective expression has a global minimum value?

I have an expression concerning $x$ as follows (from my friend). $f(x)=x^4-2 a d x^3-2 b d x^3-2 c d x^3-2 d x^3+a^2 d^2 x^2+b^2 d^2 x^2+c^2 d^2 x^2+4 a d^2 x^2+2 a b d^2 x^2+3 b d^2 x^2+2 a c d^2 x^2+...
licheng's user avatar
  • 2,005
2 votes
0 answers
108 views

Is FindShortestTour really exact? [closed]

I have read online that the FindShortestTour function on Mathematica uses the Concorde TSP solver, which is meant to provide exact solutions. However, I have been playing with this problem on my own, ...
slithy_tove's user avatar
0 votes
0 answers
57 views

How do we optimize the lowest eigenvalue of a symmetric matrix using NMinimize?

I am trying to diagonalize the symmetric matrix while optimizing the lowest eigenvalue subject to constraints. ...
user31694's user avatar
  • 189

1
2
3 4 5
44