Question: Please give a Matlab code which helps me solve this problem. 2. Nested for loops and bacteria Bacterial growth can be modeled by the equation,
Please give a Matlab code which helps me solve this problem.
2. Nested for loops and bacteria Bacterial growth can be modeled by the equation, shown below. B is the current number of bacteria, Bintial is the initial number of bacteria, GRate is the growth rate, and t is time. B = Binitial exp(t * GRate) Create a matrix to estimate the number of bacteria, B, at t = 10 days with different Bint and GRate values. For Bint, use ten values ranging from 100 to 1,000 bacteria in increments of 100. For GRate, use ten values ranging from 0.02 to 0.2 per day in increments of 0.02. The final matrix will be 10x10 with the number of bacteria at 10 days under the 100 conditions described above. One approach (although there are others), would be to write an expression where Bint and GRate correspond to a row and column index, respectively, of the matrix B. For example: B(1,2) = 100 * exp(10 * 0.02) B(2,1) = 200 * exp(10 * 0.02) Using this approach, the first two lines of code should look like this: for B inital = 1:10 for GRate = 1:10 .etc. Finally, the number of bacteria must be whole numbers, which can be addressed using the round function. What is the difference in number of bacteria at day 10 if you start with 100 versus 1000 bacteria and they are growing at a rate of 0.2 per day? What is the sum of bacteria for all 10 growth rate conditions when the initial bacteria count is 200? 2. Nested for loops and bacteria Bacterial growth can be modeled by the equation, shown below. B is the current number of bacteria, Bintial is the initial number of bacteria, GRate is the growth rate, and t is time. B = Binitial exp(t * GRate) Create a matrix to estimate the number of bacteria, B, at t = 10 days with different Bint and GRate values. For Bint, use ten values ranging from 100 to 1,000 bacteria in increments of 100. For GRate, use ten values ranging from 0.02 to 0.2 per day in increments of 0.02. The final matrix will be 10x10 with the number of bacteria at 10 days under the 100 conditions described above. One approach (although there are others), would be to write an expression where Bint and GRate correspond to a row and column index, respectively, of the matrix B. For example: B(1,2) = 100 * exp(10 * 0.02) B(2,1) = 200 * exp(10 * 0.02) Using this approach, the first two lines of code should look like this: for B inital = 1:10 for GRate = 1:10 .etc. Finally, the number of bacteria must be whole numbers, which can be addressed using the round function. What is the difference in number of bacteria at day 10 if you start with 100 versus 1000 bacteria and they are growing at a rate of 0.2 per day? What is the sum of bacteria for all 10 growth rate conditions when the initial bacteria count is 200
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
