Questions tagged [mathematical-optimization]
Questions on the optimization functions of Mathematica such as FindMinimum/FindMaximum, Minimize/Maximize, NMinimize/NMaximize, etc.
2,018
questions
-3
votes
0
answers
69
views
Why is mathematica not as popular as python? [closed]
Just want to know which is a proper learning platform for practicing math and statistics.
0
votes
0
answers
44
views
What is the key difference between Mathematica and other logic computation program? [closed]
differences between Mathematica and MATLAB, Python, Java.
8
votes
1
answer
365
views
Is the stochastic gradient descent minimization implemented in Mathematica?
I want to use Stochastic Gradient Descent method on its own (not for neural networks) to minimize an objective function in Mathematica. I couldn't find any SGD routine implemented in Mathematica (12.0)...
0
votes
1
answer
57
views
Integro-differential equation with parameters
I am trying to solve an optimization problem with constraints that leads to the following integro-differential equation
...
0
votes
1
answer
64
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
19
views
How to play to Sound's sequences at the same time?
scaleHz[ff_, nr_] := Table[ff*2^(i/nr), {i, 0, nr}]
scale[fs_, d_] := Play[Sin[# 2 Pi t], {t, 0, d}] & /@ fs
ff = 440;
n1 = 12; n2 = 14; n3 = 16;
d1 = 1;
...
2
votes
0
answers
95
views
Placing shapes along a square spiral
Proposed code example is inspired by the main idea of this challenge.
Wolfram Language provides great opportunities in computational geometry.
But not all of them are equal in terms of speed and ...
0
votes
0
answers
44
views
Code not getting solved by NMaximize as 1/0 is encountred
I have the following code. This code requires to solve the model with two variables to optimize the function. a1 and a2 are the variables as shown in the code
...
2
votes
1
answer
85
views
Code running for longer period to evaluate
0I have the following code where I want to maximize a stochastic function based on two variables. The code is taking a very long time to evaluate but still not giving answers. Can anyone help?
...
0
votes
1
answer
64
views
Why, if you write the expression in the form of two functions, does the code stop working?
I would like to find the minimum of the function EER[a, v] using parallel computing.
If I write the code like this, it works:
...
1
vote
1
answer
84
views
Understanding the calculation of the periodic function $f(x)=x-x^3, \quad -1<x<1$
It is given the following periodic function
$$f(x)=x-x^3, \quad -1<x<1$$
This is an odd function, so the coefficients $a_n,a_0$ of the Fourier Series are zero.
Usually, I face function with two ...
3
votes
0
answers
79
views
Still bug in NMaximize
Executing in 13.2 on Windows 10
...
0
votes
1
answer
79
views
Maximization of a concave function with contraints in the arguments
I have been struggling on solving this problem. Suppose you have a function f(x, y) that is concave in x and y. I want to find (x, y) that maximize f(x, y) with x ...
2
votes
1
answer
112
views
Plotting a Stochastic function
I have a stochastic function and I tried to plot it in Mathematica
...
1
vote
3
answers
2k
views
11
votes
1
answer
142
views
Status of DualLinearProgramming
DualLinearProgramming is referenced in this tutorial
tutorial/ConstrainedOptimizationLinearProgramming
It exists in Mathematica ...
0
votes
1
answer
50
views
Fitting parameter to match a dataset to another dataset
I am using a Module which calculates 3D-data based on 5 parameters and another input dataset.
I'd like to fit the result of this modul to another set of data.
Since my code became very long I will ...
3
votes
2
answers
267
views
Can Mathematica resume the data that has been completely closed/quit?
Imagine that I run these four simple plots on a PC and then close and quit Mathematica, say the notebook file name is NOTE1
...
2
votes
1
answer
102
views
ImplicitRegion with parameters
My goal would be to run the following code:
...
0
votes
0
answers
60
views
What strategy would you adopt for this deep search on a function?
Ok, so I have a problem where I have a function that depends on 9 parameters and a bound condition
$$f(x,y,z,w,t,u,v,r,s)<K$$
Now all these variables take discrete values such as:
$$x \in \{x_1, ...
3
votes
1
answer
80
views
How to more efficiently code integer constraints in LinearOptimization and Maximize
I've written the following code and it works, but my code syntax is inefficient. This is a linear optimization with binary (0,1) integer constraints. Instead of writing each Ri as between 0 and 1 and ...
0
votes
0
answers
77
views
Maximization Problem
I am trying to find the solution of the following problem.
$ \max_{n_{\in [1,M]}} \frac{n \left(\frac{k (n-2 (\rho -1) \tau )}{\frac{k n (n-2 (\rho -1) \tau )}{2 (n+1)^2}+1}-2 \rho (\tau -1)\right)}{...
0
votes
2
answers
57
views
How do to create 3D plot for the argument from two another arguments for maximum of the function?
How do to create 3D plot of ${t_{opt}} = {f_2}\left( {x,y} \right)$, where ${t_{opt}}$ is corresponding to maximum value of ${f_1}\left( {x,y,t} \right)$ at the limited ranges of $x,y,t$? If $t$ ...
5
votes
2
answers
149
views
Routine to find all sets that are solution of a equation
So I have been wodering if Mathematica has any in-built function that would easily solve me these problem without manual search using for cycles that slow down the computation.
Let's imagine I have a ...
2
votes
1
answer
66
views
Numerical Optimization over arrays of variable length
Consider the following command line. We work in the n=2 dimensions, in the sense that I have an 'x' variable of dimension n=2, and n+1=3 variables y1, y2, y3 of dimension 2 each. I have hard coded as ...
3
votes
1
answer
94
views
Why doesn't FindInstance work with inequalities?
I'm trying to use FindInstance to find some simple counterexamples to the equality a^(1/n)+b^(1/n)=((a+b)^((1/n))) , with a, b and n integers. (Ex: a -> 9, b -&...
4
votes
1
answer
211
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:
...
2
votes
0
answers
77
views
Can I solve a system for a postive semidefinite variables?
I have the following system, where I want to find the solution set consisting of real, nonzero, symmetric positive semidefinite matrices $G$ and $DD$ such that the block matrix $X$ defined below is ...
2
votes
2
answers
110
views
Finding minimum of a symbolic function [closed]
Why does Mathematica fails to find the minima of the two variable function with real coefficients. The function and my attempt is given below.
Input:
...
1
vote
2
answers
185
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
76
views
Constrained total of rowwise maxima of a matrix
Suppose we have a matrix defined as follows:
$$x=\begin{bmatrix}
9 & 8 & 1\\
8 & 5 & 1\\
1 & 1 & 8\\
\end{bmatrix}$$
...
1
vote
1
answer
50
views
Convergence with Maximize - Iterations, Precision
I have problems with some applications for finding convergence - below is one example of failure for {x=0.35,y=0.35,z=0.3}, but it works fine for {x=0.3,y=0.3,z=0.4}.
How can I increase the iterations ...
7
votes
4
answers
202
views
Numerically determining the minimum/maximum distance between two ellipses
The smaller ellipse is contained within the larger one.
By 'minimum distance', I mean the distance that minimises;
Sqrt[(y1 - y2)^2 + (x1 - x2)^2]
By maximum, I ...
0
votes
0
answers
29
views
Nminimize output of ParametricNDSolveValue
I want to minimize the time a family of ODEs vanishes.
To do so, I'm using WhenEvent to extract the vanishing time and put the result inside Nminimize:
...
0
votes
1
answer
63
views
Solving an equation involving exponential function
I have an equation
$$ c \tan \left(\theta_{\mathrm{OPT}}\right)+\frac{a b A \exp \left(-b\left[\theta_{\mathrm{OPT}}-a\right]\right)}{\left[a \exp \left(-b\left[\theta_{\mathrm{OPT}}-a\right]\right)+1\...
1
vote
1
answer
53
views
LinearOptimization and Accuracy
Surprised to encounter the following issue in handling Accuracy with LinearOptimization:
...
0
votes
1
answer
146
views
Mathematica does not show anything after running for higher iterations
Consider a BVP: $y^{\prime\prime}=\frac{3}{2}y(t)^{2}$ with the boundary conditions $y(0)=4$ and $y(1)=1$. The exact solution is $y(t)=\frac{4}{(1+t)^{2}}$ and the initial guess is $y(t)=4-3t$. Now I ...
0
votes
1
answer
35
views
Creating Table/LaTeX with Extreme Points based on parameter values in a table
I would like to simulate extreme points and illustrate results with exogenous parameters and optimal values. I created the input table and table with the optimization problem for a simplified example.
...
1
vote
1
answer
159
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:= ...
2
votes
1
answer
147
views
In NMinimize, how to incorporate constraints on positive semidefiniteness of a matrix which is not the matrix variable being optimised?
The problem
I want to solve the following problem for symmetric matrix $X$:
$$
\begin{aligned}
\min_{X\succ 0} \; & -\log(\det(X)) & \\ \text{subject to} \; & \begin{pmatrix} X &...
0
votes
0
answers
48
views
Optimize the path length in a KaryTree
I have a engineering problem that I found suitable in formulating it in graphs. A source node supplies pressure or whatever. Each node (vertex) has two edges of a certain e.g. pressure loss...whatever....
1
vote
1
answer
59
views
Equality contraint violated with NMinimize
I am attempting to numerically optimize a function of only 2 parameters k, θ. There are two inequality constraints (1 each on k ...
0
votes
0
answers
30
views
Evaluation stops without output or error when using Nested Maximize
I am trying to evaluate a max max min problem. The code is as follows:
...
2
votes
1
answer
58
views
LinearOptimization thinks 0-1 ILP is an MLP
I try to solve this 0-1 integer linear program (maximize, thus the minus) with LinearOptimization:
...
1
vote
2
answers
103
views
NMinimize keeps returning Indeterminate for well defined function
I am attempting to numerically optimize a function of only 2 parameters k, \[Theta].
The function is well-defined and the constraints are simple. However, the ...
0
votes
2
answers
211
views
Why is the plot of low quality produced?
Stydying the modulus of continuity of $\sqrt x \log(x)$ in version 13.1
on Windows 10, I execute
...
2
votes
1
answer
219
views
Memory problem for maximizing a multivariable function
I need to maximize the following function. Unfortunately I have to maximize without using numerical methods to prove that the maximal value is 3Sqrt(2Sqrt(3)-3) (about 2.04375). I tried it twice (once ...
3
votes
2
answers
127
views
Interior point method for unconstrained problems
I was recently working on applying the FindMinimum function to $f(x)=(x+1)(x-1)$, and chose the interior point method as the 'method', which yielded $x=0$. I would like to better understand how the ...
0
votes
1
answer
60
views
Maximize and NMaximize in comparison
If on one hand:
N@Maximize[{Sqrt[y^2 - x^2], x + y^2 == 0 && 0 < y < 2 && -y < x < y}, {x, y}]
{0.5, {x -> -0.5, y -> 0.707107}}
...
2
votes
2
answers
265
views
How to solve this optimization problem?
Is there an effective method to solve the following optimization problem in Mathematica?
\begin{align*}
\min & \quad -t \\
\mathrm{s.t.} &\quad A \succeq 0,\,a=1
\end{align*}
I mean A is ...