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
0answers
50 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 ...
0
votes
0answers
67 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 ...
0
votes
0answers
26 views

Minimization in a fitting [closed]

I have minimized a function and got the best fit value of two unknown parameters. I want to show these minimized value graphically. In documentation of mathematica this type of graph is found only in ...
2
votes
1answer
101 views

Findminimum of Integral

I am trying to find the value of $u$ that minimizes the following expression: ...
1
vote
1answer
57 views

Transpose Error

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

Find roots of a polynomial equation or simplify

I have an equation like below: ...
0
votes
0answers
28 views

Is it possible to create procedural lossless data compression? [closed]

Is it mathematically feasible to work on a recursive algorithm that, given a formulae, entry values, and number of rounds, could generate the very binary representation of a given file? So instead of ...
2
votes
1answer
42 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 ...
10
votes
4answers
313 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 ...
1
vote
0answers
55 views

How do I find the function that is perfectly between y = x^2 and y = x? [migrated]

At first, I thought it was as simple as taking both functions adding them together then dividing by two, but this is not the case for what I am looking for. Here is a plot of the following: ...
0
votes
0answers
60 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
33 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
48 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 ...
1
vote
1answer
68 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 analytical solution? Clearly NMinimize is ...
1
vote
1answer
30 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
37 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
37 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
56 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 ...
2
votes
0answers
53 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
27 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
89 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
79 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
57 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: ...
1
vote
1answer
25 views

Error Training FeedForward Neural Network With Various Type of Variables

I built the following FeedForward NN ...
0
votes
0answers
26 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
56 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
87 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
148 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
73 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
77 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
30 views
0
votes
0answers
31 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
82 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
31 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
33 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
90 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
57 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
49 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
86 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
79 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
47 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
24 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
99 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
70 views

Plot maximum value of a function of three variables

Given a function f[\[Theta]_, \[Phi]_, t_] given by ...
0
votes
0answers
50 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
39 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
34 views
0
votes
0answers
35 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_{...