Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 193

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

7 votes

How to find the minimum of this constrained expression?

Use a numerical approach: NMinimize[{1/2 x^2 y^2 + y^2 z^2 + z^2 x^2 + 96/(x + y + z + 1), x >= 0 && y >= 0 && z >= 0 && x^2 + y^2 + z^2 == 5}, {x, y, z}] {24.6693, {x -> 2.00209, y -> 0 …
Dr. belisarius's user avatar
1 vote

List comparison in constraints for Minimize

Your code works here (Mathematica v 9): x = Table[Symbol[StringJoin["x", ToString[i]]], {i, 7}]; A = {3, 2, 5, 1, 7, 9, 6}; Minimize[{A.x, (Apply[And, Thread[0 <= x <= 1]]) && (Apply[Plus, x] ==3) && …
Dr. belisarius's user avatar
10 votes
Accepted

How to Maximize[Log[n]^(1/Log[n]), n]

Maximize[{Log[n]^(1/Log[n]), n > 1}, n] (* {E^(1/E), {n -> E^E}} *)
Dr. belisarius's user avatar
10 votes

Finding the maximal `t` at which `u[x,t] == 1`?

Following the trend of posting alternative methods and skipping the obvious NMaximize[{t, sol[x, t] == 1, -58 <= x <= 50, 50 <= t <= 58}, {x, t}] max = SortBy[PixelValuePositions[ i = Binariz …
Dr. belisarius's user avatar
0 votes
Accepted

is it possible to combine a step monitor with a 3d contour plot

Only for this question not getting to the un-answered queue: Show[ContourPlot3D[ios, {ac, 0, 2}, {ah, 0, 2}, {ap, 0, 2}, Contours -> 10], Graphics3D@({Red, PointSize[0.01], Line[pts …
Dr. belisarius's user avatar
10 votes
Accepted

Simulating an optimization problem

w = RandomReal[{0, 1}, 10]; b = RandomReal[{0.5, 1}, 10]; a = RandomReal[{0, .5}]; rr = Array[r, 10]; Minimize[{w.Log@rr, Thread[a <= rr <= b]}, rr]
Dr. belisarius's user avatar
2 votes
Accepted

Bounding parameters in optimization problems

FullSimplify[ ArgMax[{a*Sqrt[x] + b*Sqrt[y], x + y <= 10 && a > 0 && b > 0}, {x, y}], a > 0 && b > 0] (* {(10 a^2)/(a^2 + b^2), (10 b^2)/(a^2 + b^2)} *)
Dr. belisarius's user avatar
5 votes
Accepted

Trouble with NMaximize

Your formulation doesn't work because your constraints don't involve variables. The preferred solution was posted as a comment to your question, but for making your original one work you could do: NM …
Dr. belisarius's user avatar
15 votes
Accepted

Strange domain dependency with Maximize

As Szabolcs stated, Maximize is calling NMaximize. The problem is that the call is not being done with appropriate options for your case. Just compare for example: NMaximize[{x*(1 - 0.01 x), x ∈ Int …
Dr. belisarius's user avatar
1 vote

parameter optimization

I am not sure if I am following your problem. Perhaps this is a partial answer. For solving ODEs like yours for a variable number of functions, you could do something like: dims = 3; k = RandomInteg …
Dr. belisarius's user avatar
3 votes

Find Maximum doesn't seem to work

Using FindAllCrossings from here norm[x_List] := Sqrt[x.x] (* Norm[ ] is always problematic *) r[t_] := {3 Cos[3.3 π t], Sin[4 π t] + 4 t}; n[t_] := norm[r'[t] r''[t]]/norm[r'[t]]; (* now we find th …
Dr. belisarius's user avatar
2 votes

How to find the maximum value of an integer that satisfies some inequality

If you want to use the results from Reduce, you could do: Max[j /. Solve@ Reduce[2^j/(j + 1) <= 10, j, Integers]]
Dr. belisarius's user avatar
2 votes
Accepted

How to fit one parametric array to another numerical array?

For example: experimArray = Range@20; theoretArray = ListConvolve[{a, b, c, d, e}, Range@24] sol = NMinimize[Norm[experimArray - theoretArray], {a, b, c, d, e}] So: theoretArray /. sol[[2]] (* {1. …
Dr. belisarius's user avatar
3 votes

Find the values of 3 variables that best fit 6 equations

You may use FindFit l = {0.344027 == 0.5 (a + b) - 0.5 (a - b) Cos[2 (-1.3439 - 0.0174533 c)], 0.679511 == 0.5 (a + b) - 0.5 (a - b) Cos[2 (0.20944 - 0.0174533 c)], 0.436543 == 0.5 (a + b) …
Dr. belisarius's user avatar
1 vote
Accepted

Optimization problems over the Integers

Diophantine problems are tough and there is no silver bullet. In your example this works: i = IntegerPart; sol = NMaximize[{(3 i@ n + 4)/(2 i@n + 1), n > 1}, n]; i@n /. sol[[2]] (* 1 *)
Dr. belisarius's user avatar

15 30 50 per page