Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mathematical-optimization]

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

0
votes
0answers
22 views

Monitoring PolynomialReduce/Alternatives for other CAS packages

I have a large generic polynomial That looks like $N = \sum_{i_1,i_2\cdots}c_{i_1,i_2,i_3,\cdots} {x_{1}}^{i_1}{x_{2}}^{i_2}\cdots $ This could have anywhere between 3000-9000 terms with a maximum ...
1
vote
2answers
46 views

Numerical Minimization of Large Expression

I want to minimize a function which contains ArcTan functions. The function is also very complicated. I have the following code. ...
2
votes
1answer
64 views

How to maximize just with respect two parameters out of four?

There are some posts explaining how do we maximize a function of two parameters with respect to one of those and how to plot the resulting function: Plot a function after taking the supremum with ...
11
votes
1answer
209 views

Minimizing with differential evolution

A differential evolution algorithm is given here. I would like to get this kind of animation. I thought I could use NMinimize, given ...
2
votes
1answer
40 views

How to Provide an RNN various type of inputs?

I'm trying to build an RNN in Mathematica. My window is only 2 but the variables are of different types: ...
1
vote
0answers
31 views

Export system of inequalities in MPS format

I am interested in the .MPS format, usually used in Linear Programming problems (see here). When importing a file in the .MPS ...
1
vote
2answers
62 views

Trouble finding a maximum of a constrained multivariate function

I have a multivariate function that I seek to maximize (ideally symbolically): The function has the form: $\frac{(-j*a)}{8 (-(b/2) - j (c-d-e)) ((j*b*c)/2 - (j*b*d)/2 + c*d - d^2 + a^2/4))}$ (...
1
vote
1answer
80 views

Minimize is running forever

My object function is $\frac{4 d k (1 - 2 r) r + k^2(3 r-1)r + d^2 (1 + r (6 r-5))}{ 2 (1-r)^2 r} + q* \frac{d^2 (2 - 3 r) + 2 d k ( 2 r-1) + k^2 (1 -(3 - r) r)}{(1-r)^2}$. And I'm trying to find ...
8
votes
0answers
91 views

StableMarriage vs. FindIndependendEdgeSet: How to use the procedure FindIndependendEdgeSet as a Gale-Shapley algorithm?

From Help, the procedure StableMarriage was an element of the Combinatorica, but it is available in the built-in ...
4
votes
2answers
82 views

FindMaximum ignores MaxIterations option

I'm trying to find a maximum of interpolated function inside a particular mesh cell. However, for some cells the process is very slow and it returns a warning: FindMinimum::eit: The algorithm does ...
11
votes
3answers
396 views

Minimum energy path of a potential energy surface

I have calculated the energies of a molecule by varying two parameters (Data points are here data). I want to find the minimum energy path from the point (180.0, 179.99, 21.132) to (124.5, 124.49, 0) ...
0
votes
1answer
22 views

Error from NMaximize inside function that calculate fwhm

I tried to use the function that is given in 1 in order to get the FWHM of some expression I got from solving a system of linear equations. This is the function for calculating FWHM: ...
1
vote
3answers
70 views

3D Plot the result of local Minimize with varying parameter values

I'm faced with the following minimization problem: Find $r\in[0,1]$ that minimizes $\frac{d^2+k^2 (1-2r)r}{2(1-r)r}$, which is bounded by 0 and 1. In addition, $k<d$ holds and each of $d$ and $k$ ...
0
votes
1answer
42 views

parameter fitting for a trascendental equation model

I want to solve the following problem with Mathematica: I have a physical model relating the $y$ variable with the $x$ variable given by the next expression: $$y=...
2
votes
3answers
136 views

Finding minimum from ListPlot

I have Table with 10000 elements in it and I plot a graphic using ListPlot. I need find minimum in graph. Here is a .txt file with data. I tried to use ...
0
votes
0answers
41 views

Not getting a solution to my maximization problem

I want to solve the following problem: For $0.5<q<1$, $q<r<1$, $0\leq n$, $0\leq n_1<=\lfloor{n/2}\rfloor$, and $n_1,n\in\mathbb{N}$ calculate $\arg max_{n_1} S(q,r,n,n_1) $ as a ...
0
votes
1answer
92 views

Animate particle's trajectory

Does anyone know how to animate the trajectory of a particle, but make sure before the particle reaching a certain spot, there's nothing. I mean I want to make an animation that look like https://en....
1
vote
1answer
70 views

Problem with constraints of NMaximize

I am using NMaximize to solve the following problem. ...
1
vote
0answers
90 views

Help in minimizing a cumbersome function

I'm trying to minimize a function in order to find a slope critical heigth on a solope stability analisys. The functions taken from (Chen 1975) are the following: I added all the equations to mma but ...
0
votes
1answer
40 views

Maximize function subject to condition [closed]

What commands should I use in Mathematica to obtain the maximum or minimum of a function subject to conditions? For example, find the maximum of the following function? $\qquad T=\sqrt[3]{2\,x+5} + \...
0
votes
1answer
51 views

Minimization of objective function 300000 xy [closed]

How could I minimize the following in Mathematic? 300000 xy under the constraints ...
1
vote
3answers
107 views

How to find the maximum?

I have in mind $$\max\left( \sqrt{(x-1) (y-x)}+\sqrt{(1-x) (7-y)}+\sqrt{(y-7) (x-y)}\right)$$ for $x\geq -2\land x\leq 3\land y\geq 0\land y\leq 11 $, of course, taking into account real values of the ...
0
votes
1answer
39 views

NMinimize in NMinimize …why doesn't work?

I want to use NMinimize in NMinimize. What I want to do is 1) Make and Input the candidate of numbers to func by 1 st NMinimize. 2) replace numbers with the candidate. 3) evaluate and seek the "t" ...
1
vote
0answers
54 views

