Questions tagged [mathematical-optimization]
Questions on the optimization functions of Mathematica such as FindMinimum/FindMaximum, Minimize/Maximize, NMinimize/NMaximize, etc.
455
questions with no upvoted or accepted answers
1
vote
0
answers
65
views
Manipulate and Plot of Tangent Point in Optimization Problem with Kinked Constraint: Solve and PieceWise Problems
I'm trying to illustrate an optimization problem with a piecewise constraint creating a kink at the maximum value of T if n>0.
...
1
vote
0
answers
38
views
Minimization over Booles
I would like to set my domain of NMinimize so that my variables take values in {1,0}. I know I can use ...
1
vote
0
answers
53
views
Minimize doesn't work with more parameters
In the code I wrote there is a ParametricNDSolve with four parameters. I want to minimize an error function with Minimize. If I consider ParametricNDSolve with just one parameter everything works, and ...
1
vote
0
answers
59
views
Find parameter ranges of a function whose value is within a window by sampling points
Problem:
I want to find the ranges of the parameters for a function $f(x,y,z)$ when $0.9 < f(x,y,z) < 1.1$. All parameters are bounded $x , y, z \in [0,1]$. In the real problem the function ...
1
vote
0
answers
41
views
True global minima of 6 parameter rational function
I need to find the value and positions of the global minima of a 6 parameter rational function. My current try is something like
...
1
vote
0
answers
65
views
ArgMin returning unsolved solution
I have been trying to get the ArgMin function to work so that I can find the value of $s$ that minimizes this function:
$$
f(s)=e^{-sa}\left(pe^s+(1-p)\right)^n\style{font-family:inherit;}{\text{, ...
1
vote
0
answers
38
views
Find the (unique) 9-dimensional ellipsoid of maximum volume lying with the convex set of 4 x 4 symmetric, positive-definite (trace 1) matrices
Find the unique (JohnEllipsoid) maximum volume ellipsoid lying within the 9-dimensional convex set formed by the $4 \times 4$ symmetric, positive-definite ("density") matrices with fixed ...
1
vote
0
answers
235
views
Using Experimental`OptimizeExpression for expression optimization
I am trying to optimize the following expression (example only)
expr = Normal[Series[(1 - y - 2 z)^-2, {z, 0, 3}]]
whose output becomes
...
1
vote
0
answers
100
views
Maximize taking too long
I just started to use Mathematica a few weeks ago. I am afraid there is something that does not work on my laptop because, for the following simple command, it takes too much time. Do you know if ...
1
vote
0
answers
125
views
ArgMin Returning Indeterminate Values (Steepest Descent w/ Exact Line Search)
To learn Mathematica, I'm attempting to implement a basic steepest descent algorithm (i.e., Cauchy's gradient descent).
In an effort to improve upon previous code, I'm trying to implement an exact ...
1
vote
0
answers
98
views
NSolve cannot solve. 3 equations in 3 variables
I'm trying to numerically find the critical points of the following function in 3 variables
...
1
vote
0
answers
147
views
FindMaximum does not use requested WorkingPrecision
I think that there is a bug in the way FindMaximum handles WorkingPrecision for constrained problems.
Has anyone encountered a similar problem before? Is there a work around?
Here is an example in ...
1
vote
0
answers
45
views
Finding analytic expression with replacement rules
I have a function defined as
f[k_]:= Maximize[{(x^2/(1+x^2))((1-x^(2k))/(1+x^(2k+1)))^2, 0 <= x <= 1}, x]
I would like to find an analytic form of $f$ as a ...
1
vote
0
answers
68
views
Faster Way of Plotting a Multivariate Integral with No Closed Form and Maximized
I have a double integral that looks like this.
$$J=\int_0^2\int_{-2}^2 \sin(y\cdot B_z+z\cdot B_y+\phi_y+\phi_0)\,dy\,dz$$
$\phi_y$ I am defining as different functions of y, e.g. $\phi_y=0$, $\...
1
vote
0
answers
41
views
Why is FindMinimum trying negative numbers when I constraint the values to be positive reals?
This is a follow up to this question: How do I tell FindMinimum to only work with positive, real numbers?
Using a constraint for positive, real numbers, I have the following statement:
...
1
vote
0
answers
58
views
Alpha for Huber penalty in `Fit`
For the Fit function we can define NormFunction with Huber penalty.
...
1
vote
0
answers
31
views
Fitting Experimental Data To SRK-Type Equation of State. Minimization
I'm trying to find parameters to fit an EoS to saturation pressures to different temperatures.
My experimental data are like this
...
1
vote
0
answers
86
views
Mathematica 9 code won't work in Mathematica 12
It's just plain simple copy paste from this
here is my notebook
Hope someone can get right directions why output goes wrong after watershed was applied
1
vote
0
answers
72
views
Improving the fitting of model by NMinimize
I have written a code in mathematica for a simultaneous system of ordinary differential equations. Though the fitting is just ok, but I want to make it more accurate.
I am attaching my code here. ...
1
vote
0
answers
80
views
Find the maximum of the absolute value of diffrence of two functions
I would like to find the maximum of function difference[f_]in the frequency range $[{0.1,10^7}]$, where:
...
1
vote
0
answers
65
views
Minimal and maximal angular separation of two spheres as viewed from surface of third sphere
Short version: find the values of theta and phi that make overlapValue (defined below) maximal and the values of theta and phi that make it minimal, given that all other values are constants and ...
1
vote
0
answers
40
views
Time optimization of motion using mathematica
Let us say I have a double pendulum, with the torque equations and the initial and final poisition of the end point of the pendulum. I have constraints on the maximum and minimum values of torques. I ...
1
vote
0
answers
124
views
FindMinimum where variables are Integers
I wish to find the minimum of a function where the variables are integers. Here is a simple minimum working example (my actual function is much more complicated).
...
1
vote
0
answers
106
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
0
answers
29
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
0
answers
100
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 ...
1
vote
0
answers
28
views
Finding the positions of minima for a function with algebraic constants
I have a function of several variables:
inverse[Qx_, Qy_]:= T - 2 J + 4 J1 Cos[(Qx + Qy)/2 a] Cos[(Qx - Qy)/2 a] - 2 J2 Cos[(Qx - Qy) a] + 2 J3 Cos[(Qx + Qy) a]
...
1
vote
0
answers
79
views
Memory leak in simple program
I am trying to solve a simple optimization problem on the sphere, and for some reason, I got some memory leak that I am not able to solve. To decompose the problem in step, what I wan to do is
Take ...
1
vote
0
answers
73
views
Finding symbolic solution to constrained optimization question
The code below is my attempt to solve a constrained optimization problem:
...
1
vote
0
answers
82
views
Export system of inequalities in MPS format
I am interested in the .MPS format, usually used in Linear Programming problems (see here).
When importing a file in the .MPS ...
1
vote
0
answers
119
views
Help in minimizing a cumbersome function
I'm trying to minimize a function in order to find a slope critical heigth on a solope stability analisys. The functions taken from (Chen 1975) are the following:
I added all the equations to mma but ...
1
vote
0
answers
100
views
Integer linear programming can't find global minimum
I was working with Project Euler Problem 418 using Mathematica and got in trouble.
I wrote a function to find the unique factorization triple which minimizes c / a for integer n.
...
1
vote
0
answers
110
views
L1-norm optimization algorithm crashes kernel on large datasets
I have an A.X-B linear system which I have transformed into A.x-b to be solvable as a linear program using the code below:
...
1
vote
0
answers
52
views
Making a function $ f(n) $ tangential to another function $ g(n) $ by choosing appropriate constants
I have two functions $ f(n) = 1/(1+n) + b, (n \geq 0,b \geq 0) $ and $ g(n) = pn^2 + qn + r $. Assuming that I know the value of $ p, q $, and $ r $, I am trying to find a value for the constant $ b $ ...
1
vote
0
answers
44
views
Finding zero linear combinations of polynomials (numerically)
I have two functions of real variables defined on two compact spaces
...
1
vote
0
answers
46
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 ...
1
vote
0
answers
46
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
0
answers
156
views
Affine connection with torsion using xAct
I'm working with xAct and I need to obtain the affinne connection with torsion. Without torsion it is easy:
...
1
vote
0
answers
257
views
How to make NMinimize stop running when EvaluationMonitor gets stuck
I have a some optimisation problem (though gmmobjg is a bit complicated to reproduce it here, I've posted of git).
The code for optimization is:
...
1
vote
0
answers
37
views
How to analyse huge output from Reduce systematically?
I have a constrained optimization problem, looking for Nash equilibria. I use the KKT conditions programmed using Reduce to solve it. For the general case I get a very large output, with more than 100 ...
1
vote
0
answers
81
views
Speeding up a minimisation involving Numeric integral and Interpolating function
I am doing a minimisation procedure to obtain best fit parameters a,b,NN for a model involving a numeric integral and an interpolation function. The code as written ...
1
vote
0
answers
129
views
Plot the minimum of a function of two variables , where the minimum is taken with respect to just one variable
Suppose I have a function $f(x,y)$ of two variables $x$ and $y$. Suppose that: for each fixed $y$, the function $f(x,y)$ is non-zero, odd and periodic in $x$, with one maximum and one minimum in the ...
1
vote
0
answers
213
views
Error using NMinimize/NMaximize : The initial region specified may not contain any feasible points
Link : Reduce time taken to get feasible solution
An example of 18 non linear inequations with 4 variables is given in the image. But I have a set of 32 non linear inequations with 9 variables (I ...
1
vote
0
answers
72
views
Large Deviations on Mathematica
I am not an expert with Mathematica, and I really need your help.
I am trying to do some large deviation theory with Mathematica and I have to minimize a piecewise function.
How do I minimize a ...
1
vote
0
answers
177
views
How to check the positivity of a function depending on many variables?
Suppose we have some complicated function $f(x,y,z,v,u,w)$ with $\{x,y,z,v,u,w\} \in G$; precisely, each variable excepting one is defined in the sub-domain depending on other variables: $w \in G_{1}(...
1
vote
0
answers
98
views
Precision of LinearProgramming with irrationals from trigonometry
I am solving my problem with LinearProgramming. In certain cases, my coefficients that are fed into the function come from evaluating trigonometric functions, $\sin(...
1
vote
0
answers
285
views
How to find the extremals of the functional?
How to find the extremals of the functional by Wolfram Mathematica?
$$J(y(x))=\int_{0}^{1}\big(y(x)^3+y'(x)\big)dx$$
1
vote
0
answers
248
views
LinearProgramming function cannot find a feasible solution
I have got a specific LP optimization problem as attached picture.
Given a integer n and $\varepsilon,\ p \in (0,1)$, this is a LP optimization over 2n+3 variables. I am trying to solve this with ...
1
vote
0
answers
92
views
Using FindMinimum of a function imported via DefineDLLFunction
Mathematica newbie here, just used it today for the first time.
So I've successfully "imported" a function from a dll I've built (in C++ with VS), using .NET/LINK and DefineDLLFunction and I've ...
1
vote
0
answers
100
views
Using FindMaximum on one component of a vector-valued function
I've got a physics simulation that uses NDSolve and returns a vector-valued InterpolationFunction, by which I mean that the <...