Questions tagged [mathematical-optimization]
Questions on the optimization functions of Mathematica such as FindMinimum/FindMaximum, Minimize/Maximize, NMinimize/NMaximize, etc.
2,159
questions
3
votes
5
answers
460
views
How to find the maximum value of this trigonometric function?
The known conditions are:
Sin[2 α + β] ==
2 Sin[β], 0 < α < π/2, 0 < β < π/2
Find the maximum value of Tan [β]
<...
0
votes
1
answer
42
views
Plot boundaries of a multivariable function projected in 1d
Suppose I have a function f[x,y,z,w] and all the variables are constrained in the region [-1,1]. Now, I want to plot this ...
1
vote
0
answers
43
views
Finding an optimal orientation and the oriented diameter of a given graph
I am wanting to specify a graph (a collection of vertices and edges) and find the optimal orientation of that graph.
An orientation of an undirected graph is an assignment of a direction to its every ...
1
vote
1
answer
77
views
Optimal basis set of Gaussian functions for describing a quantum system (part 2)
It's a part 2 of this question Optimal basis set of Gaussian functions for describing a quantum system (part 1)
There, the answer was given to a question related to finding geometric progressions of ...
0
votes
0
answers
83
views
Error in numerical integration using Wolfram Mathematica
I hope you are doing well.
I am having serious problems while calculating a numerical integral in Wolfram Mathematica, as the following error messages appear:
1- "Numerical integration converging ...
2
votes
2
answers
186
views
Optimal basis set of Gaussian functions for describing a quantum system (part 1)
This question arose during the discussion of the previous questions: Why does the minimum eigenvalue change dramatically when one basis function is added to the basis set? and Finding excited states ...
4
votes
2
answers
125
views
Representing pairs of values that lead to a constant
I have the following expression:
$Q=\frac{\sqrt{rc}}{1+r(1+K)}$
Q and K are constant values. Basically I want to plot a graph that shows me all the combinations of r and c that verify the equation. ...
2
votes
2
answers
174
views
Finding excited states using the condition of wave functions orthogonality
This is the continuation on my previous question Why does the minimum eigenvalue change dramatically when one basis function is added to the basis set?
Brief description of the problem: I would like ...
1
vote
2
answers
80
views
Color coding a parametric plot based on given conditions
This question is based on the answers provided here and here. Basically, I have the following Mathematica code to calculate the Lyapunov exponents as a function of Temperature:
...
0
votes
0
answers
38
views
NMinimize negating the minimum value
I am having a very strange issue. I have the following piece of code:
ee = 0.685149/(1 - E^-l)
Plot[ee, {l, 1.8, 10}]
NMinimize[{ee, 1.8 <= l <= 10}, l]
As ...
0
votes
2
answers
39
views
Solve for the correspondence between $\gamma$ and $l$ for the case of $h$ maximum
The analytic expression for $h$ is the following function on $l$, $p$, $\gamma$:
$$
h=2^{\left| l \right|+2}p!\left( \left| l \right|+p \right) !\gamma ^2\left( \sum_{m=0}^p{\frac{\left( -2 \right) ^m\...
0
votes
0
answers
37
views
Computing determinant inside Manipulate
I am solving a Nonlinear system, using the solution proposed by Bob here. I am interested in computing a reporting the determinant of the Jacobian of my system.
For this, I compute the derivatives ...
2
votes
1
answer
195
views
Rectangular matrix for Tikhonov first order regularization
I need to construct a rectangular matrix L, (n-1)xn, that has a form:
Does anyone a practical way to do it in Mathematica?
0
votes
1
answer
120
views
How to sort the eigenvalues and the eigenvectors in such way that each eigenvalue to its own corresponding eigenvector? [closed]
I would like to find eigenvalues and the corresponding eigenvectors of the matrix AA.
...
0
votes
1
answer
78
views
Predicting the convergence for Particle Swarm Optimization algorithm (PSO) population [closed]
I have a standard PSO algorithm implementation. I want to compare the data captured from PSO with some real network. I want to test how good pso is in predicting the network.
Which brings me to the ...
2
votes
1
answer
89
views
Speed up Interpolation
I have to calculate a lot of values using interpolation function. I think it could be faster, but I wasn't able to speed it up any way using Compile/Parallel computations. Am I missing something?
<...
5
votes
1
answer
196
views
How to rewrite numbers written in the string type to the numbers?
I have a list with string type characters:
...
1
vote
1
answer
55
views
Numerical minimization of an objective function with a variable number of arguments
Here is my problem: I've got an objective function f[..] to minimize (numerically with the help of FindMinimum[...] procedure) that depends on a variable number of arguments, i.e. one time it will be ...
1
vote
0
answers
95
views
Optimizing my code to solve nonlinear system
I have solved a non-linear system using Eliminate[] and Solve[], using a really nice answer found here I am able to use ...
0
votes
0
answers
48
views
How to divide a point set into a set of triangles according to a centerpoint?
15 Points in red are randomly generated.
The point in blue is called a 'centerpoint', which means any closed half space contains it also contains 15/(2+1)=5 points in red.
The question is how can I ...
0
votes
1
answer
72
views
NMinimize::nnum: The function value [...] is not a number at [...]
I have been trying to minimize a function, but I believe a syntax error is blocking the evaluation. I tried to add NumericQ to trigger the evaluation of the ...
1
vote
0
answers
41
views
Update some elements of a symbolic matrix
I am trying to build, update and manipulate a binary matrix in an optimization problem using NMinimize.
The variable to be optimized on is a vector ...
0
votes
0
answers
22
views
Minimizing 2-variable function with underdetermined constraint
I'm trying to minimize the function eps wrt the real variables a1 and a2, making sure that ...
0
votes
0
answers
33
views
Optimization over nested variables, vectors and matrices
I am trying to optimize a function that is fairly complicated, but at the end I just want to solve a parametrized assignment problem using integer linear optimization with Mathematica.
The main ...
0
votes
1
answer
72
views
Find solutions after using Eliminate
I have used Eliminate[] to reduce a system of equations as found here, I then proceeded to verify that indeed my system has zeros using this code. My question is, ...
1
vote
1
answer
81
views
Best way to replace parameters with functions
I recently solved this Nonlinear system using Eliminate:
...
-1
votes
1
answer
99
views
Solving Nonlinear System
I am solving a $3X3$ non-linear system (posted also in mathematics).After some simplifying assumptions it looks like this:
$$K c_1 x_1=(1-x_2)(1-x_3)+a_1(1-x_2)x_3+a_2(1-x_3)x_2+a_3x_3x_2$$
$$K c_2 ...
1
vote
1
answer
39
views
How to delay evaluation of Tuples[list,n] when n is a variable to be optimized through NMinimize?
I am trying to do a linear optimization on a variable i where an intermediate variable v is needed:
...
2
votes
2
answers
135
views
Is it possible to ask Mathematica to find those points $(x,y)$ at which the given function may reach its global/local extrema?
I have this two-variable function $f(x,y)$ for {x,-Pi,Pi} and {y,-Pi,Pi} in which $\{a,b,c\}$ are real parameters (can be ...
3
votes
2
answers
204
views
Fitting an exponential system
Consider the following system over a periodic array, where $1\leq j\leq n$,
$$
y_j= \sum_{k=0}^m \frac{e^{-\sum_{|i|\leq k}(k-|i|)x_{j+i}}-e^{-\sum_{|i|\leq k}(k+1-|i|)x_{j+i}}}{\sum_{|i|\leq k} x_{j+...
0
votes
2
answers
123
views
Why does Minimize return a wrong answer?
I want to find the minimum of the following function, but get a wrong result. What am I doing wrong?
...
2
votes
0
answers
105
views
Tracing the phases (i.e. the minima) of a potential
Is there a Mathematica package to trace the minima of a potential as a function of some parameter, returning its phase structure?
Working with particle physics models (in the context of cosmology and ...
3
votes
0
answers
58
views
NMinimize NelderMead postprocessing method [closed]
I am using NMinimize with the NelderMead method. I have a very good initial solution supplied via InitialPoints. If I turn off postprocessing ("PostProcess"->False) then the output is ...
0
votes
0
answers
45
views
Why do the solutions from the FindMinimum produce a lot of unphysical oscillatory points?
The parameters. Here I mention all the parameters I use in my code including some of the functions that I define for convenience
Parameter set-I
...
2
votes
1
answer
74
views
Using NMinimize for a real-valued function of complex variables
I am trying to use NMinimize to minimize a real-valued function of complex arguments, with a supplied initial point. This doesn't seem to work well. For example, the following gives errors like "...
0
votes
1
answer
76
views
Finding only non-negative roots with FindRoot
Given an arbitrary function F, how do I force FindRoot to look only for non-negative roots, returning nothing otherwise?
0
votes
0
answers
35
views
Calculating minimal unknown coefficients of a sum
I have a problem, where I have to find the minimum of a function with a sum in it (coefficients are unknown):
psi[x_] := 1 + a*x + b*x^2 + c*x^3 + d*x^4 + ...
...
0
votes
0
answers
16
views
Plot taking longer than usual time to be produced
I have the following code for a function
...
3
votes
0
answers
45
views
Performing Tobit Regression in Mathematica by Maximum LogLikelihood
I am trying to estimate a tobit model by maximum likelihood method in Mathematica. I can not find the build-in function. So I try to perform it manually.
Here is the log likelihood function of Tobit ...
0
votes
0
answers
57
views
Invalid Constraints error in Non-linear Optimization
I am trying to write the code to solve a certain optimal control problem, but I keep running into an issue when I pass on my constraints to NMininimize[].
The ...
1
vote
1
answer
117
views
Simple SDP using Hermitian matrices
I would like to run the following semidefinite program
$$ \textrm{Minimize}\,\, \textrm{tr}\big({AX}\big)\\
\textrm{subject to}\,\, X \geq B_1\,, X \geq B_2\,, $$
where $A$, $B_1$ and $B_2$ are ...
0
votes
1
answer
68
views
Find the minimum value of a constrained multivariable function [closed]
Say I have a function of four variables $f(x_1,x_2,x_3,x_4)$ and a constraint $g(x_1,x_2,x_3,x_4)$ (both are quite complicated, that's why I don't write them explicitly). I want to find the minimum ...
0
votes
0
answers
45
views
Moving average MA(1) coefficient estimation
I am new to mathematica, I have some simulated a moving average, MA(1), data and I want to estimate the coefficients, theta, of it using Maximum likelihood estimation or log likelihood. Can someone ...
0
votes
0
answers
18
views
Is there a way to print all the outputs NMaximize runs through for different variable combinations?
I've got some function of 4 angles ($\theta1$, $\phi1$, $\theta2$,$\phi2$) that I'd like to maximize using NMaximize, but I'd like to be able to see the output for ...
2
votes
1
answer
54
views
Using the result of Solve as a function of parameters
I am trying to find b2 maximising a function I named 'EG1EUB'. And 'EG1EUBb2' is the frist order condition. Based on my understanding, Solve gave me a single solution saying that b2 is the second root....
0
votes
0
answers
66
views
Reduce local maximum of function, a problem of optimization
So I have this almost linear function (for evey frequency it is the square root of a sum of squares), but not quite.
...
3
votes
1
answer
157
views
Holes in ContourPlot3D
I have a polynomial polyHP and I put some conditions Reg on it and I try to plot it with ...
0
votes
0
answers
30
views
Can I avoid FindMinimum ruining my Asserts with symbolic stuff?
I am new with Mathematica, so forgive me if I completely misunderstood the nature of the problem...
Problem description
I want to optimize a fairly complex function bypassing explicit derivative ...
2
votes
2
answers
98
views
NMaxValue - function is not a real number
I'm trying to use NMaxValue to numerically find maximal values of the function F[z]. The problematic part of my code is as ...
2
votes
2
answers
158
views
Getting an exact value from FindMinimum [closed]
FindMinimum[{(Sin[a]^2 + Sin[b]^2)/Sin[c]^2,
a + 2 b == π/2 && a + b + c == π && a > 0 && b > 0}, {a, b,
c}]
The numerical ...