コード例 #1
0
ファイル: I.cs プロジェクト: JustinBritt/COVID-19-Modelling
 public decimal GetdIdt(
     FhirDateTime t_IndexElement,
     Interfaces.Parameters.DiseaseInducedDeathRateSymptomaticIndividuals.Id d_1,
     C19M.M.C.A.Gumel2004.Interfaces.Parameters.IsolationRateSymptomaticIndividuals.Iγ γ_2,
     C19M.M.C.A.Gumel2004.Interfaces.Parameters.DevelopmentClinicalSymptomsRateAsymptomaticIndividuals.Iκ κ_1,
     Iμ μ,
     C19M.M.C.A.Gumel2004.Interfaces.Parameters.RecoveryRateSymptomaticIndividuals.Iσ σ_1,
     double E,
     double I)
 {
     return
         (κ_1.Value.Value.Value * (decimal)E
          -
          (γ_2.Value.Invoke(t_IndexElement).Value.Value + d_1.Value.Value.Value + σ_1.Value.Value.Value + μ.Value.Value.Value) * (decimal)I);
 }
コード例 #2
0
 // https://stackoverflow.com/a/55004295
 private Func <double, MathNet.Numerics.LinearAlgebra.Vector <double>, MathNet.Numerics.LinearAlgebra.Vector <double> > f(
     It t,
     Interfaces.Parameters.DiseaseInducedDeathRateSymptomaticIndividuals.Id d_1,
     Interfaces.Parameters.DiseaseInducedDeathRateIsolatedIndividuals.Id d_2,
     Ip p,
     Iβ β,
     C19M.M.C.A.Gumel2004.Interfaces.Parameters.QuarantineRateAsymptomaticIndividuals.Iγ γ_1,
     C19M.M.C.A.Gumel2004.Interfaces.Parameters.IsolationRateSymptomaticIndividuals.Iγ γ_2,
     C19M.M.C.A.Gumel2004.Interfaces.Parameters.TransmissionCoefficientModificationFactorAsymptomaticIndividuals.Iε ε_E,
     C19M.M.C.A.Gumel2004.Interfaces.Parameters.TransmissionCoefficientModificationFactorIsolatedIndividuals.Iε ε_J,
     C19M.M.C.A.Gumel2004.Interfaces.Parameters.TransmissionCoefficientModificationFactorQuarantinedIndividuals.Iε ε_Q,
     C19M.M.C.A.Gumel2004.Interfaces.Parameters.DevelopmentClinicalSymptomsRateAsymptomaticIndividuals.Iκ κ_1,
     C19M.M.C.A.Gumel2004.Interfaces.Parameters.DevelopmentClinicalSymptomsRateQuarantinedIndividuals.Iκ κ_2,
     Iμ μ,
     IΠ Π,
     C19M.M.C.A.Gumel2004.Interfaces.Parameters.RecoveryRateSymptomaticIndividuals.Iσ σ_1,
     C19M.M.C.A.Gumel2004.Interfaces.Parameters.RecoveryRateIsolatedIndividuals.Iσ σ_2,
     C19M.M.C.A.Gumel2004.Interfaces.Variables.AsymptomaticIndividuals.IE E,
     C19M.M.C.A.Gumel2004.Interfaces.Variables.SymptomaticIndividuals.II I,
     C19M.M.C.A.Gumel2004.Interfaces.Variables.IsolatedIndividuals.IJ J,
     C19M.M.C.A.Gumel2004.Interfaces.Variables.QuarantinedIndividuals.IQ Q,
     C19M.M.C.A.Gumel2004.Interfaces.Variables.RecoveredIndividuals.IR R,
     C19M.M.C.A.Gumel2004.Interfaces.Variables.SusceptibleIndividuals.IS S)
 {
     return((T, x) =>
     {
         return MathNet.Numerics.LinearAlgebra.Vector <double> .Build.Dense(new[] {
             (double)E.GetdEdt(
                 new FhirDateTime(
                     new DateTimeOffset(
                         t.StartDate.ToDateTimeOffset(TimeSpan.Zero).UtcDateTime.Date.AddDays(T))),
                 p,
                 β,
                 γ_1,
                 γ_2,
                 ε_E,
                 ε_J,
                 ε_Q,
                 κ_1,
                 μ,
                 E: x[0],
                 I: x[1],
                 J: x[2],
                 N: x.Sum(),
                 Q: x[3],
                 S: x[5]),
             (double)I.GetdIdt(
                 new FhirDateTime(
                     new DateTimeOffset(
                         t.StartDate.ToDateTimeOffset(TimeSpan.Zero).UtcDateTime.Date.AddDays(T))),
                 d_1,
                 γ_2,
                 κ_1,
                 μ,
                 σ_1,
                 E: x[0],
                 I: x[1]),
             (double)J.GetdJdt(
                 new FhirDateTime(
                     new DateTimeOffset(
                         t.StartDate.ToDateTimeOffset(TimeSpan.Zero).UtcDateTime.Date.AddDays(T))),
                 d_2,
                 γ_2,
                 κ_2,
                 μ,
                 σ_2,
                 I: x[1],
                 J: x[2],
                 Q: x[3]),
             (double)Q.GetdQdt(
                 new FhirDateTime(
                     new DateTimeOffset(
                         t.StartDate.ToDateTimeOffset(TimeSpan.Zero).UtcDateTime.Date.AddDays(T))),
                 γ_1,
                 κ_2,
                 μ,
                 E: x[0],
                 Q: x[3]),
             (double)R.GetdRdt(
                 μ,
                 σ_1,
                 σ_2,
                 I: x[1],
                 J: x[2],
                 R: x[4]),
             (double)S.GetdSdt(
                 new FhirDateTime(
                     new DateTimeOffset(
                         t.StartDate.ToDateTimeOffset(TimeSpan.Zero).UtcDateTime.Date.AddDays(T))),
                 β,
                 ε_E,
                 ε_J,
                 ε_Q,
                 μ,
                 Π,
                 E: x[0],
                 I: x[1],
                 J: x[2],
                 N: x.Sum(),
                 Q: x[3],
                 S: x[5])
         });
     });
 }