# Tagged Questions

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

108 views

...
1k views

### Schedule programing problem with integer linear programming

I know how to model this question on paper, but I don't know how doing it in Mathematica. Imagine , there is a university student who want to choose courses for this semester and he got the ...
78 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 ...
32 views

### Is the MMA formulation correct?

Let $H$ be a $4\times 8$ matrix and $R$ is a vector of 2 elements. ...
87 views

### Find smallest solution in Solve's solution set

When an equation has multiple solutions, how do you find the first solution? Example: Say we're trying to find the first positive x-intercept of the cosine function: $cos(x)=0 \land x \ge 0$ ...
94 views

### Controlling step size in FindMaximum

I have a function of several variables for which I'd like to find the maximum. On one hand, it's easy to work with in the sense that it's smooth, and its only local maximum is a global one. On the ...
56 views

### Solve equations involving summation expressions in Mathematica

I am trying to solve the simple linear regression equation analytically in Mathematica (not using builtin functions). I managed to calculate the gradient as follows f is loss function using RSS and ...
53 views

### Calculating extrema of a given function on a geometrical region

I've never used Mathematica before. Now I have to figure out, for one of my classes, how to find the max and min of the function $f(x,y)=x^3+2\ xy$ over the triangular region of the plane with ...
28 views

### Gradient Descent's Update Rule for Multiparameter Functions

I'm sure this has been answered before, but I haven't been able to find it. I'm trying to manually implement gradient descent for some function, f, with a vector of any length. I define the update ...
58 views

### How to pass numerically evaluated constraints into nminimize?

I have a set of complicated 100 constraints which can be computed numerically for the given iterative values of the design variables. Once evaluated the lhs of the constraints are available as a ...
10 views

### combinatorics questions [migrated]

How much words we can make from $0,1,2$ ? The restriction is we cant put the digit $2$ after the digit $2$. My solution: I tried to solve it with Inclusion-Exclusion Principle count the number of ...
57 views

### Finding the max points of a surface, maximize

So, this should not be hard at all, in fact no one seems so be having my issue so it should be me missing out on a point of information or just experience. So my mission is to with Mathematica find ...
378 views

### ParametricNDSolve KKT Constraint Directly

I am trying to directly solve for an optimal control using Pontryagin Maximum, where H is the Hamiltonian, in the presence of a KKT constraint. The constraint is ignored. I am wondering if a direct ...
217 views

### How to find a graphical solution for extreme values using Lagrange multipliers

I need to find the maxima and minima of a function. I managed this analytically with no problem, but now I need to show in a graphic the intersection of the functions. My function is: ...
43 views

### Numerical evaluation of large number of constraints in nminimize at each step [closed]

I am trying to solve an optimization problem with complicated constraints which can be computed only numerically. I have written a module that computes lhs of these constraints. Now I need to tell ...
138 views

### Locally Weighted Linear Regression

I am following the online Stanford Course in Machine Learning and I am trying to implement the algorithms on the fly in Mathematica. Currently, I have issues with minimizing the Locally Weighted ...
33 views

### How to make FindMiniumum work with delayed function and NIntegrate [duplicate]

I can plot my function penalty[v] just fine, but FindMinimum doesn't work, it just complains non-numerical values from ...
62 views

### Finding a maximum of a Bézier function

Suppose I have a Bézier function $f:\mathbb{R}^2\to\mathbb{R}$ with random coefficients: ...
21 views

### Question about finding the minimum for self-defined function

My self-defined function is too complicated to paste here, and it works well with numerical values assigned. Basically, I have something like this , which contains 12 parameters. With numerical values,...
118 views

### Solve a certain optimization problem [closed]

I am new user of Mathematica. I want to solve an optimization problem. W = (n (X-Y-Z) p / Z q)^(1/a) where a > 0 I ...
108 views

### How to optimize for integer parameters in Mathematica? [closed]

I am trying to find the best set of parameters in order to minimize a certain objective function with Mathematica. The objective function is not important, the only important information about it is ...
140 views

### Using StepMonitor/EvaluationMonitor with DifferentialEvolution in NMinimize

My question about tracking the progress of a minimisation/fitting process is two-fold: 1. The first part of my question can be considered a slight duplicate/follow-up of this question. There the OP ...
137 views

