Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

USING MATLAB( math modeling class)I NEED THE CODES FOR EACH PARTS AND IF IT IS P

ID: 3889165 • Letter: U

Question

USING MATLAB( math modeling class)I NEED THE CODES FOR EACH PARTS AND IF IT IS POSSIBLE THE FIGURES

) Create arrays in MATLAB containing the data on growth of paramecium given in the table below. Call the array with the days ‘n’ and the array with the density ‘Pdata’. Type ‘figure(1)’ and make a plot of the data showing the mean density as a function of days. Show the data points as filled blue circles (not points). See the MATLAB Documentation on Line Specification (LineSpec) for information on how to control the properties of marker symbols.

Day (n) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Mean density of paramecium (Pn) 14, 34 , 56, 94, 189, 266, 330, 416, 507, 580, 610, 513, 593, 557, 560, 522, 565, 517, 500, 585, 500, 495 525, 510

2) Create an array containing the change in mean density from day to day. Calculate this as Pn = Pn+1 Pn using the MATLAB ‘diff’ command and call the resulting array ‘deltaPdata’. Now create an array to model this change using the expression Pn = Pn × (N Pn), for n = 1 to 23 with N = 525 .Call this array ‘deltaPmodel’. Type ‘figure(2)’ and make a plot showing deltaPmodel versus deltaPdata. Show these points as filled black circles. Now fit a line to this data using the MATLAB backslash operator to perform least squares regression:

k= transpose (delta Pmodel)/ transpose(delta Pdata)

what is the value of k?

3) Add a red line to figure(2) showing your fit to these data points:

figure(2)

hold on

plot(deltaPmodel,k*deltaPmodel,‘r’,‘Linewidth’,2)

. 4) Now simulate your difference equation model: Pn+1 = Pn + kPn(N Pn) by iterating the map. (Hint: initialize an array called ‘Pmodel’ and set Pmodel(1) to your initial condition. Write a for loop to iterate through days 2 through 24, and on each iteration i update Pmodel(i) using the difference equation model.)

5) Add filled red circles to figure(1) showing how well your model agrees with the data:

figure(1)

hold on

plot(n,Pmodel,‘ro’,‘MarkerFaceColor’,‘r’,

Explanation / Answer

System.out.println(numbers[0]); if (numbers[3] > 0) { System.out.println(numbers[3] + " is positive"); } else { System.out.println(numbers[3] + " is not positive"); } int sum = 0; for (int i = 0; i < 10; i++) { sum += numbers[i]; }