We’re rewarding the question askers & reputations are being recalculated! Read more.

# Questions tagged [mathematical-optimization]

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

1,307 questions
Filter by
Sorted by
Tagged with
29 views

### Is there a feasible computation?

I have to find the values of $p_1$ and $p_2$ which minimizes the expression $G$. However, when I took the partial differentiation of $G$ with respect to $p_1$ and $p_2$, the equations I obtained were ...
34 views

### Nested optimization problem 3

thanks to Ulrich Neumann I am getting close to the solution of my problem... However, Mathematica tells me that no points satisfy the constraints of the following problem: ...
30 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, ...
39 views

### Nested optimization problem

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

### Linear map of unit cube (generalized)

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

### Minimize fails to find a minimum [on hold]

I am trying to find, analytically, the $\theta,\phi$ that minimize the function U($\theta,\phi$) ...
32 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 ...
70 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 ...
25 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 ...
102 views

36 views

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

Bug persists through 12.0 For example, when I call this code ...
95 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 ...
49 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: ...
48 views

### Computing RMSE (Root Mean Square Error) [closed]

I have the following data: ...
32 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? <...
14 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? ...
30 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 ...
53 views

### Status of DualLinearProgramming

DualLinearProgramming is referenced in this tutorial tutorial/ConstrainedOptimizationLinearProgramming It exists in ...
43 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: ...
29 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 ...
65 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 ...
265 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 ...
77 views

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

There is the following vector-matrix equation. where C - nonzero constant. [x1 x2 ... xn] - vector of real numbers. M - matrix of real numbers of dimension n x n It is required to find a vector $x$...
31 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 ...
42 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: <...
108 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 ...
24 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 <...
164 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, ...
71 views

### NMinimize is wrong : why?

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

### MaxDetect speed

What's the fastest way to find the local maxima of a 2D list? E.g. ...
56 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). ...
52 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 ...
61 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 ...
45 views

### Using MinValue with NDSolve

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