Problems and Requirements
Problem 1 (35 points).
Given function1
F(x, y) = 0.2x^2 + 0.1y^2 + sin(x + y)
please work out its gradient. Based on the gradient, please find out the local extreme of function
F(x,y) when both x and y are in the range of [-2pi, 2pi]. The 2D and 3D views of the
function is given in Fig. 1.
Requirements:
- Work out the gradient for F(x, y) and show it in the report;
- Write Matlab code to find extreme value for F(x, y) by gradient descent method;
- Write a report to show your solution and analysis. Please visualize the gradient
descent steps along with either its 3D view or the function contour.
Problem 2 (25 points)
A factory supplies engine for its customer. According to the
contract, the factory should deliver its product to the customer in the end of the 1st
season: 40 engines; in the end of the 2nd season: 60 engines; in the end of the 3rd season:
80 engines. Due to limited productivity, to its most, the factory is only able to produce
100 machines in a single season. The production cost is given as f(x) = 50x + 0:2x2,
where x is the number of machines produced in one season. It is possible to produce
machines more than the required quota in each season. In this case, the storage cost is
4 dollars for one machine/season. Assuming there is no reservations at the beginning for
the first season, please work out a production plan that minimizes the production cost.
Requirements:
- Model it as a standard quadratic programming problem
- Call ‘quadprog’ to solve the problem
- Write down the modeling process and show your anwser in the report
Sample Source code
1 | % Problem1.m |