The Monod equation describes the rate at which a microorganism grows (mu [hr^-1]) as a function of the concentration of nutrient in the growth medium (s [g/l]). mu_max is the maximum growth rate (when there is an unlimited supply of nutrient) and K_s is the growth medium concentration when the growth rate is half its maximum value. As the concentration of the growth medium declines (i.e. as it gets used up), the microorganism growth rate slows down. mu = mu_max s/K_s + s a) Write a Matlab script which uses a finite divided difference approximation to estimate the rate of change in growth rate (i.e. the slope, d mu/ds or mu’) at a substrate concentration of 1 g/l. Plot your estimates for mu'(s = 1 g/l) as you reduce the step size (Delta s) by factors of 10 from 0.1 to 10^-7. (i.e. 0.1, 0.01, 0.001, …. 10^-7). Use a log scale on the x-axis b) The true rate of change in growth rate at 1 g/l is 0.2222 I/(g.hr). Plot the True Relative Error as a function of step size on a log-log plot. Comment (in 1-2 sentences) on any trend you see.
Expert Answer
a- if nargin ~= 2
error('divdiff: invalid input parameters'); end [ p, m ] = size(X); % m points, polynomial order <= m-1 if p ~= 1 || p ~=size(Y, 1) || m ~= size(Y, 2) error('divdiff: input vectors must have the same dimension'); end TDD = zeros(m, m); TDD(:, 1) = Y'; for j = 2 : m for i = 1 : (m - j + 1) TDD(i,j) = (TDD(i + 1, j - 1) - TDD(i, j - 1)) / (X(i + j - 1) - X(i)); end end end