function f95(initial_point)

% f95 is a function m-file which computes the response of the 
% Anderson-May model of the immune system to an initial condition.  
%
% The syntax is f95(IC), where IC = [E1, E2, V] is the intial conditions. 

%  Let's make sure we keep the figures straight.

hfig = findobj(0,'name','f95');
if isempty(hfig)
    hfig = figure('name','f95');
end
figure(hfig)

%  Solve the ODEs and plot the result.

[t,u] = ode45(@f95pr,[0,80],initial_point');
plot(t,u);

%  Make the graph look pretty.

tstring = ['E_1(0) = ',num2str(initial_point(1)),...
        '; E_2(0) = ',num2str(initial_point(2)),...
        '; V(0) = ',num2str(initial_point(3))];
title(tstring)
xlabel('Time')
ylabel('Number of cells')
legend('Lymphocytes of type E_1','Lymphocytes of type E_2','Virus')
grid
shg


function upr = f95pr(t,u)

E1 = u(1);
E2 = u(2);
V = u(3);

P = 0.252*E1*E2/(1 + 0.008*E1*E2);

E1pr = 1 - 1.25*E1 + P + 0.05*V*E1;
E2pr = 1 - 1.25*E2 + P;
Vpr = 0.1*V - 0.01*V*E1;

upr = [E1pr E2pr Vpr]';

