Professional Documents
Culture Documents
CHBE 553 Assn 1
CHBE 553 Assn 1
Due: 10:30am Wednesday 12th of September Please submit at the start of class or email to geoffrey.wilde@ubc.ca before 10:30am.
1. Write and submit the code for a function which evaluates the real-valued Lambert W0 function using the NewtonRaphson method. That is, the function should nd the greatest root of the function fz (W ) = WeW z for given values of z 1 . As input arguments the function should take z and an integer, n, e which is the number of iterations of the NewtonRaphson method to apply. The initial guess used in the rst iteration should be ln (z + 1). The function should return the value of W found after completing n iterations. The behaviour of the function for invalid values of z or n need not be considered (but it is often a good idea to check). Note that fz has two roots for z < 0, however the above choice for the initial guess should ensure that the NewtonRaphson method will converge to the greater of the two roots. The function corresponding to the lower of the two is usually denoted W1 . 2. Use the function from (1) to compile a table of approximations to W0 for the following values of z and n: z = n = 1 , 0.1, 0, 0.1, 1, 10 e 1, 2, 3, 4, 10 .
1 B exp AC AC
2.51 Re .
B C
and C =