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
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
91 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
83 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: ...
1
vote
1answer
27 views

Error Training FeedForward Neural Network With Various Type of Variables

I built the following FeedForward NN ...
0
votes
0answers
36 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
59 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
91 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
151 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
76 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
31 views
0
votes
0answers
33 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
32 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
92 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
61 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
54 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
91 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
89 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
48 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
25 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
102 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
76 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
40 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
37 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_{...
2
votes
1answer
35 views

Using Maximize with LABColor

I'm writing a function that, given a color, returns a contrasting color. It does this by maximizing the ColorDistance between the input and output colors. However,...
6
votes
0answers
77 views

Caveats of LinearProgramming on Integers domain

When using LinearProgramming with the Integers domain, Mathematica issues the following warning: ...
0
votes
1answer
30 views

The parameters returned by NMinimize don't correspond to the minimum returned

I'm trying to use NMinimize to solve a puzzle. Some of the code is below... ...
0
votes
1answer
90 views

Problems Minimizing a Function

I need to minimize a function, but it takes a long time. So I don't know if it's normal or if there's something wrong with my model. ...
0
votes
1answer
40 views

`Maximize` does not return any result, but simply reproduce the code

I'm working with Maximize and it does not generate any result but simply reproduces the same code. My object function is rather complex which is: $0.18 k-0.36 + \...
1
vote
1answer
30 views

Mapping the FindMinimum function over a matrix

I'm quite new to Mathematica and so still trying to work out how to use some of its syntax and functions. I have a function for the free energy of a generic system with two order parameters. I am then ...
-1
votes
1answer
39 views

GlobalSearch function

its seems I cannot run global optimization functions (GlobalSearch,GlobalPenaltyFn); The output is just a reproduction of input In[] = GlobalSearch[(x - 1.3)^2 + (y - 1.5)^2, {-x + 1, -y + 1}, {x -...
1
vote
0answers
26 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] ...
0
votes
1answer
56 views

Method for constrained NonlinearModelFit with NDSolve

I'm trying to fit some data with a system of differential equations : ...
0
votes
0answers
78 views

Clebsch Gordan coefficients

I'm trying to compute various sums which contain some CG coefficients, where the sum runs over the indexes m1,m2,m corresponding to each of the three angular momenta j1,j2,j. The thing is that when I ...
0
votes
1answer
82 views

Problem with solve

I need to solve this function, but I cannot copy mathematical function, so I display in picture, sorry ...
1
vote
0answers
70 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 ...
2
votes
0answers
46 views

How do I use NMinimize to solve equations obtained using NIntegrate? [duplicate]

I wish to minimize following equation with respect to variables $h,p,q,t$: $\qquad f(h,p,q,t)=\int_0^1 \int_0^1 \frac{dx\,dy}{\sqrt{h^2+x^2+y^2-2\,x\,y\space cos(p)+2\,h\,y\,cos(q)-2\,h\,x\,cos(t)}}$....
0
votes
1answer
97 views

What is wrong with my NMinimize code? [closed]

I don't know how to write the code to find Mu1 and Mu2. Can you help me Please?. This is what I tried.
0
votes
2answers
41 views

Unable to find maximum value of my custom function

myfunn[x_, y_] := Module[{}, If[x < 5, Return[0]]; If[x < 10, Return[2]]; x*y]; I'm unable to find the maximum value of this function over the ...
0
votes
4answers
150 views

How can I solve this transcendental equation in Mathematica?

I want to solve the following equation $\frac{Sin[a[x]]}{a[x]}$ - x = 0, for x in range {0,1}. I tried the FindRoot method but it gives only one root. I want to find the roots for this equation for ...
0
votes
2answers
105 views

How to find maximum from list or table

I have some result in list form and after I build the graph I have: As you can see on the graph there is a spurious peak at the beginning. So when I tried to find maximum peak, I receive value of ...
1
vote
1answer
77 views

How do I separate all local maxima and local minima of my function?

This question (and the first answer in particular), teaches us how to find all the local maxima and minima of a function. My question is: how can I separate the maxima from the minima? My goal is to ...
1
vote
0answers
44 views

Finding symbolic solution to constrained optimization question

The code below is my attempt to solve a constrained optimization problem: ...
0
votes
2answers
164 views

How to find this global minimum?

This is a problem from a Russian school math olympiad: Minimize[(5 x^2 + 8 x*y + 5 y^2 - 14 x - 10 y + 30)/(4 - x^2 - 10 x*y - 25 y^2)^(7/2), {x, y}] The above ...