#Maple code for Lecture 5 #DMB:="Dynamical Models in Biology" by S.P. Ellner and J. Gukenheimer Help5:=proc(): print(`RecToSeq(INI,REC,N), GrowthC(INI,REC,K) , GrowthCe(REC), LeslieM(SUR,FER) `):end: #RecToSeq(INI,REC,N): Inputs two lists of numbers, INI and REC (of the same length, let's call it k) and a positive integer N larger than their length #outputs the list of the first N members of the sequence satisfying the linear recurrence with constants coefficients or order k #f(n)=REC[1]*f(n-1)+...+REC[k]*f(n-k) RecToSeq:=proc(INI,REC,N) local i,k,L,newguy: if not (type(INI,list) and type(REC,list) and nops(INI)=nops(REC) and type(N,integer) and N>=nops(INI)) then print(`bad innput`): RETURN(FAIL): fi: k:=nops(INI): L:=INI: while nops(L)