extrema attempts to find local extrema of a univariate/multivariate differentiable expression under equality constraints, using analytical methods.
Additionally, the Jacobian matrix of the constraints must be full rank (i.e., denoting the kth constraint by gk(x1,x2,…,xn)=0 for k=1,2,…,m and letting g=(g1,g2,…,gm), the Jacobian matrix of g must be equal to m).
If there is only one variable, it doesn’t have to be a list.
The parameter vars can also be entered as a list of values of the variables; e.g. [x1=a1,x2=a2,…,xn=an], in which case the critical point close to a=(a1,a2,…,an) is computed numerically by , applying an iterative method with initial point a.
Saddle and unclassified points are reported in the message area. Also, information about possible (non)strict extrema is printed out. If lagrange is passed as an optional last argument, the method of Lagrange multipliers is used. Else, the problem is reduced to an unconstrained one by applying implicit differentiation.
If critical points are left unclassified you might consider repeating the process with larger value of n, although the success is not guaranteed.
Examples.
⎡ ⎢ ⎣ |
| ⎤ ⎥ ⎦ |
⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ |
| ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ |
⎡ ⎢ ⎢ ⎣ | ⎡ ⎢ ⎢ ⎣ | − |
| a | ⎤ ⎥ ⎥ ⎦ | , | ⎡ ⎣ | ⎤ ⎦ | ⎤ ⎥ ⎥ ⎦ |
⎡ ⎣ | ⎡ ⎣ | ⎤ ⎦ | , | ⎡ ⎣ | 0.277769149124 | ⎤ ⎦ | ⎤ ⎦ |
⎡ ⎢ ⎢ ⎢ ⎢ ⎣ | ⎡ ⎢ ⎢ ⎢ ⎢ ⎣ |
| ⎤ ⎥ ⎥ ⎥ ⎥ ⎦ | , | ⎡ ⎣ | ⎤ ⎦ | ⎤ ⎥ ⎥ ⎥ ⎥ ⎦ |
⎡ ⎢ ⎢ ⎣ | ⎡ ⎢ ⎢ ⎣ |
| ⎤ ⎥ ⎥ ⎦ | , | ⎡ ⎣ | ⎤ ⎦ | ⎤ ⎥ ⎥ ⎦ |
⎡ ⎣ | ⎡ ⎣ |
| ⎤ ⎦ | , | ⎡ ⎣ | ⎤ ⎦ | ⎤ ⎦ |
⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ |
| ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ |