Questions tagged [mathematical-optimization]

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

419 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
12 votes
0 answers
241 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 ...
user avatar
  • 225k
11 votes
0 answers
337 views

Customized StepSize control in unconstrained gradient-descent optimization

I have a type of minimization problem I frequently solve that involves warping a large 2D triangle-mesh (~25,000 vertices) to fit a model. In the mesh, vertices carry the empirical measurements (each ...
user avatar
  • 2,108
10 votes
0 answers
5k views

Precision and accuracy in NDSolve and NMinimize

I use NDSolve quite a lot and have noticed that setting values for AccuracyGoal and ...
user avatar
9 votes
0 answers
138 views

LinearProgramming returns an invalid null solution that apparently doesn't satisfy constraints without any warning

Bug introduced in 9.0 or earlier and persisting through 11.0.1 or later While searching to answer the question Solving the magic backyard puzzle with MMA at some time I composed a set of arguments ...
user avatar
  • 6,923
8 votes
0 answers
103 views

Status of DualLinearProgramming

DualLinearProgramming is referenced in this tutorial tutorial/ConstrainedOptimizationLinearProgramming It exists in ...
user avatar
  • 14.7k
8 votes
0 answers
197 views

FindShortestTour causes kernel crash

I have contacted support, CASE:4075709 UPDATE I have received reply from wolfram support. They have confirmed that this is indeed a bug. There are lots of sets of data that can cause the Kernel to ...
user avatar
  • 1,941
8 votes
0 answers
1k views

Visualizing the Lagrange Multiplier Solution

This question is based on work in Susan Colley's Vector Calculus, 4th ed. The question is to find and classify critical points of $f(x,y,z)=3xy-4yz+5xz$ subject to the constraint $g(x,y,z)=3x+y+2z=13$...
user avatar
  • 14.5k
8 votes
0 answers
449 views

How to determine reason for kernel crash? -> Nelder Mead optimisation

I am making use of the Nelder Mead algorithm inside Mathematica's NMaximize to find a parameter set by solving the Schrodinger equation for a given system. (see ...
user avatar
  • 2,632
7 votes
0 answers
289 views

Is the stochastic gradient descent minimization implemented in Mathematica?

I want to use Stochastic Gradient Descent method on its own (not for neural networks) to minimize an objective function in Mathematica. I couldn't find any SGD routine implemented in Mathematica (12.0)...
user avatar
  • 1,169
7 votes
0 answers
397 views

Is there an analogue of Evaluated->False (in FindRoot) for FindMinimum?

I guess functions like FindRoot, FindMinimum, etc puts the estimation number into the expression, and then do other calculations....
user avatar
  • 7,661
7 votes
0 answers
2k views

When using NMinimize[...,Method->"DifferentialEvolution"] is an "iteration" different than a "step"?

Hopefully this question has a simple answer. I have the following bit of code: ...
user avatar
  • 71
6 votes
0 answers
159 views

SemidefiniteOptimization for operator norms: Stuck at the edge of dual feasibility

Can someone give a workaround and/or explanation why Problem 1/Problem 2 fail to solve through SemidefiniteOptimization? Problem 3 works. (I'm using 12.1.0 on Mac). ...
user avatar
6 votes
0 answers
118 views

Caveats of LinearProgramming on Integers domain

When using LinearProgramming with the Integers domain, Mathematica issues the following warning: ...
user avatar
  • 225k
6 votes
0 answers
277 views

NMinValue , NMaxValue , NMinimize and NMaximize behave poorly for 2-dimensional function unless the constraint is posed as an ImplicitRegion

I am making a plotting function where I need to know the max value the function takes over the given 2D range. I noticed a difference between the behavior of ...
user avatar
  • 63.2k
6 votes
0 answers
567 views

Custom Methods for NMinimize/NonLinearModelFit

Is there a way to write custom methods for NonLinearModelFit or NMinimize? To give background, I currently have a batch of code ...
user avatar
6 votes
0 answers
392 views

Problems extending NelderMeadMinimize into 2D

Update The eventual route I followed was to adapt a version of the NM-simplex written in C and link to it with MathLink. Once I've tested this out fully I'll post it here. I've been playing around ...
user avatar
  • 8,608
6 votes
0 answers
223 views

Issue with FindCurvePath

I have a problem with the function FindCurvePath. In some cases it crashes the Mathematica 9 Kernel. Here an example, where it crashes the kernel: ...
user avatar
  • 573
5 votes
0 answers
61 views

Memory leak in FindMinValue?

I was running some geometric optimisation code today using FindMinValue and for some reason at one point the memory usage goes upwards of 14GB, making the kernel ...
user avatar
5 votes
0 answers
105 views

How to train each layer in a Neural Network so they optimize different loss functions in an adversarial network?

Example NetGraph to illustrate the idea (Input is an online signal with a value between -1 and 1, Noise is Gaussian Centered at 0 and standard deviation 0.1, EvilNet is constrained to output a value ...
user avatar
5 votes
0 answers
79 views

Effectivelly using Compile for calculate a Unitary transformation

I am new to Mathematica, and this is my first post, so if my question is not clear enough, I would be glad to read the comments and edit my question to add more information. The problem I need to ...
user avatar
5 votes
0 answers
64 views

What does the PerformanceGoal option of FindMinimum do?

FindFit and FindMinimum both have a PerformanceGoal option. It is not documented. What does ...
user avatar
  • 225k
5 votes
0 answers
137 views

What's BayesianMinimization and related functions based on?

Is it specified anywhere what the backend is for the Bayesian optimization related functionality in Mathematica v11? I'm specifically referring to the Bayesian* ...
user avatar
5 votes
0 answers
440 views

Amelioration of a Karush-Kuhn-Tucker nice code

In what concerns the resolution of a Karush-Kuhn-Tucker condition, this wonderful code borrowed to Parreiras (The Mathematica Journal 16 2014) which is a correction of another code by Kampas (The ...
user avatar
5 votes
0 answers
391 views

Softmax Regression Classification Algorithm

I'm following the Stanford Machine Learning course while simultaneously developing my Mathematica abilities. I'm having issues with my Softmax Classifier implementation (for ref, have a look at these ...
user avatar
5 votes
0 answers
172 views

Improving the speed of an optimization algorithm via compilation and parallellization

I have written an implementation of eight variants of the PSO-algorithm and I want to test them over a set of test functions. I am using parallelization as it improves the speed a lot and I have also, ...
user avatar
  • 265
5 votes
0 answers
303 views

NMinimize seems to call function with the same values multiple times

I have to minimize a function where the evaluation of one parameter set takes very long (around 5sec) and discovered alongside, that NMinimize seems to call this ...
user avatar
4 votes
0 answers
137 views

NMinimize differential evolution: how do search points and initial points really work?

I am puzzled by the settings of a specific method for NMinimize called DifferentialEvolution, given for example here. The ...
user avatar
  • 1,491
4 votes
0 answers
518 views

Mathematica implementations of classical genetic algorithm optimization

Are there any Mathematica implementations of genetic algorithm optimization routines, including third-party and commercial? (DifferentialEvolution isn't quite what ...
user avatar
  • 185
4 votes
0 answers
98 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'...
user avatar
  • 493
4 votes
0 answers
84 views

NMaximize not finding initial points within simple constraints

I'm trying to do an optimization, but Mathematica seems not to be able to find starting coordinates within a simple rectangular region. When I run this code: ...
user avatar
4 votes
0 answers
354 views

Problem with the accuracy of the real-coded Genetic algorithm

Since there is no Genetic algorithm implemented in the Mathematica i tried to write a very simple genetic algorithm myself. The accuracy of the results depend upon rounding up the obtained parameters. ...
user avatar
  • 751
4 votes
0 answers
1k views

How to find the a minimum cost perfect matching

Crossposted on Wolfram Community A a minimum cost perfect matching is very useful tool.This three links about this demand just related me,let alone all MMA.SE. How to get some pairing with smallest ...
user avatar
  • 23.7k
4 votes
0 answers
127 views

How to do parallel computation when using LinearProgramming function?

I have a LP problem which contains 2n+3 variables with 4n+6 inequality constraints. I was trying to use Mathematica's LinearProgramming function. When n is small, like less than 30, it gives outcome ...
user avatar
  • 61
4 votes
0 answers
86 views

Optimization`FindFit`ObjectiveFunction and PenaltyFunction

Consider the following toy example: model = a Cos[w t]; data = Table[{t, Cos[2.1 t]}, {t, 0, 10, .25}] + RandomReal[.1, 41]; as both an unconstrained problem: <...
user avatar
  • 8,289
4 votes
0 answers
238 views

Classification problem using SVM methods

I am running SVM on mathematica and I a used this code with classes: ...
user avatar
4 votes
0 answers
281 views

Symbolically Minimizing a Max function

I'm having a tough time with seemingly simple symbolic Minimization/Maximization in Mathematica. I would like to use the Maximize function to work on some unknown random variables and so use min/max ...
user avatar
  • 41
4 votes
0 answers
129 views

Efficient processing of Special Ordered Sets with LinearProgramming

I'm playing with integer linear programming, especially problems involving lots of constraints which would appear to be special ordered sets. Below is a toy example, three last rows of the matrix ...
user avatar
  • 14.7k
4 votes
0 answers
591 views

Travel time sweet spot using: Mathematica and Google Maps API

I want to use Mathematica to do some time minimisation calculations calling on Google Maps API for travel time data. I'm concerned with travel time, e.g. along roads (by car or walk) and not linear ...
user avatar
  • 41
4 votes
0 answers
626 views

Minimizing a functional takes forever

I need help with minimizing a functional in Mathematica. I have a function $V(\xi)=\sum_{i=1}^\infty C_{3_i}J_0(\xi/C_i)+C_{4_i}Y_0(\xi/C_i),~~~\Sigma\leq\xi\leq\xi_1$, and want to find such $\{C_{...
user avatar
3 votes
0 answers
90 views

Solving or Minimizing the Norm of the matrix equation $M^TAM - M^TB - B^TM =C$

I am trying to solve the matrix equation $M^TAM - M^TB - B^TM=C$ where I know A, B and C. My unknown matrix is M which has the special form that all the rows and columns sum to zero. i.e. I have four ...
user avatar
  • 495
3 votes
0 answers
86 views

Finding multiple minimizers

Is it possible to find all (or as many as possible) minimizers of a given function? For example, minimizing the function $\cos(\pi(p-q))+\cos(\pi(q+p))$ for $-3\leq p,q\leq 3 $ can be done using ...
user avatar
  • 4,228
3 votes
0 answers
23 views

Constrained minimization failing to compute general solution despite giving solution for specific inputs

I am trying to run ...
user avatar
  • 71
3 votes
0 answers
93 views

NMinimize: Constraints not valid, although additional constraints make it valid

The following code produces the error message "The following constraints are not valid". However, if I add the additional constraint "diam <= 3" (commented out below), it runs correctly and finds a ...
user avatar
3 votes
1 answer
184 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: ...
user avatar
  • 839
3 votes
0 answers
341 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 ...
user avatar
  • 3,113
3 votes
0 answers
179 views

Speeding up an optimization problem

I have the following code which is working well but for matrices $M_i$ of size $40000\times 4$ the optimization problem takes extremely long. ...
user avatar
3 votes
0 answers
234 views

Automated searching for maximal 2D point configurations

I have some black-box function that takes lists of 2D points, and I would like to find some practical methods of searching for collections of points that maximize it. Motivation I've come across ...
user avatar
  • 30.4k
3 votes
0 answers
136 views

Finding the shortest distance of two points and an area

So I have a region defined by something like MeshRegion[{{0, 0}, {1, 1}, {2, 1/2}, {2, -1/2}}, {Line[{1, 2}], Line[{2, 3}], Line[{3, 4}], Line[{4, 1}]}], and two ...
user avatar
  • 1,941
3 votes
0 answers
221 views

Using of FindMinimum in constrained problem

There is a constrained optimization problem based on finite element method. We should find the optimal distribution of density inside the our region for minimazing the energy of deformation. The ...
user avatar
3 votes
0 answers
133 views

Combinatorial Optimization of NFL Games

This is a "fun" optimization problem that was prompted by an NFL betting pool. Each week you pick one team to win. If that team wins you stay in the game. If it loses you're out. The catch is that ...
user avatar
  • 271

1
2 3 4 5
9