# Questions tagged [mathematical-optimization]

Questions on the optimization functions of Mathematica such as FindMinimum/FindMaximum, Minimize/Maximize, NMinimize/NMaximize, etc.

1,451 questions
Filter by
Sorted by
Tagged with
39 views

### Nested optimization problem 2

I would like to solve a maximization problem which itself depends on a maximization. I came up with this code, ...
89 views

### Nested optimization problem

I would like to solve a maximization problem which itself depends on a maximization. I came up with this code, ...
74 views

### Linear map of unit cube (generalized)

This question is a slight generalization of this question. Let M be a fixed rational m $\times$ ...
97 views

### Minimize fails to find a minimum [closed]

I am trying to find, analytically, the $\theta,\phi$ that minimize the function U($\theta,\phi$) ...
38 views

### Get default values used in an Option of a NMinimize Method

I fear the answer is trivial, but I have extensively searched without any success. Say I perform a Nminimize minimisation using the Method "Simulated Annealing", e.g. the following from the ...
92 views

### The Maximum and Minimum Functions of Two Functions

Suppose I have two functions f(x,y)=1 + 2*x +3*y^3 and g(x,y)=y + x^2. I want to have maximum function of ...
31 views

### Constrain values to numeric during Minimize

I understand, that similar questions have been asked before, but I am absolutely new to Mathematica and can not solve it myself: In nuce it is the following: I want to calculate ...
124 views

49 views

### How to use StepMonitor in NMinimize when using vector variable

Bug persists through 12.0 For example, when I call this code ...
106 views

### Implement gradient method in functional programming style

I implemented the gm for quadratic function in Mathematica, but it looks like more in an OOP style, as the pic shows. How to rewrite it in Mathematica style? I tried with following code: ...
26 views

### Making a density plot for an expression

I have defined a function the energy $E$ of a given system by ...
55 views

### LinearProgramming with constraint on result

I need to solve a bunch of Diophantine Equations that takes so looong with FindInstance/Reduce, so I tried LinearProgramming and it's very fast. Here is a simple one: ...
80 views

### How to extract the last output from the Maximize

Pitty on me! Still a beginner. After using Mathematica for 8 years and spending an hour on google, I remained unsuccessful to find an answer of: How to extract the last element of the output of ...
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? <...
17 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? ...
36 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 ...
38 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 ...
66 views

### Status of DualLinearProgramming

DualLinearProgramming is referenced in this tutorial tutorial/ConstrainedOptimizationLinearProgramming It exists in ...
53 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: ...
40 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 == pi/2). I have tried using both ...
79 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 ...
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 ...
196 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}...
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 ...
57 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: <...
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 ...
27 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 <...
281 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, ...
76 views

### NMinimize is wrong : why?

Consider the following code: ...
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 ...
660 views

### MaxDetect speed

What's the fastest way to find the local maxima of a 2D list? E.g. ...
60 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). ...
86 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 ...
74 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 ...
51 views

### Using MinValue with NDSolve

A simplified example looks like this. The basic idea is to maximize fHelper by adjusting \[Alpha] for each ...
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 ...
454 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 ...
159 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 ...
97 views

### Approximate strictly positive solution to a linear set of equations?

Consider a positive matrix M and a positive vector b, e.g. ...