Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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
6
votes
4answers
301 views

Minimizing a function with a constant $l > 0$

I'm VERY new to Mathematica and would like some help with minimizing a function. $$f(x) = \frac{1}{2} \sqrt{\frac{\left(l^4+x^4\right)^2}{l^4 x^2}}$$ I want to find which $x-value$ (probably ...
6
votes
2answers
151 views

How to find alignments of interlocking shapes?

I'm searching for the ways to align interlocking shapes, that is, finding the locations and rotations that maximize the arc length at which they touch. For simplicity, I'm assuming 'shapes' are one ...
6
votes
0answers
456 views

Simulated Annealing Parameters and Results [closed]

I am using SimulatedAnnealing method for a simulation based optimization problem and was wondering if someone can enlighten me on the following features: Is there ...
5
votes
1answer
211 views

Sparse Hessian for FindMinimum? Broken?

Is the sparse Hessian mechanism for FindMinimum[] (Method->"Newton") broken? Or am I simply not apprehending its proper setup? Here's what's happening. Below is for solving the example problem ...
4
votes
1answer
142 views

Why does EvaluationMonitor in FindMaximum only work for some regions?

This has come about after trying to understand what was going on with this question about FindMaximum and regions. My first thought in that scenario was to set-up <...
4
votes
2answers
804 views

Linear Programming Using Dual Simplex method

I want to solve an optimization problem using the Dual Simplex Method. Although Mathematica gives the result directly when I use the command Minimize but I want to ...
3
votes
2answers
929 views

Find minimum value of function which calls NDsolve [duplicate]

I have defined a function which takes a coefficient for a differential equation as an argument, solves the differential equation with NDSolve, and returns the value of the solution at time t=10. I can ...
3
votes
1answer
217 views

Principal Axis Maximization

I know that, in order to use PrincipalAxis, for example in FindMaximum function: ...
3
votes
2answers
149 views

Minimise discrete function

Let $f\,\colon\,\Lambda\to\mathbb R$ be a real-valued function, where $\Lambda$ is a finite integer lattice. Say, $\Lambda=\mathbb Z_3^n=\{\vec x\,\mid\, x_i=0,1,2\}$ for some $n\in\mathbb N$. I'd ...
3
votes
6answers
384 views

Problem in finding the actual minimum of a rapidly varying function

I have been facing the problem of finding the true minimum of a rapidly varying functions. The commands like FindMinimum and ...
2
votes
1answer
521 views

Finding the minimum of a function

I asked this question Mark Minimum Value in DensityPlot. Another question has come up, or better said, a task: Find the minimum of a function. I haven't been able to write the needed code for that, ...
2
votes
2answers
257 views

optimization of CountourPlot with NIntegrate

I have to use ContourPlot with a complicated function depending on 2 parametrs (that I cannot report here) that contains numerical integrations. Here is a simple ...
2
votes
1answer
221 views

How to find the local minimum points in the multi-dimensional numerical data?

I am trying to get some local minima of an n-dimensional function (which only has numerical form). For two-dimensional function data, we can find the local minimum points from the contour plot easily. ...
2
votes
2answers
496 views

Find Maximum doesn't seem to work [closed]

...
2
votes
2answers
185 views

Find the maximum Z in {(X + Y)==Z} using all the digits 0-9 only once

II want to add two integers with different digits to get a third integer with different digits. At the end, all 10 digits have to be different. So there should be 10 digits in total. How you ...
1
vote
3answers
815 views

Why does Maximize return a wrong answer?

I want to find the maximum of the following function, but get a wrong result. What am I doing wrong? ...
1
vote
1answer
95 views

Given a function $f(t,s)$, compute $\max_{t_2\in [0,1]}\min_{t_1\in [0,1]} |f(t_1,s_1)-f(t_2,s_2)|$

Given a continuous and bounded function $f(t,s)$, $t,s\in[0,1]$, I would like to compute $$\max_{t_2\in [0,1]}\min_{t_1\in [0,1]} |f(t_1,s_1)-f(t_2,s_2)|,$$ for each numeric values of $s_1$ and $s_2$....
1
vote
1answer
537 views

A problem on generating convex hull

For example, I typed the following: ...
1
vote
1answer
2k views

using array elements in minimization

I have switched from mupad to Mathematica, however the syntax is completely different here. I want to ...
0
votes
1answer
104 views

NMinimize or NMaximize for a dynamic problem

I am trying to solve a relatively simple quadratic discrete time dynamic problem using NMinimize. My code works for short time horizons (T<15) but for T longer, it ends up taking minutes and for T>=...
0
votes
0answers
120 views

Kernel crashes during `LinearProgramming`. Can you reproduce it?

Using the code from this answer for a sufficiently large problem setting crashes my kernel. I'll copy/paste the code here: ...
9
votes
0answers
266 views

Help finding the centre of a faint, incomplete circle? [closed]

so I found a program in the answers to this question that I thought was brilliant, so here it is applied to my situation: I have the image and here's the code: ...
8
votes
1answer
228 views

Is there any way to speed up this code that's Maximizing a function got from numerical integration?

I have this code below, which is calculating the Binding energy of an electron in a Quantum Well Wire with a hydrogenic impurity in it. Well you don't have to care much about what kind of calculation ...
7
votes
2answers
506 views