Integer linear programming can't find global minimum

I was working with Project Euler Problem 418 using Mathematica and got in trouble. I wrote a function to find the unique factorization triple which minimizes c / a for integer n. ...
1
vote
3answers
69 views

NMaximize not solving my problem

Check the following, integer problem: ...
1
vote
1answer
44 views

How to take a point randomly from a region [duplicate]

I want to take some points randomly by the limits above, I had try to use FindInstance method but it always out (0,0) ...
0
votes
0answers
48 views

Rearrange a symbolic function in order that the result contains a minimum number of SQRT() and CBRT() calculations

I use mathematica for analytically calculating a function, which solves two equations: ...
0
votes
2answers
48 views

NSolve does not return a value

I'm interested in obtaining the KKT multipliers in a constrained optimization problem. I've checked the NMaximize documentation, but I've been unable to find how to ...
0
votes
0answers
16 views

Nmaximize with array in ConvexhullArea

I want to find maximum of convexhull area for n points. I try to give a small example (n=4) as follow ...
0
votes
1answer
40 views

How to extract the minimal value from NMinimize? [closed]

According to the manual, if I calculate NMinimize[x^4 - 3 x^2 - x, x] that returns {-3.51391, {x -> 1.30084}}, I can extract the minimal value -3.51391 using <...
1
vote
1answer
46 views

Having trouble with Maximize

The following code doesn't yield any results from Mathematica: ...
1
vote
0answers
46 views

L1-norm optimization algorithm crashes kernel on large datasets

I have an A.X-B linear system which I have transformed into A.x-b to be solvable as a linear program using the code below: ...
1
vote
2answers
81 views

The Levenberg-Marquardt method for nonlinear least squares curve-fitting

There is a function with unknown coefficient $a$, $b$, $c$ $$t(k)=\frac{1}{a b}(c-arcsinh(\sinh(c \cdot e^{a\cdot k\cdot 2\pi}))$$ I have a measurements $t_k$ from observed data. $(t_1 =0.4,t_2 =...
1
vote
2answers
108 views

Is it possible to find a closed solution for this problem?

I need to find the global minimum of the following function: ...
0
votes
1answer
94 views

Minimizing a function problem

I'm solving an elastoplastic problem of the Ducker Prager model using the closest point projection method, which consists of minimizing a distance between a trial stress and the yield surface in the ...
1
vote
0answers
71 views

How to find which automatic method is used by FindMinimum?

This question has already been addressed here and here. The second link consists of an answer by halirutan, which clearly states which method is used in which situation. However, while trying to check ...
0
votes
1answer
63 views

Finding the minimum points of a discrete trigonometric equation

Basically I'm trying to solve the equation $$A\Big(\sin(\theta_a-\theta_{a+1}) + \sin(\theta_a-\theta_{a-1})\Big) + B\Big(n_a^z \sin(\theta_a) - n_a^x \cos(\theta_a)\Big) = 0$$ subjected to the ...
4
votes
1answer
111 views

Speedup of DimensionReduce

I am interested in accelerating DimensionReduce using the "TSNE" method. I have a matrix with a size of 30000 * 10, and I want to reduce to 30000 * 8. But the calculation is very slow, any suggestions ...
1
vote
2answers
45 views

Define x as a multiple of a number as a constraint in the Maximize function

I am trying to optimize a linearly constrained Production Function. I have three inputs and want them all to be multiples of 150. I can make all the inputs to belong to the Integer Domain but is there ...
1
vote
0answers
43 views

Making a function $ f(n) $ tangential to another function $ g(n) $ by choosing appropriate constants

I have two functions $ f(n) = 1/(1+n) + b, (n \geq 0,b \geq 0) $ and $ g(n) = pn^2 + qn + r $. Assuming that I know the value of $ p, q $, and $ r $, I am trying to find a value for the constant $ b $ ...
0
votes
0answers
24 views

NMinimize calling an own defined function [duplicate]

I want to call an own defined function through NMinimize. For the sake of simplicity, let us define the problem as follow: ...
0
votes
1answer
45 views

How to save the output data of second order differential equation in Mathematica?

I am beginner in Mathematica. I am trying to save the output data as a text file but I could not save ! ...
3
votes
0answers
49 views

Plotting gradient and newton directions for parametric system of nonlinear ODEs

I have a bucket (system) of chemical kinetics models, a nonlinear dynamical system given by: where kf >= 0 and kr >= 0 are the parameters. The initial conditions are A(0) = B(0) = 1 and C(0) = 0. I'...
0
votes
1answer
246 views

Translating the Newton-Raphson method from Matlab to Mathematica

I am trying to optimize the variables of two (or three depending on how you think about it) matrices using the Newton-Raphson Method. I made the bottom code in Matlab. The code is pretty simple it ...
5
votes
2answers
256 views

Minimize distance between two lists

Writing: ...
0
votes
1answer
30 views

How can I specify the region for every variable simultaneously in NMinimize?

I want to use NMinimize to find the unknown unitary matrix that solves a (possibly nonlinear) matrix equation. For example, the one that transforms the Pauli matrix ...
2
votes
2answers
168 views

How to find second,third,etc maximum peak of list

I need to find all values of peaks. I have Table with 10000 elements in it and I plot a graphic using ListPlot. Then I tried to ...
2
votes
2answers
136 views

Anyway to Speed up this code?

I have the following code: ...
0
votes
0answers
73 views

An optimization problem

I have the following two quantities denoted by $LHS$ and $RHS$: ...