File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -321,9 +321,10 @@ class Model
321321 .sum ();
322322 // Size of the Subpopulation Group2 without dead people.
323323 double N_2 = pop.segment (first_index_group2, LctStateGroup2::Count - 1 ).sum ();
324+ const double divN_2 = (N_2 < Limits<ScalarType>::zero_tolerance ()) ? 0.0 : 1.0 / N_2;
324325 ScalarType season_val = 1 + params.template get <Seasonality>() *
325326 sin (3.141592653589793 * ((params.template get <StartDay>() + t) / 182.5 + 0.5 ));
326- dydt[Si_1] += -y[Si_1] / N_2 * season_val * params.template get <TransmissionProbabilityOnContact>()[Group1] *
327+ dydt[Si_1] += -y[Si_1] * divN_2 * season_val * params.template get <TransmissionProbabilityOnContact>()[Group1] *
327328 params.template get <ContactPatterns>().get_cont_freq_mat ().get_matrix_at (t)(
328329 static_cast <Eigen::Index>(Group1), static_cast <Eigen::Index>(Group2)) *
329330 (params.template get <RelativeTransmissionNoSymptoms>()[Group2] * infectedNoSymptoms_2 +
You can’t perform that action at this time.
0 commit comments