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
28 views

I want to obtain the minimum vale of this expression with the given constraints

I am interested in finding the minimum value of the expression in the R.H.S. below $d\leq \frac{1}{6} \left(4 \sqrt{a^2 \sin ^2(x)}+b \left(-\sqrt{3} \sin (j-2 x)+\cos (j-2 x)+2 \cos (j)\right)+c \...
0
votes
0answers
20 views

Minimizing a function and plot it

I have a long expression, depended on 3 different variables say "a", "b" and "p". Just as an example, a part of this expression is: z = p * Cos[x] * Sin[y]. I'm going to ...
4
votes
1answer
109 views

How to minimize that expression in four variables?

I mean $\sqrt{w^2+(21-x)^2}+\sqrt{(20-w)^2+z^2}+\sqrt{x^2+(20-y)^2}+\sqrt{y^2+(21-z)^2}.$ The command ...
0
votes
1answer
40 views

Problem with the continuous equivalent of Newton's method optimization

In the article Fixed-Time Stable Gradient Flows: Applications to Continuous-Time Optimization I found an interesting formula and its properties. The screenshot of the page from the article I was led ...
7
votes
1answer
152 views

Stopping condition for FindMinimum / FindMaximum

This seems like it should be a simple question -- but I am looking to use a "home made" stopping condition with FindMaximum, while evaluating a very complex function. Printing out the ...
0
votes
0answers
31 views

can not replace when use ctrl+f

I have a very long output, therefore, I want to find and replace some repeated expressions with abbreviations using crtl +f in Mathematica. when I enter expressions, the mathematical can find it and ...
0
votes
1answer
48 views

Finding local maxima on a ListPlot graph

Suppose I plot two columns of data from an ASCII file using the ListPlot function. Now, how can I obtain the coordinates of local maxima of the curve such that the maxima are greater than some lower ...
0
votes
1answer
26 views

Maximize returns unevaluated even though there is a global maximum

I was trying to calculate the maximum of a gaussian plus a line, but Maximize return unevaluated: ...
0
votes
1answer
122 views

Find a “ridge line” from a set of irregularly spaced points

I'm solvind a slope stability problem whith the finite element method. As an output I get the square root of the second deviatoric invariant of the plastic deformation, which indicates the failure ...
0
votes
0answers
43 views

How to resolve these errors that pop up when using 'Compile' for a large function? [duplicate]

The problem I have been wanting to make my code which solves an optimisation problem faster. This led to this question on here and I realised from there that the root of the problem is the very slow <...
3
votes
4answers
168 views

Code to solve quadratically constrained quadratic optimisation problem using FindMinimum is very slow. How do I make it faster?

The problem I have a quadratically constrained quadratic optimisation problem (QCQP) which takes about 13 seconds to find the optimal solution. I want to iteratively optimise a large number of times (...
1
vote
1answer
56 views

constraint minimization; 3 body problem

In my Monte Carlo simulations, hard particles aggregate into sets of triple particles due to the energy minimization. The particles cannot overlap, but they touch at the minimum of the energy. The ...
0
votes
1answer
60 views

How to solve two implicit functions with two variables and parameters

I have two functions given as; u[c_,d_] := Sinh[a b^2 c^2 + 3a b d] and v[c_,d_] := Log[a b^2 c^2 + 3a b d + d^2] - d. I want ...
0
votes
0answers
27 views

NMinimize sum of several fitted results

I have 10 data sets and assume them a same parameter, offset in the CorrelationFit function. I would like to minimize the ...
3
votes
2answers
88 views

Syntax error in NMaximize despite following official documentation

This is the code I'm trying to run: ...
1
vote
1answer
89 views

How to find the intersection points of two 3D surfaces in Mathematica?

I have two equations consisting of two variables and I'm plotting those two functions in 3D by defining the range of the two variables. I need to find the points of intersection of these two functions....
2
votes
0answers
47 views

Maximize a function over complexes

Assume that I have a bounded real valued function $h(a,b)$ such that $a\in \mathbb{C}$ and $b\in [0,1]$. Can Mathematica maximize such function over $\mathbb{C}\times [0,1]$? I tried some functions ...
0
votes
0answers
26 views

Finding points of intersections between contours and mesh functions in ContourPlot3D

I have this code example that finds plane of zero first derivatives - the intersections of these planes will give the locations of the local extrema. Or at least a good starting point to finding them. ...
2
votes
1answer
41 views

In NMinimize, how to incorporate constraints on positive semidefiniteness of a matrix which is not the matrix variable being optimised?

The problem I want to solve the following problem for symmetric matrix $X$: $$ \begin{aligned} \min_{X\succ 0} \; & -\log(\det(X)) & \\ \text{subject to} \; & \begin{pmatrix} X &...
0
votes
1answer
54 views

Using ContourPlot3D to fine the local extrema of a 3D function

This answer shows a neat way of using ContourPlot and MeshFunctions to find the local extrema of a 2D function: the ...
1
vote
1answer
106 views

How to efficiently replace the repetitive sequence?

The problem is how to determine the repetitive sequences and replace the part with consecutive sequences For example: A={{1,3,4},{2,3,5},{1,6}} Then, detect there ...
3
votes
1answer
124 views

Optimal triangle (minimal area) surrounding a disk

Using RegionWithin it's quite easy to evaluate a parametric triangle with maximal area inside the disk(constant): ...
1
vote
1answer
43 views

NMaximize seems not to work with a plottable function

I am trying to use maximum likelihood for estimating a parameter for a model based on some experimental data. The likelihood function I am trying to maximize calls a number of custom functions I have ...
0
votes
0answers
30 views

Assume some expression is false

I need to Reduce a complicated function and I want to exclude some conditions A and B. How do I assume that the expression A is ...
3
votes
2answers
155 views

Stationary solution of PDE and eigenvalues

I need to find the eigenvalues of the stationary solution ($\dot{u}=0$) of the following PDE $ \dot{u}=-d u + (d-2)x u'-v(d)L_{d}^{1}(u'+2x u'') $ with $ L_{d}^{n}(f)=\int_0^\infty dy~y^{-1+d/2}\left(\...
4
votes
0answers
52 views

Is there a better way to simulate quadratic cost MPC problems?

Question I would like to know if there is a more straightforward or a better way to simulate MPC problems in terms of code length and accuracy as compared to what I am doing. I am looking to know if ...
1
vote
1answer
58 views

How to show all global minimizers?

This is a follow-up to this question and I'm aware of this question for the local minimizers case. Consider, for $0\leq \epsilon\leq 1$ and $0<q,p<1$, the function $$ \begin{align} f(\...
2
votes
1answer
75 views

Numerical Minimization for a function of five variables [closed]

I have the function f[w_,x_,y_, α_,g_]=Sqrt[((w^2 + x^4) (1 + 2 w α^2 + α^4))/( 2 x^2 w) - α^2 y]*Sqrt[((g w)^2/x^2) + (2 x^2)/w + (2 w (g α - 1 )^2)/x^2] with ...
3
votes
0answers
73 views

Finding multiple minimizers

Is it possible to find all (or as many as possible) minimizers of a given function? For example, minimizing the function $\cos(\pi(p-q))+\cos(\pi(q+p))$ for $-3\leq p,q\leq 3 $ can be done using ...
0
votes
1answer
70 views

Why does FindDistributionParameters[] fail to converge for this distribution? [closed]

During testing my code for calculate parameters The following exception is thrown: ...
2
votes
2answers
130 views

Minimization using NMinimize

I have a system of ODEs say $$x'(t)=2 x(t)-x(t)y(t)-3 x(t) g(t),$$ $$y'(t)= y(t)-2 x(t)y(t)- x(t) g(t)$$ with ICs $x(0)= 1, y(0)=1/2$, say, for $t_0 \leqslant t \leqslant t_f$, where $t_0$ and $t_f$ ...
1
vote
1answer
55 views

Finding the joint domain for a couple of functions of three variables

I have two functions $f_{1}(x,y,z)$ and $f_{2}(x,y,z)$ defined respectively as ...
0
votes
1answer
66 views

FindMaximum works on desktop but not on laptop [closed]

I have a simple code to find maximum as follows. ...
1
vote
1answer
28 views

Avoid “Initial points not satisfying constraint”

I have this maximization problem which works for many examples I run before I made the For loops. ...
2
votes
1answer
59 views

Minimize Number of Boolean Formulas that Evaluate to True

I'm interested in a MinSat variant: given a list of boolean formulas like ...
3
votes
1answer
76 views

Minimization of constrained variable [closed]

I am trying to perform a minimization of a variable but NMinimize[] does not seems what I need (it minimize a function, but my variable is inside a function) I want to minimize "h" with ...
2
votes
1answer
63 views

How to set linear constraints on elements of a long list

I would like to minimize over quite large set of $a_i$ some function $f(a_1,a_2,\dots,a_n)$ subject to a set of $k$ linear constraints: $$ i=1\dots n: \quad a_i\ge0;\quad j=1\dots k:\quad\sum_{i=1}^n ...
0
votes
0answers
39 views

Can Mathematica solve matrix-based parametric (convex or semidefinite) constrained optimization problems?

I have gone through Mathematica's documentation and guides on ConvexOptimization, ParametricConvexOptimization and SemidefiniteOptimization. I am also running the latest version of Mathematica. The ...
0
votes
1answer
72 views

How to create a set (of matrices) which will be used as an finite group to minimize a function?

I'm new here so I'm a little lost. I need to minimize a function considering that the minimizing parameter belongs to a preestablished set. It all involves matrices.It's something like this: Where ...
1
vote
2answers
54 views

Why can't I define a function using the Minimization function in Mathematica?

Suppose I define a function in this way: function[x_,y_]=Minimize[E^(x^2 + y^2 + z^2 + w^2 + x*y + x*z + x*w + y*z + y*w + z*w), {z,w}] The output in Mathematica ...
0
votes
0answers
24 views

NArgMin with Root functions

I'm trying to minimize an error function sumt to find some parameters S, s0, si : ...
0
votes
0answers
35 views

NMinimize - Strange “function value is not a number” error

I am seeing strange behaviour in some code I have written that uses NMaxmimize. Here is a minimal working example: ...
2
votes
2answers
84 views

Minimization problem in proving Fermat's principle

I am trying to prove the Fermat's Principle of least distance, the problem statement goes: ...
0
votes
0answers
34 views

Fit, NIntegrate in FindRoot results in non-numerical values

I'm trying to find certain values of q for which the derivative of the following function is equal to zero: ...
0
votes
1answer
31 views

Parametric Maximization of a function with indicator function

How is it possible to determine the maximum and maximizer of the following function? where I(x>0) = 1 if x>0, otherwise 0 ...
3
votes
3answers
128 views

How should i write the code to minimize this function?

I am not a mathematica user. I need to find the solution to a given problem, which we already described there for theoretical analysis. I'll rewrite here the problem: Let $\mathbf a = (a_1,...,a_d)$ ...
1
vote
0answers
40 views

Symbolically solving linear program [closed]

I have been surprised that Mathematica cannot solve a linear program. Specifically, I have tried to solve the following problem: ...
1
vote
0answers
43 views

Numerical Optimization with analytically unsolvable constraints

,Im working alreade quite long on a constrained numerical optimization problem. I want to numerically maximize a function lets call it ...
0
votes
0answers
38 views

NMinimize subject to many complicated conditions not obbeying imposed equation

This question derives from (and refers to) this one asked by me, and I hope that creating a new question rather than editing that one is appropriate. There I ask for a way to find the subset of the ...

1
2 3 4 5
34