banner



how to find extreme values of a function

Only every bit we can search for local extreme values of a function of 1 variable by ways of the command FindMinimum , we can likewise use this command to search for local farthermost values of functions of more than one variable.

If f(x,y,...) is a role of the variables 10, y, ..., and so we tin can utilize the command FindMinimum to seek out a local minimum value of f from a seed value of x =ten 0, y =y 0, ... as follows:

FindMinimum[ f(x,y,...),{ 10 , x 0 },{ y , y 0 },...]

From this seed value, Mathematica volition notice the path of steepest downwards gradient and follow it until it reaches a local minimum value, or until its computations go beyond a specific signal.  If one modifies the command then that it is in the form FindMinimum[ f(x,y,...),{ ten , ten 0 , xmin , xmax },{ y , y 0 , ymin , ymax },...]

so the search for a local minimum value volition stop if the value of x passes outside of the interval [xmin,xmax], or the value of y passes outside of the interval [ymin,ymax], etc.
Example 1: The function f(10,y) = e -(2 x 2 - five x + 7 y 2 + iii y)

has a unique local maximum value in its domain.  Find the location of the point where this maximum occurs using Mathematica.

The local maximum values of f(ten,y) occur at the aforementioned points as the local minimum values of g(x,y) = -f(x,y).  Thus we can search for the location of a local maximum value of f(x,y) past applying the office

FindMinimum to g(x,y).  Using the signal (0, 0) every bit a seed value, we search for the local maximum of f(ten,y) every bit follows:In[1]:= f[x_,y_]=Exp[-(2*x^2-5*ten+seven*y^2+3*y)];
FindMinimum[-f[x,y],{x,0},{y,0}] Out[1]= {-31.3881, {x -> 1.25, y -> -0.214286}}

Thus we see that g(x,y) = -f(ten,y) has a local minimum value of -31.3881 at x = one.25 and y = -0.214286, which implies that f(10,y) has a local maximum value of 31.3881 at this point.
The graph of f(x,y).


Example two: An island is to exist stocked with deer and antelope.  Due to limited space on the island, the weights of the animals at the end of the year are dependent upon the population densities of the animals.  Let us use x to denote the number of deer and y to denote the number of antelope.  It is constitute that the function Westward one = 180 - .135 x - .090 y

represents the average weight of a deer at the end of the year, and the function

Due west 2 = 120 - .080 x - .160 y

represents the average weight of an antelope at the end of the year.

Bold that the population of the animals remains constant during the course of the year, how should the island be stocked in order to maximize the total weight of the animals?

In guild to solve this problem we must starting time find a function of our variables ten and y that represents the maximum total weight of the animals.  The total weight of the deer is given by the product of the number of deer and the average weight of each deer.  Thus the total weight of the deer is x (180 - .135x - .090y).  Similarly, the total weight of the antelope is the product of the number of antelope and the boilerplate weight of each antelope.  Thus the total weight of the antelope is y (120 - .080x - .160y).  The total weight of all of the animals is then given by the function

f(x,y) = x (180 - .135 x - .090 y) + y (120 - .080 x - .160 y)
= 180 x + 120 y - .135 10 ii - .160 y 2 - .17 x y .

Since the boilerplate weight of each deer must be positive, we can find the maximum number of deer that can exist on the island by letting y = 0 and solving Westward 1 > 0 for x.  We obtain

180 - .135 ten > 0.

Thus nosotros have 0x 1333.  The maximum number of antelope that tin be on the isle is institute past letting 10 = 0 and solving W two > 0 for y.  Then

120 - .160 y > 0.

Thus 0y 750.  Therefore we consider the function f(x,y) for ten in the interval [0,1333] and for y in the interval [0,750].  By graphing this office on this domain

The graph of f(10,y) for values of 10 and y such that f(10,y) 0.

it appears that f(x,y) has a unique local maximum, and that this local maximum is the overall maximum value of the function on this domain.

Now we must find values for x and y so equally to maximize f(ten,y).  We shall do this by finding the the location and the value of the unique local maximum.  To find the local maximum value of f(10,y) past ways of the function

FindMinimum, nosotros must search for the local minimum value of -f(x,y).  We exercise this as follows:In[2]:= f[x_,y_]=180*x+120*y-.135*x^2-.160*y^2-.17*x*y;
FindMinimum[-f[x,y],{x,0,0,1333},{y,0,0,750}] Out[2]= {-60104.3, {10 -> 646.957, y -> 31.3043}}

Thus nosotros run across that -f(x,y) has a local minimum value of -60104.3 when x = 646.957 and y = 31.3043.  Therefore f(x,y) has a local maximum value of 60104.3 at these same values of 10 and y.  Since this local maximum value of f(x,y) is besides the global maximum value of f(x,y), we run into that f(x,y) has a global maximum value of of 60104.3 when x = 646.957 and y = 31.3043.  Since our problem really requires that each of x and y be integers, nosotros tin experiment with some integer values of ten and y most these corresponding values to find that our global maximum is 60104.335 when x = 647 and y = 31.

Case 3: The part f(10,y) = x 2 + 2 y 2 - ln(x y)

has a unique local minimum on the region divers by x > 0 and y > 0.  Allow the states utilize Mathematica to find the values of ten and y where the local minimum occurs, and the value of the local minimum.

We shall use the point (2, two) for a seed value, and now that we accept specified a seed value, we can search for the local minimum as follows:

In[3]:= f[x_,y_]=x^2-three*Log[ten*y]+2*y^2;
FindMinimum[f[ten,y],{x,2},{y,2}] Out[3]= {2.82333, {10 -> 1.22474, y -> 0.866025}}

Thus we see that we have a local minimum value of 2.82333 when x = one.22474 and y = 0.866025.

Exercises

Source: http://www.mathcs.emory.edu/~fox/NewCCS/ModuleIII/ModIIIP6.html

Posted by: torrezandessaint.blogspot.com

0 Response to "how to find extreme values of a function"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel