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
3 votes
1 answer
246 views

My model has not finished evaluating in more than a day so can't test if it works, what is wrong with it?

Hello I have this modified monocentric city model that I have been working on for a while. Sorry for the long post, I wanted to add the whole code, because it's all connected. My suspicion is that it ...
user avatar
2 votes
1 answer
63 views

Local extrema points of a function of two variables

i need to find local extrema points of a function of two variables, but it doesnt work FindMaximum[x^3 - 2 y^3 - 3 x + 6 y, {x, y}] I have this error: ...
user avatar
  • 43
0 votes
1 answer
91 views

Finding local minimum of a 2D potential

I tried to find a local minimum point of a 2D potential U[\[Chi],\[CurlyPhi]] with both FindMinimum and ...
user avatar
  • 13
0 votes
0 answers
32 views

Norm adding up residual

For FindFit I want to have a norm that just sums up all residuals. For the sum of absolute values there is NormFunction -> (Norm[#, 1] &), but I don't know ...
user avatar
  • 77
7 votes
3 answers
564 views

How can I quickly find the coordinates of key points? [closed]

There are 1000 points in the space. The coordinates are (0,0,0) - (9,9,9). Any point can cover all points on the three straight lines (parallel to the X, Y and Z axes respectively) where this point is ...
user avatar
  • 107
1 vote
2 answers
151 views

Minimax / Minmax optimization

For the complex polynomial $$P_n(z) := 1+z+\frac{z^2}{2} + \sum_{j=3}^n \gamma_j z^j,\quad z \in \mathbb C.$$ I want to solve the following minimax/minmax optimization problem: $$\min_{\gamma_j} \max_{...
user avatar
  • 113
0 votes
0 answers
21 views

Issues with ConvexOptimization and SetPrecision

I am completely new to Mathematica (second day), so do not expect things to look polished. I am trying to perform a ConvexOptimization over a List/Array (dimensionality ...
user avatar
  • 113
3 votes
1 answer
1k views

Is there a faster way to solve this linear programming problem?

I need to get a rational solution of the linear constraints ...
user avatar
  • 51
2 votes
1 answer
77 views

Parametric minimization of a quadratic expression in two variables

I am not an expert in using Mathematica, and I do not understand the following result (apologies if it appears trivial). I want to find the general solution to minimize the following expression over $...
user avatar
0 votes
1 answer
46 views

Finding element selected in NMaximize[{Min[...], constraints},{vars}]

How can I determine which element of Min[] is being selected in a NMaximize[{Min[...], constraints},{vars}] problem? For example,...
user avatar
2 votes
1 answer
105 views

Weakness in Maximize

Solving a minimization problem in version 13 on Windows 10, I obtain ...
user avatar
  • 16.6k
1 vote
0 answers
34 views

When can you guarantee Minimize outputs the global minimum? [closed]

In the Minimize documentation, it's stated that "Minimize will return exact results if given exact input. With approximate input, it automatically calls NMinimize." What is an approximate ...
user avatar
3 votes
1 answer
80 views

Convex optimization of a least squares regularized objective function [closed]

Given, a vector of observations $\mathbf{y}=(y_1, y_2,\ldots,y_n)$ I am trying to find the soltuion to the following optimization problem: $$ \min{ (1/2) \|\mathbf{y-x}\|_2^2 + \lambda \|\mathbf{Dx}\|...
user avatar
2 votes
2 answers
135 views

Find the maximum value of the minimum eigenvalue of the matrix

There is a $4×4$ matrix $Q$ where $c,d,e,m,n$ are variables. How to get the maximum value of the minimum eigenvalue of $Q$? $Q=$ $$\\\left( \begin{array}{cccc} \frac{12058305}{23104}-304 c & -849 ...
user avatar
  • 51
0 votes
0 answers
87 views

Simplification of long trigonometric expression taking a long time

I have tried to Simplify as well as FullSimplify a long trigonometric expression to get a simplified form of the expression but it takes a very long time almost hours and sometimes it also shows error ...
user avatar
0 votes
0 answers
37 views

Selecting a set of points from a region to maximize the smallest pairwise distance

Suppose, we have a region (say, for simplicity, a unit cube) and a distance function that, given the coordinates of any two points in the region, calculates the distance between them. It is not simply ...
user avatar
1 vote
1 answer
126 views

How to numerically solve an equation

I would like to solve for $r_2$ the following two (independent) equations: $x_{Min}(a,b,c,r_1,F)=x_{Max}(a,b,c,r_2,F)$ (1) and $x_{Min}(a,b,c,r_2,F)=x_{Max}(a,b,c,r_1,F)$ (2) where $a$, $b$, $c$, $r_1$...
user avatar
2 votes
2 answers
77 views

Plot issue : put a legend instead of a top label

I have an issue about putting a legend consisted of a text and numerical value instead of a label. For example, with this command line : ...
user avatar
  • 35
1 vote
1 answer
53 views

Plot issue : bad label ordering with concatenation of strings

I have an issue about a label which is consisted of a variable name [Omega]BD and a numerical value associated. Firstly, I put the BD subscript to ...
user avatar
  • 35
1 vote
0 answers
65 views

Find Max Instance Over Permutations

I would like to find the maximum of some objective function over all possible permutations ...
user avatar
1 vote
1 answer
88 views

How to Plot 3D plot for optimized values in Mathematica

I have the following ODE from the paper https://sci-hub.hkvisa.net/10.1016/j.aml.2018.02.016 $y^{\prime\prime}(t)=-ay^{\prime m}(t)+y(t)(b y^{2}(t)-\frac{3}{2}y(t)+\frac{1}{2})$. The boundary ...
user avatar
  • 169
1 vote
1 answer
54 views

PlotMarkers in Mathematica with using an iteration scheme

I have the following operator $T:[0,1]\rightarrow[0,1]$ by $Tx=\frac{x}{2}$. I use the following method for two different initial point $x_{0}\in[0,1]$ as $x_{n+1}=Tx_{n}$ $n=0,1,2,3,...$ I have set ...
user avatar
  • 169
1 vote
1 answer
79 views

How to optimize the $L^{2}$ norm in Mathematica for an iteration scheme and How to plot its 3D graph?

Consider the BVP $y^{\prime\prime}(t)=\frac{3}{2}y(t)^{2}$ with boundary conditions $y(0)=4$ and $y(1)=1$. The initial iterate is in this case $x_{0}=4-3t$. The higher iterates are given by the ...
user avatar
  • 169
0 votes
0 answers
29 views

Minimizing and marginalizing in Mathematica

Suppose there is a chi-squared function of several parameters, f(x,y,z), and I have to fit one parameter, say "x", while the rest "y" and "z" have to be dealt with in a ...
user avatar
1 vote
2 answers
92 views

Please I need help to define a function of two variables (t,x)!

Let's define the following function: f[t_, x_] = t^2 + t*x*(1 - x) such that $x \in (0,1)$ and `$t \in (0,0.02)$ The problem is when I want to define the following ...
user avatar
0 votes
0 answers
58 views

Solve two equation by fixed point iteration method

I am tryin to reproduce the figure.2 of this paper. In order to obtain this plot, I need to find the global minimum of equation.(7) or equivalently solving two coupled equations of $\frac{\partial \...
user avatar
  • 1
1 vote
2 answers
80 views

How do I find the minimum and maximum values of a function of two variable with constraints? [closed]

The question is find the minima and maxima of the function $$f(x,y)= x^2+5y^2+11x-12y+30$$ on $(x^2)/81+(y^2)/49 \leq 1.$ I've been trying to use FindMaxValue and <...
user avatar
  • 85
0 votes
1 answer
38 views

Why do I get NMinimize::nrnum error?

I have this minimization program and although I've restricted my variables to be non negative, I get a nrnum error in the NMinimize step. I'm guessing this is what ...
user avatar
  • 541
0 votes
1 answer
45 views

Maximizing arbitrarily scaled step function

I am attempting to maximize a function dependent on a single variable (x) that contains multiple parameters. The case of a simply loaded beam with discontinuities in the loading. However so far I have ...
user avatar
3 votes
1 answer
66 views

Finding maximum of 2D interpolating function as a function of one of the variables

I am solving a 2D PDE in space and time b(r,t) and would like to find the maximum value of b in space as a function of time t. Using the solution for maximising a 1D interpolating function from here, ...
user avatar
0 votes
0 answers
46 views

Optimal command pipelining that maximizes total value in a given time duration

Consider I have two types of commands A and B which can be pipelined. Each of these types have a certain time duration and a value associated with it. For example, ...
user avatar
  • 4,683
3 votes
1 answer
103 views

Differences between minimization functions?

There's more than 20 functions having to do with minimization ...
user avatar
  • 2,638
0 votes
0 answers
55 views

Code Producing FindMinimum::nrnum; how do we fix it?

Suppose $A=\left\{\sqrt{m}:m\in\mathbb{N}\right\}$ and $S\subseteq A$: I wish to create a code which finds: $$\min\left\{c:\forall(d\in S)\exists(c\in A)\left(c/d\in A\right),\max(S)\le c \le \prod\...
user avatar
  • 199
0 votes
1 answer
112 views

Mathematica does not show anything after running for higher iterations

Consider a BVP: $y^{\prime\prime}=\frac{3}{2}y(t)^{2}$ with the boundary conditions $y(0)=4$ and $y(1)=1$. The exact solution is $y(t)=\frac{4}{(1+t)^{2}}$ and the initial guess is $y(t)=4-3t$. Now I ...
user avatar
  • 169
0 votes
0 answers
33 views

problem In NMinimize and large number of variables and constraints

I Try to solve TSP problem by writing the linear program of this problem (I know that FindShortestTour Function can solve it but I need to solve it manually), I generate the linear program correctly ...
user avatar
  • 73
1 vote
0 answers
37 views

Expressions using matrix variables in SemidefiniteOptimization

The SemidefiniteOptimization function allows one to specify the region for the optimization variable, such as in ...
user avatar
  • 11
0 votes
0 answers
51 views

extremum points

I'm trying to find Min and Max points of the polynomial below, but it seems that the expression is very complicated to mathematical, I've tried a numerical function, such as NMinimize, NRoots, Solve, ...
user avatar
  • 5
3 votes
1 answer
71 views

How do I use a FunctionCompile(d) function in FindMInimum

Suppose I would like to speed up the function in FindMinimum[function[variables],startingPoint] by compiling function I've constructed a minimal working example to describe what I would like to do. ...
user avatar
  • 2,068
0 votes
1 answer
68 views

How do I find the maxima of the function x+y such that x^2+y^2=1? [closed]

It is a simple question. I am trying to maximise x+y for coordinates {x,y} that lies on a circle of radius one. I tried using FindMaximum. ...
user avatar
0 votes
0 answers
19 views

Table of time-varing calculation slower to the point of kernel blowing up

There is a complicated function obtained by numerically solving a pde, let us call it $u(t,x,z)$. For this $u$, I want to calculate the global maximum of $u^2$ at a fixed position of $z$, and plot ...
user avatar
  • 43
1 vote
1 answer
155 views

Need to find a unique mathematical expression (not in documentation) that is as short as possible but takes a good amount of time to evaluate

I am writing a public ResourceFunction and I need a good clever use case that should not appear to emulate any examples in the official documentation but will ...
user avatar
  • 1,787
3 votes
2 answers
164 views

Easier way to find integers for complex^complex

If I have (a+b I)^(c+d I) and the result is e+f I a,b,c,d should be integers e >= 2 or e <= -2 f so close to zero as possible .. this is the object function I want to minimize How to do this in ...
user avatar
  • 33
0 votes
1 answer
98 views

Fitting data in a matrix

Consider the 'm' matrix: Link to 'matrix.dat': https://drive.google.com/drive/folders/1COdMCCBKq85vMDj6Jrb2qqoUlE9eTk6w?usp=sharing ...
user avatar
  • 939
3 votes
1 answer
167 views

Solve an equation

I have this equation in terms of x0 and I need to find x0 in terms of Theta . ...
user avatar
  • 61
10 votes
1 answer
126 views

Accumulate matrix elements

Consider the 'm' matrix: Link to 'matrix.dat': https://drive.google.com/drive/folders/1COdMCCBKq85vMDj6Jrb2qqoUlE9eTk6w?usp=sharing ...
user avatar
  • 939
0 votes
0 answers
49 views

Solving numerically Pdes and Odes and Iteration processes

Dears, I have the following equations: $x^{\prime\prime}(t)=\frac{3}{2}x(t)^{2}$ with $x(0)=4$ and $x(1)=1$. The exact solution is $x(t)=\frac{4}{(1+t)^{2}}$. Now the corresponding operator is $ Px=x+\...
user avatar
  • 169
2 votes
1 answer
68 views

It seems that ConvexOptimization does not attain the optimal value

I am trying to implement the concrete example of formula (11.20) Boyd & Vandenberghe, page 580. Therefore, we have computed a point that satisfies many (m − r) of the inequalities, i.e., we have ...
user avatar
  • 111
1 vote
1 answer
100 views

Correct code for 4th differential equation

How to code and solve the following equation in mathematica. d^2/dx^2(x^2d^2u/dx^2)+b^2u=0
user avatar
  • 21
0 votes
1 answer
42 views

How is Mathematica minimizing correlation exactly with linear constraints?

I made a random data matrix as data = Table[Random[], {i, 5}, {j, 5}]; In my case it was $$ \left( \begin{array}{ccccc} 0.951203 & 0.546669 & 0.86928 &...
user avatar
  • 1,028
1 vote
2 answers
99 views

How to get x and y values and function of xy pairs (H[x,y]) from Histogramlist?

So I have generated a set of random data points as shown below sample1 = RandomVariate[BinormalDistribution[{0, 0.4}, {1.2, 1.2}, 0], 250]; From the sample, I ...
user avatar

1
2 3 4 5
38