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

learn more… | top users | synonyms (4)

-2
votes
1answer
66 views

Calculate minimum subject to conditions

What is the lowest value of $c$ such that $\qquad a^2 + b^2 = c^2$ and $\qquad ab + ac + bc = 100$ I want to solve this problem with Mathematica Edit These conditions are generated from a right ...
0
votes
0answers
20 views

Why isn't this minimize function returning the optimal answer? [on hold]

I am trying to minimize the following equation by solving for s1, s2, s3, s4 (where s1+s2+s3+s4=20, and they should be positive integers) ...
0
votes
0answers
29 views

NMaximize — Error + Output

When I run the code, Table[ NMaximize[ {f[α, χ, τ], 0 <= α <= 2 π, 0 <= χ <= π}, {α, χ}, WorkingPrecision -> 10 ], {τ, 0.1, 2, 0.1} ] ...
0
votes
2answers
35 views
0
votes
1answer
44 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 ...
0
votes
0answers
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(...
1
vote
0answers
33 views

Training Hidden Markov Models using Mathematica

I have created a Hidden Markov Process with an initial probability vector, emission and transmission matrices. ...
3
votes
2answers
101 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: ...
0
votes
0answers
34 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 <...
8
votes
3answers
315 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 ...
3
votes
1answer
38 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: ...
1
vote
1answer
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 ...
4
votes
3answers
153 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 ]; $$ ...
0
votes
1answer
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 ...
3
votes
0answers
44 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 ...
2
votes
2answers
350 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 ...
11
votes
1answer
625 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. ...
0
votes
0answers
39 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], ...
0
votes
0answers
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. ...
2
votes
1answer
53 views

Why isn't FindMinimum doing anything?

Why is FindMinimum not giving me a result? ...
10
votes
4answers
489 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? ...
0
votes
1answer
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 ...
1
vote
1answer
46 views

How to symbolically solve the minimization problem in simple linear regression

I want to use mathematica to symbolically solve the minimization problem in simple linear regression: $${\text{Find }}\text{arg}\min _{\alpha ,\,\beta }Q(\alpha ,\beta ),\qquad {\text{for }}Q(\alpha ,...
3
votes
1answer
123 views

Finding Maximum Value of ElectricField in a bounded region

I have been trying to find the maximum value of the magnitude of an electric field in a bounded region. NDSolve gives the value of the potential inside the region ...
1
vote
1answer
80 views

How to speed up this code with NMaximize?

I want to maximize the expected exponential growth rate of the portfolio, which contains 3 stocks. I get the adjusted stock price for General Electric, Du Pont, and IBM. ...
3
votes
0answers
64 views

CVaR Portfolio Optimization

I am looking for help on CVaR Portfolio Optimization based on the article . I have to solve the following problem: CVaR cannot be negative by design. Therefore, (a)+ is defined as max(a, 0). Withe ...
10
votes
7answers
572 views

how to get $n$ equidistributed points on the unit sphere

We can get $n$ equidistributed points in the unit circle using CirclePoints. But how do you get $n$ equidistributed points on the unit sphere(surface of a ball)? ...
0
votes
0answers
232 views

How to find Multiple Maxima/Minima [duplicate]

I am trying to solve a problem that requires finding multiple maxima of a numerical function. So the function generates some numbers that are coming out of an experiment. I tried using NMaximize or ...
2
votes
1answer
143 views
1
vote
2answers
213 views

Incorporating the minimum and maximum of the function in a Dynamic plot

I'm working on my project for class and it's supposed to be a graph that can take functions from the user and display it along with finding the max and min of the graph. But I just don't know how to ...
1
vote
1answer
112 views

Maximising solutions of NDSolve [duplicate]

I have the following system of differential equations ...
4
votes
1answer
138 views

How can I find the greatest of this expression?

I want to find the greatest of the expression $$P=a \sqrt{12-b}+\sqrt{b\left(12+a^2\right)}+66\sqrt{a^2+b+3}-\left(a^2+b\right)^2$$ with $a >0$, $0<b\leq 12$. I tried ...
-1
votes
1answer
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 ...
1
vote
1answer
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 ...
2
votes
1answer
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 ...
-1
votes
1answer
91 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 ...
1
vote
1answer
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: ...
0
votes
1answer
112 views

Is the MMA formulation correct?

Let $H$ be a $4\times 8$ matrix and $R$ is a vector of 2 elements. ...
2
votes
3answers
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 ...
22
votes
2answers
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 ...
5
votes
0answers
87 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 ...
1
vote
2answers
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$ ...
2
votes
1answer
99 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 ...
0
votes
0answers
63 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 ...
0
votes
0answers
35 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 ...
4
votes
2answers
66 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 ...
0
votes
1answer
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 ...
2
votes
1answer
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 ...
1
vote
2answers
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: ...