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
2answers
36 views

Check whether a given quantity is negative

Given four numbers $n0, n1, n2, n4$ such that $n1+n2+n3+n4 = 1$. How can we check the sign of $A - 2 B$ (where $A$ and $B$ are defined below), i.e., whether this quantity is positive or negative? <...
0
votes
0answers
18 views

Apply Conditions on the Derivative of a Model with More Equations than Data in FindFit

Looking to combine the two approaches from these two posts here: How to Add a Constraint on the Derivative of the Model in FindFit How to fit 3 data sets to a model of 4 differential equations? ...
0
votes
1answer
39 views

How to have NonlinearModelFit not evaluate a function too early?

This is a follow up of my previous question How can I define the following function for arbitray values of the arguments? that received no attention so here I will try to be more concise with the ...
0
votes
1answer
41 views

Maximize and minimize R6 function using Lagrange Multipliers

I've been trying to maximize and minimize the following function using Lagrange Multipliers, in Wolfram Mathematica 11.3: d = Sqrt[x^2 + y^2 + z^2 + u^2 + v^2 + w^2] Subject to the following ...
7
votes
0answers
69 views

Status of DualLinearProgramming

DualLinearProgramming is referenced in this tutorial tutorial/ConstrainedOptimizationLinearProgramming It exists in ...
2
votes
1answer
57 views

How to Add a Constraint on the Derivative of the Model in FindFit

I would like to add constraints on a model and its derivatives and then use FindFit to fit some parameters. An example is below: ...
1
vote
1answer
42 views

FindFit or NMinimize? Fitting a System of ODEs to Long Time Behaviour

I am looking to fit a model composed of a system of ODEs to a long term behaviour given by a single data point of the final steady state of the system (e.g., x[1000] == pi/2). I have tried using both ...
0
votes
1answer
82 views

FindMinimum giving wrong answer [closed]

I have a very simple problem that Mathematica is giving a wrong answer to. I want to minimize the following function: $\frac{3+t^2+6\theta +3 \theta^2}{6 t^3}$ in $\theta$ and $t$. Now, plotting the ...
3
votes
1answer
273 views

Finding local minima of an energy defined by integration

This question is also asked here and here. I would like to reproduce the two solid curves in Fig. 1a of this paper. The total energy is given in Appendix A, and the curve is obtained by minimizing ...
3
votes
1answer
211 views

Solve the vector-matrix equation. Minimize the length of the desired n-dimensional vector

There is the following vector-matrix equation: $$\mathbf x^\top\mathbf M\mathbf x=\begin{bmatrix}x_1&x_2&x_3\end{bmatrix}\begin{bmatrix}a&b&c\\d&e&f\\g&h&i\end{bmatrix}...
0
votes
0answers
34 views

Univariate Gaussian Splitting

I would like to experiment a bit with univariate Gaussian Split libraries. This is essentially a constrained non-linear optimization (minimization) problem. There are multiple formulations of this ...
0
votes
1answer
60 views

Using NMinimize with Table to plot an energy

I would like to reproduce the solid blue line of Figure 2a in this article. For this, I have used the code found here. Notice, however, that I am not succeeding. Could you help me? Here is my code: <...
1
vote
1answer
144 views

