Leslie matrix model : population transition ( by python program)

The above lines are magic spells. If you have any error massage, move to web site.
You can try the excercise on the web site.


Analysis of the Leslie matrix model

Input $ \bf L = \begin{bmatrix} 0 & 1 & 2 & 0 \\ 0.5 & 0 & 0 & 0 \\ 0 & 0.6 & 0 & 0 \\ 0 & 0 & 0.1 & 0\end{bmatrix}$, $ \; {\bf n}(0) = \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0\end{bmatrix} $

Put the followings,


Calculate ${\bf n}(1)= {\bf L\: n}(0) $

$$ \begin{pmatrix} 0 & 1 & 2 & 0 \\ 0.5 & 0 & 0 & 0 \\ 0 & 0.6 & 0 & 0 \\ 0 & 0 & 0.1 & 0\end{pmatrix} \begin{pmatrix} 0 \\ 1 \\ 0 \\ 0\end{pmatrix} $$

Using ${\bf n}(1) = \begin{pmatrix} 1 \\ 0 \\ 0.6 \\ 0 \end{pmatrix}$ 、calculate ${\bf n}(2) = {\bf L}\,{\bf n}(1)$


Using ${\bf n}(0) = \begin{pmatrix} 0 \\ 1 \\ 0 \\ 0 \end{pmatrix}$ 、calculate ${\bf n}(2) = {\bf L}{\bf L} \,{\bf n}(0)$


${\bf L}{\bf L}$ is equibalint to ${\bf L}^2$

Compute ${\bf L}^t$ with arbitrary exponent $t$. For example $t=4$, ${\bf L}^4$.




Compute ${\bf n}(t)={\bf L}^{t}{\bf n}(0), \;\; t=0, \cdots $, and plot population number of each age.