Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

6CCE3EAL

Engineering Algorithms (Mock)

January 2023 (Period 1)

1.  a. A one-dimensional ordinary differential equation (ODE) y\ = f(x,y) with initial condition y(0) = y0  is approximated by the trapezoidal method

yn+1 = yn + ∆x [ f(xn+1,yn+1) + f(xn ,yn )] ,

where xn = n∆x and ∆x is the step size.

i. What is meant by the order of a numerical ODE scheme? [6 marks]

ii. Consider a test problem where f(x,y) = λy . Show that the method

is stable only if

' ' < 1. [14 marks]

b. Given a function f(x) and an equispaced grid of points xn = n∆x, derive a two-point central difference scheme for the derivative of f . Determine the accuracy of the scheme. [10 marks]

c. Consider the matrix equation Ax = b given by

l1    1     1  lx1       l 1

3     1     −3      x2      =     5

1  −2  −5  x3            10

i. Find a LU decomposition of A using the Doolittle method. [12 marks]

ii. Using this LU decomposition, solve the system using forward- and back-substitution. [8 marks]

2.  a. Consider the function f(x,y) = x2y − xy2 + 3x2y2 .

i. Compute the gradient and Hessian of f(x,y).   [8 marks]

ii. Find and classify all critical points of f(x,y).   [12 marks]

.

b. Using the method of feasible regions, solve the linear program

min z = 2x1 + x2

s.t.   x2  ≤ 10

2x1 + 5x2  ≤ 60

x1 + x2  ≤ 18

3x1 + x2  ≤ 44

x1  ≥ 0,x2  ≥ 0. [14 marks]

c. Consider the function g(x,y) = 1 − (xy − 3)2 .

i. Compute the gradient of g(x,y). [4 marks]

ii. Starting at  (x,y) =  (0, 0), apply one step of the steepest ascent method to approximate the solution to the problem

max  g(x,y).

(x,y)R2 [12 marks]