Introduction
Math 251: Computational Lab 4
Fall 2019, Sections 18,19,20
Instructor:
Recitation Instructor: Due Date:
Vladimir Shtelen Leonardo Santana November 15, 2019
You are encouraged to discuss this assignment with other students and with the instructor/recitation instructor, but the work you hand in should be your own. See the website
http://sites.math.rutgers.edu/courses/251/ComputationalLabs/Computing251.html
for more information as well as helpful background information and commands for completing the assignment.
While problems you have dealt with so far in class only have up to three variables, problems in the real world can have much more than that. In this lab, you will deal with a problem in 4 variables and see how the standard optimization techniques can be used on this problem.
Your Task
For this assignment, the individualized data from your instructor will consist of two functions f (w, x, y, z) and g(w, x, y, z). With this information, your goal will be to find the maximum value of f(w,x,y,z) with respect to the constraint g(w,x,y,z) 1. To do this, you need to:
Find points where the gradient of f is zero, and check to see if these points are within the desired domain.
Use Lagrange multipliers to determine the critical points along the boundary of the domain. Figure out where the maximum value of f is attained and what this maximum value is.
1
Deliverable
Your code should consist of the following:
1. Storing the two functions f and g.
2. Finding (and displaying) all possible interior critical points by finding points where the (4- dimensional) gradient of f is zero. Determine which of these points lie within the constrained region.
3. Use Lagrange multipliers (again in 4-dimensions) to determine the potential critical points along the boundary g(w, x, y, z) = 1.
4. Find the value of f at each of these points, determine the maximum and minimum value, along with at which of the critical points it is attained.
2
Math 251: Computational Lab 4 Grading Rubric
This lab is worth a total of 15 points.
3 points for including the supporting code for all of the points below.
2 points for identifying all critical points of the objective function (these are on your grader data sheet).
2 points for determining whether or not these points are valid (i.e., if they satisfy the desired inequality constraint).
2 points for setting up the Lagrange multiplier problem.
2 points for finding all solutions to the Lagrange multiplier problem. They do not need to show all of the solutions, and can just display the number of solutions to show that it worked properly. This number is on your grading file.
2 point for evaluating the objective function at all critical points and solutions to the Lagrange multiplier problem.
2 point for identifying the appropriate maximum and minimum of the objective func- tion.
Please note that dierent implementations of numerical software may give (floating point) numerical answers which are not identical to those which you have been given. For example, the same (complicated!) series of instructions which result in 461539.8116 in one imple- mentation gives 461539.801 in another implementation. Both answers should be graded as correct.
1
Reviews
There are no reviews yet.