MATLAB Restate the problem as an optimization problem. Then:
Posted: Mon May 23, 2022 12:34 pm
MATLAB Restate the problem as an optimization problem. Then:
1. A seminal breakthrough in HIV treatment was the use of multiple-drug combination therapy. The idea behind the therapy is that multiple drugs, introduced to the body at specific times, fight the virus off better than one drug alone. A key step in the development of multiple-drug therapy is determining the best time to take the next drug. One way this is done is to take the next drug when the previous drug is at its maximum in the body (and beginning to decrease from there). Drug absorption and elimination in the body is modeled using compartmental models. Consider a model whose solution is given by x(t) 10 (e-t/4 3 24 e-1/2), (1) where c(t) is the amount of the drug in the body at time t. Assume that we want to administer the next drug when x(t) is at its maximum. We call this time tmax in what follows. Recall that we have only talked about minimizing functions so you will have to restate the problem as a minimization problem. 1 (a) Find tmax and the maximum of the function x(t) by taking the derivative (by hand) and using fzero (MATLAB) or scipy.optimize.fsolve (Python), with an initial guess of Xo = 2, to find the root of x'(t). Create a 1 x 2 row vector that contains tmax in the in the first component and the maximum in the second component. Save this vector to the variable A1. Note to python users: scipy.optimize.fsolve returns an array, make sure you get the single number out of that array for your answers here. (b) Use fminbnd (MATLAB) or scipy.optimize.fminbound (python) with the interval (0, 12] to find tmax and the maximum of x(t). Create a 2 x 1 column vector that contains tmax in the first component and the maximum in the second component. Save this vector to the variable A2.
1. A seminal breakthrough in HIV treatment was the use of multiple-drug combination therapy. The idea behind the therapy is that multiple drugs, introduced to the body at specific times, fight the virus off better than one drug alone. A key step in the development of multiple-drug therapy is determining the best time to take the next drug. One way this is done is to take the next drug when the previous drug is at its maximum in the body (and beginning to decrease from there). Drug absorption and elimination in the body is modeled using compartmental models. Consider a model whose solution is given by x(t) 10 (e-t/4 3 24 e-1/2), (1) where c(t) is the amount of the drug in the body at time t. Assume that we want to administer the next drug when x(t) is at its maximum. We call this time tmax in what follows. Recall that we have only talked about minimizing functions so you will have to restate the problem as a minimization problem. 1 (a) Find tmax and the maximum of the function x(t) by taking the derivative (by hand) and using fzero (MATLAB) or scipy.optimize.fsolve (Python), with an initial guess of Xo = 2, to find the root of x'(t). Create a 1 x 2 row vector that contains tmax in the in the first component and the maximum in the second component. Save this vector to the variable A1. Note to python users: scipy.optimize.fsolve returns an array, make sure you get the single number out of that array for your answers here. (b) Use fminbnd (MATLAB) or scipy.optimize.fminbound (python) with the interval (0, 12] to find tmax and the maximum of x(t). Create a 2 x 1 column vector that contains tmax in the first component and the maximum in the second component. Save this vector to the variable A2.