1 /* Sample usage of difference equation package -*-Macsyma-*- */
2 if get('differ,'version)=false then load(differ)$
4 a:matrix([1,-1],[-5,5]);
11 /* First order equations */
23 /* Systems of homogeneous first order equations */
26 eqn1:y[k+1]+z[k]-3*y[k]=0;
27 eqn2:3*y[k]+z[k+1]-5*z[k]=0;
28 difference([eqn1,eqn2],[y[k],z[k]]);
30 /* Second order equations */
32 y[k+2]-6*y[k+1]+8*y[k]=0;
39 y[k+2]-6*y[k+1]+8*y[k]=0;
43 /* Fibonacci Numbers: 1, 1, 2, 3, 5, 8, 13, 21, ... */
49 ratsimp(ev(part(%,2),n=7));