%% Figure 1(a) function DT_divorce close all clear all global beta gamma mu I_b opts=odeset('Events',@RCI); mu=1/21900; beta=1; gamma=1/5; I_b=1e-6; cont=.5; cont_end=365; tend=80*365; Zsq=mu*beta; Z=-I_b*beta*(mu+gamma)-mu*(mu+gamma+beta); noZ=mu*(mu+gamma); S_star=(-Z-sqrt(Z^2-4*Zsq*noZ))/(2*Zsq); % otherS_star=(-Z+sqrt(Z^2-4*Zsq*noZ))/Zsq; I_star=-(beta*S_star*I_b-mu+mu*S_star)/(beta*S_star); initials=[S_star I_star S_star I_star 0 0]; tspan1=0:1:365; tspan2=365:1:cont_end+365; tspan3=cont_end+365:1:tend+365; [T1,Y1]=ode45(@SIR,tspan1,initials,[],0); [T2,Y2,te1,ye1,ie1]=ode45(@SIR,tspan2,[Y1(end,1:4) 0 0],opts,cont); [T3,Y3,te2,ye2,ie2]=ode45(@SIR,tspan3,Y2(length(Y2),:),opts,0); T=[T1(1:length(T1)-1);T2(1:length(T2)-1);T3]-365; Y=[Y1(1:length(Y1)-1,:);Y2(1:length(Y2)-1,:);Y3]; figure(1) hold on fill([0,0,1,1],[0,1.75,1.75,0],[.95,.95,.95],'EdgeColor','None') [hAx,hLine1,hLine2]=plotyy(T(365:end)/365,Y(365:end,5)./Y(365:end,6),T/365,Y(:,2)); leg=legend('Control Period','Relative Cumulative Incidence','Proportion Infective','Location','Northeast'); set(leg,'FontSize',15) plot(T(1:10:end),ones(length(T(1:10:end)),1),'r:','linewidth',2) set(hLine2,'Color','k','LineWidth',2) set(hLine1,'Color','r','LineWidth',2) set(hAx(2),'YColor','k','FontSize',25,'XLim',[-1 tend/365],'YLim',[-1e-8 10e-3],'YTick',linspace(0,10e-3,6)) set(hAx(1),'YColor','r','FontSize',25,'XLim',[-1 tend/365],'YLim',[0 1.75],'YTick',linspace(0,1.75,8)) xticks(0:10:tend/365-1) ylabel(hAx(2),'Proportion of Population Infective') ylabel(hAx(1),'Relative Cumulative Incidence') xlabel(hAx(1),'Time (yrs)') hold off %Create Beta matrix for R_t b_mat=ones(1,length(T)); b_mat(T>0)=1-cont; b_mat(T>365)=1; figure(2) subplot(3,1,1) hold on fill([0,0,1,1],[0,1.75,1.75,0],[.95,.95,.95],'EdgeColor','None') [hAx,hLine1,hLine2]=plotyy(T(365:end)/365,Y(365:end,5)./Y(365:end,6),T/365,Y(:,2)); leg=legend('Control Period','Location','Northeast'); set(leg,'FontSize',15) plot(T(1:10:end),ones(length(T(1:10:end)),1),'r:','linewidth',2) set(hLine2,'Color','k','LineWidth',2) set(hLine1,'Color','r','LineWidth',2) set(hAx(2),'YColor','k','FontSize',25,'YLim',[-1e-8 10e-3],'YTick',linspace(0,10e-3,6)) set(hAx(1),'YColor','r','FontSize',25,'YLim',[0 1.75],'YTick',linspace(0,1.5,4)) xticks(0:tend/365-1) ylabel(hAx(2),'Infectives') ylabel(hAx(1),'RCI') hold off subplot(3,1,2) hold on fill([0,0,1,1],[.151,1.75,1.75,.151],[.95,.95,.95],'EdgeColor','None') plot(T/365,Y(:,1),'k','linewidth',2) plot(T/365,Y(1,1)*ones(length(T),1),'k--') xlabel('Time (yrs)') ylabel('Susceptibles') xticks(0:tend/365-1) set(gca,'fontsize',25) axis([-1 50 .15 .25]) hold off subplot(3,1,3) hold on fill([0,0,1,1],[.505,1.75,1.75,.505],[.95,.95,.95],'EdgeColor','None') plot(T/365,Y(:,1).*b_mat'*beta/gamma,'k','linewidth',2) plot(T/365,ones(length(T),1),'k--') xlabel('Time (yrs)') ylabel('R_t') xticks(0:tend/365) axis([-1 50 0.5 1.2]) set(gca,'fontsize',25) hold off hold off end function [value,isterminal,direction]=RCI(t,y,mod) value=[y(5)-y(6),y(5)-y(6)]; isterminal=[0,0]; direction=[1,-1]; end function y=SIR(t,y,mod) global beta gamma mu I_b S1=y(1); S2=y(3); I1=y(2); I2=y(4); c=1-mod; y(1)=mu*(1-S1)-c*beta*S1*(I1+I_b); y(2)=c*beta*S1*(I1+I_b)-(gamma+mu)*I1; y(3)=mu*(1-S2)-beta*S2*(I2+I_b); y(4)=beta*S2*(I2+I_b)-(gamma+mu)*I2; y(5)=c*beta*S1*(I1+I_b); y(6)=beta*S2*(I2+I_b); end %% Figure 1(b) function DT_Divorce_NewHeat close all clear all global gamma mu I_b num=50; mu=1/21900; gamma=1/5; I_b=1e-6; cont=1; R0=linspace(1,100,num); beta=R0*(gamma+mu); controlLength=365*linspace(1/12,80,num); Zsq=mu*beta; Z=-I_b*beta*(mu+gamma)-mu*(mu+gamma+beta); noZ=mu*(mu+gamma); S_star=(-Z-sqrt(Z.^2-4*Zsq.*noZ))./(2*Zsq); I_star=-(beta.*S_star*I_b-mu+mu*S_star)./(beta.*S_star); initials=[S_star; I_star; S_star; I_star; zeros(1,length(R0)); zeros(1,length(R0))]; RCI=zeros(length(R0),length(controlLength)); for i=1:length(beta) for j=1:length(controlLength) tspan1=0:1:controlLength(j); tspan2=controlLength(j):1:controlLength(j)+365*25; [T1,Y1]=ode45(@SIR,tspan1,initials(:,i),[],[cont beta(i)]); [T2,Y2]=ode45(@SIR,tspan2,Y1(length(Y1),:),[],[0 beta(i)]); RCI(i,j)=max(Y2(:,5)./Y2(:,6)); CA(i,j)=min(Y2(:,6)-Y2(:,5)); times=T2(Y2(:,2)>initials(2,i)); time(i,j)=times(1); [i j] end end RCI2=RCI; RCI2(RCI2<=1)=NaN; FS1=30; figure(1) colormap(jet); b=image(round(controlLength/365),R0,RCI2,'CDataMapping','scaled'); set(b,'AlphaData',~isnan(RCI2)) set(gca,'YDir','normal') xlabel('Duration of Control (yrs)','FontSize',FS1) ylabel('\it{R}_0','FontSize',FS1) c=colorbar; caxis([1 1.7]) ylabel(c,'Maximum Observed RCI','FontSize',FS1) xt=get(gca,'XTick'); set(gca,'fontsize',FS1) figure(2) colormap(flipud(jet)); image(round(controlLength/365),R0,CA*2e6,'CDataMapping','scaled') set(gca,'YDir','normal') xlabel('Length of Control Period (yrs)','FontSize',FS1) ylabel('\it{R}_0','FontSize',FS1) c=colorbar; ylabel(c,'Lowest Number of Cases Averted','FontSize',FS1) end function y=SIR(t,y,params) global gamma mu I_b S1=y(1); S2=y(3); I1=y(2); I2=y(4); c=1-params(1); beta=params(2); y(1)=mu*(1-S1)-c*beta*S1*(I1+I_b); y(2)=c*beta*S1*(I1+I_b)-(gamma+mu)*I1; y(3)=mu*(1-S2)-beta*S2*(I2+I_b); y(4)=beta*S2*(I2+I_b)-(gamma+mu)*I2; y(5)=c*beta*S1*(I1+I_b); y(6)=beta*S2*(I2+I_b); end %% Figure 1(c) function DT_Divorce_lengthxstrength close all clear all global gamma mu I_b num=150; mu=1/21900; gamma=1/5; I_b=1e-6; R0=5; beta=R0*gamma; controlLength=365*linspace(1/12,20,num); strength=linspace(0,1,num); Zsq=mu*beta; Z=-I_b*beta*(mu+gamma)-mu*(mu+gamma+beta); noZ=mu*(mu+gamma); S_star=(-Z-sqrt(Z.^2-4*Zsq.*noZ))./(2*Zsq); I_star=-(beta.*S_star*I_b-mu+mu*S_star)./(beta.*S_star); initials=[S_star; I_star; S_star; I_star; zeros(1,length(R0)); zeros(1,length(R0))]; RCI=zeros(num,num); for i=1:length(controlLength) for j=1:length(strength) tspan1=0:1:controlLength(i); tspan2=controlLength(i):1:controlLength(i)+365*25; [T1,Y1]=ode45(@SIR,tspan1,initials(:),[],[strength(j) beta]); [T2,Y2]=ode45(@SIR,tspan2,Y1(length(Y1),:),[],[0 beta]); RCI(i,j)=max(Y2(:,5)./Y2(:,6)); CA(i,j)=-max(Y2(:,6)-Y2(:,5)); [i j] end end RCI2=RCI; RCI2(RCI2<=1)=NaN; FS1=30; FS2=40; figure(1) colormap(jet); b=image(strength,round(controlLength/365),RCI2,'CDataMapping','scaled'); set(b,'AlphaData',~isnan(RCI2)) set(gca,'YDir','normal') set(gca,'FontSize',FS1) xlabel('Effectiveness of Control','FontSize',FS1) ylabel('Duration of Control (yrs)','FontSize',FS1) c=colorbar; caxis([1 1.7]) ylabel(c,'Maximum Observed RCI','FontSize',FS1) figure(2) colormap(flipud(jet)); image(strength,round(controlLength/365),CA*2e6,'CDataMapping','scaled') set(gca,'YDir','normal') xlabel('Effectiveness of Control','FontSize',FS1) ylabel('Length of Control Period (yrs)','FontSize',FS1) c=colorbar; ylabel(c,'Lowest Number of Cases Averted','FontSize',FS1) end function y=SIR(t,y,params) global gamma mu I_b S1=y(1); S2=y(3); I1=y(2); I2=y(4); c=1-params(1); beta=params(2); y(1)=mu*(1-S1)-c*beta*S1*(I1+I_b); y(2)=c*beta*S1*(I1+I_b)-(gamma+mu)*I1; y(3)=mu*(1-S2)-beta*S2*(I2+I_b); y(4)=beta*S2*(I2+I_b)-(gamma+mu)*I2; y(5)=c*beta*S1*(I1+I_b); y(6)=beta*S2*(I2+I_b); end %% Figure 2(a) function Seasonal_divorce close all clear all global beta0 beta1 gamma mu I_b opts=odeset('Events',@RCI); mu=1/21900; beta0=1; beta1=.01; gamma=1/5; I_b=1e-6; cont=.9; cont_end=365*1; shift=1-mod(cont_end,1); tend=5*365; Zsq=mu*beta0; Z=-I_b*beta0*(mu+gamma)-mu*(mu+gamma+beta0); noZ=mu*(mu+gamma); S_star=(-Z-sqrt(Z^2-4*Zsq*noZ))/(2*Zsq); I_star=-(beta0*S_star*I_b-mu+mu*S_star)/(beta0*S_star); inits=[S_star I_star S_star I_star 0 0]; tspan0=0:1:36500+365*shift; [T,Y]=ode45(@SIR_seasonal,tspan0,inits,[],0); initials=[Y(end,1:4) 0 0]; tspan1=365*shift:1:(365*shift)+365; tspan2=tspan1(end):1:tspan1(end)+cont_end; tspan3=tspan2(end):1:tend+tspan2(end); [T1,Y1]=ode45(@SIR_seasonal,tspan1,initials,[],0); [T2,Y2,te1,ye1,ie1]=ode45(@SIR_seasonal,tspan2,[Y1(end,1:4) 0 0],opts,cont); [T3,Y3,te2,ye2,ie2]=ode45(@SIR_seasonal,tspan3,Y2(end,:),opts,0); T=([T1(1:length(T1)-1);T2(1:length(T2)-1);T3]-365*shift)-365; Y=[Y1(1:length(Y1)-1,:);Y2(1:length(Y2)-1,:);Y3]; te2=te2+1; figure(4) hold on fill(([tspan2(1),tspan2(1),tspan2(end),tspan2(end)]-365)/365-shift,[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') [hAx,hLine1,hLine2]=plotyy(T(365:end)/365,Y(365:end,5)./Y(365:end,6),T/365,Y(:,2)); leg=legend('Control Period','Relative Cumulative Incidence','Proportion Infective','Location','Northwest'); set(leg,'FontSize',15) plot(T(1:10:end),ones(length(T(1:10:end)),1),'r:','linewidth',2) set(hLine2,'Color','k','LineWidth',2) set(hLine1,'Color','r','LineWidth',2) set(hAx(2),'YColor','k','FontSize',25,'YLim',[-1e-8 1e-2],'YTick',linspace(0,1e-2,6)) set(hAx(1),'YColor','r','FontSize',25,'YLim',[0 1.75],'YTick',linspace(0,1.75,8)) xticks([0 1 2 3 4 5 6]) ylabel(hAx(2),'Proportion of Population Infective') ylabel(hAx(1),'Relative Cumulative Incidence') xlabel(hAx(1),'Time (yrs)','FontSize',25) hold off end function [value,isterminal,direction]=RCI(t,y,mod) value=[y(5)-y(6),y(5)-y(6)]; isterminal=[0,0]; direction=[1,-1]; end function y=SIR_seasonal(t,y,mod) global beta0 beta1 gamma mu I_b S1=y(1); S2=y(3); I1=y(2); I2=y(4); c=1-mod; y(1)=mu*(1-S1)-c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b); y(2)=c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b)-(gamma+mu)*I1; y(3)=mu*(1-S2)-beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b); y(4)=beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b)-(gamma+mu)*I2; y(5)=c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b); y(6)=beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b); end %% Figure 2(b) function Seasonal_Divorce_NewHeat close all clear all global gamma mu I_b beta1 num=150; mu=1/21900; beta1=.01; gamma=1/5; I_b=1e-6; R0=linspace(2,20,num); beta0=R0*gamma; controlLength=365*linspace(1/10,10,num); Zsq=mu*beta0; Z=-I_b*beta0*(mu+gamma)-mu*(mu+gamma+beta0); noZ=mu*(mu+gamma); S_star=(-Z-sqrt(Z.^2-4*Zsq.*noZ))./(2*Zsq); I_star=-(beta0.*S_star*I_b-mu+mu*S_star)./(beta0.*S_star); inits=[S_star; I_star; S_star; I_star; zeros(1,length(R0)); zeros(1,length(R0))]; RCI=zeros(length(R0),length(controlLength)); for i=1:length(beta0) [Tb,Yb]=ode15s(@SIR_seasonal,0:10:36500,inits(:,i),[],[beta0(i) 0]); initials=[Yb(end,1:4) 0 0]; for j=1:length(controlLength) tspan1=0:5:controlLength(j); tspan2=controlLength(j):5:controlLength(j)+365*25; [T1,Y1]=ode45(@SIR_seasonal,tspan1,initials,[],[beta0(i) 1]); [T2,Y2]=ode45(@SIR_seasonal,tspan2,Y1(length(Y1),:),[],[beta0(i) 0]); RCI(i,j)=max(Y2(:,5)./Y2(:,6)); [i j] end end RCI2=RCI; RCI2(RCI2<=1)=NaN; FS1=30; figure(1) colormap(jet); b=image(round(controlLength/365),R0,RCI2,'CDataMapping','scaled'); set(b,'AlphaData',~isnan(RCI2)) set(gca,'YDir','normal') set(gca,'FontSize',FS1) xlabel('Duration of Control (yrs)','FontSize',FS1) ylabel('\it{R}_0','FontSize',FS1) c=colorbar; caxis([1 1.7]) ylabel(c,'Maximum Observed RCI','FontSize',FS1) end function y=SIR_seasonal(t,y,params) global beta1 gamma mu I_b S1=y(1); S2=y(3); I1=y(2); I2=y(4); c=1-params(2); beta0=params(1); y(1)=mu*(1-S1)-c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b); y(2)=c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b)-(gamma+mu)*I1; y(3)=mu*(1-S2)-beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b); y(4)=beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b)-(gamma+mu)*I2; y(5)=c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b); y(6)=beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b); end %% Figure 2(c) function Seasonal_Divorce_Heat_startxend close all clear all global gamma mu I_b beta1 num=75; mu=1/21900; beta1=.01; gamma=1/5; I_b=1e-6; R0=10; beta0=R0*gamma; endTime=365*linspace(13/12,20,num); startTime=365*linspace(0,5,num); Zsq=mu*beta0; Z=-I_b*beta0*(mu+gamma)-mu*(mu+gamma+beta0); noZ=mu*(mu+gamma); S_star=(-Z-sqrt(Z.^2-4*Zsq.*noZ))./(2*Zsq); I_star=-(beta0.*S_star*I_b-mu+mu*S_star)./(beta0.*S_star); inits=[S_star; I_star; S_star; I_star; zeros(1,length(R0)); zeros(1,length(R0))]; RCI=zeros(length(startTime),length(endTime)); for i=1:length(startTime) [Tb,Yb]=ode15s(@SIR_seasonal,0:10:36500+startTime(i),inits,[],[beta0 0]); initials=[Yb(end,1:4) 0 0]; for j=1:length(endTime) if(endTime(j)-startTime(i)<6) RCI(i,j)=NaN; [i j] else tspan1=startTime(i):5:endTime(j); tspan2=tspan1(end):5:tspan1(end)+365*25; [T1,Y1]=ode45(@SIR_seasonal,tspan1,initials,[],[beta0 1]); [T2,Y2]=ode45(@SIR_seasonal,tspan2,Y1(size(Y1,1),:),[],[beta0 0]); RCI(i,j)=max(Y2(:,5)./Y2(:,6)); [i j] end end end FS1=30; figure(1) colormap(jet); b=image(startTime,endTime,RCI','CDataMapping','scaled'); set(b,'AlphaData',~isnan(RCI')) set(gca,'YDir','normal') set(gca,'FontSize',FS1) ylabel('Day Control is Ended','FontSize',FS1) xlabel('Day Control is Started','FontSize',FS1) c=colorbar; caxis([1 1.7]) ylabel(c,'Peak RCI','FontSize',FS1) hold on for k=1:3 t=linspace(0,365,25); plot(t,365*k+t,'k:','LineWidth',2) end hold off end function y=SIR_seasonal(t,y,params) global beta1 gamma mu I_b S1=y(1); S2=y(3); I1=y(2); I2=y(4); c=1-params(2); beta0=params(1); y(1)=mu*(1-S1)-c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b); y(2)=c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b)-(gamma+mu)*I1; y(3)=mu*(1-S2)-beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b); y(4)=beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b)-(gamma+mu)*I2; y(5)=c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b); y(6)=beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b); end %% Figure 3 function Seasonal_VB_divorce close all clear all global b d phi psi g r k mu I_b My_S My_I My_R My_V r_s %influx of susceptible hosts b=45.7; %Host background per-capita mortality rate d=1/21900; %Vector to host transmission rate psi=.3; %Host to vector transmission rate phi=.3; %Natural infectious host recovery rate g=1/6; %Intrinsic per-capita vector growth rate r=0.835; %density-dependent effects on recruitment k=3.675e-7; %Vector per-capita mortality rate mu=1/10; %Seasonality term r_s=.01; I_b=1e-6; cont=1; Z=((r-mu)*psi+k*b)*phi*I_b*d^2+((((r-mu)*psi+k*b)*g*I_b-b*psi*(r-mu))*phi+b^2*k*mu)*d+b^2*g*k*mu; noZ=I_b*b*d*phi*psi*(mu-r); Zsq=d*(d+g)*((r-mu)*psi+k*b)*phi; My_I=-(Z-sqrt(Z^2-4*noZ*Zsq))/(2*Zsq); My_S=-(1/d)*(My_I*(d+g)-b); My_R=(g/d)*My_I; My_U=(mu*My_I*((r-mu)*psi+k*b)*(d+g))/((((mu+phi)*d+g*mu)*My_I+I_b*d*phi)*k*psi); My_V=My_I*b*(d+g)/(psi*((-d-g)*My_I+b)); initials=[My_S(1) My_I(1) My_R(1) My_U(1) My_V(1) 0]; [T,Y]=ode45(@SIR_spray,0:1:36500,initials,[],0); initials=Y(end,:); tspan1=0:1:365; tspan2=365:1:365*2; tspan3=2*365:1:365*7; [T1,Y1]=ode45(@SIR_spray,tspan1,initials,[],0); [T2,Y2]=ode45(@SIR_spray,tspan2,[Y1(end,1:5) 0],[],cont); [T3,Y3]=ode45(@SIR_spray,tspan3,Y2(length(Y2),:),[],0); T=[T1(1:length(T1)-1);T2(1:length(T2)-1);T3]-365; Y=[Y1(1:length(Y1)-1,:);Y2(1:length(Y2)-1,:);Y3]; [TB1,YB1]=ode45(@SIR_spray,0:1:365,initials,[],0); [TB2,YB2]=ode45(@SIR_spray,365:1:365*7,[YB1(end,1:5) 0],[],0); YB=[YB1(1:length(YB1)-1,:);YB2(1:length(YB2),:)]; max(Y((365+1):end,6)./YB((365+1):end,6)) figure(4) hold on fill([0,0,1,1],[-1,2,2,-1],[.95,.95,.95],'EdgeColor','None') [hAx,hLine1,hLine2]=plotyy(T((365+1):end)/365,Y((365+1):end,6)./YB((365+1):end,6),T/365,Y(:,2)/(1000830)); leg=legend('Control Period','Relative Cumulative Incidence','Proportion Infective','Location','Northwest'); set(leg,'FontSize',15) plot(T(1:10:end),ones(length(T(1:10:end)),1),'r:','linewidth',2) set(hLine2,'Color','k','LineWidth',2) set(hLine1,'Color','r','LineWidth',2) set(hAx(2),'YColor','k','FontSize',25,'YLim',[-1e-8 10e-3],'YTick',linspace(0,10e-3,6)) set(hAx(1),'YColor','r','FontSize',25,'YLim',[0 2],'YTick',linspace(0,2,9)) xticks([0 1 2 3 4 5 6]) ylabel(hAx(2),'Proportion of Host Population Infective') ylabel(hAx(1),'Relative Cumulative Incidence') xlabel(hAx(1),'Time (yrs)') hold off end function [value,isterminal,direction]=RCI(t,y,mod) global My_S My_I My_R My_V phi value=[y(6)-phi*My_S*My_V*t./(My_S+My_I+My_R),y(6)-phi*My_S*My_V*t./(My_S+My_I+My_R)]; isterminal=[0,0]; direction=[1,-1]; end function y=SIR_spray(t,y,params) global b d psi phi g r k mu I_b r_s sigma=1+params; %%State Variables S=y(1); I=y(2); R=y(3); U=y(4); V=y(5); %Susceptibles y(1)=b-psi*(V*S)/(S+I+R)-d*S; %Infectives y(2)=psi*(V*S)/(S+I+R)-(d+g)*I; %Removed y(3)=g*I-d*R; %Susceptible vectors (U) y(4)=(U+V)*(r*(1+r_s*cos(2*pi*t/365))-k*(U+V))-phi*U*(I+I_b)/(S+I+R)-sigma*mu*U; %Infected Vectors(V) y(5)=phi*U*(I+I_b)/(S+I+R)-sigma*mu*V; %New infectives y(6)=phi*S*V/(S+I+R); end %% Figure 4(a) function Seasonal_divorce_pulsing close all clear all global beta0 beta1 gamma mu I_b opts=odeset('Events',@RCI); name='Seasonal(10)_pulse'; mu=1/21900; % gamma=2.5; beta0=1; beta1=.01; gamma=1/5; I_b=1e-6; cont=.9; cont_end=365*1; shift=1-mod(cont_end,1); tend=5*365; Zsq=mu*beta0; Z=-I_b*beta0*(mu+gamma)-mu*(mu+gamma+beta0); noZ=mu*(mu+gamma); S_star=(-Z-sqrt(Z^2-4*Zsq*noZ))/(2*Zsq); I_star=-(beta0*S_star*I_b-mu+mu*S_star)/(beta0*S_star); inits=[S_star I_star S_star I_star 0 0]; tspan0=0:1:36500+365*shift; [T,Y]=ode45(@SIR_seasonal,tspan0,inits,[],0); initials=[Y(end,1:4) 0 0]; tspan1=365*shift:1:(365*shift)+365*3; ton=365*1/12; toff=365*11/12; [T1,Y1]=ode45(@SIR_seasonal,tspan1,initials,[],0); Y1(5:6)=[0,0]; for i=1:12 [T2,Y2,te1,ye1,ie1]=ode45(@SIR_seasonal,T1(end):1:T1(end)+ton,Y1(end,:),opts,cont); [T3,Y3,te2,ye2,ie2]=ode45(@SIR_seasonal,T2(end):1:T2(end)+toff,Y2(end,:),opts,0); T1=[T1(1:length(T1)-1);T2(1:length(T2)-1);T3]; Y1=[Y1(1:length(Y1)-1,:);Y2(1:length(Y2)-1,:);Y3]; end [T3,Y3,te2,ye2,ie2]=ode45(@SIR_seasonal,T1(end):1:T1(end)+365*10,Y1(end,:),opts,0); Y=[Y1(1:length(Y1)-1,:);Y3]; T=[T1(1:length(T1)-1);T3]-(365*4); te2=te2+1; figure(4) hold on fill([0,0,1/12,1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') [hAx,hLine1,hLine2]=plotyy(T(365*3:end)/365,Y(365*3:end,5)./Y(365*3:end,6),T/365,Y(:,2)); leg=legend('Control Period','Relative Cumulative Incidence','Proportion Infective','Location','Northeast'); set(leg,'FontSize',15) plot(linspace(0,T(end),length(T(1:10:end))),ones(length(T(1:10:end)),1),'r:','linewidth',2) for i=1:11 fill([i,i,i+1/12,i+1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') end set(hLine2,'Color','k','LineWidth',2) set(hLine1,'Color','r','LineWidth',2) set(hAx(2),'YColor','k','FontSize',25,'YLim',[-1e-8 8e-3],'YTick',linspace(0,8e-3,5)) set(hAx(1),'YColor','r','FontSize',25,'YLim',[0 1.75],'YTick',linspace(0,1.75,8)) xticks(0:2:T(end)/365) ylabel(hAx(2),'Proportion of Population Infective') ylabel(hAx(1),'Relative Cumulative Incidence') xlabel(hAx(1),'Time (yrs)','FontSize',25) xlim(hAx(1),[-3 T(end)/365]) xlim(hAx(2),[-3 T(end)/365]) hold off %Set up control matrix for R_t b_mat=ones(length(T),1); for i=1:12 b_mat(T>i*365)=1-cont; b_mat(T>i*365+(365/12))=1; end figure(1) subplot(3,1,1) hold on fill([0,0,1/12,1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') [hAx,hLine1,hLine2]=plotyy(T(365*3:end)/365,Y(365*3:end,5)./Y(365*3:end,6),T/365,Y(:,2)); leg=legend('Control Period','Location','Northeast');t'); set(leg,'FontSize',15) plot(linspace(0,T(end),length(T(1:10:end))),ones(length(T(1:10:end)),1),'r:','linewidth',2) for i=1:11 fill([i,i,i+1/12,i+1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') end set(hLine2,'Color','k','LineWidth',2) set(hLine1,'Color','r','LineWidth',2) set(hAx(2),'YColor','k','FontSize',25,'YLim',[-1e-8 8e-3],'YTick',linspace(0,8e-3,5)) set(hAx(1),'YColor','r','FontSize',25,'YLim',[0 1.75],'YTick',linspace(0,1.5,4)) xticks(0:2:T(end)/365) ylabel(hAx(2),'Infectives') ylabel(hAx(1),'RCI') xlim(hAx(1),[-3 T(end)/365]) xlim(hAx(2),[-3 T(end)/365]) hold off subplot(3,1,2) hold on plot(T(7:end)/365,Y(7:end,1),'k','linewidth',2) plot(T(7:end)/365,Y(1,1)*ones(length(T(7:end)),1),'k--') fill([0,0,1/12,1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') for i=1:11 fill([i,i,i+1/12,i+1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') end hold off xlim([-3 T(end)/365]) ylim([.15 .25]) xticks(0:2:T(end)/365) xlabel('Time (yrs)') ylabel('Susceptibles') set(gca,'fontsize',25) subplot(3,1,3) hold on fill([0,0,1/12,1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') for i=1:11 fill([i,i,i+1/12,i+1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') end plot(T(7:end)/365,Y(7:end,1).*b_mat(7:end).*beta0.*(1+beta1.*cos(2*pi*T(7:end)/365))/gamma,'k','linewidth',2) plot(T(7:end)/365,ones(length(T(7:end)),1),'k--') xlabel('Time (yrs)') ylabel('R_t') axis([-3 T(end)/365 0 1.5]) xticks(0:2:T(end)/365) set(gca,'fontsize',25) hold off end function [value,isterminal,direction]=RCI(t,y,mod) value=[y(5)-y(6),y(5)-y(6)]; isterminal=[0,0]; direction=[1,-1]; end function y=SIR_seasonal(t,y,mod) global beta0 beta1 gamma mu I_b S1=y(1); S2=y(3); I1=y(2); I2=y(4); c=1-mod; y(1)=mu*(1-S1)-c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b); y(2)=c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b)-(gamma+mu)*I1; y(3)=mu*(1-S2)-beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b); y(4)=beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b)-(gamma+mu)*I2; y(5)=c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b); y(6)=beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b); end %% Figure 4(b) function Seasonal_divorce_reactive close all clear all global beta0 beta1 gamma mu I_b opts=odeset('Events',@outbreak); mu=1/21900; beta0=1; beta1=.02; gamma=1/5; I_b=1e-6; cont=.9; cont_end=365*1; shift=1-mod(cont_end,1); tend=5*365; Zsq=mu*beta0; Z=-I_b*beta0*(mu+gamma)-mu*(mu+gamma+beta0); noZ=mu*(mu+gamma); S_star=(-Z-sqrt(Z^2-4*Zsq*noZ))/(2*Zsq); I_star=-(beta0*S_star*I_b-mu+mu*S_star)/(beta0*S_star); inits=[S_star I_star S_star I_star 0 0]; tspan0=0:1:36500+365*shift; [T,Y]=ode45(@SIR_seasonal,tspan0,inits,[],0); initials=[Y(end,1:4) 0 0]; tspan1=365*shift:1:(365*shift)+365*3; ton=365*1/12; toff=365*11/12; [T1,Y1]=ode45(@SIR_seasonal,tspan1,initials,[],0); Y1(5:6)=[0,0]; cont_times=0; for i=1:12 [T2,Y2]=ode45(@SIR_seasonal,T1(end):1:T1(end)+ton,Y1(end,:),[],cont); [T3,Y3,te,ye,ie]=ode45(@SIR_seasonal,T2(end):1:T2(end)+toff,Y2(end,:),opts,0); T1=[T1(1:length(T1)-1);T2(1:length(T2)-1);T3]; Y1=[Y1(1:length(Y1)-1,:);Y2(1:length(Y2)-1,:);Y3]; cont_times=[cont_times te-365*4]; end [T3,Y3]=ode45(@SIR_seasonal,T1(end):1:T1(end)+365*10,Y1(end,:),[],0); Y=[Y1(1:length(Y1)-1,:);Y3]; T=[T1(1:length(T1)-1);T3]-(365*4); figure(4) hold on fill([0,0,1/12,1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') [hAx,hLine1,hLine2]=plotyy(T(365:end)/365,Y(365:end,5)./Y(365:end,6),T/365,Y(:,2)); leg=legend('Control Period','Relative Cumulative Incidence','Proportion Infective','Location','Northeast'); set(leg,'FontSize',15) plot(T(1:10:end),ones(length(T(1:10:end)),1),'r:','linewidth',2) for i=1:11 fill([cont_times(i+1)/365,cont_times(i+1)/365,cont_times(i+1)/365+1/12,cont_times(i+1)/365+1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') end set(hLine2,'Color','k','LineWidth',2) set(hLine1,'Color','r','LineWidth',2) set(hAx(2),'YColor','k','FontSize',25,'YLim',[-1e-8 16e-3],'YTick',linspace(0,16e-3,5)) set(hAx(1),'YColor','r','FontSize',25,'YLim',[0 2],'YTick',linspace(0,2,9)) xticks(0:2:T(end)/365) ylabel(hAx(2),'Proportion of Population Infective') ylabel(hAx(1),'Relative Cumulative Incidence') xlabel(hAx(1),'Time (yrs)','FontSize',25) xlim(hAx(1),[-3 T(end)/365]) xlim(hAx(2),[-3 T(end)/365]) hold off %Set up control matrix for R_t b_mat=ones(length(T),1); for i=1:12 b_mat(T>cont_times(i))=1-cont; b_mat(T>cont_times(i)+(365/12))=1; end figure(1) subplot(3,1,1) hold on fill([0,0,1/12,1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') [hAx,hLine1,hLine2]=plotyy(T(365:end)/365,Y(365:end,5)./Y(365:end,6),T/365,Y(:,2)); leg=legend('Control Period','Location','Northeast'); set(leg,'FontSize',15) plot(T(1:10:end),ones(length(T(1:10:end)),1),'r:','linewidth',2) for i=1:11 fill([cont_times(i+1)/365,cont_times(i+1)/365,cont_times(i+1)/365+1/12,cont_times(i+1)/365+1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') end set(hLine2,'Color','k','LineWidth',2) set(hLine1,'Color','r','LineWidth',2) set(hAx(2),'YColor','k','FontSize',25,'YLim',[-1e-8 16e-3],'YTick',linspace(0,16e-3,5)) set(hAx(1),'YColor','r','FontSize',25,'YLim',[0 2],'YTick',linspace(0,2,5)) xticks(0:2:T(end)/365) ylabel(hAx(2),'Proportion Infective') ylabel(hAx(1),'RCI') xlabel(hAx(1),'Time (yrs)','FontSize',25) xlim(hAx(1),[-3 T(end)/365]) xlim(hAx(2),[-3 T(end)/365]) hold off subplot(3,1,2) hold on plot(T(7:end)/365,Y(7:end,1),'k','linewidth',2) plot(T(7:end)/365,Y(7,1)*ones(length(T(7:end)),1),'k--') fill([0,0,1/12,1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') for i=1:11 fill([cont_times(i+1)/365,cont_times(i+1)/365,cont_times(i+1)/365+1/12,cont_times(i+1)/365+1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') end hold off xlim([-3 T(end)/365]) ylim([.05 .25]) xticks(0:2:T(end)/365) xlabel('Time (yrs)') ylabel('Susceptibles') set(gca,'fontsize',25) subplot(3,1,3) hold on fill([0,0,1/12,1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') for i=1:11 fill([cont_times(i+1)/365,cont_times(i+1)/365,cont_times(i+1)/365+1/12,cont_times(i+1)/365+1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') end plot(T(7:end)/365,Y(7:end,1).*b_mat(7:end).*beta0.*(1+beta1.*cos(2*pi*T(7:end)/365))/gamma,'k','linewidth',2) plot(T(7:end)/365,ones(length(T(7:end)),1),'k--') xlabel('Time (yrs)') ylabel('R_t') axis([-3 T(end)/365 0 2]) xticks(0:2:T(end)/365) set(gca,'fontsize',25) hold off end function [value,isterminal,direction]=outbreak(t,y,mod) value=y(2)-1e-4; isterminal=1; direction=1; end function y=SIR_seasonal(t,y,mod) global beta0 beta1 gamma mu I_b S1=y(1); S2=y(3); I1=y(2); I2=y(4); c=1-mod; y(1)=mu*(1-S1)-c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b); y(2)=c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b)-(gamma+mu)*I1; y(3)=mu*(1-S2)-beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b); y(4)=beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b)-(gamma+mu)*I2; y(5)=c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b); y(6)=beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b); end %% Figure 4(c) function Seasonal_divorce_predictive close all clear all global beta0 beta1 gamma mu I_b mu=1/21900; beta0=1; beta1=.02; gamma=1/5; I_b=1e-6; cont=.9; cont_end=365*1; shift=1-mod(cont_end,1); tend=5*365; ndays=365; Zsq=mu*beta0; Z=-I_b*beta0*(mu+gamma)-mu*(mu+gamma+beta0); noZ=mu*(mu+gamma); S_star=(-Z-sqrt(Z^2-4*Zsq*noZ))/(2*Zsq); I_star=-(beta0*S_star*I_b-mu+mu*S_star)/(beta0*S_star); inits=[S_star I_star S_star I_star 0 0]; tspan0=0:1:36500+365*shift; [T,Y]=ode45(@SIR_seasonal,tspan0,inits,[],0); initials=[Y(end,1:4) 0 0]; tspan1=365*shift:1:(365*shift)+365*3; ton=365*1/12; toff=365*11/12; [T1,Y1]=ode45(@SIR_seasonal,tspan1,initials,[],0); Y1(5:6)=[0,0]; cont_times=zeros(12,1); for i=1:12 [T2,Y2]=ode45(@SIR_seasonal,T1(end):1:T1(end)+ton,Y1(end,:),[],cont); cont_times(i)=T1(end); checks=zeros(365,1); for j=1:ndays [T3,Y3]=ode45(@SIR_seasonal,T2(end):1:T2(end)+j,Y2(end,:),[],0); [T4,Y4]=ode45(@SIR_seasonal,T3(end):1:T3(end)+ton,Y3(end,:),[],cont); [T5,Y5]=ode45(@SIR_seasonal,T4(end):1:T4(end)+365*10,Y4(end,:),[],0); checks(j)=max(Y5(:,5)./Y5(:,6)); end [~,ind]=min(checks); [T3,Y3]=ode45(@SIR_seasonal,T2(end):1:T2(end)+ind,Y2(end,:),[],0); T1=[T1(1:length(T1)-1);T2(1:length(T2)-1);T3]; Y1=[Y1(1:length(Y1)-1,:);Y2(1:length(Y2)-1,:);Y3]; end [T3,Y3]=ode45(@SIR_seasonal,T1(end):1:T1(end)+365*10,Y1(end,:),[],0); Y=[Y1(1:length(Y1)-1,:);Y3]; T=[T1(1:length(T1)-1);T3]-(365*4); cont_times=cont_times-(365*4); figure(4) hold on fill([0,0,1/12,1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') [hAx,hLine1,hLine2]=plotyy(T(365*3:end)/365,Y(365*3:end,5)./Y(365*3:end,6),T/365,Y(:,2)); leg=legend('Control Period','Relative Cumulative Incidence','Proportion Infective','Location','Northeast'); set(leg,'FontSize',15) plot(linspace(0,T(end),length(T(1:10:end))),ones(length(T(1:10:end)),1),'r:','linewidth',2) for i=2:12 fill([cont_times(i)/365,cont_times(i)/365,cont_times(i)/365+1/12,cont_times(i)/365+1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') end set(hLine2,'Color','k','LineWidth',2) set(hLine1,'Color','r','LineWidth',2) set(hAx(2),'YColor','k','FontSize',25,'YLim',[-1e-8 8e-3],'YTick',linspace(0,8e-3,5)) set(hAx(1),'YColor','r','FontSize',25,'YLim',[0 1.75],'YTick',linspace(0,1.75,8)) xticks(0:2:T(end)/365) ylabel(hAx(2),'Proportion of Population Infective') ylabel(hAx(1),'Relative Cumulative Incidence') xlabel(hAx(1),'Time (yrs)','FontSize',25) xlim(hAx(1),[-3 T(end)/365]) xlim(hAx(2),[-3 T(end)/365]) hold off %Set up control matrix for R_t b_mat=ones(length(T),1); for i=1:12 b_mat(T>i*365)=1-cont; b_mat(T>i*365+(365/12))=1; end figure(1) subplot(3,1,1) hold on fill([0,0,1/12,1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') [hAx,hLine1,hLine2]=plotyy(T(365*3:end)/365,Y(365*3:end,5)./Y(365*3:end,6),T/365,Y(:,2)); leg=legend('Control Period','Location','Northeast'); set(leg,'FontSize',15) plot(linspace(0,T(end),length(T(1:10:end))),ones(length(T(1:10:end)),1),'r:','linewidth',2) for i=2:12 fill([cont_times(i)/365,cont_times(i)/365,cont_times(i)/365+1/12,cont_times(i)/365+1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') end set(hLine2,'Color','k','LineWidth',2) set(hLine1,'Color','r','LineWidth',2) set(hAx(2),'YColor','k','FontSize',25,'YLim',[-1e-8 8e-3],'YTick',linspace(0,8e-3,5)) set(hAx(1),'YColor','r','FontSize',25,'YLim',[0 1.75],'YTick',linspace(0,1.5,4)) xticks(0:2:T(end)/365) ylabel(hAx(2),'Infectives') ylabel(hAx(1),'RCI') xlim(hAx(1),[-3 T(end)/365]) xlim(hAx(2),[-3 T(end)/365]) hold off subplot(3,1,2) hold on plot(T(7:end)/365,Y(7:end,1),'k','linewidth',2) plot(T(7:end)/365,Y(1,1)*ones(length(T(7:end)),1),'k--') fill([0,0,1/12,1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') for i=2:12 fill([cont_times(i)/365,cont_times(i)/365,cont_times(i)/365+1/12,cont_times(i)/365+1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') end hold off xlim([-3 T(end)/365]) ylim([.15 .25]) xticks(0:2:T(end)/365) xlabel('Time (yrs)') ylabel('Susceptibles') set(gca,'fontsize',25) subplot(3,1,3) hold on fill([0,0,1/12,1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') for i=2:12 fill([cont_times(i)/365,cont_times(i)/365,cont_times(i)/365+1/12,cont_times(i)/365+1/12],[-.1,2,2,-.1],[.95,.95,.95],'EdgeColor','None') end plot(T(7:end)/365,Y(7:end,1).*b_mat(7:end).*beta0.*(1+beta1.*cos(2*pi*T(7:end)/365))/gamma,'k','linewidth',2) plot(T(7:end)/365,ones(length(T(7:end)),1),'k--') xlabel('Time (yrs)') ylabel('R_t') axis([-3 T(end)/365 0 1.5]) xticks(0:2:T(end)/365) set(gca,'fontsize',25) hold off end function [value,isterminal,direction]=RCI(t,y,mod) value=[y(5)-y(6),y(5)-y(6)]; isterminal=[0,0]; direction=[1,-1]; end function y=SIR_seasonal(t,y,mod) global beta0 beta1 gamma mu I_b S1=y(1); S2=y(3); I1=y(2); I2=y(4); c=1-mod; y(1)=mu*(1-S1)-c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b); y(2)=c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b)-(gamma+mu)*I1; y(3)=mu*(1-S2)-beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b); y(4)=beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b)-(gamma+mu)*I2; y(5)=c*beta0*(1+beta1*cos(2*pi*t/365))*S1*(I1+I_b); y(6)=beta0*(1+beta1*cos(2*pi*t/365))*S2*(I2+I_b); end