Question: reference equation for part a) Problem 8: ( 6.28) (You can use MATLAB's built-in functions for this problem) Bacteria growth rate can be modeled with
reference equation for part a)
Problem 8: ( 6.28) (You can use MATLAB's built-in functions for this problem) Bacteria growth rate can be modeled with the equation In N, In No = u (t to), where y is the growth rate constant, and N, and No are the numbers of bacteria at times t and to, respectively. Determine u and No such that the equation will best fit the following data. Use to = 0. t = N [0; 2; 4; 6; 8]; [35; 1990; 70800; 2810000; 141250000]; % Time [hours] % Number of bacteria [cells/ml] = (a) Use the user-defined function LinReg developed in Problem 7 (6.19). (b) Use MATLAB's built-in function polyfit. Example 6-1 (pg 198) function (al, a0] LinearReqression (x, y) % LinearRegression calculates the coefficients al and a0 of the linear % equation y = a1*x + a0 that best fits n data points. % Input variables: % * A vector with the coordinates x of the data points. % y A vector with the coordinates y of the data points. % Output variables: al and a0 nx=lenqth (x); ny=lenqth (y); ny Check if the vectors x and y have the same size. disp ( 'ERROR: The number of elements in x must be the same as y.') al= 'Error'; a0= 'Error'; else Sx=sum (x); Sy=sum (y); Sxy=sum (x.*y); Sxx=sum (x.^2); al= (nx*Sxy-Sx*Sy) / (nx*Sxx-Sx^2); a)= (Sxx*Sy-Sxy* Sx)/ (nx*Sxx-Sx^2); if nx = end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
