File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -99,13 +99,18 @@ void Model::initialize(ScalarType dt)
9999 m_populations[Eigen::Index (0 )][Eigen::Index (InfectionState::Dead)];
100100 }
101101 else {
102-
103102 // compute Susceptibles at time 0 and m_forceofinfection at time -dt as initial values for discretization scheme
104103 // use m_forceofinfection at -dt to be consistent with further calculations of S (see compute_susceptibles()),
105104 // where also the value of m_forceofinfection for the previous timestep is used
106105 update_forceofinfection (dt, true );
107106 if (m_forceofinfection > 1e-12 ) {
108107 m_initialization_method = 4 ;
108+
109+ /* Attention: With an inappropriate combination of parameters and initial conditions, it can happen that S
110+ becomes greater than N when this formula is used. In this case, at least one compartment is initialized
111+ with a number less than zero, so that a log_error is thrown.
112+ However, this initialization method is consistent with the numerical solver of the model equations,
113+ so it may sometimes make sense to use this method. */
109114 m_populations[Eigen::Index (0 )][Eigen::Index (InfectionState::Susceptible)] =
110115 m_transitions.get_last_value ()[Eigen::Index (InfectionTransition::SusceptibleToExposed)] /
111116 (dt * m_forceofinfection);
You can’t perform that action at this time.
0 commit comments