diff --git a/part_II_fmincom.m b/part_II_fmincom.m index 27d4857..1ba25be 100644 --- a/part_II_fmincom.m +++ b/part_II_fmincom.m @@ -232,40 +232,19 @@ %graph the results -% Define the quarantine policy -quarantine_percentage = 0.5; % 50% -quarantine_start_date = datetime(2021, 10, 27); % Adjust the start date -quarantine_end_date = datetime(2022, 3, 23); % Adjust the end date - -% Calculate the policy indices based on the date range -policy_indices = find(omicron_dates >= quarantine_start_date & omicron_dates <= quarantine_end_date); - -% Implement the policy by modifying the transition matrix during the policy period -for i = policy_indices - A_opt(1, 5) = A_opt(1, 5) * (1 - quarantine_percentage); - A_opt(2, 5) = A_opt(2, 5) * (1 - quarantine_percentage); -end - - unknowns_Q = [unknowns_opt;0]; x_opt0 = unknowns_Q(5:9); xtot = zeros(5,length(omicron_dates)); -Q = 0.8; % 80% of the population is quarantined +Q = 0.75; % percentage of the population is quarantined -A_opt = [1 - unknowns_opt(1), unknowns_opt(3), unknowns_opt(2), 0, 0; - unknowns_opt(1), 1 - unknowns_opt(3) - unknowns_opt(4), 0, 0, 0; - 0, 0, 1 - unknowns_opt(2), 0, 0; - 0, unknowns_opt(4), 0, 1, 0; +A_opt = [1 - unknowns_opt(1)*(1-Q), 0, unknowns_opt(2), 0, 0; + unknowns_opt(1)*(1-Q), 1 - unknowns_opt(3) - unknowns_opt(4), 0, 0, 0; + 0, unknowns_opt(3), 1 - unknowns_opt(2), 0, 0; + 0, unknowns_opt(4)*(1-Q), 0, 1, 0; 0, 0, 0, 0, 1; ]; -policy_indices = find(omicron_dates >= quarantine_start_date & omicron_dates <= quarantine_end_date); -%for i = policy_indices -% A_opt(1, 5) = A_opt(1, 5) * (1 - quarantine_percentage); -% A_opt(2, 5) = A_opt(2, 5) * (1 - quarantine_percentage); -%end - xtot(:,1) = x_opt0; for t = 2:length(omicron_dates) @@ -276,6 +255,7 @@ I_opt = xtot(2,:); R_opt = xtot(3,:); D_opt = xtot(4,:); +Q = xtot(5,:); % %50 of the Susceptible population will be quarantined, assuming that %quarantined population will not die or be infected @@ -322,10 +302,15 @@ %calculate the percentage of death and cases in the quarantine model -diff_cases = omicron_cases(length(omicron_dates)) - cum_cases(length(omicron_dates)); -diff_cases_percen = (diff_cases/POP_STL)*100; -diff_deaths = omicron_deaths(length(omicron_dates)) - cum_deaths(length(omicron_dates)); -diff_deaths_percen = (diff_deaths/POP_STL)*100; +OMI_deaths = omicron_deaths(length(omicron_dates)); +OMI_cases = omicron_cases(length(omicron_dates)); + +OMI_t = length(omicron_dates); %durantion of omicron + +diff_cases = omicron_cases(OMI_t) - cum_cases(OMI_t); +diff_cases_percen = ((diff_cases)/OMI_cases)*100; +diff_deaths = omicron_deaths(OMI_t) - cum_deaths(OMI_t); +diff_deaths_percen = ((diff_deaths)/OMI_deaths)*100; fprintf('The reduced infected population percentage is: %f\n',diff_cases_percen); fprintf('The reduced deceased population percentage is: %f\n',diff_deaths_percen);