Professional Documents
Culture Documents
Optimization in Physics
Optimization in Physics
FindMinimum@ f , xD searches for a local minimum in f , starting from an automatically selected point.
FindMinimum@ f , 8x, x0 <D searches for a local minimum in f , starting from the point x = x0 .
FindMinimum@ f , 88x, x0 <, 8y, y0 <, …<D searches for a local minimum in a function of several variables.
FindMinimum@8 f , cons<, 88x, x0 <, 8y, y0 <, …<D searches for a local minimum subject to the constraints cons.
FindMinimum@8 f , cons<, 8x, y, …<D starts from a point within the region defined by the constraints.
1 2 3 4 5
-1
-2
-3
Plot@x Cos@xD, xD
Plot@x Cos@xD, xD
x . a@@2DD
3.42562
a@@1DD
- 3.2883713955908966`
H*the first element is the value of the function and second one
is the value of ind variable after applying FindMinimum command*L
? FindMaximum
15
10
-3 -2 -1 1 2
FindMaximum::cvmit : Failed to converge to the requested accuracy or precision within 100 iterations.
H*cannot find the maxima bcz it is parabola and maxima dznt exist*L
NMinimize@x ^ 4 - 3 x ^ 2 + x, xD
8- 3.51391, 8x ® - 1.30084<<
8- ¥, 8x ® Indeterminate, y ® Indeterminate<<
NMinimize@y ^ 2 + 2 y + 5, yD
84., 8y ® - 1.<<
y = x ^ 4 - 2 x ^ 3 + 4 x ^ 2 + 3 x + 5;
- 0.296204
D@y, xD . a@@2DD
- 3.23839´ 10-8
H*now we will take a ponit previous of founded mininma and will put it in the
slope of y i.e 1st derivative to check it wether it is positive or negative*L
4 12-Optimization.nb
s = 8- 0.28<
- 0.28
k = D@y, xD
3 + 8 x - 6 x2 + 4 x3
k . x -> s
0.201792
yy = x ^ 2 y ^ 2 + 3 y ^ 2 z ^ 2 + - y ^ 2 Hz ^ 2 - 1L ^ 2 - 3;
a =.;
l = 5; s = 7;
a = FindMinimum@Sqrt@l ^ 2 + x ^ 2D + Sqrt@l ^ 2 + Hs - xL ^ 2D, xD
812.2066, 8x ® 3.5<<
x = x . a@@2DD
3.5
6 12-Optimization.nb
thi = ArcTan@x lD
thr = ArcTan@Hs - xL lD
0.610726
0.610726