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
6
votes
3answers
366 views

How to make Minimize with Sqrt calculate faster?

This code ran a long time without getting a result (v12.0 & v11.3) Minimize[{Sqrt[3 + x] + Sqrt[3 - x*y], x^2 + y^2 == 9}, {x, y}] But with $x=3\cos t,y=3\...
0
votes
0answers
44 views

Using Globally Convergent Newton's Method to solve for minimum of function [closed]

My goal is to write a function for the Globally Converging Newton's method to find the minimum of a function. It should stop when the derivative of it is less than 10^-6. This is what I have so far ...
0
votes
0answers
32 views

Linear programming problem(Not Hard) [closed]

Suppose there is a furniture retail store that buys products from suppliers. Four main items the store wants to buy as stock are chair, table, sofa, and closet, costing 500, 700, 600, 300, ...
-1
votes
0answers
35 views

smallest distance to place the capital? [migrated]

A country has four cities where should the capital be built. it is desirable that the sum of distances of the cities from the capital be as small as possible? how do i solve it ?
1
vote
1answer
53 views

Finding minimum for a function of four variables [closed]

I would like to find the min of the following function, -5 + 2 Sqrt[5] + 4 (5 - 3 Sqrt[5]) b^2 + Sqrt[2] (-1 + 2 b^2 - 2 a Sqrt[1 - a^2 - 2 b^2] Cos[ρ - ϛ]) for ...
0
votes
1answer
38 views

All positive integer points up to a certain distance from a hyperplane

I have the hyperplane $\sum_{i=1}^{d} x_i c_i = z$ for $x \in \mathbb{R}^d$, defined by the vector of postivive numerical coefficients $c_i \in \mathbb{R}, c_i > 0$, and the value $z > 0$. I ...
1
vote
1answer
20 views

cannot get EvaluationMonitor to output number of iterations taken to find a root

