-
Notifications
You must be signed in to change notification settings - Fork 0
/
Total_Effective_Fractions.c
111 lines (97 loc) · 3.31 KB
/
Total_Effective_Fractions.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include <MODEL.h>
double Total_Effective_Fraction_of_Infectious_Males ( const double * y, Parameter_Table * Table )
{
double x;
int i;
double N;
/* Definition of the state vector numerical order, from 0 to n, of model variables */
#include <Model_Variables_Code.Include.c>
if( Table->n_Mu == 1 ) {
N = total_Males (y, Table);
x = (Table->Xhi*y[YI] + y[YL])/N;
}
else {
printf(" Number of substages for the low-infectivity, quasi-latent stage (n_Mu) is %d\n",
Table->n_Mu);
printf(" n_Mu > 1 requires a carefull code implementation (which in-progress)\n");
printf(" The program will exit\nm");
exit(0);
}
return (x);
}
double Total_Effective_Fraction_of_Infectious_Females ( const double * y, Parameter_Table * Table )
{
double x, x_0, x_1;
int i;
double N;
/* Definition of the state vector numerical order, from 0 to n, of model variables */
#include <Model_Variables_Code.Include.c>
if( Table->n_Mu == 1 ) {
if (Table->TYPE_of_MODEL == 0) {
N = total_Females (y, Table);
x = (Table->f_W*(Table->Xhi*y[WI] + y[WL]) + (1.0-Table->f_W)*(Table->Xhi*y[XI] + y[XL]))/N;
}
else if (Table->TYPE_of_MODEL == 1) {
x_0 = Total_Effective_Fraction_of_Infectious_Females_Type_0 (y, Table);
x_1 = Total_Effective_Fraction_of_Infectious_Females_Type_1 (y, Table);
x = Table->f_0 * x_0 + (1.0 - Table->f_0) * x_1;
}
else {
printf("TYPE_of_MODEL out of range!!!");
printf("This model identifier has not been setup");
printf(" The program will exit\n");
exit(0);
}
}
else {
printf(" Number of substages for the low-infectivity, quasi-latent stage (n_Mu) is %d\n",
Table->n_Mu);
printf(" n_Mu > 1 requires a carefull code implementation (which in-progress)\n");
printf(" The program will exit\n");
exit(0);
}
return (x);
}
double Total_Effective_Fraction_of_Infectious_Females_Type_0 ( const double * y,
Parameter_Table * Table )
{
double x;
int i;
double N;
/* Young Females */
/* Definition of the state vector numerical order, from 0 to n, of model variables */
#include <Model_Variables_Code.Include.c>
if( Table->n_Mu == 1 ) {
N = total_Females (y, Table);
x = (Table->f_W*(Table->Xhi*y[W0I] + y[W0L]) + (1.0-Table->f_W)*(Table->Xhi*y[X0I] + y[X0L]))/N;
}
else {
printf(" Number of substages for the low-infectivity, quasi-latent stage (n_Mu) is %d\n",
Table->n_Mu);
printf(" n_Mu > 1 requires a carefull code implementation (which in-progress)\n");
printf(" The program will exit\n");
exit(0);
}
return (x);
}
double Total_Effective_Fraction_of_Infectious_Females_Type_1 ( const double * y, Parameter_Table * Table )
{
double x;
int i;
double N;
/* Older Females */
/* Definition of the state vector numerical order, from 0 to n, of model variables */
#include <Model_Variables_Code.Include.c>
if( Table->n_Mu == 1 ) {
N = total_Females (y, Table);
x = (Table->f_W*(Table->Xhi*y[W1I] + y[W1L]) + (1.0-Table->f_W)*(Table->Xhi*y[X1I] + y[X1L]))/N;
}
else {
printf(" Number of substages for the low-infectivity, quasi-latent stage (n_Mu) is %d\n",
Table->n_Mu);
printf(" n_Mu > 1 requires a carefull code implementation (which in-progress)\n");
printf(" The program will exit\nm");
exit(0);
}
return (x);
}