# Tagged Questions

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

9 views

### NMaximize and FindMaximum — Two Different Results

I have the following code in my preamble: ...
40 views

### How to find a maximum?

FindMaximum[1/2*Abs[(o - u)^2/(1 + o^2 + u^2 + 2*o*u + 2*o^2*u^2)]^2, {o, u}] doesn't work. It gave me that : FindMaximum::fmgz: Encountered a gradient that ...
3 views

### Maximum Likelihood Approach for parameter estimation of multi response data, could you provide a tutorial? [migrated]

I was trying to fit the parameters a time dependent system coupled of ODES relate to a kinetic experiment with multi response data. example: A->B+H A+H->C+H A->D dcA(t)/dt=-k1Ca(t)-k2Ca(t)*Ch(t)-k3*Ca(...
30 views

### Training Hidden Markov Models using Mathematica

I have created a Hidden Markov Process with an initial probability vector, emission and transmission matrices. ...
100 views

### In NMinimize, how can I efficiently handle NIntegrate errors for non-integrable functions?

I am using NMinimize to find parameters that minimise the integral of a function in the least squares sense: ...
33 views

### Why Mathematica does not Maximize when using parameter

I have recently started using Mathematica and I have got a question using it. I would appreciate if one could help me figuring out how to handle it. I have the following simple maximisation code <...
313 views

### Find parameters that minimize the distance between two curves in terms of the infinite norm

I am trying to implement a very simple NMinimize code that would search for parameters of a polynomial that minimize (globally) the distance between this polynomial ...
36 views

### (Custom) domain restrictions for NMaximize

I'm new to mathematica, so please be forbearing with me :D I would like to use NMaximize together with domain restriction (where the domain is a custom domain). I've got an example: ...
63 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 ...
152 views

### Optimizing a Difference in Mathematica

I have the following expressions: $$\frac{1}{2} \Bigg [1 + \sqrt{a^2 + (b e^{-\gamma(\tau)})^2 + (c e^{-\gamma(\tau)})^2} \Bigg ];$$ ...
53 views

### Find the minimum of several functions

I have 6 functions of four variables $f_i: \mathbb{R}^4 \rightarrow \mathbb{R},\, i \in 1..6$ For each function $f_j$ I want to find the subset of $\mathbb{R}^4$, called $S_j$, for which it is ...
43 views

### Issues with methods of FindMinimum

I'm trying to use the function FindMinimum for portfolio optimization in stead of NMinimize, since the latter is a lot slower. Also because the variance function of my portfolio is convex, locally ...
349 views

### Need an efficient method for finding certain matrices

I am trying to write a function which produces square matrices with certain characteristics. The function should have two inputs: number of the rows, n number of ...
623 views

### Fitting Vogel's formula for phyllotaxis to the image of a flower

After having read this question I was inspired to investigate how we could take an image of a plant displaying phyllotaxis and fit Vogel's model of phyllotaxis to the image. The theory is very simple. ...
38 views

### Constrain a series of parameters while using FindMinimum

I'm working on fitting some experimental data using a model function that consists of sum of Lorentzians with width parameters A[1], ...
49 views

### Optimization: Area of solvable constraints

I need some support with the following problem: In a polar-type problem, I hand over a list of variables rlist and a numerical optimization function (e.g. ...
53 views

### Why isn't FindMinimum doing anything?

Why is FindMinimum not giving me a result? ...
488 views

### Finding a point from a set of contours such that it is nearest to a given point

I have several contour lines and one point. How can I find a point in one of those contour lines which is nearest to the given point? ...
65 views

### How to minimize the total delivered price when buying many items from many different sources [closed]

In the past, I have often had a problem that I have tried to solve with a large matrix in Excel. Now I want to solve the problem in Mathematica because the matrix is getting larger and the problem ...
46 views

198 views

### Finding the maximum of a gradient vector

Im trying to find the maximum of my gradient vector G[x,y], I've tried several options including FindMaximumValue, FindMaximum etc. but i couldn't find it. The full function is shown below, any help ...
97 views

### Moving the start of a graph to the right, finding maxima in an oscillator

I have the following code written to simulate a driven damped oscillator ...
109 views

### Complicated implicit plotting [closed]

I'm quite new to Mathematica and have already spent tons of time on problems of this type, browsing through tutorials and topics here. I'm now coming to conclusion that it cannot be done and am about ...
89 views

### Problem with a chemical optimization problem [closed]

First of all, I want to say that I'm quite new to Mathematica. I searched a lot on this site to learn how to solve my problem, which this is the problem of my life! I want to minimize a function. It ...
80 views

### RegionPlot with rank constraint

I am trying to plot the feasible region of a rank constrained semidefinite program shown below: The Mathematica code that I am using is the following: ...
112 views

### Is the MMA formulation correct?

Let $H$ be a $4\times 8$ matrix and $R$ is a vector of 2 elements. ...
97 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 ...
116 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 ...
86 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 ...
92 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$ ...
98 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 ...
61 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 ...
33 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 ...
65 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 ...
59 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 ...
383 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 ...
218 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: ...
47 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 ...