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
1answer
42 views

Position of maximum element in list under optimisation

For a list of several functions: functions = {a[x,y,z],b[x,y,z],c[x,y,z],d[x,y,z]}; I want to maximize the maximum value of a function of three variables. This ...
0
votes
0answers
21 views

NMaximize scrambles constraints

There have been lots of questions around regarding the issue that NMaximize/NMinimize may give results - or at least evaluate ...
2
votes
0answers
45 views

Simultaneous Peak and Background Fit

I'm not sure if this is the proper way to do this, but I have a question related to another open question of mine. In this post, I'm looking at analyzing some quantum dot UV-Vis absorbance spectra (...
3
votes
1answer
72 views

Proving the positive semidefiniteness of a 6X6 symbolic matrix

Specifically, I want to check the positive semidefiniteness of the following 6X6 symbolic matrix ...
0
votes
1answer
99 views

Maximize this function

For the following matrix $$M = \begin{pmatrix} f1[x,y,z] & f2[x,y,z]\\ g1[x,y,z] & g2[x,y,z]\\ h1[x,y,z] & h2[x,y,z] \end{pmatrix} $$ with ...
0
votes
1answer
38 views

Maximise over functions in Mathematica

Define the functions $h$, $j$, and $k$ that are each functions of 3 variables: h[x,y,z] j[x,y,z] k[x,y,z] How can I find the max of these functions? I want the ...
25
votes
2answers
887 views

Possible bug in NMaximize function?

Bug introduced in 12.0 In 12.0.0 for Microsoft Windows (64-bit) (April 6, 2019) writing: ...
0
votes
0answers
54 views

How to find, for a temp. equation, Maxmum valus of position and time?

I have to find the position x and the time t for which the temperature is a maximum. I have a function ...
1
vote
1answer
48 views

ArgMin over intervals and discrete sets

I was playing with ArgMin but I'm not sure how to use it for constrained optimization. For example, ArgMin[x^2, x] returns <...
11
votes
1answer
124 views

Minimizing expression over symmetric matrices

I'm trying to solve the following maximization problem over space of symmetric matrices A and positive definite H $$R=\max_{A\in S(R^d)}\frac{\text{tr}(HA)^2+2\text{tr}(HAHA)}{\text{tr}(AHA)}$$ So ...
0
votes
1answer
55 views

FindMinimum diverges

I just enocountered following issue, FindMinimjum explicitly diverges — final result is WORSE than initial supplied conditions. During evaluation of In[37]:= ...
0
votes
1answer
38 views

Plot global maximum point and differential equation

I have two questions: (1) I found the global maximum point of the following function ...
0
votes
0answers
36 views

Arrow key problem with mathematica 12 and bash version 5

I want to know if anyone experiences the issue with mathematica-12 with bash-5? I am using the command line interface of mathematica. Now when I do up arrow or down arrow to go to history, it does ...
0
votes
1answer
54 views

NMinimize cannot be used within RegionPlot

My version of Mathematica (11.1) apparently cannot do NMinimize within RegionPlot. It did work before (!) my last software update. Here is an example from user GioMott having the same (unanswered) ...
1
vote
2answers
43 views

Find maximum of x given a bunch of constraints [closed]

Trying to find maximum of x given that '''0<=x<=3''' and some other stuff. This works fine: Clear[x, y] FindMaximum[{x, 0<=x<=3}, x] But this does ...
2
votes
1answer
47 views

Function of Maximum and Minimum Functions of Two Functions

I try to answer this question The Maximum and Minimum Functions of Two Functions I wrote the following code ...
0
votes
0answers
41 views

Numerical maximization

I am facing a numerical maximization problem with constraints. Using Method -> {"RandomSearch", "SearchPoints" -> 3}, AccuracyGoal -> 2 often does not find ...
0
votes
0answers
35 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 ...
0
votes
1answer
38 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: ...
0
votes
1answer
34 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, ...
0
votes
1answer
57 views

Nested optimization problem

I would like to solve a maximization problem which itself depends on a maximization. I came up with this code, ...
2
votes
1answer
68 views

Linear map of unit cube (generalized)

This question is a slight generalization of this question. Let M be a fixed rational m $\times$ ...
0
votes
1answer
96 views

Minimize fails to find a minimum [closed]

I am trying to find, analytically, the $\theta,\phi$ that minimize the function U($\theta,\phi$) ...
0
votes
0answers
35 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 ...
0
votes
1answer
83 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 ...
0
votes
0answers
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 ...
3
votes
3answers
113 views

Constraint of NDSolve with an integral of the solution

I'd like to use NDSolve and to make a constraint with an integral. For example, take the very simple : $$f'(x)=-f(x)/x_0 $$ the solution is $$f(x)=f_0 e^{-x/x_0} $$ And $f_0$ is given by : $$\int_0^...
0
votes
1answer
27 views

error for NMinimize with Parameters in the form f[a_]:=NMinimize

I'm trying to write a function of a variable as the argument of a minimization where that variable comes to play. Here is the code : ...
0
votes
1answer
41 views

Parallelizing FindMinimum

I have complicated 6-dimensional function to optimise. Using FindMinimum works all right, but takes a few minutes. Considering that I want to check multiple starting points, I'm looking at run times ...
0
votes
0answers
65 views

How to fit a spline (not interpolate) through points in 3D?

I have coordinates of points in 3D and want to fit a spline through these points. I found a least square approach for 2D case: https://demonstrations.wolfram.com/...
1
vote
1answer
75 views

How to include measurement error in FindDistributionParameters (using maximum likelihood)?

I am trying to fit a non-standard PDF to data using FindDistributionParameters. My custom distribution is defined like this: ...
1
vote
2answers
103 views

Optimize with constraints

I want to find the smallest $k$ such that $kx^2 \ge (\sin(x)-x)^2$ for all scalar $x\in[a,\ b]$? Obviously, I can do it analytically, but how can I do it (symbolically) in Mathematica? I am new to ...
2
votes
2answers
90 views

Find optimal BezierFunction

For a given set of points (examplary quadrant) n = 5; (* number of inner points*) p = Table[{Cos[φ], Sin[φ]}, {φ, Join[{0}, RandomReal[{0, Pi/2}, n], {Pi/2}]}]; ...
0
votes
0answers
20 views

The problem in finding a connected path through square lattice

I have a LxL square lattice. I randomly chose some points on this lattice and take them as my points. I want to find a connected path from left(0) to right(L). Below is my code: ...
2
votes
0answers
36 views

NMinimize with real solutions, problem in the resolution and criteria for other ways to solve equations

I have multiple parts in my question. You are welcome to answer to any of them :) Part 1 : I have 3 equations $p(x_1,y_1)=p(x_2,y_2),\mu_x(x_1,y_1)=\mu_x(x_2,y_2),\mu_y(x_1,y_1)=\mu_y(x_2,y_2)$. I'm ...
0
votes
0answers
44 views

NMinimize and large number of unknowns: avoid explicitly writing the list down

I have set up a rather large minimisation problem and it works well, if not for one nuisance. I need to often change the number of variables to be given to NMinimize: clearly it is rather impractical ...
0
votes
0answers
21 views

Different results for different LP Methods

I am trying to utilize the Farkas dual as a certificate of primal infeasibility. The goal is to solve the problem $$\min_{\textbf{y}} \textbf x\cdot \textbf b \text{ subject to } \\ \textbf 1 \geq ...
5
votes
1answer
44 views

How to use StepMonitor in NMinimize when using vector variable

Bug persists through 12.0 For example, when I call this code ...
2
votes
1answer
101 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: ...
0
votes
0answers
26 views

Making a density plot for an expression

I have defined a function the energy $E$ of a given system by ...
0
votes
0answers
52 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: ...
1
vote
1answer
64 views

Computing RMSE (Root Mean Square Error) [closed]

I have the following data: ...
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
16 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
32 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
34 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 ...
6
votes
0answers
61 views

Status of DualLinearProgramming

DualLinearProgramming is referenced in this tutorial tutorial/ConstrainedOptimizationLinearProgramming It exists in ...
2
votes
1answer
47 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
34 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
71 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 ...

1 2 3 4 5 28