You are on page 1of 2

TPG4155 Applied Computer Methods

in Petroleum Science
Exercise 1

Deadline: September 3rd 2017, 23:00.


Exercise hour: August 28th, 17:15-20:00 and August 30th, 8:15 - 11:00
Information: The exercise must be handed in electronically through Blackboard. You
may typeset the exercises with LATEX, Word etc., or scan your handwritten sheets. It is
strongly recommended to take this opportunity to learn how to use LATEX. In problems
where plots or source code are required, include printed/exported versions in the file
you send in. The file format must be PDF. Exercises delivered too late will be rejected if
you have not made an agreement in advance with the teaching assistant.

Any reference to specific chapters, theorems, etc., will refer to the book Numerical
Methods Using Matlab (4th edition) by Mathews and Fink.

Problem 1
Use Theorem 8.1 to determine where each of the following functions is increasing and
where it is decreasing. Verify your findings by plotting the functions in MATLAB.
a) f ( x ) = 2x3 9x2 + 12x 5
b) f ( x ) = x/( x + 1)

Problem 2
Write a MATLAB program for the cubic approximation method presented in Section 8.1.
Use the program to find the minimum of f ( x ) = x2 sin( x ) on the interval [0, 1] with
an accuracy criterion of = 106 . Try setting = 1012 . How many extra iterations are
needed? Note: The relevant section in the book, pg. 420421, is riddled with typos. A critical
one is eq. (20), which gives the formula for G. As listed it gives you G/h, not G. The correct
formula for G is as follows: G = ( f 0 ( p1 ) f 0 ( p0 ))h. Notice the h at the end. There are also
several typos in the example. However, the values for F, G, and are correct.

Problem 3
An oil company is looking at a reservoir geometry and has decided that the best locations
to place injectors A, B, C, D and E are at the coordinates (10, 10), (30, 50), (16.667, 29),
(0.555, 29.888) and (22.2221, 49.988), respectively, in the xy-plane. The company also
needs a central platform to run the injectors from. It is anticipated that during an average
week the total volume pumped through each injector pipeline will be 10, 18, 20, 14, and
25 (arbitrary units) for injectors A, B, C, D, and E, respectively. Longer pipelines require
TPG4155 Applied Computer Methods in Petroleum Science

more powerful compressors in order to compensate for friction loss in the pipes. The
company therefore wants to minimize the total distance-volume (distance from platform
to injector multiplied by volume). To accomplish this, where in the xy-plane should the
platform be located? Use the steepest descent method. Visually verify that your solution
is correct by plotting the function.
Bonus: Use the Nelder-Mead algorithm to solve the same problem. Compare the two
solutions (runtime, accuracy, etc.).

Exercise 1 August 23, 2017


Page 2 of 2

You might also like