I was given the following problem: Consider the equation x = exp(-x2). Plot the two curves on the same plot to get a rough idea of the intersection point. Then use a built - in function (e.g. ...
3
votes
2answers
89 views
1
vote
2answers
96 views

Is a seven-dimensional constrained maximization problem too demanding for meaningful analysis?

I am interested in finding the maximum of a[1]^2 a[2]^2 a[3]^2 a[4]^2 a[5]^2 a[6]^2 a[7]^2 subject to the (entanglement) constraint ...
0
votes
1answer
73 views

Maximize a six-dimensional function subject to joint positive-semidefiniteness constraints

I want to maximize Abs[a1 b1] + Abs[a2 b2] + Abs[a3 b3] subject to the joint constraints ...
6
votes
4answers
339 views

How to use genetic algorithm to calculate the maximum value of this matrix

1-9 the 9 numbers are arranged into 3 * 3 matrix without repetition.How to select the matrix with the largest determinant value: ...
0
votes
1answer
67 views

Fitting different data sets with different models and 2 free variables using FindFit

I have a T1 equation from which I got two noisy datasets, one for y=0 (datax) and the other for x=0 (datay) (t is always equal to 1): ...
9
votes
2answers
423 views

ABC analysis in Mathematica

I would like to take a table with columns for the product name and total profit and segment it into three categories. Each category would have ~1/3 of the total profit (for all products). The first ...
1
vote
1answer
41 views

Plotting “Maximize” function takes long time!

In the following code, I am trying to plot the function GG[DM_] that contains Maximize problem as shown in Fig: where /omega_a and ...
2
votes
1answer
119 views

How to interpolate {{xi,yi},… ,{xn,yn}} with minimum bending energy?

Thin Plate Splines are explained here, and a Mathematica implementation of that for real samples { { x1, y2, z1 }, { x2, y2, z2 }, ... , { xn, yn, zn } } is ...
0
votes
1answer
46 views

Plotting NMinimize function

I want to plot the following NMinimize function: I used GGPlot = Plot[GG[DM], {DM, 0.02, 10}, PlotRange -> All] But I get nothing! My code is ...
1
vote
1answer
73 views

Issue with NMaxValue Constrained to an ImplicitRegion

I am trying to find the maximum (and minimum) value of an interpolated function constrained to an ImplictRegion with a (partly) curved boundary. I have followed the documentation carefully and tried ...
0
votes
0answers
35 views

How to compute Max function of the following form:

I knew that in Mathematica, the "Max" function yields the largest element of any of the lists, for example, Max[x,y,z,....]. How do I implement this function with Mathematica? and what does this ...
1
vote
0answers
39 views

Minimize with constraints on parameters does not stop running [closed]

I have the following simple optimization problem, but when I tried to put the values into Mathmatica, it does not stop running for hours. Actual problem is: $\qquad min_{x1, x2, x3} : a1\,x1 + a2\,...
0
votes
0answers
55 views

Optimizing a nested function in mathematica getting stuck at local maximum and giving wrong answer

I am trying to maximize this function over the value "p": ...
2
votes
1answer
37 views

Nested maximum function not working

I am trying to maximize a function which is itself a maximized function. For example, see the below. Can someone explain this error: ...
2
votes
0answers
39 views

ArgMax problem with Piecewise function

I'm having an issue with finding the maximizer of a very simple piecewise function. ...
1
vote
1answer
45 views

How to solve an optimization problem with multiple constraints? [closed]

I would like to minimize a function in four variables with respect to multiple constraints. $a+b+c+d\leq 1$ and $a, b, c, d \geq 0$, i.e. minimizing on the unit simplex in 4D. How do I incorporate ...
2
votes
1answer
54 views

Maximizing Output from ParametricNDSolve [closed]

Given a system of differential equations that are dependent on two parameters, such as the system below (the equation below is not that important, I am interested in a general procedure given a ...
2
votes
0answers
57 views

Multiple agents routing optimisation problem

We are given an array of nodes of the form {{xcoordinate,ycoordinate}, weight, "name"}. This represents nodes on a 2D euclidean coordinate system. Further, we are given a number n which is the number ...
6
votes
3answers
480 views

How to make the computation of a minimum efficient?

I have a $80\times 80$ matrix $A$ and a vector $P$ and I want to compute efficiently the following minimum $$ \min\{n\in \Bbb N :\|A^nP\|_\infty < 1\} $$ Then I defined my matrix and vector in ...
1
vote
1answer
78 views

Find (numerically) point where derivative is infinite

I have a function that is shown in the image, below. The point I am interested in extracting (numeric fine) is, in this case, 200. This appears to be the point at which one derivative is infinite. It ...
8
votes
1answer
303 views

Maximizing over a 1D region

Why does the following not compute? MaxValue[-y^2, y ∈ Interval[{-1, 1}]] I expect it to compute the maximum value of the funtion over the interval from -1 to 1 ...
1
vote
1answer
41 views

NDSolve with Events that reevaluate with different Discrete Variables

I have the following problem: I have a set of ODEs and some discrete variables which I can solve successfully. Now I want mathematica to check at every $0.1 \,t$ time step, wether it would increase ...
3
votes
2answers
206 views

Levenberg-Marquardt method for fitting

I have a model function: ...
4
votes
1answer
63 views

Using preconditioners efficiently

I am trying to numerically solve a linear system of equations of the form A x = a where A is really ill-conditioned and ...
6
votes
5answers
187 views

Maximizing efficiency of a power-tower (tetration) calculation

I'm working on a power tower $\displaystyle z^{z^{.^{.^{.}}}}$ and wish to maximize the efficiency of my algorithm to compute a cycle map. This is a color-coded diagram of the cycle period of each ...
0
votes
0answers
58 views

NDSolve with Functions Depending on time and time dependent Functions

EDIT: following the advice of using Raw Input Form, the equations have the following form ...
4
votes
1answer
55 views

Calculating the volume of a paraboloidal region

I have an inequality that defines a paraboloid. I would like to calculate the volume of the intersection of this paraboloid and a cylinder of radius R. ...
0
votes
2answers
95 views

Is it possible to minimize this function in Mathematica/wolframAlpha?

I want to minimize this function $f(x, y)=\left(n_{1}\right)\left(1-x(1-x)^{k_{1}}(1-y)^{k_{2}}\right)^{T}+\left(n_{2}\right)\left(1-y(1-x)^{k_{1}}(1-y)^{k_{2}}\right)^{T}$ Though it is a function in ...
7
votes
6answers
406 views

Finding a center and radius that minimizes total distance

I have a list of $d$-dimensional data points $x_i$, and I want to find a $d$-ball which minimizes the sum of the squares of distances between the surface of the ball and the points. In other words, I’...
0
votes
3answers
104 views

Find the minimum of an expression with multiple constraints

I need help to find a value for "d" which the expr has the minimum value at that "d" value. Constraints are added to the code ...
1
vote
0answers
56 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 ...
0
votes
3answers
88 views

Finding the maxima of a function of two variables

I am trying to understand how Mathematica finds the local maxima of a function of two variables, but I am a bit lost here. For example, consider: ...
1
vote
1answer
65 views

Minimization problem!

Im probably not seeing the obvious question but i want to minimize an expression like: Func[A_,B_,θ_,θ1_]:= A Cos[θ-θ1] + B Sin[θ]^2 where i do to minimize in ...
2
votes
2answers
100 views

How can I find the coefficients which minimize my non elementary integral?

I have the integral which I express in Mathematica code as: Integrate[ (-((x^2 (c + x^2 (b + a x^2)))/(m + x^2 (v + d x^2))) + Abs[x])^2, {x, -1, 1}] I ...
2
votes
2answers
111 views

Finding the global maximum of a function

I've the following code: ...
1
vote
1answer
53 views

How to interpolate a set of points with given local extrema?

I have a set of points on the 0xy plane: say (-3,0), (-2,4), (-1,0), (1,2), (3,0), (5,1), (6,0), (8,-2), (10,0) I would like to use software, like Mathematica, ...
2
votes
2answers
42 views

Maximise a function over real and complex parameters [closed]

I have the function f[b_x_] := Exp[-I b] Sin[I x], where $x$ is real and $b$ is complex. I want to maximise the function $f$ over $x$ and $b$, but it is ...
1
vote
2answers
65 views

Plotting only one piece of an implicit 3d surface (the one value of the order parameter wich minimizes some free energy function)

I would like to plot a graphic of spontaneous magnetization vs T vs h for a Curie Weiss Model. The equation for stationary ...
1
vote
1answer
55 views

Question for function FindMaximum

I need some advice on using the function FindMaximum as follows. I find the function y(x) from a differential equation as below, and then for each c and each xMax I have different solutions y(x) and ...
0
votes
0answers
47 views

Prime Number Generator using Sieve of Eratosthenes

I was trying to apply the Sieve of Eratosthenes to find the prime numbers within the range of 100. I understand that Mathematica has a built in procedure to find prime numbers, but I was trying to ...
2
votes
0answers
26 views

NMinimize : Finding which method was used [duplicate]

Is it possible to find out which method Mathematica used when using the NMinimize method? Ie, either Nelder-Mead, differential evolution, etc... Thanks.
1
vote
1answer
38 views

Problem when using NMinimize in a RecurrenceTable

I have a problem when I'm trying to use NMinimize in my RecurrenceTable, like in this example : ...

1 2 3 4 5 28