FindMinimum: How can I know which method Mathematica has used?

I have been using FindMinimum to find a local minimum of a non-linear function within a constrained region. How can I know which method Mathematica has selected to find the local minimum? Thanks in ...
6
votes
1answer
540 views

Mathematica vs Sigmaplot (Non LinearModelFit)

I asked a question in a previous post that was closed because "The title of the question is not correct and the issue here is too trivial to help anyone later". https://mathematica.stackexchange.com/...
5
votes
3answers
102 views

Selection of lists among list of lists to maximize coverage and avoid repetitions

There is a list of 'list of consecutive integers'. There could be a single integer as well. Example list: ...
5
votes
1answer
152 views

Optimization over a bi-linear function

For the function $$ f(x_1,x_2;a_0,b_0)=\\\small\cases{\frac{1}{2}\left[x_1+x_2-x_1x_2+\left(\frac{-1+b_0(1-a_0)}{a_0}x_1+1\right)\left(\frac{-1+b_0(1-a_0)}{a_0}x_2+1\right)\right],\quad 0 \leq x_1\...
5
votes
2answers
176 views

Unexpected slowness of FindShortestTour through 9 points

This a very useful function, but it is very slow: ...
5
votes
2answers
399 views

NMinimize Constraints on Interpolating Functions

I have the following piece of code and am trying to use NMinimize (the last line in the following chunk of code) to minimize ...
5
votes
1answer
325 views

Simple minimization not evaluating

I tried to solve a rather simple optimization problem, which Mathematica apparently cannot handle. A minimal example is the following: ...
4
votes
1answer
209 views

Performance of a bootstrap - time of computation not linear with number of iterations

I'm doing a bootstrap based on this thread with the following code (file.txt here): ...
4
votes
0answers
197 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 ...
4
votes
1answer
246 views

best way for finding approximate root of monotonic sawtooth like function

First I will generate such kind of monotonic sawtooth like function called func ...
4
votes
0answers
289 views

How is the multi-class support vector machine classifier implemented? [closed]

I am using support vector machine (SVM) method with Classify to do multi-class. Can anyone tell me the reference (paper) used by Wolfram Mathematica to develop the ...
4
votes
2answers
836 views

Optimizing functions taking matrix arguments

I'm looking for general information on how to optimize matrix valued functions, I have the following function I'm looking to maximize (or figure out if this is possible at all). ...
4
votes
2answers
524 views

FindFit and NMinimize to fit a parametric model (minimize the distance of two curves)

I am trying to find a fit to the cumulative distribution of a set of points using FindFit or NMinimize. In particular, I would like to find the parameters of the cdf of the Beta Distribution that ...
4
votes
3answers
762 views

FindRoot constrained to maximum

I am using FindRoot to find the local maximum op some function, by examining where its derivative is zero. However, keeping the starting value the same, sometimes <...
3
votes
1answer
322 views

Optimize a parametric matrix to get a lowest possible eigenvalue

This question is a followup of Plot the lowest eigenvalues of a parametric matrix Now I can get the lowest eigenvalue LowEign(t) of the matrix for a given t numerically. When I plot the LowEign ...
3
votes
1answer
6k views

Minimizing using indices, error: Part::pkspec1: The expression cannot be used as a part specification

I want to use Minimize where the variables to minimize are indices pointing into an array. Here a MWE that hopefully shows what my problem is. ...
3
votes
1answer
211 views

Optimize function defined with Nintegrate

I would like to optimize evaluation of the function defined as an integral: f[x_]:= NIntegrate[g[s],{s,0,x}] the function g[x] can be an Interpolating function. ...
3
votes
1answer
285 views

ArgMax, FindArgMax, and NArgMax disagreeing on answer

In working on an estimation problem, I created three Gaussian-like functions. The ML estimate could be seen as the argmax of the product of the three functions. In trying to get the code to run faster,...
3
votes
3answers
587 views

How to shade a plotted region in specific direction?

I am using RegionPlot to plot a linear program maximize 30x1+25x2 with the constraints ...
3
votes
1answer
1k views

wrong use of _?NumberQ?

I am having trouble with a numerical exercise. Here's a simplified version of my problem. I define two functions to find the solution to two constrained maximization problems: ...
3
votes
1answer
555 views

Why `FindMaximum` doesn't work in my example

Consider the following function ...
3
votes
2answers
251 views

FindRoot: Using replacement rule inside body

I have a function similar to the following example: f[x_, y_] := (x - 2)^2 + x ( y - 2)^2 and I would like to find the minimum with respect to ...
2
votes
3answers
329 views

Optimization over vectors with Mathematica

I have a problem in vectors $\mathbf{x} = (x_1,\ldots,x_n)$ and $\mathbf{y}=(y_1,\ldots,y_n)$, where every $x_i,y_i\in\mathbb{R}_{\geq 0}$, $$\begin{array}{ll} \text{maximize} & \displaystyle\...
2
votes
1answer
636 views

Why is `NMinimize` trying to evaluate my function analytically instead of numerically?

I have been having some trouble with NMinimize. I am trying NMinimize[f[x], x] where f is ...
2
votes
1answer
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: ...
2
votes
2answers
1k views

Find the values of 3 variables that best fit 6 equations [duplicate]

I have 6 equations ...