代写AMATH 301 Rahman Coding Project 5代做Java程序
- 首页 >> Matlab编程AMATH 301 Rahman Coding Project 5
Due Thursday, February 10th at 11:59pm (but due to open assignment week you may take up to Friday, February 11th at 11:59pm)
To give you more time to work on past CPs that you may have missed, CP5 is shorter and easier than the other ones.
Please don’t use built in functions for any of the following – write your own scripts similar to the lectures. I programmed the autograder to throw a tolerance error if you use a built in function.
Problem 1
Multidrug therapy of cancer is starting to show promise of increasing the efficacy of both drugs and de- creasing their potential toxicity. One important issue that arises when designing a multidrug therapy regime is when to administer each drug. A common approach is to administer each drug when the previous drug has just reached its maximum concentration in the body (and is therefore beginning to wear of). Suppose that the concentration of the first drug in the body can be modeled by the function
c(t) = 1.3 (e-t/11 - e-4t/3) ,
where t is the time in hours since the first drug was administered and c(t) is the concentration of the first drug at time t. First plot the curve to find two points between which c(t) has a local maxima (or equivallently c/ (t) has a root). Use the bisection method with the two boundary points you found to find the time, t = t* the second drug should be administered such that jc/ (t* )j < 10-8 . Save the time t* as A1, the concentration c(t* ) as A2, and the error for the root of your derivative of your bisection scheme jc/ (t* )j as A3.
Problem 2
We mentioned in class that Newton’s method can work very slowly when finding minima of certain functions. The problem arises when more than one derivative vanishes at the minimum. Remember that if x* is the minimum of a smooth function f (x), then f/ (x* ) is zero. If f// (x* ) is also zero, then Newton’s method will take longer to converge. If f// (x* ) and f/// (x* ) are both zero, then Newton’s method will take longer still. We will explore this phenomenon in the following problem.
In each part, you should use a tolerance of 10-8 and an initial guess of x0 = 2.
(1) The function f (x) = x2 has a minimum atx* = 0. It is easy to check that f/ (0) = 0 but that f// (0) 0. Use Newton’s method to approximate this minimum. Save the number of iterations it takes, with the initial iteration counting as an iteration, in a variable named A4. Save the final iteration in a variable named A5.
(2) Repeat the process above with f (x) = x500 . Save the number of iterations Newton’s method took in A6 and save the final iteration in A7.
(3) Repeat the process above with f (x) = x1000 . Save the number of iterations Newton’s method took in A8 and save the final iteration in A9. (Your final iteration for this and the previous part may look strange, but you should be able to confirm that f/ is very close to zero for these iterations.)