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
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^...
2
votes
1answer
114 views

Findminimum of Integral

I am trying to find the value of $u$ that minimizes the following expression: ...
1
vote
1answer
86 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 (...
1
vote
1answer
67 views

Transpose Error

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

Find roots of a polynomial equation or simplify

I have an equation like below: ...
2
votes
1answer
56 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 ...
13
votes
4answers
398 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
67 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
41 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
65 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 ...
4
votes
3answers
110 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 ...
1
vote
1answer
35 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
40 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 ...
0
votes
1answer
42 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
71 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 ...
3
votes
0answers
84 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.
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 ...
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$....
2
votes
1answer
87 views

Simultaneous Equations and Optimization

I have the following simultaneous equations. $W=G[V](s+80)+(1-G[V])114$ $V=(1-F[W])(90-s)$ where $F$ and $G$ are cumulative distribution functions of $x$ and $y$. The variables of $x$ and $y$ are ...
1
vote
2answers
58 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: ...
2
votes
1answer
37 views

Error Training FeedForward Neural Network With Various Type of Variables

I built the following FeedForward NN ...
0
votes
0answers
41 views

Non-trivial feasible solution to unbounded linear programming problem

I have a linear programming problem that I know is either unbounded or the only feasible solution is the 0 vector (depending on input). In fact, it isn't strictly a linear programming problem since I ...
2
votes
1answer
61 views

ArgMin and NArgMin gives different result

Im doing the same problem with ArgMin and NArgMin, however NArgMin messes up the order of the solution. Given function: ...
1
vote
1answer
95 views

NonlinearModelFit returning imaginary numbers after fitting real data

I am getting problems when I try to use NonlinearModelFit to fit a squareroot-like function to a set of real data points. Here is the function: \begin{equation} \...
1
vote
2answers
156 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
0answers
45 views

Why are optimization variables exceeding their allowed regions?

In the optimization of a function, shown below, why are the variables xi, yi not adhering to their specified allowed regions {variable, 0, 5}? ...
1
vote
1answer
81 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 ...
1
vote
1answer
79 views

An optimization problem over two variables

I have the function fun[x_,y_, t_] = Cos[x] + Exp[I y] Sin[x] Sin[t]; such that $0\le {\rm x}\le \pi$, $0\le {\rm y}\le 2\pi$, and $0\le {\rm t} \le 10$. I compute ...
-2
votes
1answer
31 views
0
votes
0answers
34 views

RegionPlot with FindMaximum

I don't understand why each time I'm launching this computation Mathematica buggs and I get a message from Windows that the Kernel stopped working... I'm trying to get a map of where the value of ...
2
votes
2answers
84 views

Finding extremes in discrete data by the fastest code

everybody! I'm new and that's my first post. I have such a problem: need to extract from a matrix (with dimensions n x 2) such points which have second coordinate smaller than -500 or higher than 500....
1
vote
1answer
33 views

Constraints When Using NMinimize

I want to put in constraints like z.x1 >=1, z.x2 >= 1 where z, x1, x2 are vectors, but I do not want to list them out. ...
0
votes
0answers
35 views

Plotting results of NMinimize with respect to a parameter

I have some predefined function F[x], where x can be a 2D vector. I am doing the following: ...
3
votes
1answer
96 views

Minimum path on a rectangular prism

First of all, this is a fun question that I have seen from here. We have a rectangular prism with dimension $30\times12\times12$ cubic inches. Assume that there is an ant at the blue point 1 inch ...
0
votes
2answers
72 views

Parametric Find Maximum

I'd like to plot the maximum of a curve in function of a parameter. Meaning I looking for maxima that depend on a parameter. Here is what I tried to do but FindMaximum is not parametric, so it did ...
1
vote
1answer
63 views

How to disable symbolic preprocessing in NMinimize without performance loss?

I want to find a global minimum of a function which is defined only numerically and cannot be evaluated with symbolic arguments. For example, this could be a minimum of a compiled function. ...
1
vote
1answer
94 views

3D-Plot optimization results for varying parameter values

Before starting, FYI: This is a question related to 3D Plot the result of local Minimize with varying parameter values Consider my objective function, $objF$: ...
0
votes
0answers
106 views

Kuhn-Tucker Conditions Take Forever

I am trying to solve a Kuhn-Tucker constrained maximization problem. The variables of interest are d1,d2,dr and i. The other symbols are parameters which I have several restrictions for. It's an ...
0
votes
1answer
51 views

Nminimize seems not work

I have to adjust a set of experimental data to a relatively complex nonlinear model. For this example I do a simulation of the data with a simplified function: ...
0
votes
0answers
28 views

`Minimize` not working for general case

I'm trying to perform a minimization for an arbitrary natural number. If I enter a specific number, Mathematica performs the correct minimization. Am I specifying k ...
0
votes
1answer
105 views

NMinimize or NMaximize for a dynamic problem

I am trying to solve a relatively simple quadratic discrete time dynamic problem using NMinimize. My code works for short time horizons (T<15) but for T longer, it ends up taking minutes and for T>=...
1
vote
3answers
81 views

Plot maximum value of a function of three variables

Given a function f[\[Theta]_, \[Phi]_, t_] given by ...
0
votes
0answers
52 views

What's wrong with my NMinimize code with the definite constraints?

I have a problem with my NMinimize code, the answer based on the paper is Mu1 = 8 and Mu2 = 19,34 that's the optimal Mu1 and Mu2. But my answer is Mu1 = 5,17 and Mu2 = 17,17. The paper said "adopt the ...
0
votes
0answers
45 views

Maximizing an integral/Solving the associated Euler-Lagrange equation

Case 1 I have the following integral which I need to numerically maximize. Here $v = v(u)$. $$V = \int_{u_l}^{u_r} du\sqrt{\frac{4}{(1+uv)^2} \frac{(1-uv)^2}{(1+uv)^2}\frac{dv}{du}} $$ The ...
0
votes
2answers
35 views
0
votes
0answers
38 views

NMaximize with a variable ranging over permutations

I have an optimization problem where there are $n$ activities and I want to find an optimal schedule of those activities. The schedule is specified as $S=(\mathbf{t},p)$ where: $\mathbf{t}=\left(t_{...