% step3.m
% solve the linearized system

beta, x0, t1, u0 

arr=arrhen(Xbar(2)); 
arrprime=arr*gamma*Xbar(2)^(-2);
A=[-1-arr -Xbar(1)*arrprime; alpha*arr -1-beta+alpha*Xbar(1)*arrprime] 
lambda=eig(A)  % check the eigenvalues
B=[0;beta]; 
Ubar=Xbar(2)-(1-Xbar(2)+alpha*Xbar(1)*arr)/beta 

[t,x]=ode45('linear',[0 t1],x0);

figure(3), clf % clear figure
subplot(2,1,1)
plot(t,x)
title([ 'linearized,  beta=' num2str(beta) ...
	',  u0='  num2str(u0) ... 
	',  x0=[' num2str(x0(1)) '; ' num2str(x0(2)) ']' ...
	])
% the three dots ... mean that the command continues on the next line

subplot(2,1,2)
plot(x(:,1),x(:,2),[0;0],[0;0],'xr')
axis ([-1 1 -1 1])
% axis square
title([ 'x marks the stationary solution (the origin)' ])
