Stack Exchange Network

Stack Exchange network consists of 174 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
1answer
31 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
52 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
65 views

NMaximize not solving my problem

Check the following, integer problem: ...
1
vote
1answer
42 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
43 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
47 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
0answers
45 views

FindMinimum Speed [closed]

I have a code that uses the FindMinimum function with Method->"PrincipalAxis". The code works fine, but is very slow. However,...
0
votes
1answer
35 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
44 views

Having trouble with Maximize

The following code doesn't yield any results from Mathematica: ...
1
vote
0answers
44 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
65 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
106 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
89 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
63 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
58 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 ...
3
votes
1answer
99 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
38 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
39 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
44 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
45 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
136 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
247 views

Minimize distance between two lists

Writing: ...
0
votes
1answer
27 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
156 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
126 views
0
votes
0answers
71 views

An optimization problem

I have the following two quantities denoted by $LHS$ and $RHS$: ...
0
votes
0answers
52 views

Minimize and Table of variables

I use a list of variables to Minimize a particular quantity { Q, val1, Table[Pi, {i, 1, m, 1}} where i is the subscript of P. However in this way I have ...
3
votes
1answer
36 views

evaluation about Exp[] and Complex problem [closed]

Exp[I*Pi*0.75]*Exp[I*Pi*0.75] Exp[I*2*Pi*0.75] the results are: -2.22045*10^-16 - 1. I -1.83697*10^-16 - 1. I I know it is ...
0
votes
1answer
34 views

How can I optimize plotting the solution to ParametricNDSolve as a function of a range of values of the parameter?

I'm using ParametricNDSolve to find a solution to a set of first order ODEs which have one independent variable, z. The set of initial values contains a function of t. ...
0
votes
0answers
28 views

`Minimize` keeps running

I'm trying to determine the effect of small changes in one parameter of my problem on the KKT multipliers. The program computes the values of those multipliers (γVec...
3
votes
1answer
115 views

Generate convex-hull of a 15 dimensional space

This question follows my last post. I have a function $ \vec{f}: S^6 \times S^6 \rightarrow \mathbb{R}^{13} $ defined on two 6-dim hyperspheres. We will denote the function $ \vec{f}(\vec{x},\vec{y}) ...
0
votes
1answer
29 views

How to find minima for non scalar-valued [closed]

I want to find minima. My code: ...
1
vote
1answer
96 views

Minimization of a function

Let $T$ be a $n\times m$ matrix, I'm trying to solve $$ \min \sum_i T_{ij}{\lambda_i}^{\frac{1}{\alpha_i}}$$ $$ s.t. \sum_i \lambda_i =1, \lambda_i \geq 0$$ for $j=1,2,...,m$. When $\alpha_i=\alpha$ ...
1
vote
0answers
36 views

Finding zero linear combinations of polynomials (numerically)

I have two functions of real variables defined on two compact spaces ...
1
vote
2answers
51 views

Solve multiple equations and getting solutions [duplicate]

This is my first post here so I'm not really sure how all of this works, but I'll try my best to explain my problem. I'm supposed to solve the equation system ...
0
votes
1answer
52 views

How to optimize this script?

fx8350, 16Gb ram just need to solve this: 13, 19, 19, 16, 26, 33, 26, 31, 5, 24, 21, 34, 35, 35, 35, 20, 7, 12, 18, 17, 6, 8, 15, 24, 2, 17, 15, 22, 29, 15, 21
3
votes
2answers
96 views

Programming with Mathematica Syntax - Dunford decomposition

I am always amazed while I am reading some solutions of problems in mathematical problems of this site with Mathematica. For instance, look at the problem 48. Whereas I am writing 100 lines of code ...
4
votes
1answer
215 views

estimation of values using NMaximize over symbolic array entries

I'm trying to generate instances of a dataset that satisfy specific conditions, based on the following equation: Each of four non-zero terms (term 1, A; term 3, B; term 4, C; term 5, D) is a scalar. ...
3
votes
2answers
57 views

Find the base vectors of a point set

I have a list of coordinates that fits into a 2D periodic lattice, with some error ( $\vec{R}=n\vec{i}+m\vec{j}+\vec{\varepsilon}$). Is there a way to find the base vectors of the lattice? I guess the ...
2
votes
1answer
46 views

FindInstance for all real values satisfying a condition

I seek at least one instance of positive fractions $p,q,r$ where $p,q,r \in \mathbb{Q}^+$, for which $$\frac12 (a - 2 b + c)^2 \ge pa^2 + qb^2 + rc^2\quad \forall\ a,b,c \in \mathbb{R}.$$ I used this ...
4
votes
1answer
48 views

AccuracyGoal & PrecisionGoal: how to know which was used to yield the result?

With NMinimize (or many other functions), when an answer is found without any warnings, this means that a certain convergence criterium was achieved. It could be ...
2
votes
2answers
41 views

SearchPoints -> Automatic within DifferentialEvolution: what's its meaning?

A simple question: what is the meaning of the standard option (Automatic) for SearchPoints within the ...
2
votes
0answers
112 views

Adjacency Matrix to Clusters of Equal Sizes

I have a system with 72 nodes. I have a binary adjacency matrix $S$ of size $72\times 72$. If $S_{i,j}=1$, then node $i$ is adjacent to node $j$. So, we also have $S_{i,j}=S{j,i}$. So, $S$ is a ...
0
votes
1answer
88 views

How to find clusters with same cluster sizes?

I have a set of 71 data points. Each data point is represented by its latitude and longitude. I want to divide them into 12 clusters. The first 11 cluster will have exactly 6 points each and 12th ...
1
vote
3answers
95 views

Find k largest edges with unique nodes (kind of maximum weighted matching)

I have a weighted graph, and I am interested to find k largest edges with unique nodes. Currently, I do it in the following manner ...
0
votes
1answer
50 views

NMaximize refuses the constraint set [closed]

I want to run the following NMaximize code but I receive warnings that the constraint set is not right. ...
4
votes
4answers
290 views

Solve struggles to solve equation with variable constraint

I am trying to find {x,y} set satisfying first order conditions with the constraint: 0<x<=y<1 Here is my code, which ...