1
answer
0
watching
69
views
10 Nov 2019
Just need the code for (a) I haven't had any luck. Thanks inadvance!
Consider the logistic equation xn+1 = rhoxn(1 - xn) which was first developed to model the growth and decay of a population of some species over time. The variable xn represents the size of the population as a fraction of the maximum population; so xn = 0 means that the population is zero, and xn = 1 means the population is as large as it can be. The subscript "n" indicates a particular instance in time; for this example, each iteration (and therefore each subscript index n) represents a single year passing. Iterate the equation for the following values of rho, starting with a population on year 1 of x1 = 0.5: rho = 0.5, 2.6, 3.8 Iterate the equation for each value of rho and calculate three column vectors (one for each rho) of length 40 which contains x(1) to x(40). For fun, plot your results and try to interpret. ANSWERS; Should be written out as A18.dat-A20.dat. Now, plot the three solutions that you computed. Remember to comment out the plotting commands before you upload your code. Notice that the solution for rho = 0.5 looks like it might be decaying to zero. Using rho = 0.5 and starting with x1 = 0.5, iterate until the absolute value of xn+1 is less than 10-6, which occurs on iteration n. ANSWERS: Save a 2 times 1 vector in A21.dat. The first component should be the number of iterations n, and the second component should be the absolute value of xn+1. Note that in the notation above, iteration 1 takes us from x1 to x2.
Just need the code for (a) I haven't had any luck. Thanks inadvance!
Consider the logistic equation xn+1 = rhoxn(1 - xn) which was first developed to model the growth and decay of a population of some species over time. The variable xn represents the size of the population as a fraction of the maximum population; so xn = 0 means that the population is zero, and xn = 1 means the population is as large as it can be. The subscript "n" indicates a particular instance in time; for this example, each iteration (and therefore each subscript index n) represents a single year passing. Iterate the equation for the following values of rho, starting with a population on year 1 of x1 = 0.5: rho = 0.5, 2.6, 3.8 Iterate the equation for each value of rho and calculate three column vectors (one for each rho) of length 40 which contains x(1) to x(40). For fun, plot your results and try to interpret. ANSWERS; Should be written out as A18.dat-A20.dat. Now, plot the three solutions that you computed. Remember to comment out the plotting commands before you upload your code. Notice that the solution for rho = 0.5 looks like it might be decaying to zero. Using rho = 0.5 and starting with x1 = 0.5, iterate until the absolute value of xn+1 is less than 10-6, which occurs on iteration n. ANSWERS: Save a 2 times 1 vector in A21.dat. The first component should be the number of iterations n, and the second component should be the absolute value of xn+1. Note that in the notation above, iteration 1 takes us from x1 to x2.
Hubert KochLv2
21 Mar 2019