%plot disaggregated model variables

ia=3;ib=3;
fsize=12;
horz=100;
time=0:1:horz-1;


figure;
subplot(ia,ib,1)
plot(time,100*Iu(1:horz),'b-','LineWidth',2);hold on
plot(time,100*Ik(1:horz),'r--','LineWidth',2);hold off
box off;
title('Infected (Iu,Ik)','FontSize',fsize);
ylabel('% of Initial Population','FontSize',fsize);
set(gca,'FontSize',fsize);

subplot(ia,ib,2)
plot(time,100*Su(1:horz),'b-','LineWidth',2);hold on
plot(time,100*Sk(1:horz),'r--','LineWidth',2);hold off
box off;
title('Susceptibles (Su,Sk)','FontSize',fsize);
ylabel('% of Initial Population','FontSize',fsize);
set(gca,'FontSize',fsize);

subplot(ia,ib,3)
plot(time,100*Ru(1:horz),'b-','LineWidth',2);hold on
plot(time,100*Rk(1:horz),'r--','LineWidth',2);hold on
box off;
title('Recovered (Ru,Rk)','FontSize',fsize);
ylabel('% of Initial Population','FontSize',fsize);
set(gca,'FontSize',fsize);

subplot(ia,ib,5)
plot(time,100*(aggC(1:horz)-c_ss)/c_ss,'k-','LineWidth',2);hold off
box off;
title('Aggregate Consumption, C','FontSize',fsize);
ylabel('% Dev. from Initial Steady State','FontSize',fsize);
xlabel('Weeks','FontSize',fsize);
set(gca,'FontSize',fsize);

subplot(ia,ib,6)
plot(time,100*(aggN(1:horz)-n_target)/n_target,'k-','LineWidth',2);hold off
box off;
title('Aggregate Hours, N','FontSize',fsize);
ylabel('% Dev. from Initial Steady State','FontSize',fsize);
xlabel('Weeks','FontSize',fsize);
set(gca,'FontSize',fsize);

subplot(ia,ib,8)
plot(time,100*(aggX(1:horz)-x_ss)/x_ss,'k-','LineWidth',2);hold off
box off;
title('Aggregate Consumption, C','FontSize',fsize);
ylabel('% Dev. from Initial Steady State','FontSize',fsize);
xlabel('Weeks','FontSize',fsize);
set(gca,'FontSize',fsize);

subplot(ia,ib,9)
plot(time,100*(aggK(1:horz)-k_ss)/k_ss,'k-','LineWidth',2);hold off
box off;
title('Aggregate Hours, N','FontSize',fsize);
ylabel('% Dev. from Initial Steady State','FontSize',fsize);
xlabel('Weeks','FontSize',fsize);
set(gca,'FontSize',fsize);

subplot(ia,ib,4)
plot(time,100*Du(1:horz),'b-','LineWidth',2);hold on
plot(time,100*Dk(1:horz),'r--','LineWidth',2);hold on
box off;
title('Deaths (Du,Dk)','FontSize',fsize);
ylabel('% of Initial Population','FontSize',fsize);
xlabel('Weeks','FontSize',fsize);
set(gca,'FontSize',fsize);


leg1=legend('People with unknown health status','People with known health status'); 
set(leg1,...
    'Position',[-0.0704335567178815 0.894078940309976 1.19107142857143 0.044047619047619],...
    'Orientation','horizontal');
legend boxoff;

suptitle3('Simulation Results (1/2)');
orient landscape
print -dpdf -fillpage sim_fig1





figure;
subplot(2,2,1)
plot(time,100*(cou(1:horz)-inc_target/2)/inc_target/2,'b-','LineWidth',2); hold on
plot(time,100*(cso(1:horz)-inc_target/2)/inc_target/2,'r--','LineWidth',2); hold on
plot(time,100*(coi(1:horz)-inc_target/2)/inc_target/2,'k-.','LineWidth',2); hold on
plot(time,100*(cor(1:horz)-inc_target/2)/inc_target/2,'m:','LineWidth',2); hold off
box off;
title('online Consumption by Type','FontSize',fsize);
ylabel('% Dev. from Initial Steady State','FontSize',fsize);
xlabel('Weeks','FontSize',fsize);
set(gca,'FontSize',fsize);
legend('Unknown Status (Not Tested)','Susceptibles (Tested)','Infected (Tested)','Recovered (Tested)','Location','best');
legend boxoff

subplot(2,2,2)
plot(time,100*(cnu(1:horz)-inc_target/2)/inc_target/2,'b-','LineWidth',2); hold on
plot(time,100*(cns(1:horz)-inc_target/2)/inc_target/2,'r--','LineWidth',2); hold on
plot(time,100*(cni(1:horz)-inc_target/2)/inc_target/2,'k-.','LineWidth',2); hold on
plot(time,100*(cnr(1:horz)-inc_target/2)/inc_target/2,'m:','LineWidth',2); hold off
box off;
title('offline Consumption by Type','FontSize',fsize);
ylabel('% Dev. from Initial Steady State','FontSize',fsize);
xlabel('Weeks','FontSize',fsize);
set(gca,'FontSize',fsize);
legend('Unknown Status (Not Tested)','Susceptibles (Tested)','Infected (Tested)','Recovered (Tested)','Location','best');
legend boxoff
 
subplot(2,2,3)
plot(time,100*(nu(1:horz)-n_target)/n_target,'b-','LineWidth',2); hold on
plot(time,100*(ns(1:horz)-n_target)/n_target,'r--','LineWidth',2); hold on
plot(time,100*(ni(1:horz)-n_target)/n_target,'k-.','LineWidth',2); hold on
plot(time,100*(nr(1:horz)-n_target)/n_target,'m:','LineWidth',2); hold off
box off;
title('Hours by Type','FontSize',fsize);
ylabel('% Dev. from Initial Steady State','FontSize',fsize);
xlabel('Weeks','FontSize',fsize);
set(gca,'FontSize',fsize);
legend('Unknown Status (Not Tested)','Susceptibles (Tested)','Infected (Tested)','Recovered (Tested)','Location','best');
legend boxoff


suptitle('Simulation Results (2/2)');
orient landscape
print -dpdf -fillpage sim_fig2