$\min \int_{0}^{\infty} (a f'(x)^2+b f(x)^2+c |f(x)|) dx$

Can Mathematica solve $\min_{f(x) s.t. f(0)=f_0} \int_{0}^{\infty} (a f'(x)^2+b f(x)^2+c |f(x)|$)dx ? I tried ...
0
votes
1answer
30 views

Plot with substitution of domain values before evaluation of function

I have a function of two variables $f(x,y)$. I find the maximum value of $f(x_0,y)$ by first substituting the value of $x=x_0$ and then maximizing in the range $0<y<1$. My question is: How to <...
0
votes
5answers
298 views

If someone would want to think about the question: mathematical-optimization “Banknote”

I solved the puzzle of IBM Ponder This September 2019 by my code written with mathematica. I would like to share this code after the solution that will come as soon, and discuss it. In the meantime, ...
3
votes
2answers
83 views

NMinimize is wrong : why?

Consider the following code: ...
1
vote
0answers
35 views

Time optimization of motion using mathematica

Let us say I have a double pendulum, with the torque equations and the initial and final poisition of the end point of the pendulum. I have constraints on the maximum and minimum values of torques. I ...
6
votes
4answers
662 views

MaxDetect speed

What's the fastest way to find the local maxima of a 2D list? E.g. ...
1
vote
0answers
63 views

FindMinimum where variables are Integers

I wish to find the minimum of a function where the variables are integers. Here is a simple minimum working example (my actual function is much more complicated). ...
1
vote
1answer
96 views

How can I find the minimum and maximum output of a function and specify the valid ranges and steping of each variable? [closed]

I am a software developer, and it has been far too long since the last time I've needed to do any math this complicated. I've forgotten a lot of the proper terminology, which has made finding answers ...
2
votes
1answer
91 views

How to get ReplaceAll to happen before function call

I have a problem I am attempting to solve with NMinimize. I have a scoring function, which will give me a final score. The problem has many variables, so instead of having them as parameters, they ...
-1
votes
2answers
52 views

Using MinValue with NDSolve

A simplified example looks like this. The basic idea is to maximize fHelper by adjusting \[Alpha] for each ...
0
votes
1answer
73 views

DSolve returns unevaluated(I need a closed or numerical solution for this system and plot solution)

I am trying to find a solution to this system of differential equations but the program gives the same output without any messages. I would like help. Please find the Mathematica code posted here. a ...
8
votes
3answers
456 views

Numerical minimum of a one-valued function

Bug introduced in 12.0 [CASE:4332003] My problem is that the Kernel cannot finish computation and eats up memory when a simple constraint like 0 <= x <= 2 is ...
12
votes
0answers
165 views

Linear programming with lazy constraints

Does Mathematica offer any means for solving linear programming problems with "lazy constraints", as described e.g. here? While I am not very familiar with linear programming, my understanding of the ...
5
votes
3answers
99 views

Approximate strictly positive solution to a linear set of equations?

Consider a positive matrix M and a positive vector b, e.g. ...
0
votes
0answers
33 views

How to solve this set of linear equations

I am trying to solve six linear equations, for which a solution exists (since it can be recovered by Matlab). I am trying to reproduce it here. I have the following MWE: ...
1
vote
0answers
30 views

How to minimize the eigenvalues of a hermitian matrix?

Suppose I have a complex hermitian matrix, M[x_,y_] whose eigenvalues must be real.I tried to minimize the first eigenvalue by writing following command:f[x_,y_]:=Eigenvalues[M[x,y]][[1]]; Minimize[f[...
9
votes
2answers
141 views

FindMaximum returns a solution that violates the constraints

I am looking at the following optimization problem $$ \begin{align*} \max\ & 1000 r_1 + \frac{1}{2}r_2 + \frac{1}{3}r_3\\ \text{s.t. }& 1000^2 r_1 + \frac{1}{4}r_2 + \frac{1}{9}r_3 = \frac{1}{...
1
vote
1answer
25 views

Numerical Maximization with Alternating Sum

I need to maximize a function that involves an alternating sum and a set of constraints. I have tried the following code: NMaximize[{(-1)^{m}*n!, n + m == 7, m > 0, n > 0}, {m, n}] However, the ...
0
votes
3answers
62 views

Optimizing with respect to the parameters of an optimization problem

I’ve got this simple loop that prints out the solutions to 2 simple equations for various values of parameters $a$ and $b$. I need to add a command that would display the parameter values that lead ...
5
votes
1answer
152 views

Matching spectral data to known spectral lines

Preamble: I designed some code to help me take spectral images from a spectrometer and convert pixel number into wavelength. It does reasonably well at matching a calibration spectrum of a neon lamp ...
0
votes
0answers
40 views

Analytic maximization that reduce fails to solve

I'm working on an interesting problem but stuck on a step that Mathematica fails on (no matter what angle I try to get at it from). I'm attempting to find the symbolic maximum of this convex function ...
1
vote
3answers
50 views

Minimize a function with singular points ( limit exists)

I need to minimize a function that has several problem points (divergences). For example, if I consider: ...
2
votes
1answer
137 views

Plot feasible region of a high-dimensional LP only along some dimensions

I have a question on the possibility of using Mathematica to plot a convex closed region satisfying a linear system of equalities and inequalities. Let me first present the linear system. Let $x\...
0
votes
1answer
218 views

Solving a profit maximization with Cobb-Douglas production function

I'm considering a typical profit-maximization problem: \begin{equation} \label{optimization1} \begin{aligned} & \underset{K,L}{\text{max}} & & P Y - r K - w L \\ \end{aligned} \end{...
4
votes
1answer
82 views

Working examples for SemidefiniteOptimization

It appears to me that for some types of invocation, SemidefiniteOptimization is not working for matrices larger that 2x2. An example from help that works ...
11
votes
2answers
261 views

Custom SGD optimizer in Mathematica neural network framework?

I have a new approach to SGD optimizer, and thought to try to test it in Mathematica. It uses gradients to simultaneously maintain online parabola model for smarter choice of step size - I only need ...
6
votes
1answer
191 views

Assign Error bars for y-intercept

I have some data (x,y) with error bars in y direction: ...
2
votes
0answers
38 views

When mapping FindMinimum to a list, how to find out which instance does not converge

I defined a function f[x,y] and wanted to study its minimum over x when viewing y as a ...
1
vote
0answers
26 views

Wish to increase speed of MaximizeOverPermutationMH merit function

I am working with MaximizeOverPermutationMH (see Link to discussion about function and would like to optimize the execution speed of the merit function. This function accepts a 100-digit permutation ...
0
votes
1answer
40 views

Solving a specific equation in Mathematica & Finding the range of a value in an inequality

Is there any way to solve (or even approximate the value of x) the following equation in Mathematica? ...
0
votes
1answer
70 views

Maximize a definite integral with constraints on the limits

I would like to maximize the following definite double integral with respect to $0<r<\frac{1}{2}$: $\int _0^{\frac{d}{1-r}}\int _{\frac{d+r x-x}{r}}^s [(1-r) x+r y -d]dydx$ under the ...
0
votes
0answers
75 views

Time spent on a transformation exceeded 300 when solving the optimization problem

I have the code which shows below to solve an optimization problem, but it will show that it's over the time constraint of 300 seconds. Is there anyone who could help me solve it. Thanks. ...
3
votes
2answers
167 views

Plotting maxima within a simplex

I am trying to draw a particular maximum plot within a simplex. I have functions based on two variables: Write p,q for the two variables where p,q \geq 0 and p + q \leq 1. This defines the simplex ...
2
votes
0answers
49 views

How to read and write the same text file in Parallelization using ParallelTable? [closed]

I want to know how to write and read a same text file (for example, external.txt ) without conflicts in parallelization. The following is just a small idea, but the problem is there seems a conflicts ...
1
vote
0answers
72 views

Optimization in Mathematica

I'm trying to solve the optimization problem below, but it seems like I don't get something about how the function works. Anyone see what is wrong? Would be happy to exchange for the newer ...
0
votes
0answers
76 views

Plotting a maximization of a definite integral

I am applying Alex Trounev's approach suggested in this post. It worked for the function in that post. But it is now not working for another, more complicated function. My objective function is $f=\...
4
votes
4answers
410 views

Find maximum according to a parameter

I am new to Mathematica. I want to find the maximum of the functions: ...
0
votes
0answers
76 views

3D-plot of a maximization of a definite integral

I'm applying the answer (If method) suggested by 'ThatGravityGuy' in this post in a more complicated case. Consider my objective function (pardon its formidable ...

1
3 4
5
6 7
30