예제 #1
0
 /// <summary>
 /// Gets the rate at which susceptible individuals acquire infections.
 /// </summary>
 public FhirDecimal GetValue(
     C19M.M.C.A.Safi2010.Interfaces.Parameters.EffectiveContactRate.Iβ β,
     C19M.M.C.A.Safi2010.Interfaces.Parameters.EfficacyIsolationTreatmentHospitalizedIndividuals.Iη η,
     double H,
     double I,
     double N)
 {
     return(new FhirDecimal(
                (decimal)(β.Value.Value.Value * ((decimal)I + η.Value.Value.Value * (decimal)H))
                /
                (decimal)(N)));
 }
 // https://stackoverflow.com/a/55004295
 private Func <double, MathNet.Numerics.LinearAlgebra.Vector <double>, MathNet.Numerics.LinearAlgebra.Vector <double> > f(
     It t,
     C19M.M.C.A.Safi2010.Interfaces.Parameters.HospitalizationRateQuarantinedIndividuals.Iα α,
     C19M.M.C.A.Safi2010.Interfaces.Parameters.EffectiveContactRate.Iβ β,
     C19M.M.C.A.Safi2010.Interfaces.Parameters.NaturalRecoveryRateInfectiousIndividuals.Iγ γ_1,
     C19M.M.C.A.Safi2010.Interfaces.Parameters.RecoveryRateHospitalizedIndividuals.Iγ γ_2,
     C19M.M.C.A.Safi2010.Interfaces.Parameters.DiseaseInducedDeathRateInfectiousIndividuals.Iδ δ_1,
     C19M.M.C.A.Safi2010.Interfaces.Parameters.DiseaseInducedDeathRateHospitalizedIndividuals.Iδ δ_2,
     C19M.M.C.A.Safi2010.Interfaces.Parameters.EfficacyIsolationTreatmentHospitalizedIndividuals.Iη η,
     C19M.M.C.A.Safi2010.Interfaces.Parameters.DevelopmentDiseaseSymptomsRateExposedIndividuals.Iκ κ,
     C19M.M.C.A.Safi2010.Interfaces.Parameters.AcquireInfectionRateSusceptibleIndividuals.Iλ λ,
     C19M.M.C.A.Safi2010.Interfaces.Parameters.NaturalDeathRate.Iμ μ,
     C19M.M.C.A.Safi2010.Interfaces.Parameters.RecruitmentRateSusceptibleIndividuals.IΠ Π,
     C19M.M.C.A.Safi2010.Interfaces.Parameters.QuarantineRateExposedIndividuals.Iσ σ,
     C19M.M.C.A.Safi2010.Interfaces.Parameters.HospitalizationRateInfectiousIndividuals.Iϕ ϕ,
     C19M.M.C.A.Safi2010.Interfaces.Parameters.InfectionAcquiredImmunityLossRateRecoveredIndividuals.Iψ ψ,
     C19M.M.C.A.Safi2010.Interfaces.Variables.ExposedIndividuals.IE E,
     C19M.M.C.A.Safi2010.Interfaces.Variables.HospitalizedIndividuals.IH H,
     C19M.M.C.A.Safi2010.Interfaces.Variables.InfectiousIndividuals.II I,
     C19M.M.C.A.Safi2010.Interfaces.Variables.QuarantinedIndividuals.IQ Q,
     C19M.M.C.A.Safi2010.Interfaces.Variables.RecoveredIndividuals.IR R,
     C19M.M.C.A.Safi2010.Interfaces.Variables.SusceptibleIndividuals.IS S)
 {
     return((T, x) =>
     {
         return MathNet.Numerics.LinearAlgebra.Vector <double> .Build.Dense(new[] {
             (double)E.GetdEdt(
                 β,
                 η,
                 κ,
                 λ,
                 μ,
                 σ,
                 E: x[0],
                 H: x[1],
                 I: x[2],
                 N: x.Sum(),
                 S: x[5]),
             (double)H.GetdHdt(
                 α,
                 γ_2,
                 δ_2,
                 μ,
                 ϕ,
                 H: x[1],
                 I: x[2],
                 Q: x[3]),
             (double)I.GetdIdt(
                 γ_1,
                 δ_1,
                 κ,
                 μ,
                 ϕ,
                 E: x[0],
                 I: x[2]),
             (double)Q.GetdQdt(
                 α,
                 μ,
                 σ,
                 E: x[0],
                 Q: x[3]),
             (double)R.GetdRdt(
                 γ_1,
                 γ_2,
                 μ,
                 ψ,
                 H: x[1],
                 I: x[2],
                 R: x[4])
         });
     });
 }