%-- Aaron Reichow %-- Mathematical Ecology Matlab log %-- Log: 4/1/09 Where: Lab --% %-- CASE 1: Predation of N1 on N2, No hunting --% dn1='r*n1*(1-n1/k)-h*n1*n2' dn2='b*h*n1*n2-m*n2' %-- CASE 2: Predation of N1 on N2, Hunting on H1 --% dn1='r*n1*(1-n1/k)-h*n1*n2-h1*n1' dn2='b*h*n1*n2-m*n2' %-- CASE 3: Predation of N1 on N2, Hunting on H2 --% dn1='r*n1*(1-n1/k)-h*n1*n2' dn2='b*h*n1*n2-m*n2-h2*n2' %-- CASE 4: Predation of N1 on N2, Hunting on H1, h2 --% dn1='r*n1*(1-n1/k)-h*n1*n2-h1*n1' dn2='b*h*n1*n2-m*n2-h2*n2' %--------------------== Calculations ==--------------------% %-- --% [n1hats, n2hats] = solve(dn1,dn2,'n1,n2') %-- according to jp, these change- don't assume (3,1) is correct --% n1hat = n1hats(3,1) n2hat = n2hats(3,1) w = sym(strcat('[', dn1, ';', dn2, ']')) v = sym('[n1,n2]') %-- solve for the jacobian --% jacob = jacobian(w,v) %-- solve general expressions for the eigenvalues --% glambdas = eigensys(jacob) jac = subs(jacob, n1hat, 'n1') jac = subs(jac, n2hat, 'n2') elambdas = eigensys(jac)