Math 171B HW2: Mathematical Programming - Calculus, Newton's Method, and MATLAB, Assignments of Mathematics

A homework assignment for math 171b: mathematical programming, instructed by jennifer erway during spring quarter 2007. The goal of the assignment is to review concepts from calculus, gain a better understanding of newton's method for solving nonlinear equations, and learn how to implement the method on a computer using matlab. Several exercises that cover topics such as taylor series expansions, gradient vectors, and jacobian matrices.

Typology: Assignments

Pre 2010

Uploaded on 03/28/2010

koofers-user-qhg
koofers-user-qhg 🇺🇸

9 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Math 171B: Mathematical Programming
Instructor: Jennifer Erway
Spring Quarter 2007
Homework Assignment #2
Due: Friday, April 13
Our goal in this homework is to review some basic concepts from calculus of real and multivariate functions,
gain a better understanding of Newton’s method for solving nonlinear equations involving vector-valued func-
tions of several real variables, to learn about the convergence properties of Newton’s method, and to understand
how to implement the method on a computer. For our review of calculus, we wil l need to recall the definitions
of continuity and differentiation, in the cases of both real-valued and vector-valued functions of one and many
variables. Key tools throughout the course will be Taylor series and Taylor Remainder Theorem. We will do
a couple of simple implementation problems to start us off using MATLAB.
The starred exercises are those that require the use of MATLAB You MUST do the MATLAB problems
to get credit for the homework.
Exercise 2.1 Let F(x) denote a twice-continuously differentiable function of one variable. Assuming only
the mean-value theorem of integral calculus: F(b) = F(a) + Rb
aF0(t)dt, derive the following variants of the
Taylor-series expansion with integral remainder:
(a) F(x+h) = F(x) + Rx+h
xF0(t)dt.
(b) F(x+h) = F(x) + hR1
0F0(x+ηh).
(c) F(x+h) = F(x) + hF 0(x) + hR1
0[F0(x+ηh)F0(x)] .
(d) F(x+h) = F(x) + hF 0(x) + h2R1
0F00(x+ηh)(1 η) . (Hint: Try expanding F0(x+h) using a
formula like part (b) and then differentiate with respect to husing the chain rule.)
Exercise 2.2 Find the gradient vector F(x) = f(x) of the following functions, and then find the Jacobian
matrix of F(x). (The Jacobian matrix of F(x) = f(x) is the same as the Hessian matrix 2f(x) of f(x)).
(a) f(x) = 2 x2x2
12+ (x13)2.
(b) f(x) = (2x1+x2)2+ 4(x2x3)4.
Exercise 2.3 Find f0(x), f(x), and 2f(x) for the following functions of nvariables:
(a) f(x) = 1
2xTHx, where His an n×nconstant matrix.
(b) f(x) = bTAx 1
2xTATAx, where Ais an m×nconstant matrix and bis a constant vector.
(c) f(x) = kxk=Pn
i=1 x2
i1/2.
Exercise 2.4 Given a vector xof appropriate dimension, find the Jacobians F0(x) for the following functions.
(a)
F(x) = ex1(4x2
1+ 2x2
2+ 4x1x2+ 4x2+x1+ 5)
ex1(3x2+ 2x1+ 4)
(b)
F(x) = (AxnI)¯x
¯xT¯x1,
1
pf2

Partial preview of the text

Download Math 171B HW2: Mathematical Programming - Calculus, Newton's Method, and MATLAB and more Assignments Mathematics in PDF only on Docsity!

Math 171B: Mathematical Programming

Instructor: Jennifer Erway Spring Quarter 2007

Homework Assignment # Due: Friday, April 13

Our goal in this homework is to review some basic concepts from calculus of real and multivariate functions, gain a better understanding of Newton’s method for solving nonlinear equations involving vector-valued func- tions of several real variables, to learn about the convergence properties of Newton’s method, and to understand how to implement the method on a computer. For our review of calculus, we will need to recall the definitions of continuity and differentiation, in the cases of both real-valued and vector-valued functions of one and many variables. Key tools throughout the course will be Taylor series and Taylor Remainder Theorem. We will do a couple of simple implementation problems to start us off using MATLAB. The starred exercises are those that require the use of MATLAB You MUST do the MATLAB problems to get credit for the homework.

Exercise 2.1 Let F (x) denote a twice-continuously differentiable function of one variable. Assuming only the mean-value theorem of integral calculus: F (b) = F (a) +

∫ (^) b a F^

′(t) dt, derive the following variants of the

Taylor-series expansion with integral remainder:

(a) F (x + h) = F (x) +

∫ (^) x+h x F^

′(t) dt.

(b) F (x + h) = F (x) + h

0 F^

′(x + ηh) dη.

(c) F (x + h) = F (x) + hF ′(x) + h

0 [F^

′(x + ηh) − F ′(x)] dη.

(d) F (x + h) = F (x) + hF ′(x) + h^2

0 F^

′′(x + ηh)(1 − η) dη. (Hint: Try expanding F ′(x + h) using a formula like part (b) and then differentiate with respect to h using the chain rule.)

Exercise 2.2 Find the gradient vector F (x) = ∇f (x) of the following functions, and then find the Jacobian matrix of F (x). (The Jacobian matrix of F (x) = ∇f (x) is the same as the Hessian matrix ∇^2 f (x) of f (x)).

(a) f (x) = 2

x 2 − x^21

  • (x 1 − 3)^2.

(b) f (x) = (2x 1 + x 2 )^2 + 4(x 2 − x 3 )^4.

Exercise 2.3 Find f ′(x), ∇f (x), and ∇^2 f (x) for the following functions of n variables:

(a) f (x) = 12 xT^ Hx, where H is an n × n constant matrix.

(b) f (x) = bT^ Ax − 12 xT^ AT^ Ax, where A is an m × n constant matrix and b is a constant vector.

(c) f (x) = ‖x‖ =

(∑n i=1 x 2 i

Exercise 2.4 Given a vector x of appropriate dimension, find the Jacobians F ′(x) for the following functions.

(a) F (x) =

ex^1 (4x^21 + 2x^22 + 4x 1 x 2 + 4x 2 + x 1 + 5) ex^1 (3x 2 + 2x 1 + 4)

(b) F (x) =

(A − xnI) ¯x x ¯T^ x¯ − 1

where x ∈ Rn, A is an (n − 1) × (n − 1) matrix, I is the (n − 1) × (n − 1) identity matrix, xn is the last component of x, and ¯x = (x 1 ,... , xn− 1 )T^.

Exercise 2.5* Create a MATLAB m-file of the form:

function [F,J] = D(x) F = [a ; b]; J = [c d ; e f];

where the expressions for a, b, c, d, e, f are chosen so that the function returns the 2×1-vector-valued function F (x) and the 2 × 2-vector-valued Jacobian matrix J(x) for the function from part (a) of Problem 2.2. Use this m-file to compute F and J at x = (1, 0)T^ ; and x = (1, 1)T^. Capture the output from the computation and turn it in with the homework.

Exercise 2.6* Sketch the function F (x) = (^1) x − a for a = 2. Then derive a Newton iteration for com- puting the reciprocal of a number a without performing division. Create a MATLAB m-file to implement the algorithm, and use it with x 0 = 0.3 to approximate e−^1 , where e = 2.7182818284, by calculating x 1 , x 2 , and x 3. Repeat for x 0 = 1.0.