### Using Minuit2 to minimize a Mathematica function

FindMinimum is great, but sometimes it is difficult to get an idea of the uncertainties and intermediate evaluation diagnostics. How to define a function in ...
158 views

### FindMinimum doesn't increase step size when necessary

I've spent much time finding a minimal example demonstrating this problem with FindMinimum. Normally one faces this problem when fitting very large and complicated ...
21 views

...
55 views

### ShortestTour Problem with Constraints [closed]

I can solve a travelling salesman problem with FindShortestTour[], but couldn't find any function to solve a shorest tour problem with additional constraints like cost, fuel capacity etc. How cam I ...
31 views

### Problem with ParametricNDSolve and FindMaximum [closed]

I have a system 4 coupled differential equations: ...
50 views

### Solving 4 coupled differential equation and minimizing the solution

I have a system of $4$ coupled differential equations. ...
113 views

### Find coordinate {x, y, z} where two functions are minimal

I am trying to find a point in a ListPointPlot where the total RegionDistance is minimal AND the total differences of the <...
57 views

### Maximum value of a function using loops

I have a function ab+bc+a/c, where a,b and c ranges from 1 to 5.I have to get an output of maximum value of this function and the values of a,b and c which give that maximum value. Is it possible to ...
71 views

### FindMinimum step size too small

I'm running a simulation of an electromagnetic system using Radia, an external code that is run from Mathematica. I want to use FindMinimum to determine some ...
83 views

### Optimization of the solution to an ODE

Apologies if this is obvious -- I'm very new to Mathematica. I'm trying to minimize the solution to an ODE with respect to a variable. The following code generates the solution to the ODE, ...
55 views

### Minimize: which algorithm is in use?

How can I know which algorithm has been used by Minimize to solve a given problem? Can I force Minimize to use a specific ...
44 views

### Finding parameters with NMinimize doesn't do any steps

To find the best fit for an SVM, I have to constantly re-train my classifier with different parameters based on the result of the test set. I created a helper function which trains the SVM with the ...
63 views

38 views

### NMinimize to Optimize Parameters for Quarter Car Model

I am very new to Mathematica and am trying to simulate a mountain bike suspension by using a quarter-car model and I have input a displacement vs time road profile for two bumps for the excitation. ...
100 views

### Absolute minimum of a function

I would like to ask for some recomendations in order to get a faster result of a function evaluation to get the absolute minimum. In my desperate moments I have written the following code to get the ...
39 views

### How do I Maximize over a Cuboid region?

So, I want to, say, find a maximum value of $|x_1x_3+x_1x_4+x_2x_3-x_2x_4|$ in a unit cube in 4D; how do I do that? I've tried ...
93 views

### Find extremal values while plotting

I have a parametric function {x[t],y[t]}. I then do ...
37 views

### From “NMinimize::nosat: Obtained solution does not satisfy the following constraints within Tolerance”, can prove something?

I got a very very complicated function G[r1,r2,F1,F2] to minimize. It has four variables, r1,r2,F1,F2. When I introduce the ...
40 views

### How to set step size in FindMinimum?

My initial guess is very close to the solution. So I want step size is to be very small. Is there anyway to control the step size in the findminimum function?
42 views

### How to solve a constrained minimization problem?

I unsuccessfully tried ClearAll; Minimize[x^(8/5) + y^(8/5) + z^(8/5), x*y*z + x^2 + y^2 + z^2 == 4, {x, y, z}] No output during few hours. I am interested in ...
57 views

### “PostProcess” and “Tolerance” in DifferentialEvolution? [closed]

What is "postprocess" option in DifferentialEvolution method (for instance when using ...
53 views

### Step Monitor option in DifferentialEvolution

Using the "Step Monitor" option what exactly do I read? Does it show me the "best solution" for each population? Or does it show me each search point in the population? Also is there an integrated "...
177 views

Define: ...
238 views

### How to describe the convex hull of a set of points as an implicit region for optimization?

Last edit: 2016-05-03 A.G.'s answer was the one helped me the most, see explanation at the end of this question. Original question In Mathematica you can create out of a set of points in 2D and 3D ...