               Page 345
s=10; r=.03; mu=.02; Tmax=1500;
p=[-r/Tmax (r-mu) s];
T0=max(roots(p))

% make up an m-file, hiv1.m, with
%   function Tprime=hiv1(t,T);
%   s=10; r=.03; mu=.02; Tmax=1500;
%   Tprime=s+r*T*(1-T/Tmax)-mu*T;
[t,T]=ode23('hiv1',[0 50],0);
plot(t,T); hold on
[t,T]=ode23('hiv1',[0 50],T0/4); plot(t,T)
[t,T]=ode23('hiv1',[0 50],T0/2); plot(t,T)
[t,T]=ode23('hiv1',[0 50],(T0+Tmax)/2); plot(t,T)
[t,T]=ode23('hiv1',[0 50],Tmax); plot(t,T)

s=0; r=.06; mu=.02; Tmax=1500;
p=[-r/Tmax (r-mu) s];
T0=max(roots(p))
% make an m-file, hiv2.m, same as before execpt
%   s=0; r=.06; mu=.02; Tmax=1500;
hold off
[t,T]=ode23('hiv2',[0 50],0);
plot(t,T); hold on
[t,T]=ode23('hiv2',[0 50],T0/4); plot(t,T)
[t,T]=ode23('hiv2',[0 50],T0/2); plot(t,T)
[t,T]=ode23('hiv2',[0 50],(T0+Tmax)/2); plot(t,T)
[t,T]=ode23('hiv2',[0 50],Tmax); plot(t,T)

               Exercises/Experiments
4.
% contents of m-file exer104.m:
%   function Yprime=exer104(t,Y)
%   % Y(1)=T, Y(2)=TL, Y(3)=TA, Y(4)=V
%   s=10; r=0.03; Tmax=1700; mu=0.02; b=.24;
%   a=2.4; k1=0.000024; k2=0.003; N=1400;
%   Yprime=[...
%    s-mu*Y(1)+r*Y(1).*(1-(Y(1)+Y(2)+Y(3))/...
%   Tmax)-k1*Y(4).*Y(1);
%    k1*Y(4).*Y(1)-mu*Y(2)-k2*Y(2);
%    k2*Y(2)-b*Y(3);
%    N*b*Y(3)-k1*Y(4).*Y(1)-a*Y(4)];
%
[t,Y] = ode23('exer104',[0 365],[1000; 0; 0; 0.001]);
plot(t,Y)
% try out to about 3 1/2 years
[t,Y] = ode23('exer104',[0 1200],[1000; 0; 0; 0.001]);
plot(t,Y)

