# Matlab normal equations model to analyze response

(See attached file for full problem description)

---

This model is used to analyze the body's response to a bolus injection of this antibiotic:

B(t) = B0e(-k*t)

Using this model, and data provided for the average plasma concentration data in ug/ml with time in hours :

a) perform linear regression on this penicillin clearance using the normal equations

b) plot the concentration data and re-plot the log of the concentration data to show that it appears linear.

c) Determine initial concentration, B0, and elimination rate constant, k

Concentration (ug/ml) Time (min)

89 22

60 44

30 88

15 132

7 176

a) for linear regression

ln( B ) = ln( B0 )- Kt

I'm not sure how to use the normal equations in MATLAB to plot this? We're not supposed to use polyfit function... I think you have to make a 2 column matrix with a column of 1's and a column of the time?

---

(See attached file for full problem description)

Â© BrainMass Inc. brainmass.com December 24, 2021, 5:28 pm ad1c9bdddfhttps://brainmass.com/computer-science/matlab/49820

#### Solution Preview

Answer:

From what you write I understand that you are to perform linear regression for the logarithmic fit: ln(B) = ln(B_0) - Kt

If you find out otherwise, please tell me, and I shall try to help, but now I proceed with the stated understanding.

BTW, the ln(B) = ln(B_0) - Kt fit would do exactly the same as the polyfit (x, y, 1) function of MatLab, but here you are apparently requested to do "manually" what the polyfit does.

First I shall try to explain about the normal equations and linear regressions.

For convenience, let us rename x_1 = ln(B_0) and x_2 = K.

Then the equations based on the input data which you are supposed to try to fit as best you can are:

1 * x_1 - 22 * x_2 = ln(89)

1 * x_1 - 44 * x_2 = ln(60)

1 * x_1 - 88 * x_2 = ln(30)

1 * x_1 - 132 * x_2 = ln(15)

1 * x_1 - 176 * x_2 = ln(7)

You see here 5 equations for only 2 unknowns. Obviously it is not likely possible to find a solution that will make all these equations true. Instead, what ...