Lab 8:  Growth with alternation of generations

(This lab is based on a student project from 1997.)

Alternation of generations is a life history common to many algae,
in which both the haplod and the diploid phases exist as independently
growing and reproducing organisms.

Haploid individuals (gametophytes) produce diploid individuals 
by producing haploid gametes that then unite.

Diploid individuals (sporophytes) produce haploid individuals 
by meiosis.

In this lab, you will analyse a simple model for how the numbers
of haploids and diploids change over time.

During a year, assume that:

	a = the number of diploid offspring produced per haploid parent
	b = the number of haploid offspring produced per diploid parent
	
Further assume that no parents survive from one year to the next
(a simplifying assumption).

Using Mathematica, analyse the above model as much as possible
during the lab period.

What are the equations describing the change in 
number of haploids (h[t]) and diploids (d[t]) from one year
to the next?

Write the above in matrix form
(with haploids first and diploids second).

You may wish to call this matrix (and the others that follow)
by a particular name so that you can refer to them in future lines.

mat={{?,?},{?,?}}

Determine the eigenvalues and the eigenvectors of the
above matrix

Eigenvalues[mat]

Eigenvectors[mat]

Determine the diagonal matrix D

Mathematica will let us do this simply by
multiplying the vector of eigenvalues (using
regular * multiplication and not the normal
. dot product):

dmat=Eigenvalues[mat]*IdentityMatrix[2]

Determine the transformation matrix A
(REMEMBER: Mathematica gives eigenvectors
in rows not columns.  Use the matrix
operation:  Transpose[] to get the eigenvectors into columns)

amat=Transpose[Eigenvectors[mat]]

Determine the inverse matrix of A

imat=Inverse[amat]

Determine the general solution for the system
at any time in the future, given h0 and d0 
haploids initially.

sol=Simplify[ amat.MatrixPower[dmat,n].imat.{h0,d0} ]

The first part of the above vector will give you the number of haploids:

numhap = Part[sol, 1]

The second part of the above vector will give you the number of diploids:

numdip = Part[sol, 2]

Questions for the lab

When will number of individuals in the population
grow over time?

What special parameters are needed in order for the
population to stay constant in size?

Using these special parameters, plot numhap over time
(Try different values to get a sense of the dynamics.)

ListPlot[Table[
	numhap /. a->2 /. b->1/2 /. h0->5 /. d0->15, {n,0,10}],
	PlotJoined->True]

The oscillations persist over time in these graphs because the
negative eigenvalue does not decay over time.
(Convince yourself that this is true.)