Commit 79495c9b authored by Nathaniel Osgood (ndo885)'s avatar Nathaniel Osgood (ndo885)
Browse files

Fixed other formulas for CompletingLatentPeriod to not scale by dt, given that...

Fixed other formulas for CompletingLatentPeriod to not scale by dt, given that resulting net flows are multiplied by dt
parent 3e83a872
......@@ -2029,20 +2029,19 @@ double integrateODEFromPreviousToCurrentTimepointModelSpecific(int iTimepoint,
prevalenceOfInfection), 5);
#endif
double MeanLatentPeriodInWeeks = 0.42857;
double CompletingLatentPeriod = (currentE / MeanLatentPeriodInWeeks)*dt;
currentE += NewInfectionsFlowForDT - (CompletingLatentPeriod)*dt; // first term already considered dt
double CompletingLatentPeriodFlow = (currentE / MeanLatentPeriodInWeeks);
currentE += NewInfectionsFlowForDT - (CompletingLatentPeriodFlow)*dt; // first term already considered dt
double MeanTimeToRecoveryInWeeks = 1.0;
double Recovery = (currentI / MeanTimeToRecoveryInWeeks);
currentI += (CompletingLatentPeriod - Recovery)*dt;
currentR += (Recovery)*dt;
double RecoveryFlow = (currentI / MeanTimeToRecoveryInWeeks);
currentI += (CompletingLatentPeriodFlow - RecoveryFlow)*dt;
currentR += (RecoveryFlow)*dt;
// confirm numerical stability and no obvious integration errors
assert(currentS >= 0.0);
assert(currentE >= 0.0);
assert(currentI >= 0.0);
assert(currentR >= 0.0);
}
// ok, now update the state at the target (final) timepoint
......@@ -2250,13 +2249,13 @@ double integrateODEFromPreviousToCurrentTimepointModelSpecificSEIRWithLogCParame
prevalenceOfInfection), 5);
#endif
double MeanLatentPeriodInWeeks = 0.42857;
double CompletingLatentPeriod = (currentE / MeanLatentPeriodInWeeks)*dt;
currentE += NewInfectionsFlowForDT - (CompletingLatentPeriod)*dt; // first term already considered dt
double CompletingLatentPeriodFlow = (currentE / MeanLatentPeriodInWeeks);
currentE += NewInfectionsFlowForDT - (CompletingLatentPeriodFlow)*dt; // first term already considered dt
double MeanTimeToRecoveryInWeeks = 1.0;
double Recovery = (currentI / MeanTimeToRecoveryInWeeks);
currentI += (CompletingLatentPeriod - Recovery)*dt;
currentR += (Recovery)*dt;
double RecoveryFlow = (currentI / MeanTimeToRecoveryInWeeks);
currentI += (CompletingLatentPeriodFlow - RecoveryFlow)*dt;
currentR += (RecoveryFlow)*dt;
// confirm numerical stability and no obvious integration errors
assert(currentS >= 0.0);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment